[poppler] glib bindings: add PopplerAnnotFileAttachment, extend test-poppler-glib, and make PopplerAttachment.size signed
Carlos Garcia Campos
carlosgc at gnome.org
Sun Nov 15 08:45:46 PST 2009
Excerpts from Carlos Garcia Campos's message of sáb feb 21 10:42:41 +0100 2009:
> El sáb, 17-01-2009 a las 19:34 +0100, Thomas Viehmann escribió:
> > Hi,
>
> Hi Thomas,
>
> I'm sorry for the late reply :-(
>
> > attached are three patches
> > - poppler.add-support-for-file-attachment-annotations.patch
> > As mentioned on IRC know, I'm wondering whether it'd be better to
> > avoid creating an own GType for each annotation type, in particular
> > if there is nothing to know beyond the type for users.
> > For now this patch follows the AnootText example and has its own
> > type.
> > An alternative could be to just check the type field and make the
> > interface take PopplerAnnot.
>
> We discussed it when implemented the initial annots support and we
> decided to use GObjects because we need some logic like
> GAnnotationMarkup is an interface implemented by other Annotation
> objects. Then we realized it would be better not use interfaces (I don't
> remember exactly why), but make Markup inherit from Annot, so that
> markup annots will inherit from Markup and the other annots will inherit
> directly from Annot base class. Anyway, I'm afraid it's too late to
> change the API ...
>
> > - poppler.extend-test-poppler-glib-to-show-more-page-annotatio.patch
> > Makes test-poppler-glib print information about PopplerAnnotation
> > and
> > PopplerAction items associated with a page.
> > This currently depends on the aforementioned patch, but if adopting
> > that is difficult, I could also separate it out.
> > - poppler.signedness-of-PopplerAttachment.size.patch
> > While running test-poppler-glib, I noticed that EmbFile will use
> > size
> > -1 to indicate that no size has been specified. This could be
> > captured
> > better by making PopplerAttachment.size gssize instead of gsize.
>
> Thank you very much for the patches. Some minor comments about the first
> patch below.
This has been in my TODO list for a long time . . . I've just
committed the patch with such issues fixed.
Thanks!
> > Kind regards
> >
> > T.
>
> > diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
> > index 067afcc..15d7178 100644
> > --- a/glib/poppler-annot.cc
> > +++ b/glib/poppler-annot.cc
> > @@ -24,6 +24,8 @@ typedef struct _PopplerAnnotClass
> > PopplerAnnotClass;
> > typedef struct _PopplerAnnotMarkupClass PopplerAnnotMarkupClass;
> > typedef struct _PopplerAnnotFreeTextClass PopplerAnnotFreeTextClass;
> > typedef struct _PopplerAnnotTextClass PopplerAnnotTextClass;
> > +typedef struct _PopplerAnnotMovieClass PopplerAnnotMovieClass;
> > +typedef struct _PopplerAnnotFileAttachmentClass
> > PopplerAnnotFileAttachmentClass;
>
> hmm, I guess that PopplerAnnotMovieClass is from another patch or
> something.
>
> > +/* PopplerAnnotFileAttachment */
> > +/**
> > + * poppler_annot_file_attachment_get_attachment:
> > + * @annot: a #PopplerAnnotFileAttachment
> > + *
> > + * Creates a #PopplerAttachment for the file of the file attachment
> > annotation @annot.
> > + * The #PopplerAttachment must be freed with g_free by the caller.
> > + *
>
> This is wrong, PopplerAttachment is a GObject and should be free with
> g_object_unref(), not with g_free()
>
> Thanks,
--
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20091115/911b8e49/attachment.pgp
More information about the poppler
mailing list