Files
pkgsrc-ng/print/luatex/patches/patch-ad
2013-09-26 17:14:40 +02:00

171 lines
5.1 KiB
Plaintext

$NetBSD: patch-ad,v 1.5 2013/03/24 17:00:30 spz Exp $
Fix build with poppler-0.22
--- texk/web2c/luatexdir/lua/lepdflib.cc.orig 2011-05-19 05:38:37.000000000 +0000
+++ texk/web2c/luatexdir/lua/lepdflib.cc
@@ -89,7 +89,9 @@ new_poppler_userdata(AnnotBorder);
new_poppler_userdata(Annots);
new_poppler_userdata(Array);
new_poppler_userdata(Catalog);
+#if 0
new_poppler_userdata(EmbFile);
+#endif
new_poppler_userdata(Dict);
//new_poppler_userdata(GooString);
new_poppler_userdata(LinkDest);
@@ -152,7 +154,7 @@ static int l_new_Annot(lua_State * L)
pdfdoc_changed_error(L);
uout = new_Annot_userdata(L);
uout->d =
- new Annot((XRef *) uxref->d, (Dict *) udict->d, (Catalog *) ucatalog->d,
+ new Annot((PDFDoc *) uxref->d, (Dict *) udict->d,
(Object *) uref->d);
uout->atype = ALLOC_LEPDF;
uout->pc = uxref->pc;
@@ -174,7 +176,7 @@ static int l_new_Annots(lua_State * L)
pdfdoc_changed_error(L);
uout = new_Annots_userdata(L);
uout->d =
- new Annots((XRef *) uxref->d, (Catalog *) ucatalog->d,
+ new Annots((PDFDoc *) uxref->d, (int) 0,
(Object *) uannotsobj->d);
uout->atype = ALLOC_LEPDF;
uout->pc = uxref->pc;
@@ -364,7 +366,7 @@ static int m_##type##__tostring(lua_Stat
// Annot
m_poppler_get_BOOL(Annot, isOk);
-m_poppler_get_OBJECT(Annot, getAppearance);
+m_poppler_get_OBJECT(Annot, getAppearanceResDict);
m_poppler_get_poppler(Annot, AnnotBorder, getBorder);
static int m_Annot_match(lua_State * L)
@@ -393,13 +395,17 @@ static int m_Annot__gc(lua_State * L)
printf("\n===== Annot GC ===== uin=<%p>\n", uin);
#endif
if (uin->atype == ALLOC_LEPDF)
+#if 0
delete(Annot *) uin->d;
+#else
+ ((Annot *) uin->d)->decRefCnt();
+#endif
return 0;
}
static const struct luaL_Reg Annot_m[] = {
{"isOk", m_Annot_isOk},
- {"getAppearance", m_Annot_getAppearance},
+ {"getAppearance", m_Annot_getAppearanceResDict},
{"getBorder", m_Annot_getBorder},
{"match", m_Annot_match},
{"__tostring", m_Annot__tostring},
@@ -410,6 +416,8 @@ static const struct luaL_Reg Annot_m[] =
//**********************************************************************
// AnnotBorderStyle
+#if 0
+
m_poppler_get_DOUBLE(AnnotBorderStyle, getWidth);
m_poppler__tostring(AnnotBorderStyle);
@@ -435,6 +443,8 @@ static const struct luaL_Reg AnnotBorder
{NULL, NULL} // sentinel
};
+#endif
+
//**********************************************************************
// Annots
@@ -684,6 +694,7 @@ static int m_Catalog_findDest(lua_State
m_poppler_get_poppler(Catalog, Object, getDests);
m_poppler_get_INT(Catalog, numEmbeddedFiles);
+#if 0
static int m_Catalog_embeddedFile(lua_State * L)
{
EmbFile *ef;
@@ -707,6 +718,7 @@ static int m_Catalog_embeddedFile(lua_St
lua_pushnil(L);
return 1;
}
+#endif
m_poppler_get_INT(Catalog, numJS);
@@ -749,7 +761,9 @@ static const struct luaL_Reg Catalog_m[]
{"findDest", m_Catalog_findDest},
{"getDests", m_Catalog_getDests},
{"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
+#if 0
{"embeddedFile", m_Catalog_embeddedFile},
+#endif
{"numJS", m_Catalog_numJS},
{"getJS", m_Catalog_getJS},
{"getOutline", m_Catalog_getOutline},
@@ -761,6 +775,8 @@ static const struct luaL_Reg Catalog_m[]
//**********************************************************************
// EmbFile
+#if 0
+
m_poppler_get_GOOSTRING(EmbFile, name);
m_poppler_get_GOOSTRING(EmbFile, description);
m_poppler_get_INT(EmbFile, size);
@@ -801,6 +817,8 @@ static const struct luaL_Reg EmbFile_m[]
{NULL, NULL} // sentinel
};
+#endif
+
//**********************************************************************
// Dict
@@ -1347,7 +1365,7 @@ static int m_Object_getType(lua_State *
static int m_Object_getTypeName(lua_State * L)
{
- char *s;
+ const char *s;
udstruct *uin;
uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
if (uin->pd != NULL && uin->pd->pc != uin->pc)
@@ -2034,7 +2052,7 @@ static int m_Page_getLinks(lua_State * L
if ((uin->pd != NULL && uin->pd->pc != uin->pc)
|| (ucat->pd != NULL && ucat->pd->pc != ucat->pd->pc))
pdfdoc_changed_error(L);
- links = ((Page *) uin->d)->getLinks((Catalog *) ucat->d);
+ links = ((Page *) uin->d)->getLinks();
if (links != NULL) {
uout = new_Links_userdata(L);
uout->d = links;
@@ -2629,7 +2647,10 @@ m_poppler_get_INT(XRef, getNumObjects);
m_poppler_get_INT(XRef, getRootNum);
m_poppler_get_INT(XRef, getRootGen);
// getStreamEnd
-m_poppler_get_INT(XRef, getSize);
+static int m_XRef_getSize(lua_State * L)
+{
+ return m_XRef_getNumObjects(L);
+}
// getEntry
m_poppler_get_poppler(XRef, Object, getTrailerDict);
@@ -2683,11 +2704,15 @@ int luaopen_epdf(lua_State * L)
{
register_meta(Annot);
// TODO register_meta(AnnotBorder);
+#if 0
register_meta(AnnotBorderStyle);
+#endif
register_meta(Annots);
register_meta(Array);
register_meta(Catalog);
+#if 0
register_meta(EmbFile);
+#endif
register_meta(Dict);
register_meta(GooString);
register_meta(LinkDest);