diff --git a/meson.build b/meson.build index 13fc772..074bf23 100644 --- a/meson.build +++ b/meson.build @@ -59,7 +59,8 @@ flags = [ '-Wextra', '-pedantic', '-Werror=implicit-function-declaration', - '-Werror=vla' + '-Werror=vla', + '-fvisibility=hidden' ] flags = cc.get_supported_arguments(flags) diff --git a/zathura/document.h b/zathura/document.h index 42d7e77..6bd1d76 100644 --- a/zathura/document.h +++ b/zathura/document.h @@ -28,7 +28,7 @@ zathura_document_t* zathura_document_open(zathura_t* zathura, * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_document_free(zathura_document_t* document); +ZATHURA_PLUGIN_API zathura_error_t zathura_document_free(zathura_document_t* document); /** * Returns the path of the document @@ -36,7 +36,7 @@ zathura_error_t zathura_document_free(zathura_document_t* document); * @param document The document * @return The file path of the document */ -const char* zathura_document_get_path(zathura_document_t* document); +ZATHURA_PLUGIN_API const char* zathura_document_get_path(zathura_document_t* document); /** * Returns the URI of the document @@ -44,7 +44,7 @@ const char* zathura_document_get_path(zathura_document_t* document); * @param document The document * @return The URI of the document */ -const char* zathura_document_get_uri(zathura_document_t* document); +ZATHURA_PLUGIN_API const char* zathura_document_get_uri(zathura_document_t* document); /** * Returns the basename of the document @@ -52,7 +52,7 @@ const char* zathura_document_get_uri(zathura_document_t* document); * @param document The document * @return The basename of the document */ -const char* zathura_document_get_basename(zathura_document_t* document); +ZATHURA_PLUGIN_API const char* zathura_document_get_basename(zathura_document_t* document); /** * Returns the password of the document @@ -60,7 +60,7 @@ const char* zathura_document_get_basename(zathura_document_t* document); * @param document The document * @return Returns the password of the document */ -const char* zathura_document_get_password(zathura_document_t* document); +ZATHURA_PLUGIN_API const char* zathura_document_get_password(zathura_document_t* document); /** * Returns the page at the given index @@ -69,7 +69,7 @@ const char* zathura_document_get_password(zathura_document_t* document); * @param index The index of the page * @return The page or NULL if an error occurred */ -zathura_page_t* zathura_document_get_page(zathura_document_t* document, unsigned int index); +ZATHURA_PLUGIN_API zathura_page_t* zathura_document_get_page(zathura_document_t* document, unsigned int index); /** * Returns the number of pages @@ -77,7 +77,7 @@ zathura_page_t* zathura_document_get_page(zathura_document_t* document, unsigned * @param document The document * @return Number of pages */ -unsigned int zathura_document_get_number_of_pages(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_number_of_pages(zathura_document_t* document); /** * Sets the number of pages @@ -85,7 +85,7 @@ unsigned int zathura_document_get_number_of_pages(zathura_document_t* document); * @param document The document * @param number_of_pages Number of pages */ -void zathura_document_set_number_of_pages(zathura_document_t* document, unsigned +ZATHURA_PLUGIN_API void zathura_document_set_number_of_pages(zathura_document_t* document, unsigned int number_of_pages); /** @@ -94,7 +94,7 @@ void zathura_document_set_number_of_pages(zathura_document_t* document, unsigned * @param document The document * @return Current page */ -unsigned int zathura_document_get_current_page_number(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_current_page_number(zathura_document_t* document); /** * Sets the number of pages @@ -102,7 +102,7 @@ unsigned int zathura_document_get_current_page_number(zathura_document_t* docume * @param document The document * @param current_page The current page number */ -void zathura_document_set_current_page_number(zathura_document_t* document, unsigned +ZATHURA_PLUGIN_API void zathura_document_set_current_page_number(zathura_document_t* document, unsigned int current_page); /** @@ -112,7 +112,7 @@ void zathura_document_set_current_page_number(zathura_document_t* document, unsi * @param document The document * @return X adjustment */ -double zathura_document_get_position_x(zathura_document_t* document); +ZATHURA_PLUGIN_API double zathura_document_get_position_x(zathura_document_t* document); /** * Returns the Y position as value relative to the document height (0=top, @@ -121,7 +121,7 @@ double zathura_document_get_position_x(zathura_document_t* document); * @param document The document * @return Y adjustment */ -double zathura_document_get_position_y(zathura_document_t* document); +ZATHURA_PLUGIN_API double zathura_document_get_position_y(zathura_document_t* document); /** * Sets the X position as a value relative to the document width (0=left, @@ -130,7 +130,7 @@ double zathura_document_get_position_y(zathura_document_t* document); * @param document The document * @param position_x the X adjustment */ -void zathura_document_set_position_x(zathura_document_t* document, double position_x); +ZATHURA_PLUGIN_API void zathura_document_set_position_x(zathura_document_t* document, double position_x); /** * Sets the Y position as a value relative to the document height (0=top, @@ -139,7 +139,7 @@ void zathura_document_set_position_x(zathura_document_t* document, double positi * @param document The document * @param position_y the Y adjustment */ -void zathura_document_set_position_y(zathura_document_t* document, double position_y); +ZATHURA_PLUGIN_API void zathura_document_set_position_y(zathura_document_t* document, double position_y); /** * Returns the current zoom value of the document @@ -147,7 +147,7 @@ void zathura_document_set_position_y(zathura_document_t* document, double positi * @param document The document * @return The current zoom value */ -double zathura_document_get_zoom(zathura_document_t* document); +ZATHURA_PLUGIN_API double zathura_document_get_zoom(zathura_document_t* document); /** * Returns the current scale value of the document (based on zoom and screen @@ -156,7 +156,7 @@ double zathura_document_get_zoom(zathura_document_t* document); * @param document The document * @return The current scale value, in pixels per point */ -double zathura_document_get_scale(zathura_document_t* document); +ZATHURA_PLUGIN_API double zathura_document_get_scale(zathura_document_t* document); /** * Sets the new zoom value of the document @@ -164,7 +164,7 @@ double zathura_document_get_scale(zathura_document_t* document); * @param document The document * @param zoom The new zoom value */ -void zathura_document_set_zoom(zathura_document_t* document, double zoom); +ZATHURA_PLUGIN_API void zathura_document_set_zoom(zathura_document_t* document, double zoom); /** * Returns the rotation value of zathura (0..360) @@ -172,7 +172,7 @@ void zathura_document_set_zoom(zathura_document_t* document, double zoom); * @param document The document * @return The current rotation value */ -unsigned int zathura_document_get_rotation(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_rotation(zathura_document_t* document); /** * Sets the new rotation value @@ -180,7 +180,7 @@ unsigned int zathura_document_get_rotation(zathura_document_t* document); * @param document The document * @param rotation The new rotation value */ -void zathura_document_set_rotation(zathura_document_t* document, unsigned int rotation); +ZATHURA_PLUGIN_API void zathura_document_set_rotation(zathura_document_t* document, unsigned int rotation); /** * Returns the adjust mode of the document @@ -188,7 +188,7 @@ void zathura_document_set_rotation(zathura_document_t* document, unsigned int ro * @param document The document * @return The adjust mode */ -zathura_adjust_mode_t zathura_document_get_adjust_mode(zathura_document_t* document); +ZATHURA_PLUGIN_API zathura_adjust_mode_t zathura_document_get_adjust_mode(zathura_document_t* document); /** * Sets the new adjust mode of the document @@ -196,7 +196,7 @@ zathura_adjust_mode_t zathura_document_get_adjust_mode(zathura_document_t* docum * @param document The document * @param mode The new adjust mode */ -void zathura_document_set_adjust_mode(zathura_document_t* document, zathura_adjust_mode_t mode); +ZATHURA_PLUGIN_API void zathura_document_set_adjust_mode(zathura_document_t* document, zathura_adjust_mode_t mode); /** * Returns the page offset of the document @@ -204,7 +204,7 @@ void zathura_document_set_adjust_mode(zathura_document_t* document, zathura_adju * @param document The document * @return The page offset */ -int zathura_document_get_page_offset(zathura_document_t* document); +ZATHURA_PLUGIN_API int zathura_document_get_page_offset(zathura_document_t* document); /** * Sets the new page offset of the document @@ -212,7 +212,7 @@ int zathura_document_get_page_offset(zathura_document_t* document); * @param document The document * @param page_offset The new page offset */ -void zathura_document_set_page_offset(zathura_document_t* document, unsigned int page_offset); +ZATHURA_PLUGIN_API void zathura_document_set_page_offset(zathura_document_t* document, unsigned int page_offset); /** * Returns the private data of the document @@ -220,7 +220,7 @@ void zathura_document_set_page_offset(zathura_document_t* document, unsigned int * @param document The document * @return The private data or NULL */ -void* zathura_document_get_data(zathura_document_t* document); +ZATHURA_PLUGIN_API void* zathura_document_get_data(zathura_document_t* document); /** * Sets the private data of the document @@ -228,7 +228,7 @@ void* zathura_document_get_data(zathura_document_t* document); * @param document The document * @param data The new private data */ -void zathura_document_set_data(zathura_document_t* document, void* data); +ZATHURA_PLUGIN_API void zathura_document_set_data(zathura_document_t* document, void* data); /** * Sets the width of the viewport in pixels. @@ -237,7 +237,7 @@ void zathura_document_set_data(zathura_document_t* document, void* data); * @param[in] width The width of the viewport */ void -zathura_document_set_viewport_width(zathura_document_t* document, unsigned int width); +ZATHURA_PLUGIN_API zathura_document_set_viewport_width(zathura_document_t* document, unsigned int width); /** * Sets the height of the viewport in pixels. @@ -246,7 +246,7 @@ zathura_document_set_viewport_width(zathura_document_t* document, unsigned int w * @param[in] height The height of the viewport */ void -zathura_document_set_viewport_height(zathura_document_t* document, unsigned int height); +ZATHURA_PLUGIN_API zathura_document_set_viewport_height(zathura_document_t* document, unsigned int height); /** * Return the size of the viewport in pixels. @@ -255,7 +255,7 @@ zathura_document_set_viewport_height(zathura_document_t* document, unsigned int * @param[out] height,width The width and height of the viewport */ void -zathura_document_get_viewport_size(zathura_document_t* document, +ZATHURA_PLUGIN_API zathura_document_get_viewport_size(zathura_document_t* document, unsigned int *height, unsigned int* width); /** @@ -266,7 +266,7 @@ zathura_document_get_viewport_size(zathura_document_t* document, * @param[in] height The viewport PPI */ void -zathura_document_set_viewport_ppi(zathura_document_t* document, double ppi); +ZATHURA_PLUGIN_API zathura_document_set_viewport_ppi(zathura_document_t* document, double ppi); /** * Return the viewport PPI (pixels per inch: the resolution of the monitor, @@ -276,7 +276,7 @@ zathura_document_set_viewport_ppi(zathura_document_t* document, double ppi); * @return The viewport PPI */ double -zathura_document_get_viewport_ppi(zathura_document_t* document); +ZATHURA_PLUGIN_API zathura_document_get_viewport_ppi(zathura_document_t* document); /** * Set the device scale factors (e.g. for HiDPI). These are generally integers @@ -286,14 +286,14 @@ zathura_document_get_viewport_ppi(zathura_document_t* document); * @param[in] x_factor,yfactor The x and y scale factors */ void -zathura_document_set_device_factors(zathura_document_t* document, +ZATHURA_PLUGIN_API zathura_document_set_device_factors(zathura_document_t* document, double x_factor, double y_factor); /** * Return the current device scale factors (guaranteed to be non-zero). * * @return The x and y device scale factors */ -zathura_device_factors_t +ZATHURA_PLUGIN_API zathura_device_factors_t zathura_document_get_device_factors(zathura_document_t* document); /** @@ -304,7 +304,7 @@ zathura_document_get_device_factors(zathura_document_t* document); * @param[in] document The document instance * @param[out] height,width The computed height and width of the cell */ -void zathura_document_get_cell_size(zathura_document_t* document, +ZATHURA_PLUGIN_API void zathura_document_get_cell_size(zathura_document_t* document, unsigned int* height, unsigned int* width); /** @@ -315,7 +315,7 @@ void zathura_document_get_cell_size(zathura_document_t* document, * @param[in] document The document * @param[out] height,width The height and width of the document */ -void zathura_document_get_document_size(zathura_document_t* document, +ZATHURA_PLUGIN_API void zathura_document_get_document_size(zathura_document_t* document, unsigned int* height, unsigned int* width); /** @@ -326,7 +326,7 @@ void zathura_document_get_document_size(zathura_document_t* document, * @param[in] pages_per_row number of pages per row * @param[in] first_page_column column of the first page (first column is 1) */ -void zathura_document_set_page_layout(zathura_document_t* document, unsigned int page_padding, +ZATHURA_PLUGIN_API void zathura_document_set_page_layout(zathura_document_t* document, unsigned int page_padding, unsigned int pages_per_row, unsigned int first_page_column); /** @@ -335,7 +335,7 @@ void zathura_document_set_page_layout(zathura_document_t* document, unsigned int * @param document The document * @return The padding in pixels between pages */ -unsigned int zathura_document_get_page_padding(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_page_padding(zathura_document_t* document); /** * Returns the number of pages per row @@ -343,7 +343,7 @@ unsigned int zathura_document_get_page_padding(zathura_document_t* document); * @param document The document * @return The number of pages per row */ -unsigned int zathura_document_get_pages_per_row(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_pages_per_row(zathura_document_t* document); /** * Returns the column for the first page (first column = 1) @@ -351,7 +351,7 @@ unsigned int zathura_document_get_pages_per_row(zathura_document_t* document); * @param document The document * @return The column for the first page */ -unsigned int zathura_document_get_first_page_column(zathura_document_t* document); +ZATHURA_PLUGIN_API unsigned int zathura_document_get_first_page_column(zathura_document_t* document); /** * Save the document @@ -361,7 +361,7 @@ unsigned int zathura_document_get_first_page_column(zathura_document_t* document * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_document_save_as(zathura_document_t* document, const char* path); +ZATHURA_PLUGIN_API zathura_error_t zathura_document_save_as(zathura_document_t* document, const char* path); /** * Generate the document index @@ -371,8 +371,7 @@ zathura_error_t zathura_document_save_as(zathura_document_t* document, const cha * error occurred * @return Generated index */ - -girara_tree_node_t* zathura_document_index_generate(zathura_document_t* document, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_tree_node_t* zathura_document_index_generate(zathura_document_t* document, zathura_error_t* error); /** * Get list of attachments @@ -382,7 +381,7 @@ girara_tree_node_t* zathura_document_index_generate(zathura_document_t* document * error occurred * @return List of attachments */ -girara_list_t* zathura_document_attachments_get(zathura_document_t* document, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_document_attachments_get(zathura_document_t* document, zathura_error_t* error); /** * Save document attachment @@ -393,7 +392,7 @@ girara_list_t* zathura_document_attachments_get(zathura_document_t* document, za * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_document_attachment_save(zathura_document_t* document, const char* attachment, const char* file); +ZATHURA_PLUGIN_API zathura_error_t zathura_document_attachment_save(zathura_document_t* document, const char* attachment, const char* file); /** * Returns a string of the requested information @@ -403,6 +402,6 @@ zathura_error_t zathura_document_attachment_save(zathura_document_t* document, c * error occurred * @return List of document information entries or NULL if information could not be retrieved */ -girara_list_t* zathura_document_get_information(zathura_document_t* document, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_document_get_information(zathura_document_t* document, zathura_error_t* error); #endif // DOCUMENT_H diff --git a/zathura/links.h b/zathura/links.h index 8d8728e..dc72408 100644 --- a/zathura/links.h +++ b/zathura/links.h @@ -13,7 +13,7 @@ * @param target Target * @return New zathura link */ -zathura_link_t* +ZATHURA_PLUGIN_API zathura_link_t* zathura_link_new(zathura_link_type_t type, zathura_rectangle_t position, zathura_link_target_t target); @@ -22,7 +22,7 @@ zathura_link_new(zathura_link_type_t type, zathura_rectangle_t position, * * @param link The link */ -void zathura_link_free(zathura_link_t* link); +ZATHURA_PLUGIN_API void zathura_link_free(zathura_link_t* link); /** * Returns the type of the link @@ -30,7 +30,7 @@ void zathura_link_free(zathura_link_t* link); * @param link The link * @return The target type of the link */ -zathura_link_type_t zathura_link_get_type(zathura_link_t* link); +ZATHURA_PLUGIN_API zathura_link_type_t zathura_link_get_type(zathura_link_t* link); /** * Returns the position of the link @@ -38,7 +38,7 @@ zathura_link_type_t zathura_link_get_type(zathura_link_t* link); * @param link The link * @return The position of the link */ -zathura_rectangle_t zathura_link_get_position(zathura_link_t* link); +ZATHURA_PLUGIN_API zathura_rectangle_t zathura_link_get_position(zathura_link_t* link); /** * The target value of the link @@ -46,7 +46,7 @@ zathura_rectangle_t zathura_link_get_position(zathura_link_t* link); * @param link The link * @return Returns the target of the link (depends on the link type) */ -zathura_link_target_t zathura_link_get_target(zathura_link_t* link); +ZATHURA_PLUGIN_API zathura_link_target_t zathura_link_get_target(zathura_link_t* link); /** * Evaluate link diff --git a/zathura/macros.h b/zathura/macros.h index a1957dc..62e6075 100644 --- a/zathura/macros.h +++ b/zathura/macros.h @@ -7,6 +7,7 @@ #define UNUSED(x) GIRARA_UNUSED(x) #define DEPRECATED(x) GIRARA_DEPRECATED(x) +#define ZATHURA_PLUGIN_API GIRARA_VISIBLE #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) diff --git a/zathura/main.c b/zathura/main.c index 2355a1e..d9ca48f 100644 --- a/zathura/main.c +++ b/zathura/main.c @@ -119,7 +119,7 @@ init_zathura(const char* config_dir, const char* data_dir, /* main function */ -int +GIRARA_VISIBLE int main(int argc, char* argv[]) { init_locale(); diff --git a/zathura/page.h b/zathura/page.h index 0db3cfa..f56d2e3 100644 --- a/zathura/page.h +++ b/zathura/page.h @@ -16,7 +16,7 @@ * @param error Optional error * @return Page object or NULL if an error occurred */ -zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int +ZATHURA_PLUGIN_API zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int index, zathura_error_t* error); /** @@ -26,7 +26,7 @@ zathura_page_t* zathura_page_new(zathura_document_t* document, unsigned int * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_page_free(zathura_page_t* page); +ZATHURA_PLUGIN_API zathura_error_t zathura_page_free(zathura_page_t* page); /** * Returns the associated document @@ -35,7 +35,7 @@ zathura_error_t zathura_page_free(zathura_page_t* page); * @return The associated document * @return NULL if an error occurred */ -zathura_document_t* zathura_page_get_document(zathura_page_t* page); +ZATHURA_PLUGIN_API zathura_document_t* zathura_page_get_document(zathura_page_t* page); /** * Returns the set id of the page @@ -43,7 +43,7 @@ zathura_document_t* zathura_page_get_document(zathura_page_t* page); * @param page The page object * @return The id of the page */ -unsigned int zathura_page_get_index(zathura_page_t* page); +ZATHURA_PLUGIN_API unsigned int zathura_page_get_index(zathura_page_t* page); /** * Returns the width of the page @@ -52,7 +52,7 @@ unsigned int zathura_page_get_index(zathura_page_t* page); * @return Width of the page * @return -1 If an error occurred */ -double zathura_page_get_width(zathura_page_t* page); +ZATHURA_PLUGIN_API double zathura_page_get_width(zathura_page_t* page); /** * Sets the new width of the page @@ -60,7 +60,7 @@ double zathura_page_get_width(zathura_page_t* page); * @param page The page object * @param width The new width of the page */ -void zathura_page_set_width(zathura_page_t* page, double width); +ZATHURA_PLUGIN_API void zathura_page_set_width(zathura_page_t* page, double width); /** * Returns the height of the page @@ -69,7 +69,7 @@ void zathura_page_set_width(zathura_page_t* page, double width); * @return Height of the page * @return -1 If an error occurred */ -double zathura_page_get_height(zathura_page_t* page); +ZATHURA_PLUGIN_API double zathura_page_get_height(zathura_page_t* page); /** * Sets the new height of the page @@ -77,7 +77,7 @@ double zathura_page_get_height(zathura_page_t* page); * @param page The page object * @param height The new height of the page */ -void zathura_page_set_height(zathura_page_t* page, double height); +ZATHURA_PLUGIN_API void zathura_page_set_height(zathura_page_t* page, double height); /** * Returns the visibility of the page @@ -86,7 +86,7 @@ void zathura_page_set_height(zathura_page_t* page, double height); * @return true if the page is visible * @return false if the page is hidden */ -bool zathura_page_get_visibility(zathura_page_t* page); +ZATHURA_PLUGIN_API bool zathura_page_get_visibility(zathura_page_t* page); /** * Sets the visibility of the page @@ -94,7 +94,7 @@ bool zathura_page_get_visibility(zathura_page_t* page); * @param page The page object * @param visibility The new visibility value */ -void zathura_page_set_visibility(zathura_page_t* page, bool visibility); +ZATHURA_PLUGIN_API void zathura_page_set_visibility(zathura_page_t* page, bool visibility); /** * Returns the custom data @@ -102,7 +102,7 @@ void zathura_page_set_visibility(zathura_page_t* page, bool visibility); * @param page The page object * @return The custom data or NULL */ -void* zathura_page_get_data(zathura_page_t* page); +ZATHURA_PLUGIN_API void* zathura_page_get_data(zathura_page_t* page); /** * Sets the custom data @@ -110,7 +110,7 @@ void* zathura_page_get_data(zathura_page_t* page); * @param page The page object * @param data The custom data */ -void zathura_page_set_data(zathura_page_t* page, void* data); +ZATHURA_PLUGIN_API void zathura_page_set_data(zathura_page_t* page, void* data); /** * Search page @@ -121,7 +121,7 @@ void zathura_page_set_data(zathura_page_t* page, void* data); * error occurred * @return List of results */ -girara_list_t* zathura_page_search_text(zathura_page_t* page, const char* text, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_page_search_text(zathura_page_t* page, const char* text, zathura_error_t* error); /** * Get page links @@ -131,7 +131,7 @@ girara_list_t* zathura_page_search_text(zathura_page_t* page, const char* text, * error occurred * @return List of links */ -girara_list_t* zathura_page_links_get(zathura_page_t* page, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_page_links_get(zathura_page_t* page, zathura_error_t* error); /** * Free page links @@ -140,7 +140,7 @@ girara_list_t* zathura_page_links_get(zathura_page_t* page, zathura_error_t* err * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_page_links_free(girara_list_t* list); +ZATHURA_PLUGIN_API zathura_error_t zathura_page_links_free(girara_list_t* list); /** * Get list of form fields @@ -150,7 +150,7 @@ zathura_error_t zathura_page_links_free(girara_list_t* list); * error occurred * @return List of form fields */ -girara_list_t* zathura_page_form_fields_get(zathura_page_t* page, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_page_form_fields_get(zathura_page_t* page, zathura_error_t* error); /** * Free list of form fields @@ -159,7 +159,7 @@ girara_list_t* zathura_page_form_fields_get(zathura_page_t* page, zathura_error_ * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_page_form_fields_free(girara_list_t* list); +ZATHURA_PLUGIN_API zathura_error_t zathura_page_form_fields_free(girara_list_t* list); /** * Get list of images @@ -169,7 +169,7 @@ zathura_error_t zathura_page_form_fields_free(girara_list_t* list); * error occurred * @return List of images or NULL if an error occurred */ -girara_list_t* zathura_page_images_get(zathura_page_t* page, zathura_error_t* error); +ZATHURA_PLUGIN_API girara_list_t* zathura_page_images_get(zathura_page_t* page, zathura_error_t* error); /** * Get image @@ -180,7 +180,7 @@ girara_list_t* zathura_page_images_get(zathura_page_t* page, zathura_error_t* er * error occurred * @return The cairo image surface or NULL if an error occurred */ -cairo_surface_t* zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathura_error_t* error); +ZATHURA_PLUGIN_API cairo_surface_t* zathura_page_image_get_cairo(zathura_page_t* page, zathura_image_t* image, zathura_error_t* error); /** * Get text for selection @@ -190,7 +190,7 @@ cairo_surface_t* zathura_page_image_get_cairo(zathura_page_t* page, zathura_imag * occurred * @return The selected text (needs to be deallocated with g_free) */ -char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error); +ZATHURA_PLUGIN_API char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, zathura_error_t* error); /** * Render page @@ -201,7 +201,7 @@ char* zathura_page_get_text(zathura_page_t* page, zathura_rectangle_t rectangle, * @return ZATHURA_ERROR_OK when no error occurred, otherwise see * zathura_error_t */ -zathura_error_t zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing); +ZATHURA_PLUGIN_API zathura_error_t zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool printing); /** * Get page label. Note that the page label might not exist, in this case NULL @@ -212,6 +212,6 @@ zathura_error_t zathura_page_render(zathura_page_t* page, cairo_t* cairo, bool p * occurred. * @return Page label */ -char* zathura_page_get_label(zathura_page_t* page, zathura_error_t* error); +ZATHURA_PLUGIN_API char* zathura_page_get_label(zathura_page_t* page, zathura_error_t* error); #endif // PAGE_H diff --git a/zathura/plugin-api.h b/zathura/plugin-api.h index eb9c6c4..fd6fc59 100644 --- a/zathura/plugin-api.h +++ b/zathura/plugin-api.h @@ -3,6 +3,9 @@ #ifndef PLUGIN_API_H #define PLUGIN_API_H +#include + +#include "types.h" #include "page.h" #include "document.h" #include "links.h" @@ -227,7 +230,7 @@ typedef struct zathura_plugin_definition_s { #define ZATHURA_PLUGIN_REGISTER_WITH_FUNCTIONS(plugin_name, major, minor, rev, plugin_functions, mimetypes) \ static const char* zathura_plugin_mime_types[] = mimetypes; \ \ - const zathura_plugin_definition_t ZATHURA_PLUGIN_DEFINITION_SYMBOL = { \ + ZATHURA_PLUGIN_API const zathura_plugin_definition_t ZATHURA_PLUGIN_DEFINITION_SYMBOL = { \ .name = plugin_name, \ .version = { major, minor, rev }, \ .functions = plugin_functions, \ diff --git a/zathura/types.c b/zathura/types.c index 5b4713b..7db693d 100644 --- a/zathura/types.c +++ b/zathura/types.c @@ -82,7 +82,7 @@ zathura_image_buffer_free(zathura_image_buffer_t* image_buffer) } girara_list_t* -zathura_document_information_entry_list_new() +zathura_document_information_entry_list_new(void) { girara_list_t* list = girara_list_new2((girara_free_function_t) zathura_document_information_entry_free); diff --git a/zathura/types.h b/zathura/types.h index a4542e4..6e008d2 100644 --- a/zathura/types.h +++ b/zathura/types.h @@ -112,14 +112,14 @@ typedef enum zathura_adjust_mode_e * @param height Height of the image stored in the buffer * @return Image buffer or NULL if an error occurred */ -zathura_image_buffer_t* zathura_image_buffer_create(unsigned int width, unsigned int height); +ZATHURA_PLUGIN_API zathura_image_buffer_t* zathura_image_buffer_create(unsigned int width, unsigned int height); /** * Frees the image buffer * * @param buffer The image buffer */ -void zathura_image_buffer_free(zathura_image_buffer_t* buffer); +ZATHURA_PLUGIN_API void zathura_image_buffer_free(zathura_image_buffer_t* buffer); /** * Rectangle structure. @@ -230,14 +230,14 @@ typedef struct zathura_jump_s * @param title Title of the index element * @return Index element */ -zathura_index_element_t* zathura_index_element_new(const char* title); +ZATHURA_PLUGIN_API zathura_index_element_t* zathura_index_element_new(const char* title); /** * Free index element * * @param index The index element */ -void zathura_index_element_free(zathura_index_element_t* index); +ZATHURA_PLUGIN_API void zathura_index_element_free(zathura_index_element_t* index); /** * Creates a list that should be used to store \ref @@ -245,7 +245,7 @@ void zathura_index_element_free(zathura_index_element_t* index); * * @return A list or NULL if an error occurred */ -girara_list_t* zathura_document_information_entry_list_new(); +ZATHURA_PLUGIN_API girara_list_t* zathura_document_information_entry_list_new(void); /** * Creates a new document information entry @@ -255,7 +255,7 @@ girara_list_t* zathura_document_information_entry_list_new(); * * @return A new entry or NULL if an error occurred */ -zathura_document_information_entry_t* +ZATHURA_PLUGIN_API zathura_document_information_entry_t* zathura_document_information_entry_new(zathura_document_information_type_t type, const char* value); @@ -264,7 +264,7 @@ zathura_document_information_entry_new(zathura_document_information_type_t * * @param entry The entry that should be freed */ -void zathura_document_information_entry_free(zathura_document_information_entry_t* entry); +ZATHURA_PLUGIN_API void zathura_document_information_entry_free(zathura_document_information_entry_t* entry); /** * Context for MIME type detection