Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 384875 | Differences between
and this patch

Collapse All | Expand All

(-)luatex-beta-0.70.1/source/texk/web2c/luatexdir/lua/lepdflib.cc (-101 / +1 lines)
Lines 89-95 new_poppler_userdata(AnnotBorder); Link Here
89
new_poppler_userdata(Annots);
89
new_poppler_userdata(Annots);
90
new_poppler_userdata(Array);
90
new_poppler_userdata(Array);
91
new_poppler_userdata(Catalog);
91
new_poppler_userdata(Catalog);
92
new_poppler_userdata(EmbFile);
93
new_poppler_userdata(Dict);
92
new_poppler_userdata(Dict);
94
//new_poppler_userdata(GooString);
93
//new_poppler_userdata(GooString);
95
new_poppler_userdata(LinkDest);
94
new_poppler_userdata(LinkDest);
Lines 393-399 static int m_Annot__gc(lua_State * L) Link Here
393
    printf("\n===== Annot GC ===== uin=<%p>\n", uin);
392
    printf("\n===== Annot GC ===== uin=<%p>\n", uin);
394
#endif
393
#endif
395
    if (uin->atype == ALLOC_LEPDF)
394
    if (uin->atype == ALLOC_LEPDF)
396
        delete(Annot *) uin->d;
395
        ((Annot *) uin->d)->decRefCnt();
397
    return 0;
396
    return 0;
