zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Functions
page.c File Reference
#include <girara/session.h>
#include <girara/utils.h>
#include <glib/gi18n.h>
#include "document.h"
#include "page.h"
#include "plugin.h"
#include "utils.h"
#include "internal.h"
#include "types.h"

Go to the source code of this file.

Data Structures

struct  zathura_page_t

Functions

zathura_page_t * zathura_page_new (zathura_document_t *document, unsigned int index, zathura_error_t *error)
zathura_error_t zathura_page_free (zathura_page_t *page)
zathura_document_t * zathura_page_get_document (zathura_page_t *page)
unsigned int zathura_page_get_index (zathura_page_t *page)
double zathura_page_get_width (zathura_page_t *page)
void zathura_page_set_width (zathura_page_t *page, double width)
double zathura_page_get_height (zathura_page_t *page)
void zathura_page_set_height (zathura_page_t *page, double height)
bool zathura_page_get_visibility (zathura_page_t *page)
void zathura_page_set_visibility (zathura_page_t *page, bool visibility)
void * zathura_page_get_data (zathura_page_t *page)
void zathura_page_set_data (zathura_page_t *page, void *data)
girara_list_t * zathura_page_search_text (zathura_page_t *page, const char *text, zathura_error_t *error)
girara_list_t * zathura_page_links_get (zathura_page_t *page, zathura_error_t *error)
zathura_error_t zathura_page_links_free (girara_list_t *UNUSED(list))
girara_list_t * zathura_page_form_fields_get (zathura_page_t *page, zathura_error_t *error)
zathura_error_t zathura_page_form_fields_free (girara_list_t *UNUSED(list))
girara_list_t * zathura_page_images_get (zathura_page_t *page, zathura_error_t *error)
cairo_surface_t * zathura_page_image_get_cairo (zathura_page_t *page, zathura_image_t *image, zathura_error_t *error)
char * zathura_page_get_text (zathura_page_t *page, zathura_rectangle_t rectangle, zathura_error_t *error)
zathura_error_t zathura_page_render (zathura_page_t *page, cairo_t *cairo, bool printing)

Function Documentation

zathura_error_t zathura_page_form_fields_free ( girara_list_t *  UNUSEDlist)

Definition at line 276 of file page.c.

girara_list_t* zathura_page_form_fields_get ( zathura_page_t *  page,
zathura_error_t error 
)

Get list of form fields

Parameters
pageThe page object
errorSet to an error value (see zathura_error_t) if an error occured
Returns
List of form fields

Definition at line 254 of file page.c.

zathura_error_t zathura_page_free ( zathura_page_t *  page)

Frees the page object

Parameters
pageThe page object
Returns
ZATHURA_ERROR_OK when no error occured, otherwise see zathura_error_t

Definition at line 79 of file page.c.

void* zathura_page_get_data ( zathura_page_t *  page)

Returns the custom data

Parameters
pageThe page object
Returns
The custom data or NULL

Definition at line 184 of file page.c.

zathura_document_t* zathura_page_get_document ( zathura_page_t *  page)

Returns the associated document

Parameters
pageThe page object
Returns
The associated document
NULL if an error occured

Definition at line 104 of file page.c.

double zathura_page_get_height ( zathura_page_t *  page)

Returns the height of the page

Parameters
pageThe page object
Returns
Height of the page
-1 If an error occured

Definition at line 144 of file page.c.

unsigned int zathura_page_get_index ( zathura_page_t *  page)

Returns the set id of the page

Parameters
pageThe page object
Returns
The id of the page

Definition at line 114 of file page.c.

char* zathura_page_get_text ( zathura_page_t *  page,
zathura_rectangle_t  rectangle,
zathura_error_t error 
)

Get text for selection

Parameters
pagePage
rectangleSelection
errorSet to an error value (see zathura_error_t) if an error occured
Returns
The selected text (needs to be deallocated with g_free)

Definition at line 326 of file page.c.

bool zathura_page_get_visibility ( zathura_page_t *  page)

Returns the visibility of the page

Parameters
pageThe page object
Returns
true if the page is visible
false if the page is hidden

Definition at line 164 of file page.c.

double zathura_page_get_width ( zathura_page_t *  page)

Returns the width of the page

Parameters
pageThe page object
Returns
Width of the page
-1 If an error occured

Definition at line 124 of file page.c.

cairo_surface_t* zathura_page_image_get_cairo ( zathura_page_t *  page,
zathura_image_t image,
zathura_error_t error 
)

Get image

Parameters
pagePage
imageImage identifier
errorSet to an error value (see zathura_error_t) if an error occured
Returns
The cairo image surface or NULL if an error occured

Definition at line 304 of file page.c.

girara_list_t* zathura_page_images_get ( zathura_page_t *  page,
zathura_error_t error 
)

Get list of images

Parameters
pagePage
errorSet to an error value (see zathura_error_t) if an error occured
Returns
List of images or NULL if an error occured

Definition at line 282 of file page.c.

zathura_error_t zathura_page_links_free ( girara_list_t *  UNUSEDlist)

Definition at line 248 of file page.c.

girara_list_t* zathura_page_links_get ( zathura_page_t *  page,
zathura_error_t error 
)

Get page links

Parameters
pageThe page object
errorSet to an error value (see zathura_error_t) if an error occured
Returns
List of links

Definition at line 226 of file page.c.

zathura_page_t* zathura_page_new ( zathura_document_t *  document,
unsigned int  index,
zathura_error_t error 
)

Get the page object

Parameters
documentThe document
indexPage number
errorOptional error
Returns
Page object or NULL if an error occured

Definition at line 24 of file page.c.

zathura_error_t zathura_page_render ( zathura_page_t *  page,
cairo_t *  cairo,
bool  printing 
)

Render page

Parameters
pageThe page object
cairoCairo object
printingrender for printing
Returns
ZATHURA_ERROR_OK when no error occured, otherwise see zathura_error_t

Definition at line 348 of file page.c.

girara_list_t* zathura_page_search_text ( zathura_page_t *  page,
const char *  text,
zathura_error_t error 
)

Search page

Parameters
pageThe page object
textSearch item
errorSet to an error value (see zathura_error_t) if an error occured
Returns
List of results

Definition at line 204 of file page.c.

void zathura_page_set_data ( zathura_page_t *  page,
void *  data 
)

Sets the custom data

Parameters
pageThe page object
dataThe custom data

Definition at line 194 of file page.c.

void zathura_page_set_height ( zathura_page_t *  page,
double  height 
)

Sets the new height of the page

Parameters
pageThe page object
heightThe new height of the page

Definition at line 154 of file page.c.

void zathura_page_set_visibility ( zathura_page_t *  page,
bool  visibility 
)

Sets the visibility of the page

Parameters
pageThe page object
visibilityThe new visibility value

Definition at line 174 of file page.c.

void zathura_page_set_width ( zathura_page_t *  page,
double  width 
)

Sets the new width of the page

Parameters
pageThe page object
widthThe new width of the page

Definition at line 134 of file page.c.