zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Functions
plugin.c File Reference
#include "plugin.h"
#include <stdlib.h>
#include <glib/gi18n.h>
#include <girara/datastructures.h>
#include <girara/utils.h>
#include <girara/statusbar.h>
#include <girara/session.h>
#include <girara/settings.h>

Go to the source code of this file.

Data Structures

struct  zathura_plugin_t
struct  zathura_type_plugin_mapping_t
struct  zathura_plugin_manager_t

Typedefs

typedef void(* zathura_plugin_register_service_t )(zathura_plugin_t *)
typedef unsigned int(* zathura_plugin_api_version_t )(void)
typedef unsigned int(* zathura_plugin_abi_version_t )(void)
typedef unsigned int(* zathura_plugin_version_function_t )(void)

Functions

zathura_plugin_manager_t * zathura_plugin_manager_new ()
void zathura_plugin_manager_add_dir (zathura_plugin_manager_t *plugin_manager, const char *dir)
void zathura_plugin_manager_load (zathura_plugin_manager_t *plugin_manager)
zathura_plugin_t * zathura_plugin_manager_get_plugin (zathura_plugin_manager_t *plugin_manager, const char *type)
girara_list_t * zathura_plugin_manager_get_plugins (zathura_plugin_manager_t *plugin_manager)
void zathura_plugin_manager_free (zathura_plugin_manager_t *plugin_manager)
void zathura_plugin_set_register_functions_function (zathura_plugin_t *plugin, zathura_plugin_register_function_t register_function)
void zathura_plugin_add_mimetype (zathura_plugin_t *plugin, const char *mime_type)
zathura_plugin_functions_t * zathura_plugin_get_functions (zathura_plugin_t *plugin)
void zathura_plugin_set_name (zathura_plugin_t *plugin, const char *name)
char * zathura_plugin_get_name (zathura_plugin_t *plugin)
char * zathura_plugin_get_path (zathura_plugin_t *plugin)
zathura_plugin_version_t zathura_plugin_get_version (zathura_plugin_t *plugin)

Typedef Documentation

typedef unsigned int(* zathura_plugin_abi_version_t)(void)

Definition at line 46 of file plugin.c.

typedef unsigned int(* zathura_plugin_api_version_t)(void)

Definition at line 45 of file plugin.c.

typedef void(* zathura_plugin_register_service_t)(zathura_plugin_t *)

Definition at line 44 of file plugin.c.

typedef unsigned int(* zathura_plugin_version_function_t)(void)

Definition at line 47 of file plugin.c.

Function Documentation

void zathura_plugin_add_mimetype ( zathura_plugin_t *  plugin,
const char *  mime_type 
)

Sets the functions register function of the plugin

Parameters
pluginThe plugin
mime_typeThe mime type that should be added

Definition at line 363 of file plugin.c.

zathura_plugin_functions_t* zathura_plugin_get_functions ( zathura_plugin_t *  plugin)

Returns the plugin functions

Parameters
pluginThe plugin
Returns
The plugin functions

Definition at line 373 of file plugin.c.

char* zathura_plugin_get_name ( zathura_plugin_t *  plugin)

Returns the name of the plugin

Parameters
pluginThe plugin
Returns
The name of the plugin or NULL

Definition at line 391 of file plugin.c.

char* zathura_plugin_get_path ( zathura_plugin_t *  plugin)

Returns the path to the plugin

Parameters
pluginThe plugin
Returns
The path of the plugin or NULL

Definition at line 401 of file plugin.c.

zathura_plugin_version_t zathura_plugin_get_version ( zathura_plugin_t *  plugin)

Returns the version information of the plugin

Parameters
pluginThe plugin
Returns
The version information of the plugin

Definition at line 411 of file plugin.c.

void zathura_plugin_manager_add_dir ( zathura_plugin_manager_t *  plugin_manager,
const char *  dir 
)

Adds a plugin directory to the plugin manager

Parameters
plugin_managerThe plugin manager
dirPath to a directory with plugins

Definition at line 77 of file plugin.c.

void zathura_plugin_manager_free ( zathura_plugin_manager_t *  plugin_manager)

Frees the plugin manager

Parameters
plugin_manager

Definition at line 244 of file plugin.c.

zathura_plugin_t* zathura_plugin_manager_get_plugin ( zathura_plugin_manager_t *  plugin_manager,
const char *  type 
)

Returns the (if available) associated plugin

Parameters
plugin_managerThe plugin manager
typeThe document type
Returns
The plugin or NULL if no matching plugin is available

Definition at line 216 of file plugin.c.

girara_list_t* zathura_plugin_manager_get_plugins ( zathura_plugin_manager_t *  plugin_manager)

Returns a list with the plugin objects

Parameters
plugin_managerThe plugin manager
Returns
List of plugins or NULL

Definition at line 234 of file plugin.c.

void zathura_plugin_manager_load ( zathura_plugin_manager_t *  plugin_manager)

Loads all plugins available in the previously given directories

Parameters
plugin_managerThe plugin manager

Definition at line 87 of file plugin.c.

zathura_plugin_manager_t* zathura_plugin_manager_new ( )

Creates a new instance of the plugin manager

Returns
A plugin manager object or NULL if an error occured

Definition at line 55 of file plugin.c.

void zathura_plugin_set_name ( zathura_plugin_t *  plugin,
const char *  name 
)

Sets the name of the plugin

Parameters
pluginThe plugin
nameThe name of the plugin

Definition at line 383 of file plugin.c.

void zathura_plugin_set_register_functions_function ( zathura_plugin_t *  plugin,
zathura_plugin_register_function_t  register_function 
)

Sets the functions register function of the plugin

Parameters
pluginThe plugin
register_functionThe register function that registers the document functions

Definition at line 353 of file plugin.c.