Re: morning hack...


Subject: Re: morning hack...
From: Joaquín Cuenca Abela (cuenca@celium.net)
Date: Thu Apr 12 2001 - 18:50:28 CDT


Martin Sevior wrote:
>
> Going on List. Everyone should know about this cool work.

ok, so I think that we should give a brief resume:

I was speaking about a log system. Martin, Jesper and I we were
speaking about it at guadec. In short, we wanted to raise the quality
of the bug reports, so we though that something that logs users
movements from the very start until [s]he reachs a segfault would be
very useful (think of no more non reproducible bugs).

So, we though that we could hack a bit the Defun* macros at
ap_EditMethods to log each call.
As I was waiting for the perl stuff to come back from .au, and I had
some time (lately I don't sleep very well :), I hacked an implementation
of that idea...
After opening abiword, writting "Hello, world!ª[DEL]", if I quit abiword
I got:

[real output from my current code:]

<?xml version="1.0"?>
<logger>
        <event name="insertData">
                <calldata x="0" y="0">H</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">e</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">l</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">l</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">o</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">,</calldata>
        </event>
        <event name="insertSpace"/>
        <event name="insertData">
                <calldata x="0" y="0">w</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">o</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">r</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">l</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">d</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">!</calldata>
        </event>
        <event name="insertData">
                <calldata x="0" y="0">ª</calldata>
        </event>
        <event name="delLeft"/>
        <event name="querySaveAndExit">
                <calldata x="0" y="0"/>
        </event>
</logger>

of course, if abi segfaults, it stops without closing the <logger>.

Now that we have protobindings for perl, it may be better to just output
perl code.

> On Thu, 12 Apr 2001 jskov@zoftcorp.adsl.dk wrote:
> >
> > Joaquin> It's still missing the serialization of the view and
> > Joaquin> callbackdata, so right now it only stores in a file
> > Joaquin> (fixme_log.txt) the name of the ap_EditMethods method called.
> > Joaquin> The file gets big very soon, mainly due to cursorDefault and
> > Joaquin> cursorIBeam... I've using
> >
> > I think we'd want the ability to filter out events like the cursor
> > I-beam drawing event (and cursorDefault, possibly others as well).
> >
>
> Joaquin, this is very cool too!.
>
> Yes there is no need to record mouse motion events. We should filter
> those out.

it's fixed.

> > Joaquin> Well, what do you think of this proof of concept?
> >
> > Like it very much. I think it would be an absolutely developer feature
> > - there may also be a few users who'd actually put it to good use, but
> > I suspect it won't be many.
> >
> > Does Word have macros, btw?
> >
>
> I can envision two types of Abi macros. Sophsticated and Easy. Easy macros
> simply record Abi events and save them to a buffer. I imagine a Modeless
> dialog with a "record" checkbox and the option to save the collected Abi

I was thinking in adding 3 buttons to the "extra" toolbar (record, play
& stop). I even added them (in my local copy)... definitively, I was
sleeping at the graphics BOF :-)

> events to a named buffer. The user presses record, which record all their
> key presses. Once completed the events could be saved to a named buffer.
>
> The dialog stays up while the user goes about editting and records what
> the the user types. Once the user has finished typing these events
> are saved into a named buffer. All such recorded passages are
> displayed in a combo-box. These macros can then be executed again simply
> by pulling their name off of a combo box selection in the modeless dialog.
> Then pressing an execute button. The events are then just presented to the
> EditMethods in sequence.

Word let's you bind the macros to a new button in the toolbar, or to a
new menu item, or to a keybinding (or just saved in your HD, and
reproducible through the macros dialog box). Something like that would
be cool.

> Sophisticated macros make full use of our Perl (or other language)
> scripting capabilities.

That's the way it works in Word.

> We just use Abi as a regular editor and save perl code to text format. Of

I would prefer to just use a simple text widget. If the widget is good
enough, we can even have syntax hiligh.

> (PS. There is too much cool stuff happening right now! We should maybe
> just finish off a couple features, get 0.90 and 1.0 done.)

:-) "just" ?

Cheers,

P.S.: If somebody wants to take a look at my current code, send me an
email and I will send you a patch.

--
Joaquín Cuenca Abela
cuenca@celium.net



This archive was generated by hypermail 2b25 : Thu Apr 12 2001 - 18:50:34 CDT