GNOME Bugzilla – Bug 685461
Make the EvView struct public
Last modified: 2018-05-22 14:47:09 UTC
Created attachment 225758 [details] [review] make EvView struct public Currently the EvView struct holds all the data members used by EvView, and the EvView struct is hidden in a -private header file. Instead, we should use the pattern struct { GtkContainer parent; EvviewPrivate *priv; } and make the EvViewPrivate struct private. Unfortunately, this will change the ABI, but will help to prevent ABI changes in the future, no? Besides, this also allows for subclassing EvView.
If we do this (and since it's an ABI break, we'll have to wait until we need to do an ABI break for a really important reason), you shouldn't just s/foo->bar/foo->priv->bar/g but instead most functions that have multiple ->priv-> accesses should have an EvViewPrivate *priv = view->priv; decl at the top and then use priv-> instead of view->priv-> throughout.
Yeah, this is more of a proof of concept patch I made, as I was discussing with Carlos about how to fix other bug in evince without breaking the ABI... So it was a minimal patch :)
Actually I think it wouldn't be an ABI break to do this. Since EvView is a private struct (and the private header not installed), the only way to subclass EvView previously would have been using g_type_query() at runtime to get the struct sizes, and that will continue to work (even though the actual struct size returned will be different).
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/evince/issues/303.