2011-01-07 09:07:02 +01:00
|
|
|
/* See LICENSE file for license and copyright information */
|
|
|
|
|
2011-01-24 12:43:39 +01:00
|
|
|
#ifndef RENDER_H
|
|
|
|
#define RENDER_H
|
|
|
|
|
2011-01-07 09:07:02 +01:00
|
|
|
#include <stdbool.h>
|
2011-01-24 12:43:39 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <girara-datastructures.h>
|
2011-01-07 09:07:02 +01:00
|
|
|
|
|
|
|
#include "ft/document.h"
|
2011-02-09 21:28:36 +01:00
|
|
|
#include "callbacks.h"
|
2011-01-07 09:07:02 +01:00
|
|
|
|
2011-01-24 12:43:39 +01:00
|
|
|
typedef struct render_thread_s
|
|
|
|
{
|
2011-02-08 07:51:53 +01:00
|
|
|
girara_list_t* list; /**> The list of pages */
|
|
|
|
GThread* thread; /**> The thread object */
|
|
|
|
GMutex* lock; /**> Lock */
|
|
|
|
GCond* cond; /**> Condition */
|
2011-01-24 12:43:39 +01:00
|
|
|
} render_thread_t;
|
|
|
|
|
2011-02-08 07:51:53 +01:00
|
|
|
/**
|
|
|
|
* This function initializes a render thread
|
|
|
|
*
|
|
|
|
* @return The render thread object or NULL if an error occured
|
|
|
|
*/
|
2011-01-24 12:43:39 +01:00
|
|
|
render_thread_t* render_init(void);
|
2011-02-08 07:51:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function destroys the render thread object
|
|
|
|
*
|
|
|
|
* @param render_thread The render thread object
|
|
|
|
*/
|
2011-01-24 12:43:39 +01:00
|
|
|
void render_free(render_thread_t* render_thread);
|
2011-02-08 07:51:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is used to add a page to the render thread list
|
|
|
|
* that should be rendered.
|
|
|
|
*
|
|
|
|
* @param render_thread The render thread object
|
|
|
|
* @param page The page that should be rendered
|
|
|
|
* @return true if no error occured
|
|
|
|
*/
|
2011-01-24 12:43:39 +01:00
|
|
|
bool render_page(render_thread_t* render_thread, zathura_page_t* page);
|
|
|
|
|
2011-02-09 21:28:36 +01:00
|
|
|
/**
|
|
|
|
* This function is used to unmark all pages as not rendered. This should
|
|
|
|
* be used if all pages should be rendered again (e.g.: the zoom level or the
|
|
|
|
* colors have changed)
|
|
|
|
*/
|
|
|
|
void render_all(void);
|
|
|
|
|
2011-01-24 12:43:39 +01:00
|
|
|
#endif // RENDER_H
|