Skip to content

Add Document open and document close d-bus signals#742

Open
SebastiaanBooman wants to merge 2 commits intopwmt:developfrom
SebastiaanBooman:document-open-close-signal
Open

Add Document open and document close d-bus signals#742
SebastiaanBooman wants to merge 2 commits intopwmt:developfrom
SebastiaanBooman:document-open-close-signal

Conversation

@SebastiaanBooman
Copy link
Copy Markdown

This PR adds d-bus signals for document open and document close events.

I would like to be able listen for document open and close events. In this PR the document metadata is included in the open event, whilst the close event only contains the filename. Perhaps it would be a better idea to ensure the data sent in the close and open events are identical.

Perhaps a different/external document identifier could be used as the same file can be opened multiple times in the same Zathura process. This would make it hard to track exactly which file got opened/closed,

The first commit contains a refactor for the meta_fields struct retrieval. I added a const contraint to zathura_document_get_plugin in internal.h. This is due to having to import internal.h in document.c as it uses zathura_document_information_type_t. Without this change I got a "conflicting types" error in document.c. I am not that experienced in C so let me know if this change does not make sense.

In the future I would also like to add events for page switches, which would include:

  • page number that got switched to
  • previous page number
  • document identifier (filename ?)

@sebastinas
Copy link
Copy Markdown
Member

The document info should be provided as property instead. Also, the signals also need to be added to data/org.pwmt.zathura.xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants