3 --- texk/web2c/luatexdir/lua/lepdflib.cc.orig 2011-05-19 05:38:37.000000000 +0000
4 +++ texk/web2c/luatexdir/lua/lepdflib.cc
5 @@ -89,7 +89,9 @@ new_poppler_userdata(AnnotBorder);
6 new_poppler_userdata(Annots);
7 new_poppler_userdata(Array);
8 new_poppler_userdata(Catalog);
10 new_poppler_userdata(EmbFile);
12 new_poppler_userdata(Dict);
13 //new_poppler_userdata(GooString);
14 new_poppler_userdata(LinkDest);
15 @@ -152,7 +154,7 @@ static int l_new_Annot(lua_State * L)
16 pdfdoc_changed_error(L);
17 uout = new_Annot_userdata(L);
19 - new Annot((XRef *) uxref->d, (Dict *) udict->d, (Catalog *) ucatalog->d,
20 + new Annot((PDFDoc *) uxref->d, (Dict *) udict->d,
22 uout->atype = ALLOC_LEPDF;
24 @@ -174,7 +176,7 @@ static int l_new_Annots(lua_State * L)
25 pdfdoc_changed_error(L);
26 uout = new_Annots_userdata(L);
28 - new Annots((XRef *) uxref->d, (Catalog *) ucatalog->d,
29 + new Annots((PDFDoc *) uxref->d,
30 (Object *) uannotsobj->d);
31 uout->atype = ALLOC_LEPDF;
33 @@ -364,7 +366,7 @@ static int m_##type##__tostring(lua_Stat
36 m_poppler_get_BOOL(Annot, isOk);
37 -m_poppler_get_OBJECT(Annot, getAppearance);
38 +m_poppler_get_OBJECT(Annot, getAppearanceResDict);
39 m_poppler_get_poppler(Annot, AnnotBorder, getBorder);
41 static int m_Annot_match(lua_State * L)
42 @@ -393,13 +395,17 @@ static int m_Annot__gc(lua_State * L)
43 printf("\n===== Annot GC ===== uin=<%p>\n", uin);
45 if (uin->atype == ALLOC_LEPDF)
47 delete(Annot *) uin->d;
49 + ((Annot *) uin->d)->decRefCnt();
54 static const struct luaL_Reg Annot_m[] = {
55 {"isOk", m_Annot_isOk},
56 - {"getAppearance", m_Annot_getAppearance},
57 + {"getAppearance", m_Annot_getAppearanceResDict},
58 {"getBorder", m_Annot_getBorder},
59 {"match", m_Annot_match},
60 {"__tostring", m_Annot__tostring},
61 @@ -410,6 +416,8 @@ static const struct luaL_Reg Annot_m[] =
62 //**********************************************************************
67 m_poppler_get_DOUBLE(AnnotBorderStyle, getWidth);
69 m_poppler__tostring(AnnotBorderStyle);
70 @@ -435,6 +443,8 @@ static const struct luaL_Reg AnnotBorder
71 {NULL, NULL} // sentinel
76 //**********************************************************************
79 @@ -684,6 +694,7 @@ static int m_Catalog_findDest(lua_State
80 m_poppler_get_poppler(Catalog, Object, getDests);
81 m_poppler_get_INT(Catalog, numEmbeddedFiles);
84 static int m_Catalog_embeddedFile(lua_State * L)
87 @@ -707,6 +718,7 @@ static int m_Catalog_embeddedFile(lua_St
93 m_poppler_get_INT(Catalog, numJS);
95 @@ -749,7 +761,9 @@ static const struct luaL_Reg Catalog_m[]
96 {"findDest", m_Catalog_findDest},
97 {"getDests", m_Catalog_getDests},
98 {"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
100 {"embeddedFile", m_Catalog_embeddedFile},
102 {"numJS", m_Catalog_numJS},
103 {"getJS", m_Catalog_getJS},
104 {"getOutline", m_Catalog_getOutline},
105 @@ -761,6 +775,8 @@ static const struct luaL_Reg Catalog_m[]
106 //**********************************************************************
111 m_poppler_get_GOOSTRING(EmbFile, name);
112 m_poppler_get_GOOSTRING(EmbFile, description);
113 m_poppler_get_INT(EmbFile, size);
114 @@ -801,6 +817,8 @@ static const struct luaL_Reg EmbFile_m[]
115 {NULL, NULL} // sentinel
120 //**********************************************************************
123 @@ -1347,7 +1365,7 @@ static int m_Object_getType(lua_State *
125 static int m_Object_getTypeName(lua_State * L)
130 uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
131 if (uin->pd != NULL && uin->pd->pc != uin->pc)
132 @@ -2034,7 +2052,7 @@ static int m_Page_getLinks(lua_State * L
133 if ((uin->pd != NULL && uin->pd->pc != uin->pc)
134 || (ucat->pd != NULL && ucat->pd->pc != ucat->pd->pc))
135 pdfdoc_changed_error(L);
136 - links = ((Page *) uin->d)->getLinks((Catalog *) ucat->d);
137 + links = ((Page *) uin->d)->getLinks();
139 uout = new_Links_userdata(L);
141 @@ -2629,7 +2647,10 @@ m_poppler_get_INT(XRef, getNumObjects);
142 m_poppler_get_INT(XRef, getRootNum);
143 m_poppler_get_INT(XRef, getRootGen);
145 -m_poppler_get_INT(XRef, getSize);
146 +static int m_XRef_getSize(lua_State * L)
148 + return m_XRef_getNumObjects(L);
151 m_poppler_get_poppler(XRef, Object, getTrailerDict);
153 @@ -2683,11 +2704,15 @@ int luaopen_epdf(lua_State * L)
155 register_meta(Annot);
156 // TODO register_meta(AnnotBorder);
158 register_meta(AnnotBorderStyle);
160 register_meta(Annots);
161 register_meta(Array);
162 register_meta(Catalog);
164 register_meta(EmbFile);
167 register_meta(GooString);
168 register_meta(LinkDest);