GNOME Bugzilla – Bug 691354
Introspection and gtk-doc fixes
Last modified: 2018-05-22 14:57:27 UTC
I wrote this patchset to remove introspection warnings when building Evince, and increase compatibility when libevdocument and libevview are used through GObject-introspection. Most of these patches are trivial; feedback welcome.
Created attachment 232985 [details] [review] Mark un-namespaced define as private
Created attachment 232986 [details] [review] ev-file-helpers: use correct syntax for gtk-doc comment If it's a gtk-doc comment, it must start with the name of the function, or the parser will complain.
Created attachment 232987 [details] [review] ev-document: use right parameters name in gtk-doc comment
Created attachment 232988 [details] [review] ev-annotation: use correct variable names in function prototype
Created attachment 232989 [details] [review] ev-file-helpers: use same parameter name between header and function
Created attachment 232990 [details] [review] libdocument: add missing transfer and element-type annotations
Created attachment 232991 [details] [review] ev-mapping-list: make a boxed type And fix a number of introspection warnings.
Created attachment 232992 [details] [review] ev-document-factory: make EvTypeInfo a boxed type Fix a number of introspection warnings
Created attachment 232993 [details] [review] ev-document: remove non-existant methods
Created attachment 232994 [details] [review] ev-document: mark ev_document_synctex_forward_search() as skip It returns an EvMapping, which can't be introspected.
Created attachment 232995 [details] [review] ev-view: add missing semicolon to gtk-doc comment g-ir-scanner will emit a warning otherwise.
Created attachment 232996 [details] [review] libview: add missing transfer and element-type annotations
Created attachment 232997 [details] [review] ev-jobs: have ev_job_failed_from_error shadow ev_job_failed Since the latter uses varargs and will never be introspectable.
Created attachment 232998 [details] [review] ev-job-find: mark two methods as skip Methods that use a double pointer to a GList cannot be annotated properly, so skip them until we have a better introspectable API.
Review of attachment 232985 [details] [review]: Thanks
Review of attachment 232986 [details] [review]: Right!
Review of attachment 232987 [details] [review]: Ok
Review of attachment 232988 [details] [review]: Oops
Review of attachment 232989 [details] [review]: ::: libdocument/ev-file-helpers.h @@ +47,2 @@ GError **error); +gchar *ev_mkdtemp (const char *tmpl, Why not simply rename it to template so that you don't need to change the c file? to avoid issues with template C++ keyword?
Review of attachment 232993 [details] [review]: Ok
Review of attachment 232995 [details] [review]: Ok
Attachment 232985 [details] pushed as 00c4a35 - Mark un-namespaced define as private Attachment 232986 [details] pushed as bc66ce2 - ev-file-helpers: use correct syntax for gtk-doc comment Attachment 232987 [details] pushed as 376852b - ev-document: use right parameters name in gtk-doc comment Attachment 232988 [details] pushed as 87ca31d - ev-annotation: use correct variable names in function prototype Attachment 232989 [details] pushed as d37cbf3 - ev-file-helpers: use same parameter name between header and function Attachment 232995 [details] pushed as 8ee8b7e - ev-view: add missing semicolon to gtk-doc comment
(In reply to comment #19) > Why not simply rename it to template so that you don't need to change the c > file? to avoid issues with template C++ keyword? Yeah; looking at the git log it was previously changed from "template" to "the_template" for exactly that reason.
I didn't push attachment 232993 [details] [review] because on second thought those declarations might be there only to keep API compatibility, in which case we should mark them as "skip". Review appreciated on the other patches.
*** Bug 691214 has been marked as a duplicate of this bug. ***
Unfortunately, Documents is currently broken without "libdocument: add missing transfer and element-type annotations"
Carlos, are there any issues with this patch? We really need to get this fixed.
Review of attachment 232990 [details] [review]: Ok, let's push this to make sure introspection works, I'll try to find time to review and add the missing documentation. Thanks
Review of attachment 232991 [details] [review]: It makes sense, note that new methods have been added to EvMappingList. Sorry for the delay to review this :-(
Review of attachment 232996 [details] [review]: Thanks.
Review of attachment 232997 [details] [review]: Ok
Review of attachment 232998 [details] [review]: Both methods are actually deprecated for that reason, IIRC.
Pushed these - keeping the bug open for the other minor fixes Attachment 232990 [details] pushed as 7917b62 - libdocument: add missing transfer and element-type annotations Attachment 232991 [details] pushed as d6f7e03 - ev-mapping-list: make a boxed type Attachment 232996 [details] pushed as 4bc744c - libview: add missing transfer and element-type annotations Attachment 232997 [details] pushed as 1d87fc5 - ev-jobs: have ev_job_failed_from_error shadow ev_job_failed Attachment 232998 [details] pushed as 7d9c9de - ev-job-find: mark two methods as skip
Created attachment 234672 [details] [review] ev-document-factory: make EvTypeInfo a boxed type Fix a number of introspection warnings
Created attachment 234673 [details] [review] ev-document: mark ev_document_synctex_forward_search() as skip It returns an EvMapping, which can't be introspected.
Created attachment 234674 [details] [review] ev-document: mark deprecated get_mutex() methods as (skip) These methods do not seem to really exist, and their prototypes are there only for compatibility. Mark them as skip.
Cosimo, do you have an idea of which struct we can have to replace EvMapping so it can be introspected?
As far as I recall the problem is the "gpointer data;" field in the struct, as it can be anything, and the binding has no way to know. One possible way to solve this might be having different type-specific EvMapping substructures, or maybe wrap the data in a GValue instead.
Comment on attachment 234672 [details] [review] ev-document-factory: make EvTypeInfo a boxed type This isn't right. If we need to expose this info, we should make EvBackendInfo public instead.
-- 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/324.