Re: Commit: abiwidget stuff

From: Dominic Lachowicz <domlachowicz_at_gmail.com>
Date: Tue Dec 12 2006 - 00:29:13 CET

> *) We emit a lot of signals. We should streamline abi and/or the
> widget such that it doesn't emit 20 GTK+ signals every time you type a
> character or move left/right.

I have an idea for how to do this. Martin and I discussed it on IRC
yesterday, but I'll flesh it out here.

Emitting a GTK+ signal is pretty expensive. Emitting 40+ of them each
time the cursor moves is *really* expensive, and really isn't
indicative of how signals are supposed to work.

What I think we should do is write a class that wraps the
FL_DocListener. This class will have a lot of virtual methods to have
a subclass override, such as "virtual void bold(bool value) {}". It
will also store AbiWord's state at the current position. I.e. "is it
bold now?" "what is the font size", and etc.

When we get a FL_DocListener signal, we will see what AbiWord's state
is vs. our listener's internal state. We'll update the listener's
state, and then fire those virtual methods as necessary. Our subclass
will convert this into a GTK+ signal emission, thus minimizing the
number of GTK+ signals sent.

If I have some spare time in the next few days, I'll implement this.
If not, don't let this stop you from helping out. This should
initially be kept private to the AbiWidget, but once it gets a little
bit of testing, we can hook this up to the menus and toolbars too to
cut down on the number of times we update the widgets.

Best,
Dom

-- 
Counting bodies like sheep to the rhythm of the war drums.
Received on Tue Dec 12 00:30:02 2006

This archive was generated by hypermail 2.1.8 : Tue Dec 12 2006 - 00:30:03 CET