[poppler] patch for a progress callback

Albert Astals Cid aacid at kde.org
Wed Jan 9 11:16:05 PST 2013


El Dilluns, 7 de gener de 2013, a les 11:39:17, lists at ds.com va escriure:
> On 06 Jan 2013, at 21:01, poppler-request at lists.freedesktop.org wrote:
> > From: Albert Astals Cid <aacid at kde.org>
> > Subject: Re: [poppler] patch for a progress callback
> > 
> > El Divendres, 4 de gener de 2013, a les 09:16:25, Damian Stewart va
> > escriure: Some comments:
> > * The cpp facing api seems quite "un-C++-ish", i think that a class with a
> > pure virtual progressDone() function and a Page::setProgressHandler method
> > would make it more C++ish
> 
> In the core Poppler source, the existing callbacks follow the same pattern:
> 
> void display(OutputDev *out, double hDPI, double vDPI,
> ...
> GBool (*abortCheckCbk)(void *data) = NULL,
> 		  void *abortCheckCbkData = NULL,
> 		  GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
> 		  void *annotDisplayDecideCbkData = NULL,
> 
> With this precedent, I would have assumed
> 
> 		  void (*progressCbk)(int pageNum, float progressPct, void* user_data) =
> NULL, void *progressCbkData = NULL );
> 
> makes the most sense.. or?

Yes, i am not saying the callback is bad for the core, but it is still bad for 
the cpp frontend, the core is full of crap code, so it doesn't make sense to 
enforce good API, but for the cpp frontend we should aim at nice C++-ish API, 
and an object with a virtual pure function (i.e. an interface) seems much 
nicer to me.

Cheers,
  Albert


More information about the poppler mailing list