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>
|
2011-10-23 17:01:15 +02:00
|
|
|
#include <girara/types.h>
|
2011-01-07 09:07:02 +01:00
|
|
|
|
2011-04-18 18:19:41 +02:00
|
|
|
#include "zathura.h"
|
2011-02-09 21:28:36 +01:00
|
|
|
#include "callbacks.h"
|
2011-01-07 09:07:02 +01:00
|
|
|
|
2011-04-18 18:19:41 +02:00
|
|
|
struct render_thread_s
|
2011-01-24 12:43:39 +01:00
|
|
|
{
|
2012-01-22 21:57:18 +01:00
|
|
|
girara_list_t* list; /**< The list of pages */
|
|
|
|
GThread* thread; /**< The thread object */
|
|
|
|
GMutex* lock; /**< Lock */
|
|
|
|
GCond* cond; /**< Condition */
|
|
|
|
zathura_t* zathura; /**< Zathura object */
|
2011-04-18 18:19:41 +02:00
|
|
|
};
|
2011-01-24 12:43:39 +01:00
|
|
|
|
2011-02-08 07:51:53 +01:00
|
|
|
/**
|
|
|
|
* This function initializes a render thread
|
|
|
|
*
|
2012-02-08 15:30:13 +01:00
|
|
|
* @param zathura object
|
2011-02-08 07:51:53 +01:00
|
|
|
* @return The render thread object or NULL if an error occured
|
|
|
|
*/
|
2011-04-18 18:00:08 +02:00
|
|
|
render_thread_t* render_init(zathura_t* zathura);
|
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)
|
2011-04-18 18:00:08 +02:00
|
|
|
*
|
|
|
|
* @param zathura Zathura object
|
2011-02-09 21:28:36 +01:00
|
|
|
*/
|
2011-04-18 18:00:08 +02:00
|
|
|
void render_all(zathura_t* zathura);
|
2011-02-09 21:28:36 +01:00
|
|
|
|
2011-04-18 21:22:35 +02:00
|
|
|
/**
|
|
|
|
* Renders page
|
|
|
|
*
|
|
|
|
* @param widget Drawing area
|
|
|
|
* @param event Event
|
|
|
|
* @param data Optional data
|
|
|
|
* @return true if no error occured
|
|
|
|
*/
|
|
|
|
gboolean page_expose_event(GtkWidget* widget, GdkEventExpose* event, gpointer data);
|
|
|
|
|
2011-01-24 12:43:39 +01:00
|
|
|
#endif // RENDER_H
|