Activating plugin with keyboard shortcut
Enrico Tröger
enrico.troeger at uvena.de
Tue Dec 25 15:15:25 CET 2007
On Tue, 25 Dec 2007 14:18:26 +0100, mmassonnet at gmail.com wrote:
> Hi Enrico,
>
> On Tue, Dec 25, 2007 at 12:07:50PM +0100, Enrico Tröger wrote:
> > On Mon, 24 Dec 2007 13:53:56 +0100, mmassonnet at gmail.com wrote:
> >
> > > Yeah, verve uses DBus, but there are also the windowlist/menu/...
> > > plugins that have a focus interface however with XSelection.
> > > They all
> > Any details? What do you mean by XSelection?
>
> Code, only the code[0][1] :-) Basically, you set an XSelection inside
> your plugin, and you can get the XSelection in other processes. When
> you get the XSelection, you can write messages to it. Just like it
> would work with a common Socket where you take care for new input, you
> do it with GLib signals. You listen for new messages.
>
> [0]
> http://svn.xfce.org/index.cgi/xfce/blame/xfce4-panel/trunk/plugins/windowlist/windowlist.c
> lines 901 to 956 [1]
> http://svn.xfce.org/index.cgi/xfce/view/xfce4-panel/trunk/plugins/windowlist/xfce4-popup-windowlist.c
Thanks for the information. But it sounds rather like a hack than a
clean solution...
> > > have a xfce4-popup-$something command or verve-focus. The dict
> > > plugin is missing such an interface, unfortunately.
> > We can add something like this, no problem. But maybe we should
> > think about a more generic way. If the verve plugin has similar
> > needs and maybe other plugins too, maybe libxfce4panel can provide
> > something useful for all plugins to avoid the same code in several
> > plugins.
>
> Let me factorize what you can share between different plugins: a
> set_selection function that takes a "selection_name" (your plugin
> name), a "callback", and a "user data" for the callback (a pointer on
> your plugin). And thats it. Well then you have the popup command,
> where you can share code for the check_is_running function…
>
> IMHO, I'm not sure that a selection thing should end in libpanel.
> There are tons of ways to do this. First idea that seems nice is a
> general popup command (e.g. `xfce4-panel-popup plugin-name ...`),
> with a "popup" signal to attach to inside the panel plugin interface.
This sounds quite ncie to me and is what I was thinking of. It should
be quite easy to implement and easy to use for plugin authors without
the need to write the same code each time again. Then more plugins can
profit from this, not only the dict plugin.
For the meantime, I'll add a dict-focus command or something like this.
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce/attachments/20071225/ffcc711e/attachment.pgp>
More information about the Xfce
mailing list