[poppler] Question on how to ensure API compatibility

Ihar `Philips` Filipau thephilips at gmail.com
Sun Aug 5 07:36:08 PDT 2012


On 8/5/12, Albert Astals Cid <aacid at kde.org> wrote:
>>
>> Exactly, that's why I am unsure whether I can change
>>
>> QImage renderToImage(double xres=72.0, double yres=72.0, int x=-1, int
>> y=-1, int w=-1, int h=-1, Rotation rotate = Rotate0) const;
>>
>> to
>>
>> QImage renderToImage(double xres=72.0, double yres=72.0, int x=-1, int
>> y=-1, int w=-1, int h=-1, Rotation rotate = Rotate0, bool
>> multiThreading = false) const;
>>
>> in "Poppler::Page" defined in "qt4/src/poppler-qt4.h" without breaking
>> something. Recompiling is obviously fine, but would applications that
>> were linked against Poppler before that change still work?
>
> No, they wouldn't.
>
> Here a nice overview of the dos and donts.
> http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++
>

Extremely valuable link. Thanks.

On topic. Quote from the link:
--
If you need to add extend/modify the parameter list of an existing
function, you need to add a new function instead with the new
parameters. In that case, you may want to add a short note that the
two functions shall be merged with a default argument in later
versions of the library:

void functionname( int a );
void functionname( int a, int b ); //BCI: merge with int b = 0
--
The open question is whether the "need" is there.


Wrt, multithreading. Just a thought. I had impression that it should
be already possible to create a private instance (per thread) of the
document for the same PDF, so that the threads can rasterize the pages
of the same PDF in parallel. Only trade off is the memory consumption.


More information about the poppler mailing list