Commit 21276dfb authored by Sebastian Ramacher's avatar Sebastian Ramacher

Explicitly export plugin API symbols

… and hide all others per default.
parent 5d898add
......@@ -59,7 +59,8 @@ flags = [
'-Wextra',
'-pedantic',
'-Werror=implicit-function-declaration',
'-Werror=vla'
'-Werror=vla',
'-fvisibility=hidden'
]
flags = cc.get_supported_arguments(flags)
......
This diff is collapsed.
......@@ -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
......
......@@ -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))
......
......@@ -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();
......
......@@ -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
......@@ -3,6 +3,9 @@
#ifndef PLUGIN_API_H
#define PLUGIN_API_H
#include <cairo.h>
#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, \
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment