zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Typedefs | Enumerations | Functions
zathura.h File Reference
#include <stdbool.h>
#include <girara/types.h>
#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include "macros.h"
#include "types.h"

Go to the source code of this file.

Data Structures

struct  zathura_jump_t
struct  zathura_t

Typedefs

typedef struct _ZathuraDatabase zathura_database_t

Enumerations

enum  {
  NEXT, PREVIOUS, LEFT, RIGHT,
  UP, DOWN, BOTTOM, TOP,
  HIDE, HIGHLIGHT, DELETE_LAST_WORD, DELETE_LAST_CHAR,
  DEFAULT, ERROR, WARNING, NEXT_GROUP,
  PREVIOUS_GROUP, ZOOM_IN, ZOOM_OUT, ZOOM_ORIGINAL,
  ZOOM_SPECIFIC, FORWARD, BACKWARD, CONTINUOUS,
  DELETE_LAST, EXPAND, EXPAND_ALL, COLLAPSE_ALL,
  COLLAPSE, TOGGLE, SELECT, GOTO_DEFAULT,
  GOTO_LABELS, GOTO_OFFSET, HALF_UP, HALF_DOWN,
  FULL_UP, FULL_DOWN, HALF_LEFT, HALF_RIGHT,
  FULL_LEFT, FULL_RIGHT, NEXT_CHAR, PREVIOUS_CHAR,
  DELETE_TO_LINE_START, APPEND_FILEPATH, ROTATE_CW, ROTATE_CCW,
  PAGE_BOTTOM, PAGE_TOP
}
enum  { ZATHURA_PAGE_NUMBER_UNSPECIFIED = INT_MIN }
enum  { ZATHURA_PAGE_CACHE_DEFAULT_SIZE = 15, ZATHURA_PAGE_CACHE_MAX_SIZE = 1024 }

Functions

zathura_t * zathura_create (void)
bool zathura_init (zathura_t *zathura)
void zathura_free (zathura_t *zathura)
void zathura_set_xid (zathura_t *zathura, Window xid)
void zathura_set_config_dir (zathura_t *zathura, const char *dir)
void zathura_set_data_dir (zathura_t *zathura, const char *dir)
void zathura_set_plugin_dir (zathura_t *zathura, const char *dir)
void zathura_set_synctex_editor_command (zathura_t *zathura, const char *command)
void zathura_set_synctex (zathura_t *zathura, bool value)
void zathura_set_argv (zathura_t *zathura, char **argv)
bool document_open (zathura_t *zathura, const char *path, const char *password, int page_number)
void document_open_idle (zathura_t *zathura, const char *path, const char *password, int page_number, const char *mode)
bool document_save (zathura_t *zathura, const char *path, bool overwrite)
bool document_close (zathura_t *zathura, bool keep_monitor)
bool page_set (zathura_t *zathura, unsigned int page_id)
bool position_set (zathura_t *zathura, double position_x, double position_y)
void refresh_view (zathura_t *zathura)
bool adjust_view (zathura_t *zathura)
void page_widget_set_mode (zathura_t *zathura, unsigned int page_padding, unsigned int pages_per_row, unsigned int first_page_column)
void statusbar_page_number_update (zathura_t *zathura)
bool zathura_jumplist_has_previous (zathura_t *zathura)
bool zathura_jumplist_has_next (zathura_t *zathura)
zathura_jump_tzathura_jumplist_current (zathura_t *zathura)
void zathura_jumplist_forward (zathura_t *zathura)
void zathura_jumplist_backward (zathura_t *zathura)
void zathura_jumplist_add (zathura_t *zathura)
void zathura_jumplist_trim (zathura_t *zathura)
bool zathura_jumplist_load (zathura_t *zathura, const char *file)

Typedef Documentation

typedef struct _ZathuraDatabase zathura_database_t

Definition at line 78 of file zathura.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
NEXT 
PREVIOUS 
LEFT 
RIGHT 
UP 
DOWN 
BOTTOM 
TOP 
HIDE 
HIGHLIGHT 
DELETE_LAST_WORD 
DELETE_LAST_CHAR 
DEFAULT 
ERROR 
WARNING 
NEXT_GROUP 
PREVIOUS_GROUP 
ZOOM_IN 
ZOOM_OUT 
ZOOM_ORIGINAL 
ZOOM_SPECIFIC 
FORWARD 
BACKWARD 
CONTINUOUS 
DELETE_LAST 
EXPAND 
EXPAND_ALL 
COLLAPSE_ALL 
COLLAPSE 
TOGGLE 
SELECT 
GOTO_DEFAULT 
GOTO_LABELS 
GOTO_OFFSET 
HALF_UP 
HALF_DOWN 
FULL_UP 
FULL_DOWN 
HALF_LEFT 
HALF_RIGHT 
FULL_LEFT 
FULL_RIGHT 
NEXT_CHAR 
PREVIOUS_CHAR 
DELETE_TO_LINE_START 
APPEND_FILEPATH 
ROTATE_CW 
ROTATE_CCW 
PAGE_BOTTOM 
PAGE_TOP 

Definition at line 13 of file zathura.h.

anonymous enum
Enumerator:
ZATHURA_PAGE_NUMBER_UNSPECIFIED 

Definition at line 67 of file zathura.h.

anonymous enum
Enumerator:
ZATHURA_PAGE_CACHE_DEFAULT_SIZE 
ZATHURA_PAGE_CACHE_MAX_SIZE 

Definition at line 72 of file zathura.h.

Function Documentation

bool adjust_view ( zathura_t *  zathura)

Recompute the scale according to settings

Parameters
zathuraZathura session

Definition at line 1159 of file zathura.c.

bool document_close ( zathura_t *  zathura,
bool  keep_monitor 
)

Closes the current opened document

Parameters
zathuraThe zathura session
keep_monitorSet to true if monitor should be kept (sc_reload)
Returns
If no error occured true, otherwise false, is returned.

Definition at line 895 of file zathura.c.

bool document_open ( zathura_t *  zathura,
const char *  path,
const char *  password,
int  page_number 
)

Opens a file

Parameters
zathuraThe zathura session
pathThe path to the file
passwordThe password of the file
Returns
If no error occured true, otherwise false, is returned.

Definition at line 505 of file zathura.c.

void document_open_idle ( zathura_t *  zathura,
const char *  path,
const char *  password,
int  page_number,
const char *  mode 
)

Opens a file (idle)

Parameters
zathuraThe zathura session
pathThe path to the file
passwordThe password of the file

Definition at line 834 of file zathura.c.

bool document_save ( zathura_t *  zathura,
const char *  path,
bool  overwrite 
)

Save a open file

Parameters
zathuraThe zathura session
pathThe path
overwriteOverwrite existing file
Returns
If no error occured true, otherwise false, is returned.

Definition at line 856 of file zathura.c.

bool page_set ( zathura_t *  zathura,
unsigned int  page_id 
)

Opens the page with the given number

Parameters
zathuraThe zathura session
page_idThe id of the page that should be set
Returns
If no error occured true, otherwise false, is returned.

Definition at line 998 of file zathura.c.

void page_widget_set_mode ( zathura_t *  zathura,
unsigned int  page_padding,
unsigned int  pages_per_row,
unsigned int  first_page_column 
)

Builds the box structure to show the rendered pages

Parameters
zathuraThe zathura session
page_paddingpadding in pixels between pages
pages_per_rowNumber of shown pages per row
first_page_columnColumn on which first page start

Definition at line 1054 of file zathura.c.

bool position_set ( zathura_t *  zathura,
double  position_x,
double  position_y 
)

Moves to the given position

Parameters
zathuraZathura session
position_xX coordinate
position_yY coordinate
Returns
If no error occured true, otherwise false, is returned.

Definition at line 1103 of file zathura.c.

void refresh_view ( zathura_t *  zathura)

Refresh the page view

Parameters
zathuraZathura session

Definition at line 1149 of file zathura.c.

void statusbar_page_number_update ( zathura_t *  zathura)

