Created attachment 133932 [details] [review] Patch that allows to control whether annotations are shown I'd like to control whether the renderToImage and renderToPainter methods show annotations or not. To this end, this patch introduces a new value 'HideAnnotations' to the Document::RenderHint enum, and makes the said methods mind it. I have no idea whether this is a good way to get the new option into the interface, but it seemed the least invasive one to me. renderToPainter has a dedicated PainterFlags parameter, but renderToImage doesn't see that one. Is the new RenderHint value okay?
I'd prefer if in the showAnnotations case you pass null as the callback, that way we save a function for nothing.
That makes sense. However, I've been wondering: if we touch the interface for this, shouldn't we make it more future-proof? Maybe somebody will want more fine-grained control in the future. We could add more options, but we could also simply have the call-back as a new parameter for renderToImage and renderToPainter. What do you think?
Before adding such a weird API, i'd like to listen why anyone would need it :D
I don't personally need more than the HideAnnotations flag. But I could imagine that somebody would want to selectively hide certain annotation types, for example.
Writing a library API without a use case usually ends up in broken API, let's not write something noone has asked to have :)
Alright. New patch is attached.
Created attachment 133961 [details] [review] Patch that allows to control whether annotations are shown
Pushed
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.