John Levon wrote: > Looks super. Understandable within a couple of minutes. Great job, > Angus
Ooohh, you've just made me happy! > ... not much left to do either, if I see right. >From my TODO list: ControlCommandBuffer.[Ch] ControlDocument.[Ch] ControlForks.[Ch] ControlMath.[Ch] ControlPreamble.[Ch] ControlPrefs.[Ch] ControlPrint.[Ch] ControlSearch.[Ch] ControlSendto.[Ch] ControlSpellchecker.[Ch] ControlTexinfo.[Ch] ControlThesaurus.[Ch] > What will require Kernel::lyxview() ? At least ControlToc's usage is > spurious. Great. A quick grep suggests that this is the only thing using it. perhaps you'd have a go at culling the offending code? The idea is to gradually shrink the kernel() wrapper, making less and less of the LyX core available to the frontends. I was thinking of doing this in two ways: 1. Common, buffer-related stuff could be passed to a new void Dialog::updateKernel(string const &); method. For example, many of the controllers request kernel().buffer()->filePath(), but this is exactly the sort of thing that we could pass to them as a string. This method would be called from Dialogs::show(<dialog name>, ...), (ie, the LyX core) and thereafter when Dialogs::updateBufferDependent() is called. I thought that I'd first port the classes above to the new scheme and then stand back and see just what bits of the kernel are required by more than one controller. 2. Buffer-related stuff specific to an individual controller should really be passed to that controller in the string passed to bool Dialogs::Controller::initialiseParams(string const & data); For example, ControlChanges has code like kernel().buffer()->authors() Feel free to have a go at either; I get bogged down when doing the same thing 40 odd times :-( and a little company would be pleasant ;-) ps ControlChanges is also the main offender requiring kernel().bufferview(). Perhaps we need a new lfun to dispatch this info to the frontends? What do you think? return lyxfind::findNextChange(kernel().bufferview()); Change c(kernel().bufferview()->getCurrentChange()); Change c(kernel().bufferview()->getCurrentChange()); lyxfind::findNextChange(kernel().bufferview()); lyxfind::findNextChange(kernel().bufferview()); -- Angus