GNOME Bugzilla – Bug 624780
libevview's EvView lacks set_screen_dpi and 'zoom' prop
Last modified: 2010-07-20 16:40:10 UTC
http://library.gnome.org/devel/libevview/2.28/libevview-ev-view.html vs http://library.gnome.org/devel/libevview/2.30/libevview-ev-view.html As you can see, set_screen_dpi and the 'zoom' property are missing from 2.30, along with many other methods and props. I didn't find equivalents anywhere in libevview 2.30. Both are needed for Sugar's Read http://bugs.sugarlabs.org/ticket/1900 In case I didn't notice the equivalents somewhere: I understand that you didn't have a deprecation cycle for the 2.30 changes, but it would help to at least have a help page that details what to do about the migration. Thank you very much for libevview, but we might have to fork libevview 2.28 in order to keep Read functioning.
Found sizing-mode in DocumentModel http://library.gnome.org/devel/libevview/2.30/libevview-ev-document-model.html, sorry about that. Still can't find any DPI settings.
Hi Lucian, note that libevview was made quite fast because it was needed by sugar, as a result, the API was a private one just made public, so it was likely to change and we don't have any API/ABI compatibility guarantee. In any case we have definitely failed at providing good documentation. In this commit: http://git.gnome.org/browse/evince/commit/?id=34148304a0237fd9fd7c4ea05ca2e053d9ddd3ff we introduced EvDocumentModel to handle current state (current page, scale factor, sizing-mode, etc.) ev_view_set_screen_dpi() was used just to calculate max/min scale factor, however other view methods that take a zoom factor expect it to be already multiplied by the dpi, so the API was actually a bit inconsistent. dpi calculation shouldn't be done by the view, but by the view client. EvDocumentModel has two methods to set the max/min scale: ev_document_model_set_min_scale() ev_document_model_set_max_scale() the scale factor you provide to those methods should be already multiplied by dpi, in this commit: http://git.gnome.org/browse/evince/commit/?id=8ee88d8e916cb126a0a12e4816b9d1043cbd6472 we moved dpi calculation to libdocument, so the equivalent to set_screen_dpi() should be something like: dpi = ev_document_misc_get_screen_dpi (screen); ev_document_model_set_min_scale (model, MIN_SCALE * dpi / 72.0); ev_document_model_set_max_scale (model, MAX_SCALE * dpi / 72.0);
Ah, I see. Could you please put this on the wiki as well, in case others stumble upon the API change? Thank you very much. Feel free to close this ticket.