Commit 8e4dca7a authored by Sebastian Ramacher's avatar Sebastian Ramacher

Cairo is always needed

Signed-off-by: default avatarSebastian Ramacher <sebastian@ramacher.at>
parent a9bdf902
......@@ -10,10 +10,6 @@ HEADER = $(sort $(wildcard *.h))
OBJECTS = ${SOURCE:.c=.o}
DOBJECTS = ${SOURCE:.c=.do}
ifneq "$(WITH_CAIRO)" "0"
CPPFLAGS += -DHAVE_CAIRO
endif
CPPFLAGS += "-DVERSION_MAJOR=${VERSION_MAJOR}"
CPPFLAGS += "-DVERSION_MINOR=${VERSION_MINOR}"
CPPFLAGS += "-DVERSION_REV=${VERSION_REV}"
......
......@@ -17,6 +17,9 @@ LIBDIR ?= ${PREFIX}/lib
DESKTOPPREFIX ?= ${PREFIX}/share/applications
# libs
CAIRO_INC ?= $(shell $(PKG_CONFIG) --cflags cairo)
CAIRO_LIB ?= $(shell $(PKG_CONFIG) --libs cairo)
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0)
......@@ -40,8 +43,8 @@ HARFBUZZ_LIB ?= $(shell pkg-config --libs harfbuzz)
MUPDF_LIB ?= -lmupdf -lmupdfthird
INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} ${FREETYPE_INC} ${HARFBUZZ_INC}
LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} ${FREETYPE_LIB} ${HARFBUZZ_LIB} -ljbig2dec -lopenjp2 -ljpeg -lz
INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${CAIRO_INC} ${ZATHURA_INC} ${FREETYPE_INC} ${HARFBUZZ_INC}
LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} ${CAIRO_LIB} ${FREETYPE_LIB} ${HARFBUZZ_LIB} -ljbig2dec -lopenjp2 -ljpeg -lz
# compiler flags
CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
......@@ -52,9 +55,6 @@ LDFLAGS += -fPIC
# debug
DFLAGS ?= -g
# build with cairo support?
WITH_CAIRO ?= 1
# compiler
CC ?= gcc
LD ?= ld
......
......@@ -19,10 +19,8 @@ register_functions(zathura_plugin_functions_t* functions)
functions->page_images_get = (zathura_plugin_page_images_get_t) pdf_page_images_get;
functions->page_get_text = (zathura_plugin_page_get_text_t) pdf_page_get_text;
functions->page_render = (zathura_plugin_page_render_t) pdf_page_render;
#if HAVE_CAIRO
functions->page_render_cairo = (zathura_plugin_page_render_cairo_t) pdf_page_render_cairo;
functions->page_image_get_cairo = (zathura_plugin_page_image_get_cairo_t) pdf_page_image_get_cairo;
#endif
}
ZATHURA_PLUGIN_REGISTER(
......
......@@ -6,10 +6,7 @@
#include <stdbool.h>
#include <zathura/plugin-api.h>
#include <mupdf/fitz.h>
#if HAVE_CAIRO
#include <cairo.h>
#endif
typedef struct mupdf_document_s
{
......@@ -113,7 +110,6 @@ girara_list_t* pdf_page_links_get(zathura_page_t* page, mupdf_page_t* mupdf_page
*/
girara_list_t* pdf_page_images_get(zathura_page_t* page, mupdf_page_t* mupdf_page, zathura_error_t* error);
#if HAVE_CAIRO
/**
* Gets the content of the image in a cairo surface
*
......@@ -125,7 +121,6 @@ girara_list_t* pdf_page_images_get(zathura_page_t* page, mupdf_page_t* mupdf_pag
*/
cairo_surface_t* pdf_page_image_get_cairo(zathura_page_t* page, mupdf_page_t*
mupdf_page, zathura_image_t* image, zathura_error_t* error);
#endif
/**
* Get text for selection
......@@ -159,7 +154,6 @@ girara_list_t* pdf_document_get_information(zathura_document_t* document,
*/
zathura_image_buffer_t* pdf_page_render(zathura_page_t* page, mupdf_page_t* mupdf_page, zathura_error_t* error);
#if HAVE_CAIRO
/**
* Renders a page onto a cairo object
*
......@@ -168,6 +162,5 @@ zathura_image_buffer_t* pdf_page_render(zathura_page_t* page, mupdf_page_t* mupd
* @return true if no error occurred, otherwise false
*/
zathura_error_t pdf_page_render_cairo(zathura_page_t* page, mupdf_page_t* mupdf_page, cairo_t* cairo, bool printing);
#endif
#endif // PDF_H
......@@ -100,7 +100,6 @@ pdf_page_render(zathura_page_t* page, mupdf_page_t* mupdf_page, zathura_error_t*
return image_buffer;
}
#if HAVE_CAIRO
zathura_error_t
pdf_page_render_cairo(zathura_page_t* page, mupdf_page_t* mupdf_page, cairo_t* cairo, bool GIRARA_UNUSED(printing))
{
......@@ -134,5 +133,4 @@ pdf_page_render_cairo(zathura_page_t* page, mupdf_page_t* mupdf_page, cairo_t* c
return pdf_page_render_to_buffer(mupdf_document, mupdf_page, image, rowstride, 4,
page_width, page_height, scalex, scaley);
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment