From cca66b9ec4e494c1d919bff0f71a820d8afab1fa Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:24:48 +0200 Subject: Adding upstream version 1.2.2. Signed-off-by: Daniel Baumann --- .../internal/pdfinput/poppler-transition-api.h | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 src/extension/internal/pdfinput/poppler-transition-api.h (limited to 'src/extension/internal/pdfinput/poppler-transition-api.h') diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h new file mode 100644 index 0000000..dc9e47e --- /dev/null +++ b/src/extension/internal/pdfinput/poppler-transition-api.h @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * TODO short description + *//* + * Authors: + * see git history + * + * Copyright (C) 2018 Authors + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#ifndef SEEN_POPPLER_TRANSITION_API_H +#define SEEN_POPPLER_TRANSITION_API_H + +#include + +#if POPPLER_CHECK_VERSION(22, 4, 0) +#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get()) +#else +#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr) +#endif + +#if POPPLER_CHECK_VERSION(22, 3, 0) +#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared(std::make_unique(uri)) +#else +#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared(new GooString(uri), nullptr, nullptr, nullptr) +#endif + +#if POPPLER_CHECK_VERSION(0, 83, 0) +#define _POPPLER_CONST_83 const +#else +#define _POPPLER_CONST_83 +#endif + +#if POPPLER_CHECK_VERSION(0, 82, 0) +#define _POPPLER_CONST_82 const +#else +#define _POPPLER_CONST_82 +#endif + +#if POPPLER_CHECK_VERSION(0, 76, 0) +#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse) +#else +#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse) +#endif + +#if POPPLER_CHECK_VERSION(0, 83, 0) +#define _POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr(new GlobalParams(args)) +#else +#define _POPPLER_NEW_GLOBAL_PARAMS(args...) new GlobalParams(args) +#endif + + +#if POPPLER_CHECK_VERSION(0, 72, 0) +#define getCString c_str +#endif + +#if POPPLER_CHECK_VERSION(0,71,0) +typedef bool GBool; +#define gTrue true +#define gFalse false +#endif + +#if POPPLER_CHECK_VERSION(0,70,0) +#define _POPPLER_CONST const +#else +#define _POPPLER_CONST +#endif + +#if POPPLER_CHECK_VERSION(0,69,0) +#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(key, std::move(obj)) +#elif POPPLER_CHECK_VERSION(0,58,0) +#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), std::move(obj)) +#else +#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), &obj) +#endif + +#if POPPLER_CHECK_VERSION(0,58,0) +#define POPPLER_NEW_OBJECT_API +#define _POPPLER_FREE(obj) +#define _POPPLER_CALL(ret, func) (ret = func()) +#define _POPPLER_CALL_ARGS(ret, func, ...) (ret = func(__VA_ARGS__)) +#define _POPPLER_CALL_ARGS_DEREF _POPPLER_CALL_ARGS +#else +#define _POPPLER_FREE(obj) (obj).free() +#define _POPPLER_CALL(ret, func) (*func(&ret)) +#define _POPPLER_CALL_ARGS(ret, func, ...) (func(__VA_ARGS__, &ret)) +#define _POPPLER_CALL_ARGS_DEREF(...) (*_POPPLER_CALL_ARGS(__VA_ARGS__)) +#endif + +#if !POPPLER_CHECK_VERSION(0, 29, 0) +#error "Requires poppler >= 0.29" +#endif + +#endif -- cgit v1.2.3