zathura/zathura.h

112 lines
3.0 KiB
C
Raw Normal View History

2010-11-10 19:18:01 +01:00
/* See LICENSE file for license and copyright information */
#ifndef ZATHURA_H
#define ZATHURA_H
#include <stdbool.h>
#include <girara.h>
2011-03-05 22:11:08 +01:00
#include "render.h"
#include "document.h"
2010-12-12 22:04:42 +01:00
2010-11-13 10:05:28 +01:00
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, ADJUST_BESTFIT, ADJUST_WIDTH, ADJUST_NONE, CONTINUOUS, DELETE_LAST,
ADD_MARKER, EVAL_MARKER, EXPAND, COLLAPSE, SELECT, GOTO_DEFAULT, GOTO_LABELS,
GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, FULL_DOWN, NEXT_CHAR, PREVIOUS_CHAR,
DELETE_TO_LINE_START, APPEND_FILEPATH };
/* define modes */
#define ALL (1 << 0)
#define FULLSCREEN (1 << 1)
#define INDEX (1 << 2)
#define NORMAL (1 << 3)
#define INSERT (1 << 4)
2011-04-18 17:27:49 +02:00
typedef struct zathura_s
2010-11-10 19:18:01 +01:00
{
2010-12-12 22:04:42 +01:00
struct
2010-11-10 19:18:01 +01:00
{
girara_session_t* session; /**> girara interface session */
2010-11-18 21:22:43 +01:00
struct
{
girara_statusbar_item_t* buffer; /**> buffer statusbar entry */
girara_statusbar_item_t* file; /**> file statusbar entry */
girara_statusbar_item_t* page_number; /**> page number statusbar entry */
} statusbar;
2010-12-26 01:52:17 +01:00
2011-02-08 07:51:53 +01:00
GtkWidget *page_view; /**> Widget that contains all rendered pages */
2011-02-10 04:33:28 +01:00
GtkWidget *index; /**> Widget to show the index of the document */
2011-04-18 17:27:49 +02:00
} ui;
2010-12-12 22:04:42 +01:00
2011-01-24 12:43:39 +01:00
struct
{
2011-02-08 07:51:53 +01:00
render_thread_t* render_thread; /**> The thread responsible for rendering the pages */
2011-04-18 17:27:49 +02:00
} sync;
2011-01-24 12:43:39 +01:00
2010-12-12 22:04:42 +01:00
zathura_document_t* document; /**> The current document */
2011-04-18 17:27:49 +02:00
} zathura_t;
2010-11-10 19:18:01 +01:00
/**
* Initializes zathura
*
2011-04-18 17:27:49 +02:00
* @param argc Number of arguments
* @param argv Values of arguments
* @return Zathura zathura object or NULL if zathura could not been initialized
*/
zathura_t* zathura_init(int argc, char* argv[]);
/**
* Free zathura zathura
*
* @param zathura The zathura zathura
2010-11-10 19:18:01 +01:00
*/
2011-04-18 17:27:49 +02:00
void zathura_free(zathura_t* zathura);
2010-11-10 19:18:01 +01:00
2010-12-12 22:04:42 +01:00
/**
* Opens a file
*
2011-04-18 17:27:49 +02:00
* @param zathura The zathura zathura
2010-12-12 22:04:42 +01:00
* @param path The path to the file
* @param password The password of the file
*
* @return If no error occured true, otherwise false, is returned.
*/
2011-04-18 17:27:49 +02:00
bool document_open(zathura_t* zathura, const char* path, const char* password);
2010-12-12 22:04:42 +01:00
/**
* Closes the current opened document
*
2011-04-18 17:27:49 +02:00
* @param zathura The zathura zathura
2010-12-12 22:04:42 +01:00
* @return If no error occured true, otherwise false, is returned.
*/
2011-04-18 17:27:49 +02:00
bool document_close(zathura_t* zathura);
2010-12-12 22:04:42 +01:00
/**
* Opens the page with the given number
*
2011-04-18 17:27:49 +02:00
* @param zathura The zathura zathura
2010-12-12 22:04:42 +01:00
* @return If no error occured true, otherwise false, is returned.
*/
2011-04-18 17:27:49 +02:00
bool page_set(zathura_t* zathura, unsigned int page_id);
2010-12-12 22:04:42 +01:00
2011-03-18 18:40:20 +01:00
/**
* Builds the box structure to show the rendered pages
*
2011-04-18 17:27:49 +02:00
* @param zathura The zathura zathura
2011-03-18 18:40:20 +01:00
* @param pages_per_row Number of shown pages per row
*/
2011-04-18 17:27:49 +02:00
void page_view_set_mode(zathura_t* zathura, unsigned int pages_per_row);
2011-03-18 18:40:20 +01:00
/**
* Create blank pages
2011-04-18 17:03:08 +02:00
*
2011-04-18 17:27:49 +02:00
* @param zathura The zathura zathura
2011-04-18 17:03:08 +02:00
* @return false if an error occured, otherwise true
2011-03-18 18:40:20 +01:00
*/
2011-04-18 17:27:49 +02:00
bool create_blank_pages(zathura_t* zathura);
2011-03-18 18:40:20 +01:00
2010-11-10 19:18:01 +01:00
#endif // ZATHURA_H