Angus Leeming <[EMAIL PROTECTED]> writes: | I thought I'd try and move the minibuffer behind the frontends firewall and | so had a look at which functions are used by the "general public". It | transpires that only addSet and getString are used. > | I propose, therefore, getting rid entirely of LyXView::getMiniBuffer() and | replacing it with two boost::functions. The minibuffer can then disappear | from view. > | Any objections? Reasons please...
I am not sure how this will look. > | aleem@pneumon:src-> grep -n "getMiniBuffer()" *.C */*.C */*/*.C | lyxfunc.C:827: | owner->getMiniBuffer()->addSet(commandshortcut);lyxfunc.C:830: | owner->getMiniBuffer()->addSet(' ' + commandshortcut); | lyxfunc.C:1050: owner->getMiniBuffer()->getString(MiniBuffer::spaces, | frontends/LyXView.C:118:MiniBuffer * LyXView::getMiniBuffer() const | frontends/xforms/XFormsView.C:81: getMiniBuffer()->redraw(); > | LyXView "owns" the minibuffer and XFormsView derives from LyXView so these | don't count. That means that the only functions of interest are: > | void MiniBuffer::addSet(string const & s1, string const & s2) | { | string const str = text + ' ' + s1 + ' ' + s2; | message(str); | } > | * Note that s2 is NEVER used. Shall I kill it? Yes. | * This command is used to append the command shortcut to the displayed | lyxfunc. Might a better name be "void appendShortCut(string const & sc)"? Isn't it also used internally in the minibuffer? For telling then end of history is reached etc. ? | /** Makes the minibuffer wait for a string to be inserted. | Waits for a string to be inserted into the minibuffer, when | the string has been inserted the signal stringReady is | emitted. | */ | void MiniBuffer::getString(State spaces, | vector<string> const & completion, | vector<string> & history) | { | state_ = spaces; | completion_ = completion; | history_ = &history; | hist_iter = history_->end(); | prepare(); | } > | * Again, I think that this name is confusing. Why not prepareBuffer(...)? or | some such? If you read the comment the same of the funciton is perfectly sane.. IMHO. We use it to get a string (and it is delivered through a signal.) -- Lgb