Andre Poenitz wrote:

>> Does LyXFunc::dispatch is able to dispatch the message to all bv's the
>> buffer is connected to (and not others)? Would this be wanted?
> 
> As we don't have multiple views right now: |all| == 1, so 'yes'. But I
> don't know how this scales up. Does this information need to be delivered
> to 'all' BufferViews or just 'some active one'?

This is a good point. It seems that one has a lyxfunc associated with a
lyxview. It seems that in the current setup [or plans]

a lyxview ~ a window
a lyxview can [theorically] contain several bvs

so the message should go to the lyxview, *not* to the/all bv, because in
that case we would have repeated messages.

>> Why one has to get to the BufferView to get the lyxfunc object to
>> dispatch the signal, if at the end LyXFunc figures out the bv?
> 
> Because of stupid kernel architecture... (IMO, but I have to admit I do
> not really understand the current construction at all)

It seems that maybe the idea is also to have several lyxviews (corresponding
to several windows) and you want to get to the right one (the one
containing a specific bv).

> Because my current thinking is that the LyXFunc is view-independent as
> well and dispatches to the proper view if it can't handle the request
> 'itself'.

I'm not sure about that. It would seem that a lyxfunc is associated with a
lyxview.
 
> An advantage is less interdependencies: You dispatch your stuff to the
> root of some already existing tree instead of figuring out which leaves
> you need to dispatch to.

Then there's something fishy going on right now, because the current (say,
converter) code does this:

- gets the/a BufferView from the buffer through Buffer::getUser (getUser is
conceptually wrong per se IMHO - not much different from current_view)
- gets the LyXView from the BufferView
- get the LyXFunc from the LyXView
- pass this LyXFunc to LaTeX
- LaTeX dispatch its messages there

...

> But as I said, this is all based on some assumptions on how it currently
> works and how it should work which might not be true at all.

You surely know a lot more than me. Maybe by discussing we can figure it out
;-)

Regards, Alfredo

Reply via email to