Bug 163569 - wish okular to handle 'point and click' events (textedit-URIs)
Summary: wish okular to handle 'point and click' events (textedit-URIs)
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-09 01:56 UTC by Christian Herzberg
Modified: 2009-01-01 20:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sample document with textedit-URIs on noteheads and text (25.78 KB, application/pdf)
2008-06-10 22:02 UTC, Christian Herzberg
Details
Lilypond source file (113 bytes, text/plain)
2008-06-10 22:07 UTC, Christian Herzberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Herzberg 2008-06-09 01:56:37 UTC
Version:           0.6.80 (using 4.00.80 (KDE 4.0.80 >= (KDE 4.1 Beta1), Kubuntu packages)
Compiler:          gcc
OS:                Linux (i686) release 2.6.24-18-generic

Hello,

I'm writing music with lilypond and get pdf's with textedit-URIs at every note and other musical expressions. The behavier, I would wish, is called 'point and click'. So a click on this link would lead to the point at the sourcecode.

Here's the page in the lilypond documentation about this subject:
http://lilypond.org/doc/v2.11/Documentation/user/lilypond-program/Point-and-click

May be there's a way to get this to work between ocular and kate?

Regards,
Chrisch
Comment 1 Pino Toscano 2008-06-09 02:22:35 UTC
Could you please attach a sample document with this feature?
Comment 2 Christian Herzberg 2008-06-10 22:02:15 UTC
Created attachment 25247 [details]
Sample document with textedit-URIs on noteheads and text

Yes, here's the sample PDF with textedit-URIs on noteheads and the text "C
Major scale". When my cursor fly over a notehead the textedit-URI is shown as
hint.
For example (first note):
'textedit:///home/test/ocular-test/point-and-click.ly:6:1:8'
This referred to my source file 'point-and-click.ly'. I'm going to post it in a
minute.
Comment 3 Christian Herzberg 2008-06-10 22:07:29 UTC
Created attachment 25248 [details]
Lilypond source file

This is the Lilypond source file. You can get the PDF out of it with lilypond
installed and on konsole
  lilypond point-and-click.ly

Eventually you would like to do this to correct the URIs for your system.
Comment 4 Pino Toscano 2008-09-22 15:47:44 UTC
SVN commit 863572 by pino:

Make Okular able to distinguish the LilyPond "Point and click" links,
and make them act as source references when activated.

FEATURE: 163569


 M  +7 -0      action.cpp  
 M  +8 -0      document.cpp  
 M  +37 -1     sourcereference.cpp  
 A             sourcereference_p.h   [License: GPL (v2+)]
Comment 5 Wilbert Berendsen 2009-01-01 20:56:28 UTC
Unaware of this bug (but right now stumbling upon this code in core/document.cpp), I created a solution for the original problem outside of Okular, by creating a textedit.protocol file defining a helper protocol for textedit:// urls (as those created by LilyPond), and a small helper application, ktexteditservice, that is called to act upon the textedit url.

These protocol file and helper application are part of my lilypond-kde4 package, that lives in SVN on http://lilykde.googlecode.com/.

My ktexteditservice has a more advanced approach: it reads the user's preferences to get the preferred editor for LilyPond files (the text/x-lilypond mimetype). How the preferred editor is started with the correct arguments is determined by a (user editable) config file, ktexteditservicerc. Many known editors are already included in the config file.

It can also call directly via DBus into running applications to open a .ly document and set the cursor position, if those applications set a special environment variable. My LilyPond editor Frescobaldi uses this approach (see below).

So it is maybe better to handle textedit:// urls outside of Okular, so that they can be handled more advanced and more configurable and they would also work in other PDF viewers that use KDE to resolve clickable links. (My ktexteditservice works in Acrobat too.)

Please have a look to my code. I also wrote an editor for LilyPond files that embeds Okular to preview with point and click support. The editor is called Frescobaldi and has also its code in googlecode's svn at http://lilykde.googlecode.com/ and its own website at http://www.frescobaldi.org/ .

I look forward to discuss this further (just subscribed to Okular-devel).
Many thanks,
Wilbert Berendsen