Hi any progress/decisions on plugin events?
Cheers
bd
On 08/06/2007 10:55:29 PM, blackdog wrote:
Hi any progress/decisions on plugin events?
I just replied about the 2nd patch, but I'll sort something out in the next few days - either applying it or committing a signals implementation.
Sorry about the late reply BTW.
Regards, Nick
On 08/07/2007 12:47:53 PM, Nick Treleaven wrote:
On 08/06/2007 10:55:29 PM, blackdog wrote:
Hi any progress/decisions on plugin events?
I just replied about the 2nd patch, but I'll sort something out in the next few days - either applying it or committing a signals implementation.
I don't really want to add on_sci_notify() as a plugin symbol because I think most plugins won't use it.
I've got a signals system working for sci-notify, but I think it is too slow - I notice the delay between typing and the display updating. This is probably because a new signal is emitted in on_editor_notification() when receiving sci-notify from the Scintilla widget.
I had another idea - what if Geany just sent a new-document signal when documents are created or opened, then the plugin can manually connect to sci-notify of the document::sci ScintillaObject. This might be neater if the plugin only wants notifications for documents of a certain filetype.
Regards, Nick
yep that sounds ok. if I can get a per char event I'm happy don't care how it's done.
i'm suprised with the slowdown you're experiencing I tried it and it was fine here. to _see_ a slowdown in an unimplemented gobject event seems like there's something else going on. could it be throwing some kind of exception?
cheers
bd
On Thu, 09 Aug 2007 16:39:38 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On 08/07/2007 12:47:53 PM, Nick Treleaven wrote:
On 08/06/2007 10:55:29 PM, blackdog wrote:
Hi any progress/decisions on plugin events?
I just replied about the 2nd patch, but I'll sort something out in the next few days - either applying it or committing a signals implementation.
I don't really want to add on_sci_notify() as a plugin symbol because I think most plugins won't use it.
I've got a signals system working for sci-notify, but I think it is too slow - I notice the delay between typing and the display updating. This is probably because a new signal is emitted in on_editor_notification() when receiving sci-notify from the Scintilla widget.
I had another idea - what if Geany just sent a new-document signal when documents are created or opened, then the plugin can manually connect to sci-notify of the document::sci ScintillaObject. This might be neater if the plugin only wants notifications for documents of a certain filetype.
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On 08/09/2007 04:54:31 PM, blackdog wrote:
yep that sounds ok. if I can get a per char event I'm happy don't care how it's done.
OK, I'll add the new-document signal then.
i'm suprised with the slowdown you're experiencing I tried it and it was fine here. to _see_ a slowdown in an unimplemented gobject event seems like there's something else going on. could it be throwing some kind of exception?
The slowdown was when I had a plugin receiving the event and printing the SCN_ notification code to stdout. I just tried it again, and it was noticeable, but perhaps not as bad as I first thought. I used the G_SIGNAL_ACTION flag when using g_signal_new - I don't know if there's a better way to do it.
Regards, Nick
On Thu, 09 Aug 2007 17:29:28 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 08/09/2007 04:54:31 PM, blackdog wrote:
yep that sounds ok. if I can get a per char event I'm happy don't care how it's done.
OK, I'll add the new-document signal then.
Yes, the new-document signal sounds fine and we don't have to fire an additional signal in Geany for sci-notify for the (maybe unprobably) case that any plugin may need it. So, only these plugins which really need it will get it.
i'm suprised with the slowdown you're experiencing I tried it and it was fine here. to _see_ a slowdown in an unimplemented gobject event seems like there's something else going on. could it be throwing some kind of exception?
The slowdown was when I had a plugin receiving the event and printing the SCN_ notification code to stdout. I just tried it again, and it was noticeable, but perhaps not as bad as I first thought. I used the
I'm also a it surprised, at least I just didn't expect anything noticeable. Well, I guess the most probably reason for the noticeable delay is the difference in the used hardware. IIRC Nick uses a slowly outdated computer ( ;-), sorry I don't know how to say it without being mean).
Regards, Enrico
On 08/10/2007 12:54:36 AM, Jeff Pohlmeyer wrote:
I had another idea - what if Geany just sent a new-document signal when documents are created or opened...
Would it be possible to also add a "document-saved" signal? ( Thinking about things like file uploads or custom backups. )
Yes, I'll add this at the same time.
Regards, Nick
On 08/10/2007 11:46:49 AM, Nick Treleaven wrote:
On 08/10/2007 12:54:36 AM, Jeff Pohlmeyer wrote:
I had another idea - what if Geany just sent a new-document
signal
when documents are created or opened...
Would it be possible to also add a "document-saved" signal? ( Thinking about things like file uploads or custom backups. )
Yes, I'll add this at the same time.
Now added in SVN (as "document-save") - see my other mail for an example plugin, and also plugindata.h.
Regards, Nick
On 08/09/2007 10:56:16 PM, Enrico Tröger wrote:
On Thu, 09 Aug 2007 17:29:28 +0100, Nick Treleaven nick.treleaven@btinternet.com wrote:
On 08/09/2007 04:54:31 PM, blackdog wrote:
i'm suprised with the slowdown you're experiencing I tried it and it was fine here. to _see_ a slowdown in an unimplemented gobject event seems like there's something else going on. could it be throwing some kind of exception?
The slowdown was when I had a plugin receiving the event and
printing
the SCN_ notification code to stdout. I just tried it again, and it was noticeable, but perhaps not as bad as I first thought. I used
the I'm also a it surprised, at least I just didn't expect anything noticeable. Well, I guess the most probably reason for the noticeable delay is the difference in the used hardware. IIRC Nick uses a slowly outdated computer ( ;-), sorry I don't know how to say it without being mean).
Yep, I use a Pentium II 233 MHz system usually (Fedora, Xfce). But I think most of the Puppy Linux users have similar hardware.
Regards, Nick
On 08/09/2007 05:29:28 PM, Nick Treleaven wrote:
On 08/09/2007 04:54:31 PM, blackdog wrote:
yep that sounds ok. if I can get a per char event I'm happy don't care how it's done.
OK, I'll add the new-document signal then.
I've now committed the plugin signals code to SVN. Added signal names are: "document-new" "document-open" "document-save"
You'll need to connect both "document-new" and "document-open". They are sent after all the document fields are set, including filetype. So it should be possible to connect to doc_list[idx].sci in the callbacks, only when doc_list[idx].file_type is Haxe.
I added the geany_callbacks array (see the attachment) so that Geany can disconnect the callbacks when the plugin is unloaded. Note that if you're connecting to sci-notify I think you will need to keep track of the result of g_signal_connect, so you can disconnect it in cleanup(). Otherwise the callback will probably segfault after the plugin is unloaded. (In future users will be able to easily load and unload plugins without restarting.)
Attached is a simple plugin I used to test it. (The init and cleanup parts are not really necessary, just so it was clear the plugin was loaded).
Regards, Nick
Thanks Nick, this is working for me.
One thing should there not be a document-focus event too, or is that available elsewhere?
Cheers
bd
On Fri, 10 Aug 2007 17:28:42 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On 08/09/2007 05:29:28 PM, Nick Treleaven wrote:
On 08/09/2007 04:54:31 PM, blackdog wrote:
yep that sounds ok. if I can get a per char event I'm happy don't care how it's done.
OK, I'll add the new-document signal then.
I've now committed the plugin signals code to SVN. Added signal names are: "document-new" "document-open" "document-save"
You'll need to connect both "document-new" and "document-open". They are sent after all the document fields are set, including filetype. So it should be possible to connect to doc_list[idx].sci in the callbacks, only when doc_list[idx].file_type is Haxe.
I added the geany_callbacks array (see the attachment) so that Geany can disconnect the callbacks when the plugin is unloaded. Note that if you're connecting to sci-notify I think you will need to keep track of the result of g_signal_connect, so you can disconnect it in cleanup(). Otherwise the callback will probably segfault after the plugin is unloaded. (In future users will be able to easily load and unload plugins without restarting.)
Attached is a simple plugin I used to test it. (The init and cleanup parts are not really necessary, just so it was clear the plugin was loaded).
Regards, Nick
On 08/11/2007 11:49:11 PM, blackdog wrote:
Thanks Nick, this is working for me.
One thing should there not be a document-focus event too, or is that available elsewhere?
I think we could add something like that to send an event when switching notebook pages. I'm not sure about an event for each focus.
Regards, Nick
notebook switch event was what I wanted :)
cheers
bd
On Mon, 13 Aug 2007 12:53:39 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On 08/11/2007 11:49:11 PM, blackdog wrote:
Thanks Nick, this is working for me.
One thing should there not be a document-focus event too, or is that available elsewhere?
I think we could add something like that to send an event when switching notebook pages. I'm not sure about an event for each focus.
Regards, Nick _______________________________________________ Geany mailing list Geany@uvena.de http://uvena.de/cgi-bin/mailman/listinfo/geany
On 8/10/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
I've now committed the plugin signals code to SVN. Added signal names
When I use the new plugin event callbacks, I get some warnings when Geany exits, it complains:
g_signal_handler_disconnect: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
It looks like geany_object gets deleted before the callbacks are disconnected.
This patch seems to fix the problem...
- Jeff
On 08/16/2007 08:10:45 PM, Jeff Pohlmeyer wrote:
On 8/10/07, Nick Treleaven nick.treleaven@btinternet.com wrote:
I've now committed the plugin signals code to SVN. Added signal
names
When I use the new plugin event callbacks, I get some warnings when Geany exits, it complains:
g_signal_handler_disconnect: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
It looks like geany_object gets deleted before the callbacks are disconnected.
This patch seems to fix the problem...
Thanks, applied in SVN. It seems I'm having a bad week ;-\
Regards, Nick