398
}
397
}
399
398
Lines 408-441 static const struct luaL_Reg Annot_m[] = Link Here
408
};
407
};
409
408
410
//**********************************************************************
409
//**********************************************************************
411
// AnnotBorderStyle
412
413
m_poppler_get_DOUBLE(AnnotBorderStyle, getWidth);
414
415
m_poppler__tostring(AnnotBorderStyle);
416
417
static int m_Annots__gc(lua_State * L)
418
{
419
    udstruct *uin;
420
    uin = (udstruct *) luaL_checkudata(L, 1, M_Annots);
421
    if (uin->pd != NULL && uin->pd->pc != uin->pc)
422
        pdfdoc_changed_error(L);
423
#ifdef DEBUG
424
    printf("\n===== Annots GC ===== uin=<%p>\n", uin);
425
#endif
426
    if (uin->atype == ALLOC_LEPDF)
427
        delete(Annots *) uin->d;
428
    return 0;
429
}
430
431
static const struct luaL_Reg AnnotBorderStyle_m[] = {
432
    {"getWidth", m_AnnotBorderStyle_getWidth},
433
    {"__tostring", m_AnnotBorderStyle__tostring},
434
    {"__gc", m_Annots__gc},
435
    {NULL, NULL}                // sentinel
436
};
437
438
//**********************************************************************
439
// Annots
410
// Annots
440
411
441
m_poppler_get_INT(Annots, getNumAnnots);
412
m_poppler_get_INT(Annots, getNumAnnots);
Lines 683-713 static int m_Catalog_findDest(lua_State Link Here
683
654
684
m_poppler_get_poppler(Catalog, Object, getDests);
655
m_poppler_get_poppler(Catalog, Object, getDests);
685
m_poppler_get_INT(Catalog, numEmbeddedFiles);
656
m_poppler_get_INT(Catalog, numEmbeddedFiles);
686
687
static int m_Catalog_embeddedFile(lua_State * L)
688
{
689
    EmbFile *ef;
690
    int i, len;
691
    udstruct *uin, *uout;
692
    uin = (udstruct *) luaL_checkudata(L, 1, M_Catalog);
693
    if (uin->pd != NULL && uin->pd->pc != uin->pc)
694
        pdfdoc_changed_error(L);
695
    i = luaL_checkint(L, 2);
696
    len = ((Catalog *) uin->d)->numEmbeddedFiles();
697
    if (i > 0 && i <= len) {
698
        ef = ((Catalog *) uin->d)->embeddedFile(i - 1);
699
        if (ef != NULL) {
700
            uout = new_EmbFile_userdata(L);
701
            uout->d = ef;
702
            uout->pc = uin->pc;
703
            uout->pd = uin->pd;
704
        } else
705
            lua_pushnil(L);
706
    } else
707
        lua_pushnil(L);
708
    return 1;
709
}
710
711
m_poppler_get_INT(Catalog, numJS);
657
m_poppler_get_INT(Catalog, numJS);
712
658
713
static int m_Catalog_getJS(lua_State * L)
659
static int m_Catalog_getJS(lua_State * L)
Lines 749-755 static const struct luaL_Reg Catalog_m[] Link Here
749
    {"findDest", m_Catalog_findDest},
695
    {"findDest", m_Catalog_findDest},
750
    {"getDests", m_Catalog_getDests},
696
    {"getDests", m_Catalog_getDests},
751
    {"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
697
    {"numEmbeddedFiles", m_Catalog_numEmbeddedFiles},
752
    {"embeddedFile", m_Catalog_embeddedFile},
753
    {"numJS", m_Catalog_numJS},
698
    {"numJS", m_Catalog_numJS},
754
    {"getJS", m_Catalog_getJS},
699
    {"getJS", m_Catalog_getJS},
755
    {"getOutline", m_Catalog_getOutline},
700
    {"getOutline", m_Catalog_getOutline},
Lines 759-807 static const struct luaL_Reg Catalog_m[] Link Here
759
};
704
};
760
705
761
//**********************************************************************
706
//**********************************************************************
762
// EmbFile
763
764
m_poppler_get_GOOSTRING(EmbFile, name);
765
m_poppler_get_GOOSTRING(EmbFile, description);
766
m_poppler_get_INT(EmbFile, size);
767
m_poppler_get_GOOSTRING(EmbFile, modDate);
768
m_poppler_get_GOOSTRING(EmbFile, createDate);
769
m_poppler_get_GOOSTRING(EmbFile, checksum);
770
m_poppler_get_GOOSTRING(EmbFile, mimeType);
771
772
static int m_EmbFile_streamObject(lua_State * L)
773
{
774
    udstruct *uin, *uout;
775
    uin = (udstruct *) luaL_checkudata(L, 1, M_EmbFile);
776
    if (uin->pd != NULL && uin->pd->pc != uin->pc)
777
        pdfdoc_changed_error(L);
778
    uout = new_Object_userdata(L);
779
    uout->d = new Object();     // automatic init to type "none"
780
    ((EmbFile *) uin->d)->streamObject().copy((Object *) uout->d);
781
    uout->pc = uin->pc;
782
    uout->pd = uin->pd;
783
    return 1;
784
}
785
786
m_poppler_get_BOOL(EmbFile, isOk);
787
788
m_poppler__tostring(EmbFile);
789
790
static const struct luaL_Reg EmbFile_m[] = {
791
    {"name", m_EmbFile_name},
792
    {"description", m_EmbFile_description},
793
    {"size", m_EmbFile_size},
794
    {"modDate", m_EmbFile_modDate},
795
    {"createDate", m_EmbFile_createDate},
796
    {"checksum", m_EmbFile_checksum},
797
    {"mimeType", m_EmbFile_mimeType},
798
    {"streamObject", m_EmbFile_streamObject},
799
    {"isOk", m_EmbFile_isOk},
800
    {"__tostring", m_EmbFile__tostring},
801
    {NULL, NULL}                // sentinel
802
};
803
804
//**********************************************************************
805
// Dict
707
// Dict
806
708
807
static int m_Dict_incRef(lua_State * L)
709
static int m_Dict_incRef(lua_State * L)
Lines 2683-2693 int luaopen_epdf(lua_State * L) Link Here
2683
{
2585
{
2684
    register_meta(Annot);
2586
    register_meta(Annot);
2685
    // TODO register_meta(AnnotBorder);
2587
    // TODO register_meta(AnnotBorder);
2686
    register_meta(AnnotBorderStyle);
2687
    register_meta(Annots);
2588
    register_meta(Annots);
2688
    register_meta(Array);
2589
    register_meta(Array);
2689
    register_meta(Catalog);
2590
    register_meta(Catalog);
2690
    register_meta(EmbFile);
2691
    register_meta(Dict);
2591
    register_meta(Dict);
2692
    register_meta(GooString);
2592
    register_meta(GooString);
2693
    register_meta(LinkDest);
2593
    register_meta(LinkDest);

Return to bug 384875