Fixup fromcvs/togit conversion
[pkgsrcv2.git] / print / luatex / patches / patch-ad
1 $NetBSD$
2
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);
9 +#if 0
10  new_poppler_userdata(EmbFile);
11 +#endif
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);
18      uout->d =
19 -        new Annot((XRef *) uxref->d, (Dict *) udict->d, (Catalog *) ucatalog->d,
20 +        new Annot((PDFDoc *) uxref->d, (Dict *) udict->d,
21                    (Object *) uref->d);
22      uout->atype = ALLOC_LEPDF;
23      uout->pc = uxref->pc;
24 @@ -174,7 +176,7 @@ static int l_new_Annots(lua_State * L)
25          pdfdoc_changed_error(L);
26      uout = new_Annots_userdata(L);
27      uout->d =
28 -        new Annots((XRef *) uxref->d, (Catalog *) ucatalog->d,
29 +        new Annots((PDFDoc *) uxref->d,
30                     (Object *) uannotsobj->d);
31      uout->atype = ALLOC_LEPDF;
32      uout->pc = uxref->pc;
33 @@ -364,7 +366,7 @@ static int m_##type##__tostring(lua_Stat
34  // Annot
35  
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);
40  
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);
44  #endif
45      if (uin->atype == ALLOC_LEPDF)
46 +#if 0
47          delete(Annot *) uin->d;
48 +#else
49 +        ((Annot *) uin->d)->decRefCnt();
50 +#endif
51      return 0;
52  }
53  
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  //**********************************************************************
63  // AnnotBorderStyle
64  
65 +#if 0
66 +
67  m_poppler_get_DOUBLE(AnnotBorderStyle, getWidth);
68  
69  m_poppler__tostring(AnnotBorderStyle);
70 @@ -435,6 +443,8 @@ static const struct luaL_Reg AnnotBorder
71      {NULL, NULL}                // sentinel
72  };
73  
74 +#endif
75 +
76  //**********************************************************************
77  // Annots
78  
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);
82  
83 +#if 0
84  static int m_Catalog_embeddedFile(lua_State * L)
85  {
86      EmbFile *ef;
87 @@ -707,6 +718,7 @@ static int m_Catalog_embeddedFile(lua_St
88          lua_pushnil(L);
89      return 1;
90  }
91 +#endif
92  
93  m_poppler_get_INT(Catalog, numJS);
94  
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},
99 +#if 0
100      {"embeddedFile", m_Catalog_embeddedFile},
101 +#endif
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  //**********************************************************************
107  // EmbFile
108  
109 +#if 0
110 +
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
116  };
117  
118 +#endif
119 +
120  //**********************************************************************
121  // Dict
122  
123 @@ -1347,7 +1365,7 @@ static int m_Object_getType(lua_State * 
124  
125  static int m_Object_getTypeName(lua_State * L)
126  {
127 -    char *s;
128 +    const char *s;
129      udstruct *uin;
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();
138      if (links != NULL) {
139          uout = new_Links_userdata(L);
140          uout->d = links;
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);
144  // getStreamEnd
145 -m_poppler_get_INT(XRef, getSize);
146 +static int m_XRef_getSize(lua_State * L)
147 +{
148 +    return m_XRef_getNumObjects(L);
149 +}
150  // getEntry
151  m_poppler_get_poppler(XRef, Object, getTrailerDict);
152  
153 @@ -2683,11 +2704,15 @@ int luaopen_epdf(lua_State * L)
154  {
155      register_meta(Annot);
156      // TODO register_meta(AnnotBorder);
157 +#if 0
158      register_meta(AnnotBorderStyle);
159 +#endif
160      register_meta(Annots);
161      register_meta(Array);
162      register_meta(Catalog);
163 +#if 0
164      register_meta(EmbFile);
165 +#endif
166      register_meta(Dict);
167      register_meta(GooString);
168      register_meta(LinkDest);