Updates the page number in the statusbar. Note that 1 will be added to the displayed number

Parameters
zathuraThe zathura session

Definition at line 1019 of file zathura.c.

zathura_t* zathura_create ( void  )

Creates a zathura session

Returns
zathura session object or NULL if zathura could not be creeated

Definition at line 55 of file zathura.c.

void zathura_free ( zathura_t *  zathura)

Free zathura session

Parameters
zathuraThe zathura session

Definition at line 258 of file zathura.c.

bool zathura_init ( zathura_t *  zathura)

Initializes zathura

Parameters
zathuraThe zathura session
Returns
true if initialization has been successful

Definition at line 88 of file zathura.c.

void zathura_jumplist_add ( zathura_t *  zathura)

Add current page as a new item to the jumplist after current position

Parameters
zathuraThe zathura session

Definition at line 1320 of file zathura.c.

void zathura_jumplist_backward ( zathura_t *  zathura)

Move backward in the jumplist

Parameters
zathuraThe zathura session

Definition at line 1251 of file zathura.c.

zathura_jump_t* zathura_jumplist_current ( zathura_t *  zathura)

Return current jump in the jumplist

Parameters
zathuraThe zathura session
Returns
current jump

Definition at line 1233 of file zathura.c.

void zathura_jumplist_forward ( zathura_t *  zathura)

Move forward in the jumplist

Parameters
zathuraThe zathura session

Definition at line 1243 of file zathura.c.

bool zathura_jumplist_has_next ( zathura_t *  zathura)

Checks whether current jump has a next jump

Parameters
zathuraThe zathura session
Returns
true if current jump has a next jump

Definition at line 1227 of file zathura.c.

bool zathura_jumplist_has_previous ( zathura_t *  zathura)

Checks whether current jump has a previous jump

Parameters
zathuraThe zathura session
Returns
true if current jump has a previous jump

Definition at line 1221 of file zathura.c.

bool zathura_jumplist_load ( zathura_t *  zathura,
const char *  file 
)

Load the jumplist of the specified file

Parameters
zathuraThe zathura session
fileThe file whose jumplist is to be loaded

return A linked list of zathura_jump_t structures constituting the jumplist of the specified file, or NULL.

Definition at line 1346 of file zathura.c.

void zathura_jumplist_trim ( zathura_t *  zathura)

Trim entries from the beginning of the jumplist to maintain it's maximum size constraint.

Parameters
zathuraThe zathura session

Definition at line 1296 of file zathura.c.

void zathura_set_argv ( zathura_t *  zathura,
char **  argv 
)

Sets the program parameters

Parameters
zathuraThe zathura session
argvList of arguments

Definition at line 404 of file zathura.c.

void zathura_set_config_dir ( zathura_t *  zathura,
const char *  dir 
)

Set the path to the configuration directory

Parameters
zathuraThe zathura session
dirDirectory path

Definition at line 327 of file zathura.c.

void zathura_set_data_dir ( zathura_t *  zathura,
const char *  dir 
)

Set the path to the data directory

Parameters
zathuraThe zathura session
dirDirectory path

Definition at line 341 of file zathura.c.

void zathura_set_plugin_dir ( zathura_t *  zathura,
const char *  dir 
)

Set the path to the plugin directory

Parameters
zathuraThe zathura session
dirDirectory path

Definition at line 355 of file zathura.c.

void zathura_set_synctex ( zathura_t *  zathura,
bool  value 
)

En/Disable zathuras synctex support

Parameters
zathuraThe zathura session
valueThe value

Definition at line 395 of file zathura.c.

void zathura_set_synctex_editor_command ( zathura_t *  zathura,
const char *  command 
)

Enables synctex support and sets the synctex editor command

Parameters
zathuraThe zathura session
commandSynctex editor command

Definition at line 379 of file zathura.c.

void zathura_set_xid ( zathura_t *  zathura,
Window  xid 
)

Set parent window id

Parameters
zathuraThe zathura session
xidThe window id

Definition at line 319 of file zathura.c.