[poppler] [patch] Current state of optional content support

Brad Hards bradh at frogmouth.net
Tue Feb 26 21:10:32 PST 2008


On Thursday 14 February 2008 05:13:23 am Pino Toscano wrote:
> Alle mercoledì 13 febbraio 2008, Brad Hards ha scritto:
> > My optional content work is attached.
>
> Yay!
I finally committed it.

> > Right now, I think it is probably only a little better than current
> > master. I would like to merge it, and keep working on it. That merge will
> > also allow the glib frontend people to have a look as well.
This is still the state. Some files (those that implement optional content 
using XObjects) will be much better, others won't be any better at all.

> Just some random notes:
>
> No need to add ENABLE_TESTING() in the root CMakeLists.txt, it's done
> within PopplerMacros.
Fixed.

> Document::hasOptionalContent() should be const.
Fixed.

> Document::optionalContentModel(): the problem with that parent argument is
> that the first call actually use that, while the next ones not.
> My suggestion is to remove the parent argument, and totally transfer the
> ownership to the caller. But uhm, that would syncronizing the models...
> Then just removing the parent argument and stating it's owned by the
> Document should be fine for now...
Done.

> OptContentModel and OptContentItem: they need a d-pointer, and their
> private API moved there (but it's not a problem, we can do that once the
> code is on git). Is RadioButtonGroup supposed to be a public class or
> internal?
the d-pointer stuff isn't done, and it needs to be. I'll try to get that done, 
but if I screw it up, or don't have it committed by 0600 UTC, then can you 
please take a look?
Note: without this, the qt4 bindings will be broken for just about everyone.

> About the separate demo viewer: I'd avoid using Qt code for that, if you
> want I can start with a clear implementation - should not be too difficult
> - and test other poppler-qt4 features as well.
I like the new viewer, but I haven't done the work to merge the optional 
content stuff in.

Here is what my old viewer app basically did:
  Poppler::OptContentModel *ocModel = currentDocument->optionalContentModel();
  ocTree->setModel( ocModel );
  ocTree->expandToDepth(1);
  connect( ocModel, SIGNAL(dataChanged( QModelIndex, QModelIndex )), this, 
SLOT(reloadImage()) );

The last line is important - the changes to the optional content settings 
won't be reflected without that.

Brad


More information about the poppler mailing list