On 15/11/13 11:10, Ankit Shah wrote: > From the LyX.cpp i got the dispatch function like this: void > dispatch(FuncRequest const & action) { LAPPERR(theApp()); return > theApp()->dispatch(action); } I understood that it calls dispatch() > something from the theApp() class(/function ?) But looking at the > Dialog.h file, the dispatch function is already defined in namespace > lyx and in it's definition(in Dialog.cpp) it calls again itself using > lyx::dispatch(fr). I'm not getting which function definiton does it > finally jump to.
and so it's calling the virtual method of Application.h, which is implemented in qt4/GuiApplication.cpp. Forgot to mention: you may want to also enable -dbg action, in order to track the dispatching mechanism. > I actually just use sublime text 3 editor don't know any IDE for such > big projects, have just used Eclipse CDT IDE. What IDE do you use for > debugging and tracking method calls as they are called for line by > line debugging? I use Emacs for editing, and gdb for debugging. I advise you to use a regular text editor for editing (I ack Emacs may have a non-trivial learning curve if you don't know it), and gdb as well for debugging. Ok, you may try kdbg to just have a minimum of GUI for step-by-step debugging. Eclipse is fantastic for Java, but in my experience not as much for C/C++, and ultimately it's really slow to launch. > I decided to trace down simple find and replace box > invoked via Ctrl + F(and not the Advanced Find and Replace via > Ctrl+Shift+F). the flow of info is very similar. You have to know that: -) an LFUN (see src/FuncRequest.h) has an action code identifying the type of action we're dispatching (e.g., move cursor right, go to beginning of document, cut selection, ... see src/LyXAction.cpp for all defined actions), and a string argument, retrieved through FuncRequest::argument() -) in Advanced F&R and a few other LFUNs, that need to transmit complex structured information from the GUI/front-end to the back-end model/engine, we encode these structured options (e.g., what to find, what to replace with, whether or not to be case-sensitive, etc...), into the LFUN argument string. Later, these params are recovered back and used... ... you can see this in the code following what happens to a FindAndReplaceOptions structure. T.