[Sofaswitch-svn] [commit] r91 - in sofaswitch/trunk/callflow: . src
Author: derek Date: Thu Sep 14 19:31:09 2006 New Revision: 91 Modified: sofaswitch/trunk/callflow/Makefile.am sofaswitch/trunk/callflow/src/callflow.cpp sofaswitch/trunk/callflow/src/callflow.h sofaswitch/trunk/callflow/src/canvas.h sofaswitch/trunk/callflow/src/dnd.h sofaswitch/trunk/callflow/src/shapelist.cpp Log: Add doxygen comments everywhere. Remove surplus methods. Modified: sofaswitch/trunk/callflow/Makefile.am ============================================================================== --- sofaswitch/trunk/callflow/Makefile.am (original) +++ sofaswitch/trunk/callflow/Makefile.am Thu Sep 14 19:31:09 2006 @@ -3,3 +3,7 @@ MAKEFLAGS=-j$(shell cat /proc/cpuinfo | grep processor | wc -l) SUBDIRS = src + +docs: + doxygen callflow.dxy + Modified: sofaswitch/trunk/callflow/src/callflow.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.cpp (original) +++ sofaswitch/trunk/callflow/src/callflow.cpp Thu Sep 14 19:31:09 2006 @@ -67,11 +67,6 @@ EVT_MENU ( wxH_EDITCUT, MyFrame::OnEditCut) EVT_MENU ( wxH_HELPABOUT, MyFrame::OnHelpAbout) EVT_MENU ( wxH_HELPMANUAL, MyFrame::OnHelpManual) - EVT_MENU ( wxH_CONTROLSMAKE_PLAY_HRECORD, MyFrame::OnControlsmake_play_Hrecord) - EVT_MENU ( wxH_CONTROLSJOIN_PLAY_HRECORD, MyFrame::OnControlsjoin_play_Hrecord) - EVT_MENU ( wxH_CONTROLSMAKE_CONFERENCE, MyFrame::OnControlsmake_conference) - EVT_MENU ( wxH_CONTROLSJOIN_CONFERENCE, MyFrame::OnControlsjoin_conference) - EVT_MENU ( wxH_CONTROLSMAKE_CALL, MyFrame::OnControlsmake_call) EVT_MENU ( wxH_CONTROLSREQUESTNODE, MyFrame::OnControlsrequestnode) EVT_MENU ( wxH_CONTROLSPYTHON, MyFrame::OnControlspython) EVT_MENU ( wxH_CONTROLSEND_FOR, MyFrame::OnControlsend_for) @@ -171,7 +166,7 @@ InitToolBar(GetToolBar()); CreateStatusBar(); - SetStatusText(" Hello "); + SetStatusText(" Welcome to Call Flow. "); } @@ -234,6 +229,7 @@ if (file.IsOpened()) { file.Close(); canvas->ShapeInformationToFile(currentFileName); + SetStatusText(wxString::Format("Saved source code to %s", currentFileName.c_str())); } else { wxMessageBox(wxString::Format("Unable to open the file %s for saving", currentFileName.c_str())); return; @@ -261,6 +257,7 @@ currentFileName = filedlg.GetPath(); file.Close(); canvas->ShapeInformationToFile(currentFileName); + SetStatusText(wxString::Format("Saved source code to %s", currentFileName.c_str())); } Modified: sofaswitch/trunk/callflow/src/callflow.h ============================================================================== --- sofaswitch/trunk/callflow/src/callflow.h (original) +++ sofaswitch/trunk/callflow/src/callflow.h Thu Sep 14 19:31:09 2006 @@ -5,7 +5,8 @@ #include "dnd.h" class MyCanvas; - +/**Enumerate over the different values that the GUI can generate. Each value + means to do some action on the flow chart */ enum { // menu IDs these two are needed by wxHatch @@ -26,11 +27,6 @@ wxH_CONTROLSFOR, wxH_CONTROLSEND_FOR, wxH_CONTROLSPYTHON, - wxH_CONTROLSMAKE_CALL, - wxH_CONTROLSJOIN_CONFERENCE, - wxH_CONTROLSMAKE_CONFERENCE, - wxH_CONTROLSJOIN_PLAY_HRECORD, - wxH_CONTROLSMAKE_PLAY_HRECORD, wxH_CONTROLSCONNECT_OBJECTS, wxH_CONTROLSCOMPILE, wxH_HELPMANUAL, @@ -41,58 +37,141 @@ wxH_QUIT }; +/**The global class, which describes this application. Instantiating this + class intiates everything to happen */ class MyApp: public wxApp { public: + /**Called on construction by wx widgets code, at which point we can + * initialise, and define all the menus etc. */ virtual bool OnInit(); }; - +/**Create the main window that displays this running application */ class MyFrame: public wxFrame { public: + /**Constructor */ MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + /**Destructor */ ~MyFrame (); + /**Called in response to a shutdown command issued from somewhere */ void OnClose (wxCloseEvent& event); + + /**Called in response to a user comand to start over with a new blank + screen */ void OnFileNew (wxCommandEvent & event); + + /**Called in response to a user comand to read in an existing graph */ void OnFileOpen (wxCommandEvent & event); + + /**Called in response to a user comand to save current graph to a file. + This will save the current graph to the current name. If no such current + name is stored, it will ask for a new name.*/ void OnFileSave (wxCommandEvent & event); + + /**Called in response to a user comand to save the current graph to + some specified file - the user will have a requester asking to + what file to write to */ void OnFileSave__As (wxCommandEvent & event); + + /**Called in response to a user comand to shutdown this program */ void OnFileE_xit (wxCommandEvent & event); + /**Generic method to initialise the tool bar. This will add all our custom icons + to the tool bar.*/ void InitToolBar(wxToolBar* toolBar); + + /**Called in response to a user comand to add a "Start here" widget to the + current graph */ void OnControlsstarthere (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Stop Here" widget to the + current graph */ void OnControlsendhere (wxCommandEvent & event); + + /**Called in response to a user comand to add a "request worker" widget to + the current graph. This will ask of the remote supervisor for a node to + handle some audio functionality. */ void OnControlsrequestnode (wxCommandEvent & event); + + /**Called in response to a user comand to add a "End" ??? widget to the + current graph */ void OnControlsend (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Event catcher" widget to + the current graph. These widgets have two outputs - a)for an event, or + for continuing the proessing of the graph. */ void OnControlsEventer (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Conditional", or if + statement type widget to the current graph */ void OnControlsif (wxCommandEvent & event); + + /**Called in response to a user comand to add a "For loop" widget to the + current graph */ void OnControlsfor (wxCommandEvent & event); + + /**Called in response to a user comand to add a "End of for loop" widget + to the current graph. */ void OnControlsend_for (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Python" widget to the + current graph. This widget allows the user to add their own special + python code for processing. One such use is print statements.*/ void OnControlspython (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Stop Timer" widget to the + current graph. This is used when an event has been detected before a + timer has timed out, so the timer needs to be stopped. */ void OnControlsStopTimer (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Timer" widget to the + current graph. This starts a timer, which will generate an event of the + specified name. */ void OnControlsTimer (wxCommandEvent & event); - void OnControlsmake_call (wxCommandEvent & event); - void OnControlsjoin_conference (wxCommandEvent & event); - void OnControlsmake_conference (wxCommandEvent & event); - void OnControlsjoin_play_Hrecord (wxCommandEvent & event); - void OnControlsmake_play_Hrecord (wxCommandEvent & event); + + /**Called in response to a user comand to add a "Draw Line Segment" widget + to the current graph. The multiple line segment object is used to join + two widgets on the screen */ void OnControlsConnectObjects(wxCommandEvent & event); + + /**Called in response to a user comand to turn the current graph into executable + python code */. void OnCompile(wxCommandEvent & event); + + /**Called in response to a user comand to display the current help file */ void OnHelpManual (wxCommandEvent & event); + + /**Called in response to a user comand to display the brief synopsis of + this project */ void OnHelpAbout (wxCommandEvent & event); + + /**Called in response to a user command to cut the selected widgets from the + current graph */ void OnEditCut (wxCommandEvent & event); + + /**Called in response to a user command to copy the selected widgets in the current + graph to the clipboard */ void OnEditCopy (wxCommandEvent & event); + + /**Called in response to a user comand to copy the contents of the + clipboard to the current graph */ void OnEditPaste (wxCommandEvent & event); DECLARE_EVENT_TABLE() public: + /**Report the shape that we much add to the current graph. This shape + would be, for example, a Conditional (or if) if the user had just sent + a MyFrame::OnControlsif() command */ DndShape::Kind GetImageTypeForPlacing() const { return imageTypeForPlacing; } - + /**Undo the current variable - so we are now not ready to place a new + shape in the current graph. It is, partly, the opposite of the the + "GetImageTypeForPlacing" method. */ void ClearImageTypeForPlacing() { imageTypeForPlacing = DndShape::None; } /**Following a click on the tool bar, we are now editing in a @@ -106,8 +185,10 @@ void CloseJoinBlocks(); protected: + /**The shape that we much add to the current graph. This shape would be, + for example, a Conditional (or if) if the user had just sent a + MyFrame::OnControlsif() command */ DndShape::Kind imageTypeForPlacing; - /**The name of the file we are currently editing */ wxString currentFileName; Modified: sofaswitch/trunk/callflow/src/canvas.h ============================================================================== --- sofaswitch/trunk/callflow/src/canvas.h (original) +++ sofaswitch/trunk/callflow/src/canvas.h Thu Sep 14 19:31:09 2006 @@ -12,6 +12,9 @@ ///////////////////////////////////////////////////////////////////////////// +/**Class that describes activity on the area inside the scrollbars, titlebars + etc. It is on this Canvas that the current graph is drawn. This class + contains callbacks for the different mouse events that influence drawing */ class MyCanvas: public wxScrolledWindow { public: @@ -117,7 +120,7 @@ /**Send the curent active shapes to be compiled, and save output to the specified file. - Return true on success, false on failure */ + @return true on success, false on failure */ bool Compile(wxTextFile & file) { return activeShapes.Compile(file); } Modified: sofaswitch/trunk/callflow/src/dnd.h ============================================================================== --- sofaswitch/trunk/callflow/src/dnd.h (original) +++ sofaswitch/trunk/callflow/src/dnd.h Thu Sep 14 19:31:09 2006 @@ -229,7 +229,7 @@ output points to be linked. DndShape::Eventer, for example, only requires one of the output points to be linked. - @params index is the position in the list, and values are 0, 1, 2 ....*/ + @param index is the position in the list, and values are 0, 1, 2 ....*/ bool PointLinked(int index); protected: Modified: sofaswitch/trunk/callflow/src/shapelist.cpp ============================================================================== --- sofaswitch/trunk/callflow/src/shapelist.cpp (original) +++ sofaswitch/trunk/callflow/src/shapelist.cpp Thu Sep 14 19:31:09 2006 @@ -36,18 +36,18 @@ void MyListShapesExtended::RemoveSelectedShapes() { - MyListShapes::iterator it = begin(); - while (it != end()) { - MyListShapes::iterator it_del = it; - it++; - - if (it_del->second != NULL) { - if (it_del->second->IsSelected()) { - delete it_del->second; + MyListShapes::iterator it = begin(); + while (it != end()) { + MyListShapes::iterator it_del = it; + it++; + + if (it_del->second != NULL) { + if (it_del->second->IsSelected()) { + delete it_del->second; + erase (it_del); + } } - erase (it_del); } - } } void MyListShapesExtended::RemoveCurrentShapes() @@ -56,8 +56,8 @@ while (it != end()) { MyListShapes::iterator it_del = it; it++; - - delete it_del->second; + if (it_del->second != NULL) + delete it_del->second; erase (it_del); } }
participants (1)
-
SofaSWITCH SVN