[avida-cvs] avida CVS commits: /current .cvsignore CMakeLists.txt DartConfig.cmake /current/CMakeModules FixFindQt.cmake /current/doc CMakeLists.txt /current/doc/glossary CMakeLists.txt /current/source/cpu CMakeLists.txt /current/source/event CMakeLists.txt /current/source/main CMakeLists.txt config.hh /current/source/qt-viewer CMakeLists.txt /current/source/qt-viewer/exp CMakeLists.txt /current/source/qt-viewer/exp/exp_cleanup CMakeLists.txt Makefile.am exp_cleanup.pro main.cc modules.pri notes template2_t.cc template2_t.hh template_t.cc template_t.hh xqt_test_case.cc xqt_test_case.hh /current/source/qt-viewer/exp/exp_cleanup/analyzer analyzer.pri avd_n_analyzer_batchlist_item.hh avd_n_analyzer_batchlist_item_proto.hh avd_n_analyzer_ctrl.cc avd_n_analyzer_ctrl.hh avd_n_analyzer_data_entry.hh avd_n_analyzer_data_entry_command_list_item.cc avd_n_analyzer_data_entry_command_list_item.hh avd_n_analyzer_data_entry_command_list_item_proto.hh avd_n_analyzer_data_entry_proto.hh avd_n_analyzer_dbg_msgs.hh avd_n_analyzer_dbg_msgs_proto.hh avd_n_analyzer_genotype_list_item.hh avd_n_analyzer_genotype_list_item_proto.hh avd_n_analyzer_genotype_sel_ctrl.hh avd_n_analyzer_genotype_sel_view.cc avd_n_analyzer_genotype_sel_view.hh avd_n_analyzer_gui.cc avd_n_analyzer_listview.cc avd_n_analyzer_listview.hh avd_n_analyzer_mdl.cc avd_n_analyzer_mdl.hh avd_n_analyzer_mdl_proto.hh avd_n_analyzer_menubar_handler.cc avd_n_analyzer_menubar_handler.hh avd_n_analyzer_out_fmt_sel.cc avd_n_analyzer_out_fmt_sel.hh avd_n_analyzer_view.cc avd_n_analyzer_view.hh /current/source/qt-viewer/exp/exp_cleanup/analyzer_o analyzer_o.pri avd_analyzer_batchlist_item.hh avd_analyzer_batchlist_item_proto.hh avd_analyzer_controller.cc avd_analyzer_controller.hh avd_analyzer_controller_data.cc avd_analyzer_controller_data.hh avd_analyzer_creator.cc avd_analyzer_creator.hh avd_analyzer_data_entry.hh avd_analyzer_data_entry_command_list_item.cc avd_analyzer_data_entry_command_list_item.hh avd_analyzer_data_entry_command_list_item_proto.hh avd_analyzer_data_entry_proto.hh avd_analyzer_dbg_msgs.cc avd_analyzer_dbg_msgs.hh avd_analyzer_dbg_msgs_proto.hh avd_analyzer_genotype_list_item.hh avd_analyzer_genotype_list_item_proto.hh avd_analyzer_listview.cc avd_analyzer_listview.hh avd_analyzer_listview_proto.hh avd_analyzer_menubar_handler.cc avd_analyzer_menubar_handler.hh avd_analyzer_model.cc avd_analyzer_model.hh avd_analyzer_model_proto.hh avd_analyzer_output_fmt_selector.cc avd_analyzer_output_fmt_selector.hh avd_analyzer_utils.hh avd_analyzer_view.cc avd_analyzer_view.hh /current/source/qt-viewer/exp/exp_cleanup/containers containers.pri tRList.hh tRList_proto.hh tRetainable_list.hh tRetainable_list_proto.hh /current/source/qt-viewer/exp/exp_cleanup/dumb_gui avd_dumb_ctrl.cc avd_dumb_ctrl.hh avd_dumb_gui.cc avd_dumb_gui_dbg.hh avd_dumb_gui_dbg_proto.hh avd_dumb_view.cc avd_dumb_view.hh dumb_gui.pri /current/source/qt-viewer/exp/exp_cleanup/exp_gui avd_exp_ctrl.cc avd_exp_ctrl.hh avd_exp_gui.cc avd_exp_gui_dbg.hh avd_exp_gui_dbg_proto.hh avd_exp_view.cc avd_exp_view.hh exp_gui.pri test_thing.cc test_thing.hh test_thing_proto.hh testing_interface.hh /current/source/qt-viewer/exp/exp_cleanup/gui_factory avd_abstract_gui.hh avd_abstract_gui_proto.hh avd_gui_factory.cc avd_gui_factory.hh avd_gui_factory_error_policy.hh avd_gui_factory_proto.hh gui_factory.pri tGUI.hh tGUI_proto.hh /current/source/qt-viewer/exp/exp_cleanup/map_gui avd_map_canvas.cc avd_map_canvas.hh avd_map_canvas_rectangle.cc avd_map_canvas_rectangle.hh avd_map_canvas_rectangle_proto.hh avd_map_canvas_view.cc avd_map_canvas_view.hh avd_map_ctrl.cc avd_map_ctrl.hh avd_map_gui.cc avd_map_gui_dbg.hh avd_map_gui_dbg_proto.hh avd_map_layer.cc avd_map_layer.hh avd_map_layer_proto.hh avd_map_view.cc avd_map_view.hh map_gui.pri /current/source/qt-viewer/exp/exp_cleanup/mc avd_avida_state_mediator.hh avd_connections.cc avd_connections.hh avd_gui_factory_mediator.hh avd_mc_dbg.cc avd_mc_dbg.hh avd_mc_dbg_proto.hh avd_mc_mediator.cc avd_mc_mediator.hh avd_menubar_mediator.hh avd_mission_control.cc avd_mission_control.hh avd_settings_mediator.hh avd_windows_mediator.hh mc.pri setup_avida.cc setup_avida.hh /current/source/qt-viewer/exp/exp_cleanup/mc/attributes requests_argv.hh /current/source/qt-viewer/exp/exp_cleanup/memory_mgt ScopeGuard.h activate_watcher.hh activate_watcher_proto.hh memory_mgt.pri retainable.cc retainable.hh retainable_dbg.hh retainable_dbg_proto.hh retainable_proto.hh watch_retains.cc watch_retains.hh watch_retains_proto.hh /current/source/qt-viewer/exp/exp_cleanup/menubar avd_menubar_handler.cc avd_menubar_handler.hh avd_menubar_hdlr_creator.cc menubar.pri /current/source/qt-viewer/exp/exp_cleanup/preferences avd_prefs_ctrl.cc avd_prefs_ctrl.hh avd_prefs_dbg.cc avd_prefs_dbg.hh avd_prefs_dbg_proto.hh avd_prefs_gui.cc avd_prefs_item.cc avd_prefs_item.hh avd_prefs_item_proto.hh avd_prefs_item_view.hh avd_prefs_item_view_proto.hh avd_prefs_view.cc avd_prefs_view.hh preferences.pri /current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory avd_abstract_prefs_gui.hh avd_abstract_prefs_gui_proto.hh avd_prefs_gui_factory.cc avd_prefs_gui_factory.hh avd_prefs_gui_factory_error_policy.hh avd_prefs_gui_factory_proto.hh prefs_gui_factory.pri tPrefsGUI.hh tPrefsGUI_proto.hh /current/source/qt-viewer/exp/exp_cleanup/threaded_driver avd_avida_driver.cc avd_avida_driver.hh avd_avida_thread_drvr_dbg.hh avd_avida_thread_drvr_dbg_proto.hh avd_driver_creator.cc avd_gui_msg_event.hh avd_orig_driver_controller.cc avd_orig_driver_controller.hh threaded_driver.pri /current/source/qt-viewer/exp/exp_cleanup/user_msg avd_message_display.cc avd_message_display.hh avd_message_display_proto.hh avd_message_display_typetrack.hh avd_message_display_typetrack_proto.hh avd_qstr_message_display.cc avd_user_msg_ctrl.cc avd_user_msg_ctrl.hh avd_user_msg_ctrl_funct.hh avd_user_msg_ctrl_funct_proto.hh avd_user_msg_gui.cc avd_user_msg_gui_dbg.hh avd_user_msg_gui_dbg_proto.hh avd_user_msg_prefs_ctrl.cc avd_user_msg_prefs_ctrl.hh avd_user_msg_prefs_gui.cc avd_user_msg_prefs_view.cc avd_user_msg_prefs_view.hh avd_user_msg_view.cc avd_user_msg_view.hh gui_message_display.cc user_msg.pri /current/source/qt-viewer/exp/exp_cleanup2 CMakeLists.txt avd_dbg_msgs.hh avd_message_closure.cc avd_message_closure.hh avd_message_closure_t.cc avd_message_display.cc avd_message_display.hh avd_message_display_t.cc avd_message_set_tracker.cc avd_message_set_tracker.hh avd_message_type_set.hh demo_base_t.cc main.cc template2_t.cc template2_t.hh template_t.cc template_t.hh xqt_test_case.cc xqt_test_case.hh /current/source/support CMakeLists.txt /current/source/support/preset_organisms CMakeLists.txt /current/source/testsuites CMakeLists.txt /current/source/testsuites/qt_viewer_unit_testsuites CMakeLists.txt qt_test_case.cc qt_test_case.hh template.t.cc template.t.hh /current/source/testsuites/unit_testsuites CMakeLists.txt /current/source/testsuites/unit_testsuites/level_0 CMakeLists.txt /current/source/testsuites/unit_testsuites/level_1 CMakeLists.txt /current/source/third-party CMakeLists.txt /current/source/third-party/mockpp CMakeLists.txt /current/source/third-party/trio CMakeLists.txt /current/source/third-party/yaktest CMakeLists.txt test_case.cpp test_case.h test_problem.cpp test_problem.h text_test_interpreter.cpp /current/source/tools CMakeLists.txt tDataEntry.hh tDictionary.hh /current/source/viewers CMakeLists.txt

kaben avida-cvs at alife.org
Mon Dec 29 22:55:22 PST 2003


kaben		Mon Dec 29 14:55:22 2003 EDT

  Modified files:              
    /avida/current	.cvsignore DartConfig.cmake CMakeLists.txt 
    /avida/current/CMakeModules	FixFindQt.cmake 
    /avida/current/doc	CMakeLists.txt 
    /avida/current/doc/glossary	CMakeLists.txt 
    /avida/current/source/cpu	CMakeLists.txt 
    /avida/current/source/event	CMakeLists.txt 
    /avida/current/source/main	CMakeLists.txt config.hh 
    /avida/current/source/qt-viewer	CMakeLists.txt 
    /avida/current/source/qt-viewer/exp	CMakeLists.txt 
    /avida/current/source/qt-viewer/exp/exp_cleanup	CMakeLists.txt 
                                                   	Makefile.am 
                                                   	exp_cleanup.pro 
                                                   	main.cc modules.pri 
                                                   	notes 
                                                   	template2_t.cc 
                                                   	template2_t.hh 
                                                   	template_t.cc 
                                                   	template_t.hh 
                                                   	xqt_test_case.cc 
                                                   	xqt_test_case.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/analyzer	
                                                            	analyzer.pri 
                                                            	avd_n_analyzer_batchlist_item.hh 
                                                            	avd_n_analyzer_batchlist_item_proto.hh 
                                                            	avd_n_analyzer_ctrl.cc 
                                                            	avd_n_analyzer_ctrl.hh 
                                                            	avd_n_analyzer_data_entry.hh 
                                                            	avd_n_analyzer_data_entry_command_list_item.cc 
                                                            	avd_n_analyzer_data_entry_command_list_item.hh 
                                                            	avd_n_analyzer_data_entry_command_list_item_proto.hh 
                                                            	avd_n_analyzer_data_entry_proto.hh 
                                                            	avd_n_analyzer_dbg_msgs.hh 
                                                            	avd_n_analyzer_dbg_msgs_proto.hh 
                                                            	avd_n_analyzer_genotype_list_item.hh 
                                                            	avd_n_analyzer_genotype_list_item_proto.hh 
                                                            	avd_n_analyzer_genotype_sel_ctrl.hh 
                                                            	avd_n_analyzer_genotype_sel_view.cc 
                                                            	avd_n_analyzer_genotype_sel_view.hh 
                                                            	avd_n_analyzer_gui.cc 
                                                            	avd_n_analyzer_listview.cc 
                                                            	avd_n_analyzer_listview.hh 
                                                            	avd_n_analyzer_mdl.cc 
                                                            	avd_n_analyzer_mdl.hh 
                                                            	avd_n_analyzer_mdl_proto.hh 
                                                            	avd_n_analyzer_menubar_handler.cc 
                                                            	avd_n_analyzer_menubar_handler.hh 
                                                            	avd_n_analyzer_out_fmt_sel.cc 
                                                            	avd_n_analyzer_out_fmt_sel.hh 
                                                            	avd_n_analyzer_view.cc 
                                                            	avd_n_analyzer_view.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o	
                                                              	analyzer_o.pri 
                                                              	avd_analyzer_batchlist_item.hh 
                                                              	avd_analyzer_batchlist_item_proto.hh 
                                                              	avd_analyzer_controller.cc 
                                                              	avd_analyzer_controller.hh 
                                                              	avd_analyzer_controller_data.cc 
                                                              	avd_analyzer_controller_data.hh 
                                                              	avd_analyzer_creator.cc 
                                                              	avd_analyzer_creator.hh 
                                                              	avd_analyzer_data_entry.hh 
                                                              	avd_analyzer_data_entry_command_list_item.cc 
                                                              	avd_analyzer_data_entry_command_list_item.hh 
                                                              	avd_analyzer_data_entry_command_list_item_proto.hh 
                                                              	avd_analyzer_data_entry_proto.hh 
                                                              	avd_analyzer_dbg_msgs.cc 
                                                              	avd_analyzer_dbg_msgs.hh 
                                                              	avd_analyzer_dbg_msgs_proto.hh 
                                                              	avd_analyzer_genotype_list_item.hh 
                                                              	avd_analyzer_genotype_list_item_proto.hh 
                                                              	avd_analyzer_listview.cc 
                                                              	avd_analyzer_listview.hh 
                                                              	avd_analyzer_listview_proto.hh 
                                                              	avd_analyzer_menubar_handler.cc 
                                                              	avd_analyzer_menubar_handler.hh 
                                                              	avd_analyzer_model.cc 
                                                              	avd_analyzer_model.hh 
                                                              	avd_analyzer_model_proto.hh 
                                                              	avd_analyzer_output_fmt_selector.cc 
                                                              	avd_analyzer_output_fmt_selector.hh 
                                                              	avd_analyzer_utils.hh 
                                                              	avd_analyzer_view.cc 
                                                              	avd_analyzer_view.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/containers	
                                                              	containers.pri 
                                                              	tRList.hh 
                                                              	tRList_proto.hh 
                                                              	tRetainable_list.hh 
                                                              	tRetainable_list_proto.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui	
                                                            	avd_dumb_ctrl.cc 
                                                            	avd_dumb_ctrl.hh 
                                                            	avd_dumb_gui.cc 
                                                            	avd_dumb_gui_dbg.hh 
                                                            	avd_dumb_gui_dbg_proto.hh 
                                                            	avd_dumb_view.cc 
                                                            	avd_dumb_view.hh 
                                                            	dumb_gui.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui	
                                                           	avd_exp_ctrl.cc 
                                                           	avd_exp_ctrl.hh 
                                                           	avd_exp_gui.cc 
                                                           	avd_exp_gui_dbg.hh 
                                                           	avd_exp_gui_dbg_proto.hh 
                                                           	avd_exp_view.cc 
                                                           	avd_exp_view.hh 
                                                           	exp_gui.pri 
                                                           	test_thing.cc 
                                                           	test_thing.hh 
                                                           	test_thing_proto.hh 
                                                           	testing_interface.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory	
                                                               	avd_abstract_gui.hh 
                                                               	avd_abstract_gui_proto.hh 
                                                               	avd_gui_factory.cc 
                                                               	avd_gui_factory.hh 
                                                               	avd_gui_factory_error_policy.hh 
                                                               	avd_gui_factory_proto.hh 
                                                               	gui_factory.pri 
                                                               	tGUI.hh 
                                                               	tGUI_proto.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/map_gui	
                                                           	avd_map_canvas.cc 
                                                           	avd_map_canvas.hh 
                                                           	avd_map_canvas_rectangle.cc 
                                                           	avd_map_canvas_rectangle.hh 
                                                           	avd_map_canvas_rectangle_proto.hh 
                                                           	avd_map_canvas_view.cc 
                                                           	avd_map_canvas_view.hh 
                                                           	avd_map_ctrl.cc 
                                                           	avd_map_ctrl.hh 
                                                           	avd_map_gui.cc 
                                                           	avd_map_gui_dbg.hh 
                                                           	avd_map_gui_dbg_proto.hh 
                                                           	avd_map_layer.cc 
                                                           	avd_map_layer.hh 
                                                           	avd_map_layer_proto.hh 
                                                           	avd_map_view.cc 
                                                           	avd_map_view.hh 
                                                           	map_gui.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup/mc	
                                                      	avd_avida_state_mediator.hh 
                                                      	avd_connections.cc 
                                                      	avd_connections.hh 
                                                      	avd_gui_factory_mediator.hh 
                                                      	avd_mc_dbg.cc 
                                                      	avd_mc_dbg.hh 
                                                      	avd_mc_dbg_proto.hh 
                                                      	avd_mc_mediator.cc 
                                                      	avd_mc_mediator.hh 
                                                      	avd_menubar_mediator.hh 
                                                      	avd_mission_control.cc 
                                                      	avd_mission_control.hh 
                                                      	avd_settings_mediator.hh 
                                                      	avd_windows_mediator.hh 
                                                      	mc.pri 
                                                      	setup_avida.cc 
                                                      	setup_avida.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/mc/attributes	
                                                                 	requests_argv.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt	
                                                              	ScopeGuard.h 
                                                              	activate_watcher.hh 
                                                              	activate_watcher_proto.hh 
                                                              	memory_mgt.pri 
                                                              	retainable.cc 
                                                              	retainable.hh 
                                                              	retainable_dbg.hh 
                                                              	retainable_dbg_proto.hh 
                                                              	retainable_proto.hh 
                                                              	watch_retains.cc 
                                                              	watch_retains.hh 
                                                              	watch_retains_proto.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/menubar	
                                                           	avd_menubar_handler.cc 
                                                           	avd_menubar_handler.hh 
                                                           	avd_menubar_hdlr_creator.cc 
                                                           	menubar.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup/preferences	
                                                               	avd_prefs_ctrl.cc 
                                                               	avd_prefs_ctrl.hh 
                                                               	avd_prefs_dbg.cc 
                                                               	avd_prefs_dbg.hh 
                                                               	avd_prefs_dbg_proto.hh 
                                                               	avd_prefs_gui.cc 
                                                               	avd_prefs_item.cc 
                                                               	avd_prefs_item.hh 
                                                               	avd_prefs_item_proto.hh 
                                                               	avd_prefs_item_view.hh 
                                                               	avd_prefs_item_view_proto.hh 
                                                               	avd_prefs_view.cc 
                                                               	avd_prefs_view.hh 
                                                               	preferences.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory	
                                                                     	avd_abstract_prefs_gui.hh 
                                                                     	avd_abstract_prefs_gui_proto.hh 
                                                                     	avd_prefs_gui_factory.cc 
                                                                     	avd_prefs_gui_factory.hh 
                                                                     	avd_prefs_gui_factory_error_policy.hh 
                                                                     	avd_prefs_gui_factory_proto.hh 
                                                                     	prefs_gui_factory.pri 
                                                                     	tPrefsGUI.hh 
                                                                     	tPrefsGUI_proto.hh 
    /avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver	
                                                                   	avd_avida_driver.cc 
                                                                   	avd_avida_driver.hh 
                                                                   	avd_avida_thread_drvr_dbg.hh 
                                                                   	avd_avida_thread_drvr_dbg_proto.hh 
                                                                   	avd_driver_creator.cc 
                                                                   	avd_gui_msg_event.hh 
                                                                   	avd_orig_driver_controller.cc 
                                                                   	avd_orig_driver_controller.hh 
                                                                   	threaded_driver.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup/user_msg	
                                                            	avd_message_display.cc 
                                                            	avd_message_display.hh 
                                                            	avd_message_display_proto.hh 
                                                            	avd_message_display_typetrack.hh 
                                                            	avd_message_display_typetrack_proto.hh 
                                                            	avd_qstr_message_display.cc 
                                                            	avd_user_msg_ctrl.cc 
                                                            	avd_user_msg_ctrl.hh 
                                                            	avd_user_msg_ctrl_funct.hh 
                                                            	avd_user_msg_ctrl_funct_proto.hh 
                                                            	avd_user_msg_gui.cc 
                                                            	avd_user_msg_gui_dbg.hh 
                                                            	avd_user_msg_gui_dbg_proto.hh 
                                                            	avd_user_msg_prefs_ctrl.cc 
                                                            	avd_user_msg_prefs_ctrl.hh 
                                                            	avd_user_msg_prefs_gui.cc 
                                                            	avd_user_msg_prefs_view.cc 
                                                            	avd_user_msg_prefs_view.hh 
                                                            	avd_user_msg_view.cc 
                                                            	avd_user_msg_view.hh 
                                                            	gui_message_display.cc 
                                                            	user_msg.pri 
    /avida/current/source/qt-viewer/exp/exp_cleanup2	CMakeLists.txt 
                                                    	avd_dbg_msgs.hh 
                                                    	avd_message_closure.cc 
                                                    	avd_message_closure.hh 
                                                    	avd_message_closure_t.cc 
                                                    	avd_message_display.cc 
                                                    	avd_message_display.hh 
                                                    	avd_message_display_t.cc 
                                                    	avd_message_set_tracker.cc 
                                                    	avd_message_set_tracker.hh 
                                                    	avd_message_type_set.hh 
                                                    	demo_base_t.cc 
                                                    	main.cc 
                                                    	template2_t.cc 
                                                    	template2_t.hh 
                                                    	template_t.cc 
                                                    	template_t.hh 
                                                    	xqt_test_case.cc 
                                                    	xqt_test_case.hh 
    /avida/current/source/support	CMakeLists.txt 
    /avida/current/source/support/preset_organisms	CMakeLists.txt 
    /avida/current/source/testsuites	CMakeLists.txt 
    /avida/current/source/testsuites/qt_viewer_unit_testsuites	
                                                              	CMakeLists.txt 
                                                              	qt_test_case.cc 
                                                              	qt_test_case.hh 
                                                              	template.t.cc 
                                                              	template.t.hh 
    /avida/current/source/testsuites/unit_testsuites	CMakeLists.txt 
    /avida/current/source/testsuites/unit_testsuites/level_0	
                                                            	CMakeLists.txt 
    /avida/current/source/testsuites/unit_testsuites/level_1	
                                                            	CMakeLists.txt 
    /avida/current/source/third-party	CMakeLists.txt 
    /avida/current/source/third-party/mockpp	CMakeLists.txt 
    /avida/current/source/third-party/trio	CMakeLists.txt 
    /avida/current/source/third-party/yaktest	CMakeLists.txt 
                                             	test_case.cpp test_case.h 
                                             	test_problem.cpp 
                                             	test_problem.h 
                                             	text_test_interpreter.cpp 
    /avida/current/source/tools	CMakeLists.txt tDataEntry.hh 
                               	tDictionary.hh 
    /avida/current/source/viewers	CMakeLists.txt 
  Log:
  
  Merge from branch kaben.
  
  
  
-------------- next part --------------
Index: avida/current/.cvsignore
diff -u /dev/null avida/current/.cvsignore:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/.cvsignore	Mon Dec 29 14:55:07 2003
@@ -0,0 +1,2 @@
+{arch}
+.arch-ids
Index: avida/current/DartConfig.cmake
diff -u /dev/null avida/current/DartConfig.cmake:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/DartConfig.cmake	Mon Dec 29 14:55:07 2003
@@ -0,0 +1,9 @@
+#
+# Dart server to submit results (used by client)
+#
+SET (DROP_METHOD "scp")
+SET (DROP_SITE "myxo.css.msu.edu")
+SET (DROP_LOCATION "/home/testdummy/incoming-dart--avida--current--kaben")
+SET (DROP_SITE_USER "testdummy")
+SET (TRIGGER_SITE "http://${DROP_SITE}/avida/cgi-bin/dart--avida--current--kaben.pl")
+
Index: avida/current/CMakeLists.txt
diff -u avida/current/CMakeLists.txt:1.1 avida/current/CMakeLists.txt:1.2
--- avida/current/CMakeLists.txt:1.1	Sat Dec  6 10:00:52 2003
+++ avida/current/CMakeLists.txt	Mon Dec 29 14:55:07 2003
@@ -1,11 +1,5 @@
 
-# CMake doesn't have a 'distclean' build target.  This provides a
-# makeshift distclean, but it doesn't recurse into subdirectories.
-
-INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/TargetDistclean.cmake)
-
-
-# This section defines default configure options.
+# This section defines default builtin configure options.
 
 IF(UNIX)
 
@@ -15,7 +9,7 @@
   # - release (Release)
   # - release with debug info (RelWithDebInfo)
   SET(CMAKE_CXX_FLAGS_DEBUG
-    "-g -Wall -pedantic -DDEBUG"
+    "-g -Wall -Wno-long-double -Wno-long-long -pedantic -DDEBUG"
     CACHE STRING
     "Flags used by the compiler during debug builds."
   )
@@ -30,7 +24,7 @@
     "Flags used by the compiler during release builds."
   )
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
-    "-O2 -ffast-math -g -Wall -DDEBUG"
+    "-O2 -ffast-math -g -Wall -Wno-long-double -Wno-long-long -DDEBUG"
     CACHE STRING
     "Flags used by the compiler during release builds."
   )
@@ -41,7 +35,7 @@
   # - release (Release)
   # - release with debug info (RelWithDebInfo)
   SET(CMAKE_C_FLAGS_DEBUG
-    "-g -Wall -pedantic -DDEBUG"
+    "-g -Wall -Wno-long-double -Wno-long-long -pedantic -DDEBUG"
     CACHE STRING
     "Flags used by the compiler during debug builds."
   )
@@ -56,7 +50,7 @@
     "Flags used by the compiler during release builds."
   )
   SET(CMAKE_C_FLAGS_RELWITHDEBINFO
-    "-O2 -ffast-math -g -Wall -pedantic -DDEBUG"
+    "-O2 -ffast-math -g -Wall -Wno-long-double -Wno-long-long -pedantic -DDEBUG"
     CACHE STRING
     "Flags used by the compiler during release builds."
   )
@@ -65,7 +59,7 @@
   SET(CMAKE_VERBOSE_MAKEFILE
     TRUE
     CACHE BOOL
-    "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the consoleduring the make.  This is useful for debugging only."
+    "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only."
   )
 ENDIF(UNIX)
 
@@ -92,24 +86,164 @@
   "Single output directory for building all executables."
 )
 
-# By default, compile all unit testing software.  Tests are run via
-# 'make test' under unix.
-OPTION(_UNIT_TESTS
-  "Enable building of unit test suites."
-  ON
-)
-IF(_UNIT_TESTS)
-  ENABLE_TESTING()
-ENDIF(_UNIT_TESTS)
-
 
-# This section introduces the Avida project to CMake.
+# This section introduces the Avida project to CMake.  In this file, it
+# must be between the configuration options above (otherwise it
+# overrides their defaults) and the configuration options, cmake module
+# includes, and convenience variables below (otherwise some variables
+# can't be properly defined because PROJECT_SOURCE_DIR and
+# PROJECT_BUILD_DIR aren't yet defined).
 
 PROJECT(AVIDA)
-
 SUBDIRS(source doc)
 
 
+# Locate the ncurses screen handling package (for Avida's console
+# interface) and the Qt graphics API (for Avida's graphic interface).
+INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FindNcurses.cmake)
+INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FixFindQt.cmake)
+
+
+# By default, build the console interface to Avida.
+OPTION(_NCURSES_CONSOLE_INTERFACE
+  "Enable building Avida console interface."
+  ON
+)
+# Make sure requisites are present for build of console interface.  Give
+# user feedback if they're missing.
+IF(_NCURSES_CONSOLE_INTERFACE)
+  IF(NOT NCURSES_INCLUDE_PATH)
+    MESSAGE(
+      "Building Avida's console interface requires header files for the ncurses CRT screen handling package.  I can't find those header files.  If you know that the headers are installed, set the advanced variable NCURSES_INCLUDE_PATH to their include directory."
+    )
+  ENDIF(NOT NCURSES_INCLUDE_PATH)
+  IF(NOT NCURSES_LIBRARY)
+    MESSAGE(
+      "Building Avida's console interface requires the ncurses library 'libncurses', which I can't find.  If you know that the library is installed, set the advanced variable NCURSES_LIBRARY to its location."
+    )
+  ENDIF(NOT NCURSES_LIBRARY)
+ENDIF(_NCURSES_CONSOLE_INTERFACE)
+
+# By default, build the primitive version of Avida.
+OPTION(_PRIMITIVE_INTERFACE
+  "Enable building interfaceless Avida (fastest version)."
+  ON
+)
+
+# By default, build the graphic interface to Avida.
+OPTION(_QT_GRAPHIC_INTERFACE
+  "Enable building Avida graphic interface."
+  ON
+)
+# By default, don't build the experimental interface to Avida.
+OPTION(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE
+  "Enable building experimental Avida graphic interface."
+  OFF
+)
+# Make sure requisites are present for build of graphic interface.  Give
+# user feedback if they're missing.
+IF(QT_FOUND)
+  IF(QT_QT_LIBRARY MATCHES "qt-mt")
+    SET(QT_IS_THREAD_CAPABLE TRUE)
+  ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
+ENDIF(QT_FOUND)
+VARIABLE_REQUIRES(_QT_GRAPHIC_INTERFACE QT_GRAPHIC_INTERFACE_REQUISITES
+  QT_FOUND
+  QT_IS_THREAD_CAPABLE
+  QT_WRAP_UI
+  QT_WRAP_CPP
+)
+VARIABLE_REQUIRES(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE QT_EXP_GRAPHIC_INTERFACE_REQUISITES
+  QT_FOUND
+  QT_IS_THREAD_CAPABLE
+  QT_WRAP_UI
+  QT_WRAP_CPP
+)
+IF(_QT_GRAPHIC_INTERFACE OR _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+  IF(NOT QT_FOUND)
+    MESSAGE(
+      "Building Avida's graphic interface requires the complete Qt graphics API.  Qt can be obtained from www.trolltech.com.  If you know that the complete Qt API is present, try setting the environment variable QTDIR to the subdirectory containing Qt."
+    )
+  ENDIF(NOT QT_FOUND)
+  IF(NOT QT_IS_THREAD_CAPABLE)
+    MESSAGE(
+      "Building Avida's graphic interface requires a version of Qt that supports multiple threads, i.e., that provides the library 'libqt-mt', which I can't find.  If you know that the library is present, set the advanced variable QT_QT_LIBRARY to its location."
+    )
+  ENDIF(NOT QT_IS_THREAD_CAPABLE)
+  IF(NOT QT_INCLUDE_DIR)
+    MESSAGE(
+      "Building Avida's graphic interface requires Qt header files, which I can't find.  If you know that the headers are installed, set the advanced variable QT_INCLUDE_DIR to their include directory."
+    )
+  ENDIF(NOT QT_INCLUDE_DIR)
+  IF(NOT QT_WRAP_CPP)
+    MESSAGE(
+      "Building Avida's graphic interface requires Qt's meta-object compiler (moc), which I can't find.  If you know that the moc executable is present, set the advanced variable QT_MOC_EXECUTABLE accordingly."
+    )
+  ENDIF(NOT QT_WRAP_CPP)
+  IF(NOT QT_WRAP_UI)
+    MESSAGE(
+      "Building Avida's graphic interface requires Qt's user-interface compiler (uic), which I can't find.  If you know that the uic executable is present, set the advanced variable QT_UIC_EXECUTABLE accordingly."
+    )
+  ENDIF(NOT QT_WRAP_UI)
+ENDIF(_QT_GRAPHIC_INTERFACE OR _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+
+# By default, compile all unit tests of primitive Avida classes.  Tests
+# are run via 'make test' under unix.
+OPTION(_UNIT_TEST_PRIMITIVE
+  "Enable building primitive unit test suites."
+  ON
+)
+IF(_UNIT_TEST_PRIMITIVE)
+  SET(UNIT_TESTS TRUE)
+  SET(BUILD_TESTING TRUE)
+  ENABLE_TESTING()
+ENDIF(_UNIT_TEST_PRIMITIVE)
+
+# By default, compile all of the unit tests of avida's gui.  Tests are
+# run via 'make test' under unix.
+OPTION(_UNIT_TEST_QT_GUI
+  "Enable building Qt gui unit test suites."
+  ON
+)
+# Only test gui classes if gui is being built.
+IF(_UNIT_TEST_QT_GUI)
+  IF(_QT_GRAPHIC_INTERFACE)
+    SET(UNIT_TESTS TRUE)
+    SET(BUILD_TESTING TRUE)
+    ENABLE_TESTING()
+  ELSE(_QT_GRAPHIC_INTERFACE)
+    MESSAGE(
+      "The option _UNIT_TEST_QT_GUI is on, but the option _QT_GRAPHIC_INTERFACE is off.  Qt gui unit test suites have been disabled since the gui won't be built."
+    )
+  ENDIF(_QT_GRAPHIC_INTERFACE)
+ENDIF(_UNIT_TEST_QT_GUI)
+
+
+# By default, don't compile unit tests of avida's experimental gui.  Tests are
+# run via 'make test' under unix.
+OPTION(_UNIT_TEST_QT_EXP_GUI
+  "Enable building Qt experimental gui unit test suites."
+  OFF
+)
+# Only test gui classes if gui is being built.
+IF(_UNIT_TEST_QT_EXP_GUI)
+  IF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+    SET(UNIT_TESTS TRUE)
+    SET(BUILD_TESTING TRUE)
+    ENABLE_TESTING()
+  ELSE(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+    MESSAGE(
+      "The option _UNIT_TEST_QT_EXP_GUI is on, but the option _QT_EXPERIMENTAL_GRAPHIC_INTERFACE is off.  Qt gui unit test suites have been disabled since the gui won't be built."
+    )
+  ENDIF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+ENDIF(_UNIT_TEST_QT_EXP_GUI)
+
+
+IF(BUILD_TESTING)
+  INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
+ENDIF(BUILD_TESTING)
+
+
 # This section defines convenience variables.  They're available to
 # CMakeList.txt files in all subdirectories beneath the directory
 # containing this file..
@@ -120,6 +254,24 @@
 SET(CPU_SRC_DIR ${PROJECT_SOURCE_DIR}/source/cpu)
 SET(EVENT_SRC_DIR ${PROJECT_SOURCE_DIR}/source/event)
 SET(MAIN_SRC_DIR ${PROJECT_SOURCE_DIR}/source/main)
+SET(GUI_SRC_DIR ${PROJECT_SOURCE_DIR}/source/qt-viewer)
+
+SET(EXP_GUI_SRC_DIR
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/analyzer
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/analyzer_o
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/containers
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/dumb_bui
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/exp_gui
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/map_gui
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/mc
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/memory_mgt
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/menubar
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/preferences
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/threaded_driver
+  ${PROJECT_SOURCE_DIR}/source/qt-viewer/exp/exp_cleanup/user_msg
+)
 
 # Shortcuts to the build subdirectories.
 SET(THIRDPARTY_BLD_DIR ${PROJECT_BINARY_DIR}/source/third-party)
@@ -127,6 +279,24 @@
 SET(CPU_BLD_DIR ${PROJECT_BINARY_DIR}/source/cpu)
 SET(EVENT_BLD_DIR ${PROJECT_BINARY_DIR}/source/event)
 SET(MAIN_BLD_DIR ${PROJECT_BINARY_DIR}/source/main)
+SET(GUI_BLD_DIR ${PROJECT_BINARY_DIR}/source/qt-viewer)
+
+SET(EXP_GUI_BLD_DIR
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/analyzer
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/analyzer_o
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/containers
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/dumb_bui
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/exp_gui
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/map_gui
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/mc
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/memory_mgt
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/menubar
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/preferences
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/threaded_driver
+  ${PROJECT_BINARY_DIR}/source/qt-viewer/exp/exp_cleanup/user_msg
+)
 
 # A list of all source subdirectories (convenient for naming
 # include-directories).
Index: avida/current/CMakeModules/FixFindQt.cmake
diff -u avida/current/CMakeModules/FixFindQt.cmake:1.1 avida/current/CMakeModules/FixFindQt.cmake:1.2
--- avida/current/CMakeModules/FixFindQt.cmake:1.1	Sat Dec  6 10:00:54 2003
+++ avida/current/CMakeModules/FixFindQt.cmake	Mon Dec 29 14:55:07 2003
@@ -27,7 +27,7 @@
     SET(APPLE_EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
   ENDIF(EXECUTABLE_OUTPUT_PATH)
 
-  MACRO(CREATE_EXECUTABLE
+  MACRO(CREATE_QT_EXECUTABLE
     NAME
     SOURCES
     LIBRARIES
@@ -49,29 +49,30 @@
         LINK_FLAGS "-prebind"
     )
     INSTALL_TARGETS(${INSTALL_PREFIX} ${NAME}.app/Contents/MacOS/${NAME})
-
-    IF(DISTCLEAN_FILES)
-      ADD_CUSTOM_TARGET(clean-${NAME}.app @echo "cleaning for ${NAME}.app")
-      ADD_CUSTOM_COMMAND(
-        COMMAND rm
-        ARGS    -rf ${APPLE_EXECUTABLE_OUTPUT_PATH}/${NAME}.app
-        TARGET clean-${NAME}.app
-      )
-      ADD_DEPENDENCIES(distclean clean-${NAME}.app)
-    ENDIF(DISTCLEAN_FILES)
-
-  ENDMACRO(CREATE_EXECUTABLE)
+  ENDMACRO(CREATE_QT_EXECUTABLE)
 
 ELSE(QT_MACX_INCLUDE_DIR)
-  MACRO(CREATE_EXECUTABLE
+  MACRO(CREATE_QT_EXECUTABLE
     NAME
     SOURCES
     LIBRARIES
+    INSTALL_PREFIX
   )
     ADD_EXECUTABLE(${NAME} ${${SOURCES}})
     TARGET_LINK_LIBRARIES(${NAME} ${${LIBRARIES}})
     INSTALL_TARGETS(${INSTALL_PREFIX} ${NAME})
-  ENDMACRO(CREATE_EXECUTABLE)
+  ENDMACRO(CREATE_QT_EXECUTABLE)
 ENDIF(QT_MACX_INCLUDE_DIR)
 
+FIND_LIBRARY(QT_QT_LIBRARY 
+  NAMES qt-mt qt-mt230nc
+  PATHS
+  $ENV{QTDIR}/lib
+  /usr/local/qt/lib
+  /usr/local/lib
+  /usr/lib
+  /usr/share/qt3/lib
+  C:/Progra~1/qt/lib
+  )
 
+INCLUDE(${CMAKE_ROOT}/Modules/FindQt.cmake)
Index: avida/current/doc/CMakeLists.txt
diff -u avida/current/doc/CMakeLists.txt:1.1 avida/current/doc/CMakeLists.txt:1.2
--- avida/current/doc/CMakeLists.txt:1.1	Sat Dec  6 10:00:56 2003
+++ avida/current/doc/CMakeLists.txt	Mon Dec 29 14:55:07 2003
@@ -1,4 +1,3 @@
-
 SUBDIRS(glossary)
 
 INSTALL_FILES(/doc_html .*[.]html)
Index: avida/current/doc/glossary/CMakeLists.txt
diff -u avida/current/doc/glossary/CMakeLists.txt:1.1 avida/current/doc/glossary/CMakeLists.txt:1.2
--- avida/current/doc/glossary/CMakeLists.txt:1.1	Sat Dec  6 10:00:56 2003
+++ avida/current/doc/glossary/CMakeLists.txt	Mon Dec 29 14:55:08 2003
@@ -1,3 +1,2 @@
-
 INSTALL_FILES(/doc_html/glossary .*[.]html)
 INSTALL_FILES(/doc_html/glossary .*[.]help)
Index: avida/current/source/cpu/CMakeLists.txt
diff -u avida/current/source/cpu/CMakeLists.txt:1.1 avida/current/source/cpu/CMakeLists.txt:1.2
--- avida/current/source/cpu/CMakeLists.txt:1.1	Sat Dec  6 10:00:58 2003
+++ avida/current/source/cpu/CMakeLists.txt	Mon Dec 29 14:55:08 2003
@@ -1,4 +1,3 @@
-
 SET(libcpu_a_SOURCES
   4stack_head.cc
   code_label.cc
Index: avida/current/source/event/CMakeLists.txt
diff -u avida/current/source/event/CMakeLists.txt:1.1 avida/current/source/event/CMakeLists.txt:1.2
--- avida/current/source/event/CMakeLists.txt:1.1	Sat Dec  6 10:00:59 2003
+++ avida/current/source/event/CMakeLists.txt	Mon Dec 29 14:55:08 2003
@@ -1,7 +1,8 @@
-
 ADD_CUSTOM_COMMAND(
   OUTPUT
     cPopulation_construct_event_auto.ci
+    cPopulation_descr.ci
+    cPopulation_descr.hi
     cPopulation_enums_auto.ci
     cPopulation_name2enum_auto.ci
     cPopulation_process_auto.ci
Index: avida/current/source/main/CMakeLists.txt
diff -u avida/current/source/main/CMakeLists.txt:1.1 avida/current/source/main/CMakeLists.txt:1.2
--- avida/current/source/main/CMakeLists.txt:1.1	Sat Dec  6 10:00:59 2003
+++ avida/current/source/main/CMakeLists.txt	Mon Dec 29 14:55:09 2003
@@ -1,4 +1,3 @@
-
 INCLUDE_DIRECTORIES(${ALL_INC_DIRS})
 
 SET(libmain_a_SOURCES
@@ -63,10 +62,6 @@
 
 ADD_LIBRARY(main ${libmain_a_SOURCES})
 
-OPTION(_PRIMITIVE_INTERFACE
-  "Enable building interfaceless Avida (fastest version)."
-  ON
-)
 IF(_PRIMITIVE_INTERFACE)
   ADD_EXECUTABLE(primitive primitive.cc)
   TARGET_LINK_LIBRARIES(primitive main cpu event main tools)
Index: avida/current/source/main/config.hh
diff -u avida/current/source/main/config.hh:1.61 avida/current/source/main/config.hh:1.62
--- avida/current/source/main/config.hh:1.61	Thu Dec 11 14:13:04 2003
+++ avida/current/source/main/config.hh	Mon Dec 29 14:55:09 2003
@@ -8,6 +8,9 @@
 #ifndef CONFIG_HH
 #define CONFIG_HH
 
+#ifndef GENESIS_HH
+#include "genesis.hh"
+#endif
 #ifndef STRING_LIST_HH
 #include "string_list.hh"
 #endif
Index: avida/current/source/qt-viewer/CMakeLists.txt
diff -u avida/current/source/qt-viewer/CMakeLists.txt:1.1 avida/current/source/qt-viewer/CMakeLists.txt:1.2
--- avida/current/source/qt-viewer/CMakeLists.txt:1.1	Sat Dec  6 10:01:00 2003
+++ avida/current/source/qt-viewer/CMakeLists.txt	Mon Dec 29 14:55:09 2003
@@ -1,25 +1,8 @@
+SUBDIRS(exp)
 
-INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/TargetDistclean.cmake)
 INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FixFindQt.cmake)
-INCLUDE(${CMAKE_ROOT}/Modules/FindQt.cmake)
-
-IF(QT_FOUND)
-  IF(QT_QT_LIBRARY MATCHES "qt-mt")
-    SET(QT_IS_THREAD_CAPABLE TRUE)
-  ENDIF(QT_QT_LIBRARY MATCHES "qt-mt")
-ENDIF(QT_FOUND)
-
-OPTION(_QT_GRAPHIC_INTERFACE
-  "Enable building Avida graphic interface."
-  ON
-)
-VARIABLE_REQUIRES(_QT_GRAPHIC_INTERFACE QT_GRAPHIC_INTERFACE_REQUISITES
-  QT_FOUND
-  QT_WRAP_UI
-  QT_WRAP_CPP
-  QT_IS_THREAD_CAPABLE
-)
 
+ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
 IF(_QT_GRAPHIC_INTERFACE)
   INCLUDE_DIRECTORIES(
     ${ALL_INC_DIRS}
@@ -28,7 +11,6 @@
     ${QT_INCLUDE_PATH}
     .
   )
-  ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
   
   SET(libqtviewer_a_SOURCES
     avd_mission_control.cc
@@ -187,5 +169,5 @@
     ${THIRDPARTY_BLD_DIR}/trio
     .
   )
-  CREATE_EXECUTABLE(Avida Avida_SOURCES Avida_LIBRARIES /)
+  CREATE_QT_EXECUTABLE(Avida Avida_SOURCES Avida_LIBRARIES /)
 ENDIF(_QT_GRAPHIC_INTERFACE)
Index: avida/current/source/qt-viewer/exp/CMakeLists.txt
diff -u /dev/null avida/current/source/qt-viewer/exp/CMakeLists.txt:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/CMakeLists.txt	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,2 @@
+SUBDIRS(exp_cleanup exp_cleanup2)
+
Index: avida/current/source/qt-viewer/exp/exp_cleanup/CMakeLists.txt
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/CMakeLists.txt:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/CMakeLists.txt	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,300 @@
+INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FixFindQt.cmake)
+
+IF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+  INCLUDE_DIRECTORIES(
+    ${ALL_INC_DIRS}
+    ${THIRDPARTY_SRC_DIR}/trio
+    ${THIRDPARTY_SRC_DIR}/Loki
+    ${QT_INCLUDE_DIR}
+    ${QT_INCLUDE_PATH}
+    .
+  )
+  LINK_DIRECTORIES(
+    ${ALL_LIB_DIRS}
+    ${THIRDPARTY_BLD_DIR}/trio
+    .
+  )
+  
+  SET(libxqtviewer_a_SOURCES
+#    analyzer/avd_n_analyzer_ctrl.cc
+#    analyzer/avd_n_analyzer_data_entry_command_list_item.cc
+#    analyzer/avd_n_analyzer_genotype_sel_view.cc
+#    analyzer/avd_n_analyzer_gui.cc
+#    analyzer/avd_n_analyzer_listview.cc
+#    analyzer/avd_n_analyzer_mdl.cc
+#    analyzer/avd_n_analyzer_menubar_handler.cc
+#    analyzer/avd_n_analyzer_out_fmt_sel.cc
+#    analyzer/avd_n_analyzer_view.cc
+#    analyzer_o/avd_analyzer_controller.cc
+#    analyzer_o/avd_analyzer_controller_data.cc
+#    analyzer_o/avd_analyzer_creator.cc
+#    analyzer_o/avd_analyzer_data_entry_command_list_item.cc
+#    analyzer_o/avd_analyzer_dbg_msgs.cc
+#    analyzer_o/avd_analyzer_listview.cc
+#    analyzer_o/avd_analyzer_menubar_handler.cc
+#    analyzer_o/avd_analyzer_model.cc
+#    analyzer_o/avd_analyzer_output_fmt_selector.cc
+#    analyzer_o/avd_analyzer_view.cc
+#    dumb_gui/avd_dumb_ctrl.cc
+#    dumb_gui/avd_dumb_gui.cc
+#    dumb_gui/avd_dumb_view.cc
+#    exp_gui/avd_exp_ctrl.cc
+#    exp_gui/avd_exp_gui.cc
+#    exp_gui/avd_exp_view.cc
+#    exp_gui/test_thing.cc
+#    gui_factory/avd_gui_factory.cc
+#    map_gui/avd_map_canvas.cc
+#    map_gui/avd_map_canvas_rectangle.cc
+#    map_gui/avd_map_canvas_view.cc
+#    map_gui/avd_map_ctrl.cc
+#    map_gui/avd_map_gui.cc
+#    map_gui/avd_map_layer.cc
+#    map_gui/avd_map_view.cc
+#    mc/avd_connections.cc
+#    mc/avd_mc_dbg.cc
+#    mc/avd_mc_mediator.cc
+#    mc/avd_mission_control.cc
+#    mc/setup_avida.cc
+    memory_mgt/retainable.cc
+    memory_mgt/watch_retains.cc
+#    menubar/avd_menubar_handler.cc
+#    menubar/avd_menubar_hdlr_creator.cc
+#    preferences/avd_prefs_ctrl.cc
+#    preferences/avd_prefs_dbg.cc
+#    preferences/avd_prefs_gui.cc
+#    preferences/avd_prefs_item.cc
+#    preferences/avd_prefs_view.cc
+#    prefs_gui_factory/avd_prefs_gui_factory.cc
+#    threaded_driver/avd_avida_driver.cc
+#    threaded_driver/avd_driver_creator.cc
+#    threaded_driver/avd_orig_driver_controller.cc
+#    user_msg/avd_message_display.cc
+#    user_msg/avd_qstr_message_display.cc
+#    user_msg/avd_user_msg_ctrl.cc
+#    user_msg/avd_user_msg_gui.cc
+#    user_msg/avd_user_msg_prefs_ctrl.cc
+#    user_msg/avd_user_msg_prefs_gui.cc
+#    user_msg/avd_user_msg_prefs_view.cc
+#    user_msg/avd_user_msg_view.cc
+#    user_msg/gui_message_display.cc
+  )
+  
+  SET(libxqtviewer_moc_a_MOC_SOURCES
+#    analyzer/avd_n_analyzer_batchlist_item.hh
+#    analyzer/avd_n_analyzer_batchlist_item_proto.hh
+#    analyzer/avd_n_analyzer_ctrl.hh
+#    analyzer/avd_n_analyzer_data_entry.hh
+#    analyzer/avd_n_analyzer_data_entry_command_list_item.hh
+#    analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh
+#    analyzer/avd_n_analyzer_data_entry_proto.hh
+#    analyzer/avd_n_analyzer_dbg_msgs.hh
+#    analyzer/avd_n_analyzer_dbg_msgs_proto.hh
+#    analyzer/avd_n_analyzer_genotype_list_item.hh
+#    analyzer/avd_n_analyzer_genotype_list_item_proto.hh
+#    analyzer/avd_n_analyzer_genotype_sel_ctrl.hh
+#    analyzer/avd_n_analyzer_genotype_sel_view.hh
+#    analyzer/avd_n_analyzer_listview.hh
+#    analyzer/avd_n_analyzer_mdl.hh
+#    analyzer/avd_n_analyzer_mdl_proto.hh
+#    analyzer/avd_n_analyzer_menubar_handler.hh
+#    analyzer/avd_n_analyzer_out_fmt_sel.hh
+#    analyzer/avd_n_analyzer_view.hh
+#    analyzer_o/avd_analyzer_batchlist_item.hh
+#    analyzer_o/avd_analyzer_batchlist_item_proto.hh
+#    analyzer_o/avd_analyzer_controller.hh
+#    analyzer_o/avd_analyzer_controller_data.hh
+#    analyzer_o/avd_analyzer_creator.hh
+#    analyzer_o/avd_analyzer_data_entry.hh
+#    analyzer_o/avd_analyzer_data_entry_command_list_item.hh
+#    analyzer_o/avd_analyzer_data_entry_command_list_item_proto.hh
+#    analyzer_o/avd_analyzer_data_entry_proto.hh
+#    analyzer_o/avd_analyzer_dbg_msgs.hh
+#    analyzer_o/avd_analyzer_dbg_msgs_proto.hh
+#    analyzer_o/avd_analyzer_genotype_list_item.hh
+#    analyzer_o/avd_analyzer_genotype_list_item_proto.hh
+#    analyzer_o/avd_analyzer_listview.hh
+#    analyzer_o/avd_analyzer_listview_proto.hh
+#    analyzer_o/avd_analyzer_menubar_handler.hh
+#    analyzer_o/avd_analyzer_model.hh
+#    analyzer_o/avd_analyzer_model_proto.hh
+#    analyzer_o/avd_analyzer_output_fmt_selector.hh
+#    analyzer_o/avd_analyzer_utils.hh
+#    analyzer_o/avd_analyzer_view.hh
+#    containers/tRetainable_list.hh
+#    containers/tRetainable_list_proto.hh
+#    containers/tRList.hh
+#    containers/tRList_proto.hh
+#    dumb_gui/avd_dumb_ctrl.hh
+#    dumb_gui/avd_dumb_gui_dbg.hh
+#    dumb_gui/avd_dumb_gui_dbg_proto.hh
+#    dumb_gui/avd_dumb_view.hh
+#    exp_gui/avd_exp_ctrl.hh
+#    exp_gui/avd_exp_gui_dbg.hh
+#    exp_gui/avd_exp_gui_dbg_proto.hh
+#    exp_gui/avd_exp_view.hh
+#    exp_gui/test_thing.hh
+#    exp_gui/test_thing_proto.hh
+#    exp_gui/testing_interface.hh
+#    gui_factory/avd_abstract_gui.hh
+#    gui_factory/avd_abstract_gui_proto.hh
+#    gui_factory/avd_gui_factory.hh
+#    gui_factory/avd_gui_factory_error_policy.hh
+#    gui_factory/avd_gui_factory_proto.hh
+#    gui_factory/tGUI.hh
+#    gui_factory/tGUI_proto.hh
+#    map_gui/avd_map_canvas.hh
+#    map_gui/avd_map_canvas_rectangle.hh
+#    map_gui/avd_map_canvas_rectangle_proto.hh
+#    map_gui/avd_map_canvas_view.hh
+#    map_gui/avd_map_ctrl.hh
+#    map_gui/avd_map_gui_dbg.hh
+#    map_gui/avd_map_gui_dbg_proto.hh
+#    map_gui/avd_map_layer.hh
+#    map_gui/avd_map_layer_proto.hh
+#    map_gui/avd_map_view.hh
+#    mc/attributes/requests_argv.hh
+#    mc/avd_avida_state_mediator.hh
+#    mc/avd_connections.hh
+#    mc/avd_gui_factory_mediator.hh
+#    mc/avd_mc_dbg.hh
+#    mc/avd_mc_dbg_proto.hh
+#    mc/avd_mc_mediator.hh
+#    mc/avd_menubar_mediator.hh
+#    mc/avd_mission_control.hh
+#    mc/avd_settings_mediator.hh
+#    mc/avd_windows_mediator.hh
+#    mc/setup_avida.hh
+    memory_mgt/activate_watcher.hh
+    memory_mgt/activate_watcher_proto.hh
+    memory_mgt/retainable.hh
+    memory_mgt/retainable_dbg.hh
+    memory_mgt/retainable_dbg_proto.hh
+    memory_mgt/retainable_proto.hh
+    memory_mgt/watch_retains.hh
+    memory_mgt/watch_retains_proto.hh
+#    menubar/avd_menubar_handler.hh
+#    preferences/avd_prefs_ctrl.hh
+#    preferences/avd_prefs_dbg.hh
+#    preferences/avd_prefs_dbg_proto.hh
+#    preferences/avd_prefs_item.hh
+#    preferences/avd_prefs_item_proto.hh
+#    preferences/avd_prefs_item_view.hh
+#    preferences/avd_prefs_item_view_proto.hh
+#    preferences/avd_prefs_view.hh
+#    prefs_gui_factory/avd_abstract_prefs_gui.hh
+#    prefs_gui_factory/avd_abstract_prefs_gui_proto.hh
+#    prefs_gui_factory/avd_prefs_gui_factory.hh
+#    prefs_gui_factory/avd_prefs_gui_factory_error_policy.hh
+#    prefs_gui_factory/avd_prefs_gui_factory_proto.hh
+#    prefs_gui_factory/tPrefsGUI.hh
+#    prefs_gui_factory/tPrefsGUI_proto.hh
+#    threaded_driver/avd_avida_driver.hh
+#    threaded_driver/avd_avida_thread_drvr_dbg.hh
+#    threaded_driver/avd_avida_thread_drvr_dbg_proto.hh
+#    threaded_driver/avd_gui_msg_event.hh
+#    threaded_driver/avd_orig_driver_controller.hh
+#    user_msg/avd_message_display.hh
+#    user_msg/avd_message_display_proto.hh
+#    user_msg/avd_message_display_typetrack.hh
+#    user_msg/avd_message_display_typetrack_proto.hh
+#    user_msg/avd_user_msg_ctrl.hh
+#    user_msg/avd_user_msg_ctrl_funct.hh
+#    user_msg/avd_user_msg_ctrl_funct_proto.hh
+#    user_msg/avd_user_msg_gui_dbg.hh
+#    user_msg/avd_user_msg_gui_dbg_proto.hh
+#    user_msg/avd_user_msg_prefs_ctrl.hh
+#    user_msg/avd_user_msg_prefs_view.hh
+#    user_msg/avd_user_msg_view.hh
+  )
+  
+#  SET(libxqtviewer_ui_a_UI_SOURCES
+#  )
+  
+  QT_WRAP_CPP(xqtviewer_moc
+    libxqtviewer_moc_a_SOURCES
+    libxqtviewer_moc_a_MOC_SOURCES
+  )
+#  QT_WRAP_UI(xqtviewer_ui
+#    libxqtviewer_ui_a_HEADERS
+#    libxqtviewer_ui_a_SOURCES
+#    libxqtviewer_ui_a_UI_SOURCES
+#  )
+  ADD_LIBRARY(xqtviewer_moc ${libxqtviewer_moc_a_SOURCES})
+#  ADD_LIBRARY(xqtviewer_ui ${libxqtviewer_ui_a_SOURCES})
+  ADD_LIBRARY(xqtviewer ${libxqtviewer_a_SOURCES})
+  
+  SET(Avida_SOURCES main.cc)
+  SET(Avida_LIBRARIES
+    xqtviewer
+    main
+    cpu
+    event
+    main
+    tools
+    trio
+    xqtviewer_moc
+#    xqtviewer_ui
+    ${QT_LIBRARIES}
+  )
+#  CREATE_QT_EXECUTABLE(Avida Avida_SOURCES Avida_LIBRARIES /)
+ENDIF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+
+SET(EXECUTABLE_OUTPUT_PATH "")
+
+IF(_UNIT_TEST_QT_EXP_GUI AND _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+  INCLUDE_DIRECTORIES(
+    ${ALL_INC_DIRS}
+    ${GUI_SRC_DIR}
+    ${THIRDPARTY_SRC_DIR}/Loki
+    ${THIRDPARTY_SRC_DIR}/trio
+    ${THIRDPARTY_SRC_DIR}/yaktest
+    ${QT_INCLUDE_DIR}
+    ${QT_INCLUDE_PATH}
+    .
+  )
+  LINK_DIRECTORIES(
+    ${ALL_LIB_DIRS}
+    ${THIRDPARTY_BLD_DIR}/trio
+    ${THIRDPARTY_BLD_DIR}/yaktest
+    .
+  )
+
+  SET(TESTSUITES
+  	template_t
+  	template2_t
+  ) 
+  STRING(REGEX REPLACE _t _t.hh\; TESTSUITE_MOCSRCS ${TESTSUITES})
+  SET(libxqtunittest_a_SOURCES
+    xqt_test_case.cc
+  )
+  SET(libxqtunittest_moc_a_MOC_SOURCES
+    xqt_test_case.hh
+    ${TESTSUITE_MOCSRCS}
+  )
+  QT_WRAP_CPP(xqtunittest_moc
+    libxqtunittest_moc_a_SOURCES
+    libxqtunittest_moc_a_MOC_SOURCES
+  )
+  ADD_LIBRARY(xqtunittest_moc ${libxqtunittest_moc_a_SOURCES})
+  ADD_LIBRARY(xqtunittest ${libxqtunittest_a_SOURCES})
+
+  FOREACH(TESTSUITE ${TESTSUITES})
+    ADD_EXECUTABLE(${TESTSUITE} ${TESTSUITE}.cc)
+    TARGET_LINK_LIBRARIES(${TESTSUITE}
+      xqtviewer
+      main
+      cpu
+      event
+      main
+      tools
+      yaktest
+      xqtviewer_moc
+#      xqtviewer_ui
+      xqtunittest
+      xqtunittest_moc
+      ${QT_LIBRARIES}
+    )
+    ADD_TEST(${TESTSUITE} ${TESTSUITE})
+  ENDFOREACH(TESTSUITE)
+ENDIF(_UNIT_TEST_QT_EXP_GUI AND _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+
Index: avida/current/source/qt-viewer/exp/exp_cleanup/Makefile.am
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/Makefile.am:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/Makefile.am	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,30 @@
+
+BUILT_SOURCES = exp_cleanup.qmakefile
+
+QMAKE_OPTIONS=
+
+QMAKE_OPTIONS+="AT_SRCDIR=$(srcdir)"
+QMAKE_OPTIONS+="AT_BINDIR=$(bindir)"
+QMAKE_OPTIONS+="AT_DATADIR=$(datadir)"
+QMAKE_OPTIONS+="AT_PWD=`pwd`"
+
+exp_cleanup.qmakefile: exp_cleanup.pro Makefile.am
+	test x$(QMAKE) = x && (echo "can't continue; QMAKE unset."; exit 1) \
+	|| $(QMAKE) $(QMAKE_OPTIONS) -o $@ $<
+cPopulation_enums_auto.ci: $(srcdir)/../../../event/cPopulation.events
+	perl $(srcdir)/../../../event/make_events.pl $(<:%.events=%)
+exp_cleanup: exp_cleanup.qmakefile cPopulation_enums_auto.ci FORCE
+	echo "srcdir: $(srcdir)"
+	${MAKE} -f exp_cleanup.qmakefile
+.PHONY: FORCE
+
+mostlyclean-local:
+	make -f exp_cleanup.qmakefile clean
+clean-local:
+	make -f exp_cleanup.qmakefile distclean
+distclean-local:
+	rm -f exp_cleanup.qmakefile
+
+bin_PROGRAMS = exp_cleanup
+qt_viewer_SOURCES =
+
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_cleanup.pro
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_cleanup.pro:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_cleanup.pro	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,59 @@
+
+TEMPLATE = app
+TARGET = exp_cleanup
+DESTDIR = ../../../../work
+
+# These options configure Qt. We rely on Qt graphics and multithreading,
+# so 'qt' and 'thread' are required.
+#CONFIG *= qt thread debug
+CONFIG *= qt thread
+# Custom-options that are defined in this file.
+#CONFIG *= gprof
+# These are required modules from avida proper (the core source code).
+CONFIG *= cpu event loki main trio tools
+# These modules are needed by the user interface.
+CONFIG *= user_msg containers gui_factory mc memory_mgt menubar
+CONFIG *= threaded_driver preferences prefs_gui_factory
+# These are optional user interface elements.
+CONFIG *= analyzer analyzer_o dumb_gui exp_gui map_gui
+
+# These must be conditional on platform type.  If they are active under
+# MacOSX then the installation breaks.
+win32 {
+CONFIG	+= console
+QMAKE_LFLAGS_CONSOLE += /FORCE:MULTIPLE
+}
+
+# The 'Loki' template library lets you use long-double data types, but
+# some compilers warn that the size of long-double can change.  This
+# disables the warning under MacOSX.
+macx {
+QMAKE_CXXFLAGS_THREAD += -Wno-long-double
+}
+
+# Asks compiler and linker to generate extra code to write profile
+# information suitable for the analysis program "gprof".
+gprof {
+QMAKE_CXXFLAGS_THREAD += -pg
+QMAKE_LFLAGS_THREAD += -pg
+}
+
+# This tells qmake where to store intermediate code (to keep your source
+# tree clean).
+MOC_DIR = moc
+OBJECTS_DIR = objs
+UI_DIR = ui
+
+# These are paths to qmake-include files that tell qmake where to find
+# source code for the various software modules.
+#AVIDA_SRC_DIR = ../current/source
+AVIDA_SRC_DIR = ../../..
+EXP_AVIDA_SRC_DIR = .
+include($$EXP_AVIDA_SRC_DIR/modules.pri)
+
+
+HEADERS +=
+INTERFACES +=
+SOURCES += main.cc
+
+# arch-tag: qmake file for qt-viewer
Index: avida/current/source/qt-viewer/exp/exp_cleanup/main.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/main.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/main.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,49 @@
+#include <iostream>
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef AVD_MISSION_CONTROL_HH
+#include "mc/avd_mission_control.hh"
+#endif
+#ifndef WATCH_RETAINS_HH
+#include "memory_mgt/watch_retains.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+class cRetainableTest : public cRetainable {};
+
+int main( int argc, char **argv ){
+  avdDebug("in.");
+  cWatchRetains retain_watch;
+  cRetainableTest *retainable_test = new cRetainableTest;
+  if(retainable_test){
+    retainable_test->nameWatched("(cRetainableTest) this memory leak is on purpose.");
+  } else {
+    avdError
+    << "Couldn't allocate \"cRetainableTest\" object.\n"
+    << "Normally this object, once created, is never destroyed; it\n"
+    << "creates a small memory leak which, hopefully,\n"
+    << "the memory management system will detect.\n";
+  }
+  retain_watch.nameWatched("<main(retain_watch)>");
+  QApplication app( argc, argv );
+  avdMissionControl *mc = new avdMissionControl(argc, argv, 0, "<main(mc)>");
+  if(!mc)
+    avdFatal
+    << "Couldn't allocate \"avdMissionControl\" object.\n"
+    << "Normally that object manages the construction of the remainder\n"
+    << "of this program, including the graphic user interface and\n"
+    << "the processing part of Avida.  Since the object couldn't be\n"
+    << "created, this program has to abort.";
+  mc->nameWatched("<main(mc)>");
+  app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
+  int result = app.exec();
+  mc->release();
+  avdDebug("out.");
+  return result;
+}
+
+// arch-tag: implementation file for main function
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/modules.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/modules.pri:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/modules.pri	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,79 @@
+
+ANALYZER_CC           = $$EXP_AVIDA_SRC_DIR/analyzer
+ANALYZER_O_CC         = $$EXP_AVIDA_SRC_DIR/analyzer_o
+CONTAINERS_CC         = $$EXP_AVIDA_SRC_DIR/containers
+DUMB_GUI_CC           = $$EXP_AVIDA_SRC_DIR/dumb_gui
+EXP_GUI_CC            = $$EXP_AVIDA_SRC_DIR/exp_gui
+EXP_MAIN_CC           = $$EXP_AVIDA_SRC_DIR/exp_main
+GUI_FACTORY_CC        = $$EXP_AVIDA_SRC_DIR/gui_factory
+LOKI_CC               = $$EXP_AVIDA_SRC_DIR/third-party/Loki
+MAP_GUI_CC            = $$EXP_AVIDA_SRC_DIR/map_gui
+MC_CC                 = $$EXP_AVIDA_SRC_DIR/mc
+MEMORY_MGT_CC         = $$EXP_AVIDA_SRC_DIR/memory_mgt
+MENUBAR_CC            = $$EXP_AVIDA_SRC_DIR/menubar
+PREFERENCES_CC        = $$EXP_AVIDA_SRC_DIR/preferences
+PREFS_GUI_FACTORY_CC  = $$EXP_AVIDA_SRC_DIR/prefs_gui_factory
+THREADED_DRIVER_CC    = $$EXP_AVIDA_SRC_DIR/threaded_driver
+USER_MSG_CC           = $$EXP_AVIDA_SRC_DIR/user_msg
+
+CPU_CC    = $$AVIDA_SRC_DIR/cpu
+EVENT_CC  = $$AVIDA_SRC_DIR/event
+MAIN_CC   = $$AVIDA_SRC_DIR/main
+TRIO_C    = $$AVIDA_SRC_DIR/third-party/trio-1.9
+TOOLS_CC  = $$AVIDA_SRC_DIR/tools
+SUPPORT_CC= $$AVIDA_SRC_DIR/support
+DOC_CC	  = $$AVIDA_SRC_DIR/../doc
+
+ANALYZER_HH           = $$ANALYZER_CC
+ANALYZER_O_HH         = $$ANALYZER_O_CC
+CONTAINERS_HH         = $$CONTAINERS_CC
+DUMB_GUI_HH           = $$DUMB_GUI_CC
+EXP_GUI_HH            = $$EXP_GUI_CC
+GUI_FACTORY_HH        = $$GUI_FACTORY_CC
+LOKI_HH               = $$LOKI_CC
+MAP_GUI_HH            = $$MAP_GUI_CC
+MC_HH                 = $$MC_CC
+MEMORY_MGT_HH         = $$MEMORY_MGT_CC
+MENUBAR_HH            = $$MENUBAR_CC
+PREFERENCES_HH        = $$PREFERENCES_CC
+PREFS_GUI_FACTORY_HH  = $$PREFS_GUI_FACTORY_CC
+THREADED_DRIVER_HH    = $$THREADED_DRIVER_CC
+USER_MSG_HH           = $$USER_MSG_CC
+
+CPU_HH    = $$CPU_CC
+EVENT_HH  = $$EVENT_CC
+MAIN_HH   = $$MAIN_CC
+TRIO_H    = $$TRIO_C
+TOOLS_HH  = $$TOOLS_CC
+SUPPORT_HH= $$SUPPORT_CC
+DOC_HH 	  = $$DOC_CC
+
+include($$ANALYZER_CC/analyzer.pri)
+include($$ANALYZER_O_CC/analyzer_o.pri)
+include($$CONTAINERS_CC/containers.pri)
+include($$DUMB_GUI_CC/dumb_gui.pri)
+include($$EXP_GUI_CC/exp_gui.pri)
+include($$GUI_FACTORY_CC/gui_factory.pri)
+include($$MAP_GUI_CC/map_gui.pri)
+include($$MC_CC/mc.pri)
+include($$MEMORY_MGT_CC/memory_mgt.pri)
+include($$MENUBAR_CC/menubar.pri)
+include($$PREFERENCES_CC/preferences.pri)
+include($$PREFS_GUI_FACTORY_CC/prefs_gui_factory.pri)
+include($$THREADED_DRIVER_CC/threaded_driver.pri)
+include($$USER_MSG_CC/user_msg.pri)
+
+include($$CPU_CC/cpu.pri)
+include($$EVENT_CC/event.pri)
+include($$LOKI_CC/Loki.pri)
+include($$MAIN_CC/main_sub.pri)
+include($$TRIO_C/trio.pri)
+include($$TOOLS_CC/tools.pri)
+include($$SUPPORT_CC/support.pri)
+include($$DOC_CC/doc.pri)
+
+DEPENDPATH += ;$$AVIDA_SRC_DIR
+
+INCLUDEPATH += $$DEPENDPATH
+
+# arch-tag: qmake include file include other qmake module include files
Index: avida/current/source/qt-viewer/exp/exp_cleanup/notes
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/notes:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/notes	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,404 @@
+
+user_msg_ctrl error conditions:
+- avdUserMsgCtrl()
+  - new avdUserMsgView() returns null
+  - new avdUserMsgDply() returns null
+- ~avdUserMsgCtrl()
+  - none
+- setup()
+  - getView() returns null
+- showUserMsgGUISlot()
+  - getView() returns null
+
+analyzer/avd_n_analyzer_ctrl.cc
+dumb_gui/avd_dumb_gui.cc
+exp_gui/avd_exp_ctrl.cc
+map_gui/avd_map_ctrl.cc
+menubar/avd_menubar_handler.cc
+preferences/avd_prefs_ctrl.cc
+threaded_driver/avd_orig_driver_controller.cc
+user_msg/avd_user_msg_ctrl.cc
+analyzer_o/avd_analyzer_controller.cc
+
+***
+
+Error-handling improvements:
+- main XX
+- user_msg
+  - avd_message_display.cc XX
+  - avd_message_display.hh XX
+  - avd_message_display_proto.hh XX
+  - avd_message_display_typetrack.hh XX
+  - avd_message_display_typetrack_proto.hh XX
+  - avd_qstr_message_display.cc XX
+  - avd_user_msg_ctrl.cc
+  - avd_user_msg_ctrl.hh
+  - avd_user_msg_ctrl_funct.hh
+  - avd_user_msg_ctrl_funct_proto.hh
+  - avd_user_msg_gui.cc
+  - avd_user_msg_gui_dbg.hh
+  - avd_user_msg_gui_dbg_proto.hh
+  - avd_user_msg_prefs_ctrl.cc
+  - avd_user_msg_prefs_ctrl.hh
+  - avd_user_msg_prefs_gui.cc
+  - avd_user_msg_prefs_view.cc
+  - avd_user_msg_prefs_view.hh
+  - avd_user_msg_view.cc
+  - avd_user_msg_view.hh
+  - gui_message_display.cc
+- memory_mgt
+- containers
+- mc
+- threaded_driver
+- gui_factory
+- menubar
+- dumb_gui
+- exp_gui
+- prefs_gui_factory
+- preferences
+- map_gui
+- analyzer
+- analyzer_o
+
+***
+
+speciesid: genotype->GetSpecies()->GetID()
+fitness: phenotype->GetFitness()
+gestation_time: phenotype->GetGestationTime()
+CPU Speed: phenotype->GetMerit()
+cur_merit:
+  cMerit(phenotype.GetCurBonus()).GetDouble()
+Genome Size: genotype ? genotype->GetLength() : 0
+mem size: hardware.GetMemory().GetSize()
+
+Facing:
+  id = cell->ConnectionList().GetFirst()->GetID()...
+
+Generation: phen.GetGeneration()
+Age: phen.GetAge()
+Executed: phen.GetTimeUsed()
+LastDivide: phen.GetGestationStart()
+Offspring: phen.GetNumDivides()
+
+***
+
+there may be many many tasks;
+use a mechanism similar to stacks display to show lots of them in the
+widget.  each line must be an editable field.
+
+***
+
+Leak-tracking.
+  Requires new message tracking sys.
+    Requires Loki **
+New Zoom data.
+New Stats data.
+
+***
+
+Component Zoom is prepped in cZoomScreen::DrawCPU_Original()
+
+cZoomScreen::DrawCPU_Original() is called by cZoomScreen::Draw()
+
+***
+
+Aspects of a map layer:
+- from-to color pair
+- rgba vs. hsva
+  - for hsva, clockwise vs. counterclockwise
+- log vs. linear scaling
+- endpoints: max/min vs. auto
+  - for auto, hysteresis
+
+***
+
+- Basic map layer
+  - takes canvas, cPopulation as params
+  - original cellviewer stores cPopulationCell pointers
+- Basic canvasItem
+  - model after old MapViewCellEntry
+- Basic retainable canvasView
+
+***
+
+I have no idea how to implement toroidal world wrapping.  Possibilities
+include
+- moving all QCanvasItems, and wrapping when they fall off of the edge.
+- Overdrawing everything (four times, once for each quadrant) and
+  reorienting QCanvasViews.
+  - This requires some hacks on the QScrollView part of the QCanvasViews
+    to make the apparent viewport have 1/2 dimensions of actual
+    viewport.
+    - Don't know how I'll go about that if I try it.
+
+Can't think of a good way to use one canvase as the background of
+another, other than to draw the first canvas to a pixmap, then use that
+pixmap as the background for the other.
+
+What needs for Map Items?
+- Enough info to know whether color update is needed
+  - Might as well update whenever cell id organism is modified
+- To store or not store associated cell id / organism ?
+
+Map layer properties:
+- What kind of color transition to use
+- Coloring function
+- Opacity
+- Map layer position
+- Visibility
+- Name
+- Color Scales
+
+
+- Map zoom
+- Map center
+- Panning widget?
+
+- Associate cell viewer with particular map?
+
+***
+
+Need a QCanvas, QCanvasView per map.
+
+Need to be able to set map controller's population pointer.
+
+The old map viewer had access to cPopulation and selected cell id (int).
+It seems access to cPopulation should be enough to draw and update the
+map.
+- cPopulation can be got using cPopulationInterface::GetPopulation(),
+  and the threaded driver ctrl has accessor
+  avdAvidaThreadCtrl::getPopulationInterface().
+- Looks like I should not use cPopulationInterface::GetCellID(), but
+  instead use a sep. cell-id tracking var in the GUI.
+
+***
+
+new stable and unstable branches.
+regular testing across all three platforms.
+notify evan so he can link new releases into home page. 
+a list of stable features in the main branch.
+regular stable releases.
+
+***
+
+Q:  how do I know which cols are already displayed?  why do I have both
+of col. names and m_data_entry_cmd_list?
+
+***
+
+retainable versions of:
+- avdAnalyzerDataEntryBase,
+  - avdAnalyzerDataEntry
+  - avdAnalyzerArgDataEntry
+- avdAnalyzerDataEntryCommand,
+- cAnalyzeGenotype,
+- NOT cGenotypeBatch, 
+
+Plan for analyzer:
+- add m_batch_id_ctr [this is incremented every time a new batch is
+  loaded]
+- loadHistoricGenotypesSlot()
+
+***
+
+The problem:
+  settings data is required at multiple places, but manipulated in one
+  place.  How to get only the altered settings, rather than reading them
+  all from disk when a single setting changes?
+
+  !!! use functors to broadcast changes!
+  * works well.  <whew.>
+
+***
+
+Settings propogation options
+- could write to and read from disk, and emit "settingsChangedSig" or
+  "FooSettingsChangedSig".
+  - advantage:  this goes far in decoupling.
+  - 
+- could write an "avdFooSettings" singleton class.  Ugly.  I don't like
+  so many statics.
+- could just write an "avdFooSettings" class.
+
+This is pointless.  Just use the first option via QSettings.  This
+paradigm requires that prefs guis be created last.
+
+- could also set a whole bunch of mediator signals.  Place settings code
+  only in the prefs sections.  This means that the prefs guis have to be
+  created early.  It also means that other gui elements must request
+  prefs via the mediator system.
+  - advantage: compile-time errors.
+  - disadvantage: lots of extra coding.  
+
+***
+
+Suggestions from Elizabeth:
+- Problems with genotypes view:  you can't even see the dominant
+  organism!
+- General defaults unreasonable
+  - overhigh mutation rates
+  - environment file has rewards factored as powers
+  - birth method set.
+- viewer doesn't give numbers of updates
+- plots:
+  - osx lacks plot axis labels
+  - plots lose data when all plot windows are closed
+  - windows labels have update problems
+
+***
+
+- Another rewrite of the driver,
+  - 
+- rewrite of connections to and from mission control,
+  - split-out pieces.  (what pieces?)
+    - currently does...:
+      - triggers gui factory in response to menu commands
+      - owns and starts the driver
+      - starts the initial gui element
+      - serves as a message-center
+      - owns the mutex, and provides locking services.
+      - currently directly handles creation of old gui elements
+
+  - I could provide each gui with driver references, and mutex
+    references.
+  - or maybe remove information about the driver... Just connect signals
+    from the driver to signals in the gui,
+    and provide a reference to a limited interface to the driver:
+    - just the cAvidaDriver_Population aspect?
+      - no.  also add:
+        - accessors to
+          - cPopulation *population,
+          - cEventFactoryManager *event_manager
+          - cEventList *event_list
+          - QMutex *m_mutex
+    - I still need a way for guis to communicate with each other...
+      - one way is to create connections for them, so they never know
+        who is connected to them.  The disadvantage is requirement that
+        all available signals be connected.
+      - the second is to provide the same mechanism as before, i.e., a
+        messaging center to which they can connect any way that they
+        want.
+
+    - summary:
+      - provide reference to driver using limited interface (accessors
+        only):
+        - cPopulation *population,
+        - cEventFactoryManager *event_manager
+        - cEventList *event_list
+        - QMutex *m_mutex
+      - provide a cGUIMediator class to handle communication using
+        signals:
+          changeAvidaState
+          avidaStateChanged
+
+***
+
+Idea: For reach QMainWindow, pass its QMenuBar to a menu initialization
+object.
+- But do that later.
+
+Step: See how to enter analyze mode.  Make a dumb controller.
+
+MissionControl:
+- calls avd_GUIFactory::Instance().CreateObject("<key>");
+
+so:
+- Menu->MenuItemForGUIPart
+  - Triggers a signal
+    - Somebody catches the signal
+      - Tells MissionControl to create
+
+***
+
+Q: How can I recycle the interactive mode of Analyze mode?
+- Observation:  There are as yet no Flow commands required.
+- I can keep a list of in-use and available cGenotypeBatches. 
+
+- I can test by entering interactive mode at the console, and then
+  "updating" via a button.
+
+How do I load a batch?
+- interface to commands 
+  - LOAD_ORGANISM [filename]
+  - LOAD_BASE_DUMP [filename]
+  - LOAD_DETAIL_DUMP [filename]
+  - LOAD_SEQUENCE [sequence]
+
+Where is batch name stored?
+- cString name at line 349 of analyze.hh.
+
+Where/when are batches named?
+- initially (i.e., in cAnalyze::cAnalyze) each batch i is named
+  "Batchi".
+
+Try to load and display a batch.
+- Each batch corresponds to an entry in the left-hand column.
+
+***
+
+Re:  Local menus handled by the GUI Factory singleton:
+- I can use chained functors to make connections to the local controller
+  object;
+- I can reuse the following snippet to connect to the Factory singleton:
+    avd_AbstractGUIController *gc =
+      avd_GUIFactory::Instance().CreateObject(controller_type);
+    if(m_menubar_handler && gc){
+      m_menubar_handler->setupMenuBar(gc->menuBar());
+      gc->wrapupInit();
+    }
+- The local controller must register the functor chain in its
+  constructor,
+- and it must unregister the functor chain in its destructor.
+- the batchviewer and the attribute selector should both be singleton
+  windows, maybe selectable using a Windows menu?
+
+***
+
+- Must store list of selected attributes
+- Must keep list in sync with view
+  - on adding to view, also add to list
+  - on deleting from view, also delete from list
+    - how to delete?  delete key?  how to detect?
+  - on creating view, load items from list
+
+- column corresponding to fmt
+- quick way of checking to see whether something exists before adding
+  it?
+
+- or just clear, and redraw?
+
+---
+
+Display of properties
+- sortable
+- headers movable
+- order or headers is independant of sort order
+  - determined by order of storage in analyze class
+  - addition of new fields to display causes them to be added at end.
+Q: what happens when you add a field?
+Q: when headers are moved, and the field indices are reordered, how do I
+know which columns should hold which field-data?
+
+Order of construction:
+- able to select fields to display.
+  - must also be able to add/remove fields.
+    - must keep track of col/field relationship.
+  - for now, when the field list changes, redraw the whole table.
+
+needs: translation from field to column
+...
+
+***
+
+Better ways of opening each of the viewers?
+- map
+- instruction
+- event editor
+- godbox
+- plots
+- help
+- settings
+
+***
+***
+arch-tag: avida gui development notes to myself.
Index: avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,13 @@
+#ifndef TEMPLATE2_T_HH
+#include "template2_t.hh"
+#endif
+
+int main(int argc, char *argv[]){
+  std::cout << std::endl 
+  << "----------------------------------------" << std::endl
+  << "Testing Template2." << std::endl;
+  nDemoTestsuite2::cTestSuite t(argc, argv);
+  t.run_test();
+  std::cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/template2_t.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,85 @@
+#ifndef TEMPLATE2_T_HH
+#define TEMPLATE2_T_HH
+
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#include <iostream>
+
+class myWidget2 : public QWidget {
+Q_OBJECT
+public:
+  QPushButton *m_pb;
+  explicit myWidget2(QWidget *parent = 0, const char *name = 0, WFlags f = 0)
+  : QWidget(parent, name, f), m_pb(0)
+  {
+    QVBoxLayout *layout = new QVBoxLayout(this, 10, -1, "<myWidget(layout)>");
+    m_pb = new QPushButton("foo", this, "<myWidget::m_pb>");
+    layout->addWidget(m_pb);
+    connect(m_pb, SIGNAL(clicked()), this, SIGNAL(clicked()));
+  }
+signals:
+  void clicked();
+};
+
+class cTemplate2Test : public cXQtTestCase {
+Q_OBJECT
+protected:
+  myWidget2 *m_w;
+public:
+  cTemplate2Test(int argc, char **argv) : cXQtTestCase(argc, argv) { }
+public slots:
+  void buttonClicked(){
+    resetDeadMan();
+    std::cout << "buttonClicked..." << std::endl;
+    test_is_true(true);
+    restartTimer();
+  }
+public:
+  virtual void test() {
+    m_w = new myWidget2(0, "<cTemplateTest::(myWidget *)m_w>", 0);
+    m_w->show(); m_w->raise();
+    connect(m_w, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+
+    tFunctor twiddle_functor(this, &cXQtTestCase::twiddle);
+    tFunctor click_functor(m_w->m_pb, &QPushButton::animateClick);
+
+    pushFunctor(twiddle_functor);
+    pushFunctor(twiddle_functor);
+    pushFunctor(click_functor);
+
+    execApp();
+
+    if(m_w){ delete m_w; m_w = 0; }
+  }
+};
+
+namespace nDemoTestsuite2 {
+  class cTestSuite : public test_case {
+  public: cTestSuite(int argc, char **argv) : test_case() {
+    adopt_test_case(new cTemplate2Test(argc, argv)); 
+  } };
+}
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup/template_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/template_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/template_t.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,13 @@
+#ifndef TEMPLATE_T_HH
+#include "template_t.hh"
+#endif
+
+int main(int argc, char *argv[]){
+  std::cout << std::endl 
+  << "----------------------------------------" << std::endl
+  << "Testing Template." << std::endl;
+  nDemoTestsuite::cTestSuite t(argc, argv);
+  t.run_test();
+  std::cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup/template_t.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/template_t.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/template_t.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,85 @@
+#ifndef TEMPLATE_T_HH
+#define TEMPLATE_T_HH
+
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#include <iostream>
+
+class myWidget : public QWidget {
+Q_OBJECT
+public:
+  QPushButton *m_pb;
+  explicit myWidget(QWidget *parent = 0, const char *name = 0, WFlags f = 0)
+  : QWidget(parent, name, f), m_pb(0)
+  {
+    QVBoxLayout *layout = new QVBoxLayout(this, 10, -1, "<myWidget(layout)>");
+    m_pb = new QPushButton("foo", this, "<myWidget::m_pb>");
+    layout->addWidget(m_pb);
+    connect(m_pb, SIGNAL(clicked()), this, SIGNAL(clicked()));
+  }
+signals:
+  void clicked();
+};
+
+class cTemplateTest : public cXQtTestCase {
+Q_OBJECT
+protected:
+  myWidget *m_w;
+public:
+  cTemplateTest(int argc, char **argv) : cXQtTestCase(argc, argv) { }
+public slots:
+  void buttonClicked(){
+    resetDeadMan();
+    std::cout << "buttonClicked..." << std::endl;
+    test_is_true(true);
+    restartTimer();
+  }
+public:
+  virtual void test() {
+    m_w = new myWidget(0, "<cTemplateTest::(myWidget *)m_w>", 0);
+    m_w->show(); m_w->raise();
+    connect(m_w, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+
+    tFunctor twiddle_functor(this, &cXQtTestCase::twiddle);
+    tFunctor click_functor(m_w->m_pb, &QPushButton::animateClick);
+
+    pushFunctor(twiddle_functor);
+    pushFunctor(twiddle_functor);
+    pushFunctor(click_functor);
+
+    execApp();
+
+    if(m_w){ delete m_w; m_w = 0; }
+  }
+};
+
+namespace nDemoTestsuite {
+  class cTestSuite : public test_case {
+  public: cTestSuite(int argc, char **argv) : test_case() {
+    adopt_test_case(new cTemplateTest(argc, argv)); 
+  } };
+}
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,64 @@
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QTIMER_H
+#include <qtimer.h>
+#endif
+
+cXQtTestCase::cXQtTestCase(int argc, char **argv)
+: QObject(0, "<cXQtTestCase>")
+, m_a(0)
+, m_t(0)
+, m_deadman(0)
+, m_argc(argc)
+, m_argv(argv)
+{
+  m_a = new QApplication(m_argc, m_argv);
+  m_t = new QTimer(this);
+  connect(m_t, SIGNAL(timeout()), this, SLOT(testDriver()));
+  m_deadman = new QTimer(this);
+  connect(m_deadman, SIGNAL(timeout()), this, SLOT(timeOut()));
+}
+cXQtTestCase::~cXQtTestCase(){
+  if(m_deadman){ delete m_deadman; m_deadman = 0; }
+  if(m_t){ delete m_t; m_t = 0; }
+  if(m_a){ delete m_a; m_a = 0; }
+}
+void cXQtTestCase::restartTimer(int milliseconds, bool one_shot){
+  if(m_t) m_t->start(milliseconds, one_shot);
+}
+void cXQtTestCase::resetDeadMan(int milliseconds){
+  if(m_deadman) m_deadman->changeInterval(milliseconds);
+}
+int cXQtTestCase::execApp(){
+  restartTimer();
+  resetDeadMan();
+  return (m_a != 0)?(m_a->exec()):(1);
+}
+void cXQtTestCase::exitApp(int retval){
+  if (m_a != 0) m_a->exit(retval);
+}
+void cXQtTestCase::pushFunctor(tFunctor &functor){
+  m_functor_list.PushRear(&functor);
+}
+cXQtTestCase::tFunctor *cXQtTestCase::popFunctor(){
+  return m_functor_list.Pop();
+}
+void cXQtTestCase::twiddle(){
+  restartTimer();
+  qDebug("twiddling my thumbs...");
+  resetDeadMan();
+}
+void cXQtTestCase::timeOut(){
+  qWarning("ERROR: timed out while waiting for event to be triggered...");
+  test_non_error(false);
+  twiddle();
+}
+void cXQtTestCase::testDriver(){
+  if(tFunctor *functor = popFunctor()){ (*functor)(); }
+  else exitApp();
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/xqt_test_case.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,55 @@
+#ifndef XQT_TEST_CASE_HH
+#define XQT_TEST_CASE_HH
+
+#ifndef TLIST_HH
+#include "tList.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+/* XXX disables the Loki small-object allocator; it crashes under OSX10. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+#ifndef FUNCTOR_INC
+#include "third-party/Loki/Functor.h"
+#endif
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class QApplication;
+class QTimer;
+class cXQtTestCase : public QObject, public test_case {
+Q_OBJECT
+protected: // variables
+  typedef Loki::Functor<void> tFunctor;
+  tList<tFunctor> m_functor_list;
+  QApplication *m_a;
+  QTimer *m_t;
+  QTimer *m_deadman;
+  int m_argc;
+  char **m_argv;
+protected: // constructors/destructors
+  cXQtTestCase(int argc, char **argv);
+  ~cXQtTestCase();
+protected: // manipulators
+  void restartTimer(int milliseconds = 0, bool one_shot = true);
+  void resetDeadMan(int milliseconds = 5000);
+  int execApp();
+  void exitApp(int retval = 0);
+  void pushFunctor(tFunctor &functor);
+  tFunctor *popFunctor();
+protected slots:
+  virtual void twiddle();
+  virtual void timeOut();
+  virtual void testDriver();
+};
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/analyzer.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/analyzer.pri:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/analyzer.pri	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,35 @@
+
+analyzer {
+  HEADERS += \
+    $$ANALYZER_HH/avd_n_analyzer_ctrl.hh \
+    $$ANALYZER_HH/avd_n_analyzer_batchlist_item.hh \
+    $$ANALYZER_HH/avd_n_analyzer_batchlist_item_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_data_entry.hh \
+    $$ANALYZER_HH/avd_n_analyzer_data_entry_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_data_entry_command_list_item.hh \
+    $$ANALYZER_HH/avd_n_analyzer_data_entry_command_list_item_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_dbg_msgs.hh \
+    $$ANALYZER_HH/avd_n_analyzer_dbg_msgs_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_genotype_list_item.hh \
+    $$ANALYZER_HH/avd_n_analyzer_genotype_list_item_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_genotype_sel_view.hh \
+    $$ANALYZER_HH/avd_n_analyzer_mdl.hh \
+    $$ANALYZER_HH/avd_n_analyzer_mdl_proto.hh \
+    $$ANALYZER_HH/avd_n_analyzer_menubar_handler.hh \
+    $$ANALYZER_HH/avd_n_analyzer_listview.hh \
+    $$ANALYZER_HH/avd_n_analyzer_out_fmt_sel.hh \
+    $$ANALYZER_HH/avd_n_analyzer_view.hh
+
+  SOURCES += \
+    $$ANALYZER_CC/avd_n_analyzer_ctrl.cc \
+    $$ANALYZER_CC/avd_n_analyzer_data_entry_command_list_item.cc \
+    $$ANALYZER_CC/avd_n_analyzer_genotype_sel_view.cc \
+    $$ANALYZER_CC/avd_n_analyzer_gui.cc \
+    $$ANALYZER_HH/avd_n_analyzer_mdl.cc \
+    $$ANALYZER_CC/avd_n_analyzer_menubar_handler.cc \
+    $$ANALYZER_CC/avd_n_analyzer_listview.cc \
+    $$ANALYZER_CC/avd_n_analyzer_out_fmt_sel.cc \
+    $$ANALYZER_CC/avd_n_analyzer_view.cc
+}
+
+# arch-tag: qmake include file for analyzer module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_N_ANALYZER_BATCHLIST_ITEM_HH
+#define AVD_N_ANALYZER_BATCHLIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+#include "analyzer/avd_n_analyzer_batchlist_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer batchlist item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_batchlist_item_proto.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_N_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+#define AVD_N_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+
+
+class avdAnalyzerBatchListItem
+: public QCheckListItem, public cRetainable {
+protected:
+  const unsigned int m_batch_index;
+public:
+  avdAnalyzerBatchListItem(
+    int idx,
+    QListView *parent,
+    const QString &text
+  ):QCheckListItem(
+      parent,
+      text,
+      QCheckListItem::CheckBox
+    ),
+    m_batch_index(idx)
+  {}
+  const unsigned int getBatchIndex(void){ return m_batch_index; }
+};
+
+#endif
+
+// arch-tag: proto file for analyzer batchlist item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,652 @@
+#ifndef QCHECKBOX_H
+#include "qcheckbox.h"
+#endif
+#ifndef QFILEDIALOG_H
+#include <qfiledialog.h>
+#endif
+#ifndef QMESSAGEBOX_H
+#include <qmessagebox.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_BATCHLIST_ITEM_HH
+#include "analyzer/avd_n_analyzer_batchlist_item.hh"
+#endif
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "analyzer/avd_n_analyzer_data_entry_command_list_item.hh"
+#endif
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "analyzer/avd_n_analyzer_dbg_msgs.hh"
+#endif
+#ifndef AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_HH
+#include "analyzer/avd_n_analyzer_genotype_list_item.hh"
+#endif
+#ifndef AVD_N_ANALYZER_GENOTYPE_SEL_VIEW_HH
+#include "analyzer/avd_n_analyzer_genotype_sel_view.hh"
+#endif
+#ifndef AVD_N_ANALYZER_LISTVIEW_HH
+#include "analyzer/avd_n_analyzer_listview.hh"
+#endif
+#ifndef AVD_N_ANALYZER_MDL_HH
+#include "analyzer/avd_n_analyzer_mdl.hh"
+#endif
+#ifndef AVD_N_ANALYZER_MENUBAR_HANDLER_HH
+#include "analyzer/avd_n_analyzer_menubar_handler.hh"
+#endif  
+#ifndef AVD_N_ANALYZER_OUT_FMT_SEL_HH
+#include "analyzer/avd_n_analyzer_out_fmt_sel.hh"
+#endif
+#ifndef AVD_N_ANALYZER_VIEW_HH
+#include "analyzer/avd_n_analyzer_view.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_CTRL_HH
+#include "analyzer/avd_n_analyzer_ctrl.hh"
+#endif
+
+
+void avdAnalyzerCtrl::setGenotypeSelView(avdAnalyzerGenotypeSelView *view)
+{ SETretainable(m_gentype_sel, view); }
+void avdAnalyzerCtrl::setView(avdAnalyzerView *view)
+{ SETretainable(m_view, view); }
+void avdAnalyzerCtrl::setMdl(avdAnalyzerMdl *mdl)
+{ SETretainable(m_mdl, mdl); }
+void avdAnalyzerCtrl::setLocalMenuBarHdlr(avdAnalyzerMenuBarHandler *local_menubar_hdlr)
+{ SETretainable(m_local_menubar_hdlr, local_menubar_hdlr); }
+void avdAnalyzerCtrl::setOutFmtSel(avdAnalyzerOutFmtSel *columns_selector)
+{ SETretainable(m_columns_selector, columns_selector); }
+
+avdAnalyzerCtrl::avdAnalyzerCtrl(QObject *parent, const char *name)
+:QObject(parent, name), m_mdl(0) {
+  Debug << "<avdAnalyzerCtrl> ctor.";
+
+  avdAnalyzerView *view = new avdAnalyzerView(0, "<avdAnalyzerCtrl(m_view)>");
+  setView(view); view->release();
+  getView()->nameWatched("<avdAnalyzerCtrl(m_view)>");
+  connect(getView(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+
+  avdAnalyzerMdl *mdl = new avdAnalyzerMdl();
+  if(!mdl) Fatal << "couldn't instantiate analyzer.";
+  setMdl(mdl); mdl->release();
+  getMdl()->nameWatched("<<avdAnalyzerCtrl(m_mdl)>");
+
+  avdAnalyzerMenuBarHandler *local_menubar_hdlr = new avdAnalyzerMenuBarHandler
+  (0, "<avdAnalyzerCtrl(m_local_menubar_hdlr)>");
+  setLocalMenuBarHdlr(local_menubar_hdlr); local_menubar_hdlr->release();
+  getLocalMenuBarHdlr()->nameWatched("<avdAnalyzerCtrl(m_local_menubar_hdlr)>");
+
+  cStringList data_entry_cmd_strings;
+  data_entry_cmd_strings.PushRear("id");
+
+  //data_entry_cmd_strings.PushRear("tag");
+  data_entry_cmd_strings.PushRear("parent_id");
+  //data_entry_cmd_strings.PushRear("parent_dist");
+  //data_entry_cmd_strings.PushRear("length");
+  data_entry_cmd_strings.PushRear("merit");
+  //data_entry_cmd_strings.PushRear("gest_time");
+  data_entry_cmd_strings.PushRear("fitness");
+  ////data_entry_cmd_strings.PushRear("sequence");
+  //data_entry_cmd_strings.PushRear("task_list");
+  //data_entry_cmd_strings.PushRear("total_cpus");
+
+  getView()->getGenotypesListView()->addColumn("id");
+  getView()->getGenotypesListView()->addColumn("parent_id");
+  getView()->getGenotypesListView()->addColumn("merit");
+  getView()->getGenotypesListView()->addColumn("fitness");
+    
+  getMdl()->LoadDataEntryCommands(data_entry_cmd_strings, m_data_entry_cmd_list);
+  Debug << "after initializing m_data_entry_cmd_list: m_data_entry_cmd_list.GetSize(): "
+    << m_data_entry_cmd_list.GetSize();
+
+  for(int i = 0; i < MAX_BATCHES; i++){ m_free_batch_list[i] = i; }
+  m_free_batch_list_idx = 0;
+  m_batch_id_ctr = 0;
+
+  Debug << "<avdAnalyzerCtrl> done.";
+}
+avdAnalyzerCtrl::~avdAnalyzerCtrl(){
+  setLocalMenuBarHdlr(0);
+  setMdl(0);
+  setView(0);
+  setOutFmtSel(0);
+  setGenotypeSelView(0);
+  Debug << "<avdAnalyzerCtrl> dtor.";
+}
+bool avdAnalyzerCtrl::setup(){
+  Debug << "<avdAnalyzerCtrl::setup>";
+  emit(doResetMenuBar(getView()->menuBar()));
+  getLocalMenuBarHdlr()->setupMenuBar(getView()->menuBar());
+
+  avdConnections cnct(getLocalMenuBarHdlr(), this);
+  cnct.add(SIGNAL(loadCurrentGenotypesSig()), SLOT(loadCurrentGenotypesSlot()));
+  cnct.add(SIGNAL(loadHistoricGenotypesSig()), SLOT(loadHistoricGenotypesSlot()));
+  cnct.add(SIGNAL(openSig()), SLOT(openSlot()));
+
+  cnct.add(SIGNAL(deleteBatchesSig()), SLOT(deleteBatchesSlot()));
+  cnct.add(SIGNAL(mergeBatchesSig()), SLOT(mergeBatchesSlot()));
+  cnct.add(SIGNAL(duplicateBatchesSig()), SLOT(duplicateBatchesSlot()));
+
+  cnct.add(SIGNAL(findGenotypeSig()), SLOT(findGenotypeSlot()));
+  cnct.add(SIGNAL(findLineageSig()), SLOT(findLineageSlot()));
+  cnct.add(SIGNAL(findCladeSig()), SLOT(findCladeSlot()));
+  cnct.add(SIGNAL(sampleOrganismsSig()), SLOT(sampleOrganismsSlot()));
+  cnct.add(SIGNAL(sampleGenotypesSig()), SLOT(sampleGenotypesSlot()));
+  cnct.add(SIGNAL(invertSig()), SLOT(invertSlot()));
+
+  cnct.add(SIGNAL(genotypePhenotypeMapSig()), SLOT(genotypePhenotypeMapSlot()));
+  cnct.add(SIGNAL(chooseColumnsSig()), SLOT(chooseColumnsSlot()));
+
+  avdConnections cnct2(getView()->getBatchesListView(), this);
+  cnct2.add(SIGNAL(itemRenamed(QListViewItem *, int, const QString &)),
+    SLOT(batchListItemRenamedSlot(QListViewItem *, int, const QString &)));
+  cnct2.add(SIGNAL(selectionChanged(void)),
+    SLOT(batchListSelectionChangedSlot(void)));
+
+  getView()->show();
+  Debug << "<avdAnalyzerCtrl::setup> done.";
+  return true;
+}
+
+// menu responders
+  //
+void avdAnalyzerCtrl::loadCurrentGenotypesSlot()
+{ Debug << "loadCurrentGenotypesSlot."; }
+void avdAnalyzerCtrl::loadHistoricGenotypesSlot()
+{
+  Debug << "loadHistoricGenotypesSlot.";
+  /*
+  Ask user for Historic Genotypes file to open.
+  */  
+  QString filename = QFileDialog::getOpenFileName(
+    QString::null, QString::null, getView(),
+    "Load Historic Genotypes", "Choose historic genotypes file to open");
+
+  /*
+  Bail early if user cancels Open File dialog.
+  */
+  if(QString::null == filename){
+    Debug << "user has cancelled 'Load Historic Genotypes'; early exit.";
+    return;
+  }
+  
+  /*
+  User didn't cancel; try to load the user's file.
+  */
+  m_mdl->setCurrentBatchIdx(m_free_batch_list[m_free_batch_list_idx]);
+  bool got_file = m_mdl->loadHistoricGenotypes(filename.ascii());
+  
+  if(!got_file){ 
+    /*
+    Oh no! failed to load Historic Genotypes file.  Give user warning
+    feedback.
+    */
+    Error << "Failed to load Historic Genotypes file \"" << filename << "\".";
+  } else {
+    Debug << "Successfully loaded Historic Genotypes file \"" << filename << "\".";
+    /*
+    Successfully loaded Historic Genotypes file and created new batch.
+    Locate and name the new batch.
+    */
+    QString batch_name(QString("(Batch%1)").arg(m_batch_id_ctr));
+    m_mdl->batchName(m_free_batch_list[m_free_batch_list_idx], batch_name.ascii());
+    
+    /*
+    Create a new CheckListItem for the new batch, with addition data:
+    the index into the batch array stored in m_mdl.
+    */
+    avdAnalyzerBatchListItem *bli = new avdAnalyzerBatchListItem(
+      m_free_batch_list[m_free_batch_list_idx],
+      getView()->getBatchesListView(),
+      batch_name);
+    bli->nameWatched("<avdAnalyzerCtrl::loadHistoricGenotypesSlot(bli)>");
+    /*
+    don't release bli, in violation of the rules, because the QListView
+    getView()->getBatchesListView() has taken ownership of bli.
+    */
+    bli->setRenameEnabled(0, true);
+
+    /*
+    Increment unique-id counter, take the new batch off of the free
+    batch list, and point m_free_batch_list_idx to the next free batch.
+    */
+    m_batch_id_ctr++;
+    m_free_batch_list[m_free_batch_list_idx] = -1;
+    m_free_batch_list_idx++; 
+  }
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::openSlot()
+{
+  Debug << "openSlot.";
+  QString filename = QFileDialog::getOpenFileName(
+    QString::null, QString::null, getView(),
+    "open file dialog", "Choose a file to open");
+  if(QString::null == filename){
+    Debug << "User has cancelled 'Open'; early exit.";
+    return;
+  }
+  bool got_file = m_mdl->open(filename.ascii());
+  if(!got_file) Error << "couldn't open file \"" << filename << "\".";
+  Debug << "done.";
+}
+  //
+void avdAnalyzerCtrl::deleteBatchesSlot()
+{
+  Debug << "deleteBatchesSlot.";
+  QListViewItemIterator it(getView()->getBatchesListView());
+  while(it.current()){
+    avdAnalyzerBatchListItem *bli = dynamic_cast<avdAnalyzerBatchListItem *>(it.current());
+    if(bli && bli->isOn()){
+      Debug << "delete bli[" << bli->getBatchIndex() << "] named \""
+      << getMdl()->getBatchName(bli->getBatchIndex()) << "\".";
+      m_free_batch_list_idx--;
+      m_free_batch_list[m_free_batch_list_idx] = bli->getBatchIndex();
+      delete bli;
+      getMdl()->batchPurge(bli->getBatchIndex());
+    } else it++;
+  }
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::mergeBatchesSlot()
+{
+  Debug << "mergeBatchesSlot.";
+  QString batch_name("(Merge");
+  QListViewItemIterator it(getView()->getBatchesListView());
+  while(it.current()){
+    avdAnalyzerBatchListItem *bli = dynamic_cast<avdAnalyzerBatchListItem *>(it.current());
+    if(bli && bli->isOn()){
+      Debug << "merging bli[" << bli->getBatchIndex() << "] named \""
+      << getMdl()->getBatchName(bli->getBatchIndex()) << "\".";
+      getMdl()->batchMerge(m_free_batch_list[m_free_batch_list_idx], bli->getBatchIndex());
+      batch_name += "," + QString(getMdl()->getBatchName(bli->getBatchIndex()));
+    }
+    it++;
+  }
+  batch_name += ")";
+  m_mdl->batchName(m_free_batch_list[m_free_batch_list_idx], batch_name.ascii());
+  avdAnalyzerBatchListItem *bli = new avdAnalyzerBatchListItem(
+    m_free_batch_list[m_free_batch_list_idx],
+    getView()->getBatchesListView(),
+    batch_name);
+  bli->nameWatched("<avdAnalyzerCtrl::mergeBatchesSlot(bli)>");
+  /*
+  don't release bli, in violation of the rules, because the QListView
+  getView()->getBatchesListView() has taken ownership of bli.
+  */
+  bli->setRenameEnabled(0, true);
+  m_batch_id_ctr++;
+  m_free_batch_list[m_free_batch_list_idx] = -1;
+  m_free_batch_list_idx++; 
+}
+void avdAnalyzerCtrl::duplicateBatchesSlot()
+{
+  Debug << "duplicateBatchesSlot.";
+  QListViewItemIterator it(getView()->getBatchesListView());
+  while(it.current()){
+    avdAnalyzerBatchListItem *bli = dynamic_cast<avdAnalyzerBatchListItem *>(it.current());
+    if(bli && bli->isOn()){
+      Debug << "duplicating bli[" << bli->getBatchIndex() << "] named \""
+      << getMdl()->getBatchName(bli->getBatchIndex()) << "\".";
+      getMdl()->batchMerge(m_free_batch_list[m_free_batch_list_idx], bli->getBatchIndex());
+      QString batch_name("(Copy," + QString(getMdl()->getBatchName(bli->getBatchIndex())) + ")");
+      getMdl()->batchName(m_free_batch_list[m_free_batch_list_idx], batch_name.ascii());
+      avdAnalyzerBatchListItem *bli = new avdAnalyzerBatchListItem(
+        m_free_batch_list[m_free_batch_list_idx],
+        getView()->getBatchesListView(),
+        batch_name);
+      bli->nameWatched("<avdAnalyzerCtrl::duplicateBatchesSlot(bli)>");
+      /*
+      don't release bli, in violation of the rules, because the QListView
+      getView()->getBatchesListView() has taken ownership of bli.
+      */
+      bli->setRenameEnabled(0, true);
+      m_batch_id_ctr++;
+      m_free_batch_list[m_free_batch_list_idx] = -1;
+      m_free_batch_list_idx++; 
+    }
+    it++;
+  }
+}
+  //
+void avdAnalyzerCtrl::setupGenotypeSelView(){
+  if(!getGenotypeSelView()){
+    avdAnalyzerGenotypeSelView *gsv = new avdAnalyzerGenotypeSelView(
+      0, "<avdAnalyzerCtrl::findGenotypeSlot(gsv)>");
+    setGenotypeSelView(gsv); gsv->release();
+    getGenotypeSelView()->nameWatched("<avdAnalyzerCtrl::findGenotypeSlot(gsv)>");
+    
+  }
+  disconnect(getGenotypeSelView()->getOkayBtn(), 0, this, 0);
+  getGenotypeSelView()->getListView()->clear();
+  getGenotypeSelView()->chooseNumCPUs()->setChecked(false);
+  getGenotypeSelView()->chooseTotalCPUs()->setChecked(false);
+  getGenotypeSelView()->chooseFitness()->setChecked(false);
+  getGenotypeSelView()->chooseMerit()->setChecked(false);
+  getGenotypeSelView()->show();
+  getGenotypeSelView()->raise();
+}
+void avdAnalyzerCtrl::findGenotypeSlot()
+{
+  Debug << "findGenotypeSlot.";
+  setupGenotypeSelView();
+  getGenotypeSelView()->setCaption("Selection Criteria: Find Genotype");
+  connect(getGenotypeSelView()->getOkayBtn(), SIGNAL(clicked()),
+    this, SLOT(doFindGenotypeSlot()));
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::findLineageSlot()
+{
+  Debug << "findLineageSlot.";
+  setupGenotypeSelView();
+  getGenotypeSelView()->setCaption("Selection Criteria: Find Lineage");
+  connect(getGenotypeSelView()->getOkayBtn(), SIGNAL(clicked()),
+    this, SLOT(doFindLineageSlot()));
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::findCladeSlot()
+{ 
+  Debug << "findCladeSlot.";
+  setupGenotypeSelView();
+  getGenotypeSelView()->setCaption("Selection Criteria: Find Clade");
+  connect(getGenotypeSelView()->getOkayBtn(), SIGNAL(clicked()),
+    this, SLOT(doFindCladeSlot()));
+  Debug << "done.";
+}
+
+QString avdAnalyzerCtrl::verifyGenotypeSelView(bool &verifies_ok)
+{
+  Debug << "verifyGenotypeSelView.";
+  QString retval;
+  verifies_ok = true;
+  if(getGenotypeSelView()->chooseNumCPUs()->isChecked()) retval += "num_cpus ";
+  if(getGenotypeSelView()->chooseTotalCPUs()->isChecked()) retval += "total_cpus ";
+  if(getGenotypeSelView()->chooseFitness()->isChecked()) retval += "fitness ";
+  if(getGenotypeSelView()->chooseMerit()->isChecked()) retval += "merit ";
+  QListViewItemIterator it(getGenotypeSelView()->getListView());
+  while(it.current()){
+    bool ok;
+    it.current()->text(0).toUInt(&ok);
+    if(!ok) verifies_ok = false;
+    else retval += it.current()->text(0) + " ";
+  }
+  Debug << "done.";
+  return retval;
+}
+void avdAnalyzerCtrl::doFindGenotypeSlot()
+{
+  Debug << "doFindGenotypeSlot.";
+  bool ok;
+  QString spec_string = verifyGenotypeSelView(ok);
+  if(!ok){}
+  else{
+    avdAnalyzerBatchListItem *bli =
+      dynamic_cast<avdAnalyzerBatchListItem *>(getView()->getBatchesListView()->selectedItem());
+    getMdl()->setCurrentBatchIdx(bli->getBatchIndex());
+    getMdl()->findGenotype(spec_string);
+    batchListSelectionChangedSlot();
+  }
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::doFindLineageSlot()
+{
+  Debug << "doFindLineageSlot.";
+  bool ok;
+  QString spec_string = verifyGenotypeSelView(ok);
+  if(!ok){}
+  else{
+    avdAnalyzerBatchListItem *bli =
+      dynamic_cast<avdAnalyzerBatchListItem *>(getView()->getBatchesListView()->selectedItem());
+    getMdl()->setCurrentBatchIdx(bli->getBatchIndex());
+    getMdl()->findLineage(spec_string);
+    batchListSelectionChangedSlot();
+  }
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::doFindCladeSlot()
+{
+  Debug << "doFindCladeSlot.";
+  bool ok;
+  QString spec_string = verifyGenotypeSelView(ok);
+  if(!ok){}
+  else{
+    avdAnalyzerBatchListItem *bli =
+      dynamic_cast<avdAnalyzerBatchListItem *>(getView()->getBatchesListView()->selectedItem());
+    getMdl()->setCurrentBatchIdx(bli->getBatchIndex());
+    getMdl()->findClade(spec_string);
+    batchListSelectionChangedSlot();
+  }
+  Debug << "done.";
+}
+
+void avdAnalyzerCtrl::sampleOrganismsSlot()
+{ Debug << "sampleOrganismsSlot."; }
+void avdAnalyzerCtrl::sampleGenotypesSlot()
+{ Debug << "sampleGenotypesSlot."; }
+void avdAnalyzerCtrl::invertSlot()
+{ Debug << "invertSlot."; }
+  //
+void avdAnalyzerCtrl::genotypePhenotypeMapSlot()
+{ Debug << "genotypePhenotypeMapSlot."; }
+// batch listview responders
+void avdAnalyzerCtrl::batchListItemRenamedSlot(
+  QListViewItem *lvi, int, const QString &text)
+{
+  Debug << "entered.";
+  avdAnalyzerBatchListItem *bli = static_cast<avdAnalyzerBatchListItem *>(lvi);
+  if(bli){
+    Debug << "index " << bli->getBatchIndex() << '.';
+    m_mdl->batchName(bli->getBatchIndex(), text.ascii());
+    bli->setText(0, QString(
+      m_mdl->getBatchAt(bli->getBatchIndex())->Name()));
+    /*
+    XXX:  current code, in analyze.cc, truncates name to one word if
+    full name has more than one word.  should we change that behavior? 
+    */
+    {
+      cString fullname(text.ascii());
+      if(fullname.CountNumWords() > 1){
+        Info << "Batch name \"" << fullname << "\" will be truncated.";
+        QMessageBox::warning(
+          getView(),
+          "Name was truncated",
+          "Current code truncates the batch name\n"
+          "to one word if it is longer than one word.",
+          QMessageBox::Ok, 0, 0);
+      }
+    }
+  } else {
+    Error << "Trying to rename a null avdAnalyzerBatchListItem!";
+  }
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::batchListSelectionChangedSlot(void)
+{
+  Debug << "batchListSelectionChangedSlot.";
+  avdAnalyzerBatchListItem *bli = static_cast<avdAnalyzerBatchListItem *>(
+    getView()->getBatchesListView()->selectedItem()
+  );
+  //
+  // clear existing rows.
+  getView()->getGenotypesListView()->clear();
+  
+  // Rebuild columns.
+  getView()->getGenotypesListView()->setUpdatesEnabled(false);
+  getView()->getGenotypesListView()->blockSignals(true);
+  tRetainableListIter<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    fc_it(m_data_entry_cmd_list);
+  avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command = 0;
+  if(bli && getMdl()->getBatchAt(bli->getBatchIndex())){
+    tListIterator<cAnalyzeGenotype> it(
+      getMdl()->getBatchAt(bli->getBatchIndex())->List());
+    it.Reset();
+    cAnalyzeGenotype *genotype(0);
+    while((genotype = it.Next()) != 0){
+      QListViewItem *lvi = new avdAnalyzerGenotypeListItem(
+        genotype, getView()->getGenotypesListView());
+      fc_it.Reset();
+      int col = 0;
+      while (fc_it.Next() != 0){
+        entry_command = fc_it.Get();
+        entry_command->SetTarget(genotype);
+        lvi->setText(
+          //getView()->getGenotypesListView()->header()->mapToIndex(col),
+          col,
+          entry_command->text());
+        col++;
+      }
+      Debug << "nother genotype.";
+    }
+  }
+  getView()->getGenotypesListView()->blockSignals(false);
+  getView()->getGenotypesListView()->setUpdatesEnabled(true);
+  getView()->getGenotypesListView()->update();
+
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::chooseColumnsSlot()
+{
+  Debug << "chooseColumnsSlot.";
+  if(!getOutFmtSel()){
+    avdAnalyzerOutFmtSel *columns_selector = new avdAnalyzerOutFmtSel(
+      0, "<avd_o_AnalyzerCtrlData::m_columns_selector>");
+    setOutFmtSel(columns_selector);
+    columns_selector->release();
+    getOutFmtSel()->nameWatched("<avd_o_AnalyzerCtrlData::m_columns_selector>");
+    getLocalMenuBarHdlr()->setupMenuBar(getOutFmtSel()->menuBar());
+  
+    // Populate format-menu listview with analyze formats.
+    tRetainableListIter<avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+      fm_it(getMdl()->getGenotypeDataList());
+    fm_it.Reset(); 
+    while (fm_it.Prev() != 0){
+      avdAnalyzerDataEntryCommandListItem *lvi =
+        new avdAnalyzerDataEntryCommandListItem(getOutFmtSel()->getMenuListView());
+      avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command =
+        new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>(fm_it.Get());
+      lvi->setDataEntryCommand(entry_command);
+      entry_command->nameWatched("<avdAnalyzerCtrl::chooseColumnsSlot(menu entry_command)>");
+      entry_command->release();
+        //new avdAnalyzerDataEntryCommandListItem(
+        //  entry_command, getOutFmtSel()->getMenuListView());
+      //lvi->nameWatched("<avdAnalyzerCtrl::chooseColumnsSlot(lvi)>");
+      //Debug << "new lvi named.";
+      lvi->setDragEnabled(true);
+      lvi->setDropEnabled(false);
+    }
+    
+    // Populate formats-chosen listview with analyze formats.
+    tRetainableListIter<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> >
+      fc_it(m_data_entry_cmd_list);
+    fc_it.Reset();
+    while (fc_it.Prev() != 0){
+      avdAnalyzerDataEntryCommandListItem *lvi =
+        new avdAnalyzerDataEntryCommandListItem(getOutFmtSel()->getChoiceListView());
+      avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command =
+        new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>(*fc_it.Get());
+      lvi->setDataEntryCommand(entry_command);
+      entry_command->nameWatched("<avdAnalyzerCtrl::chooseColumnsSlot(choice entry_command)>");
+      entry_command->release();
+        //new avdAnalyzerDataEntryCommandListItem(
+        //  entry_command, getOutFmtSel()->getChoiceListView());
+      //lvi->nameWatched("<avdAnalyzerCtrl::chooseColumnsSlot(lvi)>");
+      //Debug << "new lvi named.";
+      lvi->setDragEnabled(true);
+      lvi->setDropEnabled(true);
+    }
+    connect(getOutFmtSel()->getCancelButton(), SIGNAL(clicked()),
+      this, SLOT(selectorCancelBtnClickedSlot()));
+    connect(getOutFmtSel()->getApplyButton(), SIGNAL(clicked()),
+      this, SLOT(selectorApplyBtnClickedSlot()));
+    connect(getOutFmtSel()->getOkayButton(), SIGNAL(clicked()),
+      this, SLOT(selectorOkayBtnClickedSlot()));
+  }
+  getOutFmtSel()->show();
+  getOutFmtSel()->raise();
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::updateColumnsSlot()
+{
+  Debug << "entered.";
+  int col = 0;
+  getView()->getGenotypesListView()->setUpdatesEnabled(false);
+  getView()->getGenotypesListView()->blockSignals(true);
+  // find and remove obsolete columns
+  tRetainableListIter<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    dec_it(m_data_entry_cmd_list);
+  dec_it.Reset();
+  while(dec_it.Next()){
+    QListViewItem *lvi = m_columns_selector->getChoiceListView()->findItem(
+      QString(dec_it.Get()->GetName()), 0);
+    if(lvi){ col++; }
+    else {
+      m_data_entry_cmd_list.Remove(dec_it);
+      getView()->getGenotypesListView()->removeColumn(col);
+  } }
+  // add new columns
+  tRetainableList<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > new_dec_list;
+  QListViewItemIterator lvi_it(m_columns_selector->getChoiceListView());
+  while(lvi_it.current()){
+    avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *dec =
+      static_cast<avdAnalyzerDataEntryCommandListItem *>(
+        lvi_it.current())->getDataEntryCommand();
+    dec_it.Reset();
+    bool found_the_dec = false;
+    while(dec_it.Next() != 0){
+      if(dec_it.Get()->GetName() == dec->GetName()) {
+        found_the_dec = true;
+        break;
+    } }
+    if(!found_the_dec){
+      getView()->getGenotypesListView()->addColumn(
+        QString(dec->GetName()));
+      m_data_entry_cmd_list.PushRear(dec);
+      new_dec_list.PushRear(dec);
+    }
+    ++lvi_it;
+  }
+  // update new columns
+  tRetainableListIter<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    new_dec_it(new_dec_list);
+  QListViewItemIterator genotype_it(getView()->getGenotypesListView());
+  while(genotype_it.current()){
+    cAnalyzeGenotype *genotype = static_cast<avdAnalyzerGenotypeListItem *>(
+      genotype_it.current())->getGenotype();
+    new_dec_it.Reset();
+    int new_col = col;
+    while(new_dec_it.Next() != 0){
+      avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command = new_dec_it.Get();
+      entry_command->SetTarget(genotype);
+      genotype_it.current()->setText(
+        new_col,
+        entry_command->text());
+      new_col++;
+    }
+    genotype_it++;
+  } 
+  getView()->getGenotypesListView()->blockSignals(false);
+  getView()->getGenotypesListView()->setUpdatesEnabled(true);
+  getView()->getGenotypesListView()->update();
+
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::selectorCancelBtnClickedSlot()
+{ Debug << "selectorCancelBtnClickedSlot."; }
+void avdAnalyzerCtrl::selectorApplyBtnClickedSlot()
+{
+  Debug << "selectorApplyBtnClickedSlot.";
+  updateColumnsSlot();
+  Debug << "done.";
+}
+void avdAnalyzerCtrl::selectorOkayBtnClickedSlot()
+{
+  Debug << "selectorOkayBtnClickedSlot.";
+  updateColumnsSlot();
+  Debug << "done.";
+}
+
+// arch-tag: definition file for analyzer gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_ctrl.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,104 @@
+#ifndef AVD_N_ANALYZER_CTRL_HH
+#define AVD_N_ANALYZER_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_HH
+#include "analyzer/avd_n_analyzer_data_entry.hh"
+#endif
+#ifndef TRETAINABLE_LIST_HH
+#include "containers/tRetainable_list.hh"
+#endif
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+
+class QListViewItem;
+class QMenuBar;
+class avdAnalyzerBatchListItem;
+class avdAnalyzerGenotypeSelView;
+class avdAnalyzerMdl;
+class avdAnalyzerMenuBarHandler;
+class avdAnalyzerOutFmtSel;
+class avdAnalyzerView;
+class avdAnalyzerCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  avdAnalyzerMdl *m_mdl;
+  QGuardedPtr<avdAnalyzerGenotypeSelView> m_gentype_sel;
+  QGuardedPtr<avdAnalyzerView> m_view;
+  QGuardedPtr<avdAnalyzerMenuBarHandler> m_local_menubar_hdlr;
+  QGuardedPtr<avdAnalyzerOutFmtSel> m_columns_selector;
+  tRetainableList<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > m_data_entry_cmd_list;
+
+  unsigned int m_batch_id_ctr;
+  int m_free_batch_list_idx;
+  int m_free_batch_list[MAX_BATCHES];
+protected:
+  void setGenotypeSelView(avdAnalyzerGenotypeSelView *view);
+  void setView(avdAnalyzerView *view);
+  void setMdl(avdAnalyzerMdl *mdl);
+  void setLocalMenuBarHdlr(avdAnalyzerMenuBarHandler *local_menubar_hdlr);
+  void setOutFmtSel(avdAnalyzerOutFmtSel *columns_selector);
+  avdAnalyzerGenotypeSelView *getGenotypeSelView(){ return m_gentype_sel; }
+  avdAnalyzerView *getView(){ return m_view; }
+  avdAnalyzerMdl *getMdl(){ return m_mdl; }
+  avdAnalyzerMenuBarHandler *getLocalMenuBarHdlr(){ return m_local_menubar_hdlr; }
+  avdAnalyzerOutFmtSel *getOutFmtSel(){ return m_columns_selector; }
+
+  QString verifyGenotypeSelView();
+public:
+  avdAnalyzerCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdAnalyzerCtrl();
+  bool setup();
+public slots:
+  // menu responders
+    //
+  void loadCurrentGenotypesSlot();
+  void loadHistoricGenotypesSlot(); //
+  void openSlot(); //
+    //
+  void deleteBatchesSlot(); //
+  void mergeBatchesSlot();
+  void duplicateBatchesSlot();
+    //
+  void setupGenotypeSelView();
+  void findGenotypeSlot();
+  void findLineageSlot();
+  void findCladeSlot();
+
+  QString verifyGenotypeSelView(bool &verifies_ok);
+  void doFindGenotypeSlot();
+  void doFindLineageSlot();
+  void doFindCladeSlot();
+
+  void sampleOrganismsSlot();
+  void sampleGenotypesSlot();
+  void invertSlot();
+    //
+  void genotypePhenotypeMapSlot();
+  // batch listview responders
+  void batchListItemRenamedSlot(QListViewItem *lvi, int col, const QString &text); //
+  void batchListSelectionChangedSlot(void); //
+  // columns-selector responders
+  void chooseColumnsSlot(); //
+  void updateColumnsSlot(); //
+  void selectorCancelBtnClickedSlot(); //
+  void selectorApplyBtnClickedSlot(); //
+  void selectorOkayBtnClickedSlot(); //
+signals:
+  void doResetMenuBar(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for analyzer gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,33 @@
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_HH
+#define AVD_N_ANALYZER_DATA_ENTRY_HH
+
+#ifndef QSTRING_H
+#include <qstring.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef DATA_ENTRY_HH
+#include "data_entry.hh"
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef TDATAENTRYBASE_HH
+#include "tDataEntryBase.hh"
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+#ifndef STRING_UTIL_HH
+#include "tools/string_util.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_PROTO_HH
+#include "avd_n_analyzer_data_entry_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer data entry objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.cc:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.cc	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,21 @@
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "analyzer/avd_n_analyzer_data_entry_command_list_item.hh"
+#endif
+
+avdAnalyzerDataEntryCommandListItem::avdAnalyzerDataEntryCommandListItem(QListView *parent)
+:QListViewItem(parent), m_data_entry_command(0) {}
+avdAnalyzerDataEntryCommandListItem::~avdAnalyzerDataEntryCommandListItem(){
+  setDataEntryCommand(0);
+}
+void avdAnalyzerDataEntryCommandListItem::setDataEntryCommand(
+  avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *data_entry_command
+){
+  SETretainable(m_data_entry_command, data_entry_command);
+  if(getDataEntryCommand()){
+    m_name = QString(getDataEntryCommand()->GetName());
+    setText(0, m_name);
+    setText(1, QString(getDataEntryCommand()->GetDesc()));
+  }
+}
+
+// arch-tag: definition file for analyzer data entry command list item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,23 @@
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#define AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_HH
+#include "analyzer/avd_n_analyzer_data_entry.hh"
+#endif
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+#include "analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer data entry command list item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:17 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,22 @@
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+#define AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+
+class QMimeSource;
+class avdAnalyzerDataEntryCommandListItem
+: public QListViewItem, public cRetainable {
+protected:
+  avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *m_data_entry_command;
+  QString m_name;
+public:
+  avdAnalyzerDataEntryCommandListItem(QListView *parent);
+  ~avdAnalyzerDataEntryCommandListItem();
+  void setDataEntryCommand(avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *data_entry_command);
+  avdAnalyzerDataEntryCommand<cAnalyzeGenotype> *getDataEntryCommand(void)
+  { return m_data_entry_command; }
+  virtual bool acceptDrop(const QMimeSource *mime) const { return true; }
+  const QString &getName(){ return m_name; }
+};
+
+#endif
+
+// arch-tag: proto file for analyzer data entry command list item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_data_entry_proto.hh	Mon Dec 29 14:55:09 2003
@@ -0,0 +1,167 @@
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_PROTO_HH
+#define AVD_N_ANALYZER_DATA_ENTRY_PROTO_HH
+
+/*
+With the exception of methods added to retreive data as a QString, each
+of the template classes
+
+  avdAnalyzerDataEntryBase<T>, avdAnalyzerDataEntry<T,U>,
+  avdAnalyzerArgDataEntry<T,OUT,ARG>, and
+  avdAnalyzerDataEntryCommand<T>
+
+is identical to the corresponding class
+
+  tDataEntryBase<T>, tDataEntry<T,U>, tArgDataEntry<T,OUT,ARG>, or
+  tDataEntryCommand<T>
+
+defined in tools/data_entry.hh.
+
+avdAnalyzerDataEntryBase<T> objects, and avdAnalyzerDataEntryBase<T>
+subclass objects, can be interchanged with tDataEntryBase<T> objects.
+*/
+
+template <class T> class avdAnalyzerDataEntryBase
+: public tDataEntryBase<T>, public cRetainable
+{
+public:
+  avdAnalyzerDataEntryBase(
+    const cString & _name,
+    const cString & _desc,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):tDataEntryBase<T>(_name, _desc, _null, _html_cell)
+  {}
+  virtual QString text(void) { return QString::null; }
+};
+
+/*
+Since partial specialization of avdAnalyzerDataEntry<T,U>::text() isn't
+allowed, we use this helper class to specialize for converting cStrings
+to QStrings in text().
+*/
+template <class U> class avdAnalyzerDataEntryPrintHelper{
+public:
+  QString text(U data){
+    return QString("%1").arg(data);
+  }
+};
+template <> QString
+avdAnalyzerDataEntryPrintHelper<cString>::text(cString data){
+  return QString(data);
+}
+template <> QString
+avdAnalyzerDataEntryPrintHelper<const cString &>::text(const cString &data){
+  return QString(data);
+}
+
+template <class T, class OUT> class avdAnalyzerDataEntry
+: public avdAnalyzerDataEntryBase<T> {
+protected:
+  OUT  (T::*DataRetrieval)() const;
+  void (T::*DataSet)(OUT);
+  int  (T::*DataCompare)(T*) const;
+  int CmpNULL(T *) const { return 0; }
+  avdAnalyzerDataEntryPrintHelper<OUT> m_printhelper;
+public:
+  avdAnalyzerDataEntry(
+    const cString & _name,
+    const cString & _desc,
+    OUT (T::*_funR)() const,
+    void (T::*_funS)(OUT _val) = NULL,
+    int (T::*_funC)(T * _o) const = 0,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):avdAnalyzerDataEntryBase<T>(_name, _desc, _null, _html_cell),
+    DataRetrieval(_funR),
+    DataSet(_funS),
+    DataCompare(_funC)
+  {}
+  bool Print(std::ostream & fp) const {
+    if (target == NULL) return false;
+    fp << (target->*DataRetrieval)();
+    return true;
+  }
+  int Compare(T * other) const {
+    return (DataCompare)?((target->*DataCompare)(other)):(0);
+  }
+  bool Set(const cString & value) {
+    OUT new_value(0);
+    if (DataSet == 0) return false;
+    (target->*DataSet)( cStringUtil::Convert(value, new_value) );
+    return true;
+  }
+  QString text(void) {
+    if (target == 0) return QString::null;
+    else return m_printhelper.text((target->*DataRetrieval)());
+  }
+};
+
+template <class T, class OUT, class ARG> class avdAnalyzerArgDataEntry
+: public avdAnalyzerDataEntryBase<T> {
+protected:
+  OUT (T::*DataRetrieval)(ARG) const;
+  int (T::*DataCompare)(T*,ARG) const;
+  ARG arg;
+  avdAnalyzerDataEntryPrintHelper<OUT> m_printhelper;
+public:
+  avdAnalyzerArgDataEntry(
+    const cString & _name,
+    const cString & _desc,
+    OUT (T::*_funR)(ARG) const, ARG _arg,
+    int (T::*_funC)(T * _o, ARG _i) const = 0,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):avdAnalyzerDataEntryBase<T>(_name, _desc, _null, _html_cell),
+    DataRetrieval(_funR),
+    DataCompare(_funC),
+    arg(_arg)
+  {}
+  bool Print(std::ostream & fp) const {
+    if (target == NULL) return false;
+    fp << (target->*DataRetrieval)(arg);
+    return true;
+  }
+  int Compare(T * other) const {
+    return (DataCompare)?((target->*DataCompare)(other, arg)):(0);
+  }
+  QString text(void) {
+    return m_printhelper.text((target->*DataRetrieval)(arg));
+  }
+};
+
+
+template <class T> class avdAnalyzerDataEntryCommand
+: public cRetainable {
+protected:
+  avdAnalyzerDataEntryBase<T> * data_entry;
+  cStringList args;
+public:
+  avdAnalyzerDataEntryCommand(
+    avdAnalyzerDataEntryBase<T> * _entry,
+    const cString & _args=""
+  ):data_entry(_entry),
+    args(_args, ':')
+  {}
+  avdAnalyzerDataEntryBase<T> & GetEntry() { return *data_entry; }
+  const cStringList & GetArgs() const { return args; }
+  bool HasArg(const cString & test_arg) { return args.HasString(test_arg); }
+  const cString & GetName() const { return data_entry->GetName(); }
+  const cString & GetDesc() const { return data_entry->GetDesc(); }
+  const cString & GetNull() const { return data_entry->GetNull(); }
+  const cString & GetHtmlCellFlags() const
+    { return data_entry->GetHtmlCellFlags(); }
+  void SetTarget(T * _target) { data_entry->SetTarget(_target); }
+  bool Print(std::ostream & fp) const { return data_entry->Print(fp); }
+  int Compare(T * other) const { return data_entry->Compare(other); }
+  bool SetValue(const cString & value) { return data_entry->Set(value); }
+  void HTMLPrint(std::ostream & fp, int compare=0, bool print_text=true)
+    { data_entry->HTMLPrint(fp, compare, print_text); }
+  QString text(void) const {
+    return data_entry->text();
+  }
+};
+
+
+#endif
+
+// arch-tag: proto file for analyzer data entry objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#define AVD_N_ANALYZER_DBG_MSGS_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_DBG_MSGS_PROTO_HH
+#include "avd_n_analyzer_dbg_msgs_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer debug message objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_dbg_msgs_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_N_ANALYZER_DBG_MSGS_PROTO_HH
+#define AVD_N_ANALYZER_DBG_MSGS_PROTO_HH
+
+extern avdMessageType  Info_ANALYZER_avdMsg;
+extern avdMessageType Debug_ANALYZER_avdMsg;
+extern avdMessageType Error_ANALYZER_avdMsg;
+extern avdMessageType Fatal_ANALYZER_avdMsg;
+#define  Info  AVD_INFO_MSG(ANALYZER)
+#define Debug AVD_DEBUG_MSG(ANALYZER)
+#define Error AVD_ERROR_MSG(ANALYZER)
+#define Fatal AVD_FATAL_MSG(ANALYZER)
+
+#endif
+
+// arch-tag: proto file for analyzer debug message objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,21 @@
+#ifndef AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_HH
+#define AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+#include "analyzer/avd_n_analyzer_genotype_list_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer genotype list item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_list_item_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,19 @@
+#ifndef AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+#define AVD_N_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+
+class cAnalyzeGenotype;
+class avdAnalyzerGenotypeListItem : public QListViewItem, public cRetainable {
+protected:
+  cAnalyzeGenotype *m_genotype;
+public:
+  avdAnalyzerGenotypeListItem(
+    cAnalyzeGenotype *genotype,
+    QListView *parent
+  ):QListViewItem(parent), m_genotype(genotype)
+  {}
+  cAnalyzeGenotype *getGenotype(){ return m_genotype; }
+};
+
+#endif
+
+// arch-tag: proto file for analyzer genotype list item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_ctrl.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_N_ANALYZER_GENOTYPE_SEL_CTRL_HH
+#define AVD_N_ANALYZER_GENOTYPE_SEL_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer genotype selector gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,98 @@
+#ifndef QVBUTTONGROUP_H
+#include "qvbuttongroup.h"
+#endif
+#ifndef QCHECKBOX_H
+#include "qcheckbox.h"
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QMESSAGEBOX_H
+#include <qmessagebox.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include "qpushbutton.h"
+#endif
+#ifndef AVD_N_ANALYZER_LISTVIEW_HH
+#include "analyzer/avd_n_analyzer_listview.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "analyzer/avd_n_analyzer_dbg_msgs.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_GENOTYPE_SEL_VIEW_HH
+#include "analyzer/avd_n_analyzer_genotype_sel_view.hh"
+#endif
+
+
+void avdAnalyzerGenotypeSelView::setListView(avdAnalyzerListView *view)
+{ SETretainable(m_list_view, view); }
+
+avdAnalyzerGenotypeSelView::avdAnalyzerGenotypeSelView(
+  QWidget *parent, const char *name, bool modal, WFlags f
+):QDialog(parent, name, modal, f)
+{
+  QVBoxLayout *top_layout = new QVBoxLayout(
+    this, 10, -1, "<avdAnalyzerGenotypeSelView(top_layout)>");
+
+    QVButtonGroup *bgp = new QVButtonGroup(this, "<avdAnalyzerGenotypeSelView()>");
+    top_layout->addWidget(bgp);
+
+      m_num_cpus = new QCheckBox("num_cpus", bgp, "<avdAnalyzerGenotypeSelView(m_num_cpus)>");
+      m_total_cpus = new QCheckBox("total_cpus", bgp, "<avdAnalyzerGenotypeSelView(total_cpus)>");
+      m_fitness = new QCheckBox("fitness", bgp, "<avdAnalyzerGenotypeSelView(m_fitness)>");
+      m_merit = new QCheckBox("merit", bgp, "<avdAnalyzerGenotypeSelView(m_merit)>");
+      bgp->insert(m_num_cpus);
+      bgp->insert(m_total_cpus);
+      bgp->insert(m_fitness);
+      bgp->insert(m_merit);
+
+    avdAnalyzerListView *lv = new avdAnalyzerListView(
+      this, "<avdAnalyzerGenotypeSelView(m_list_view)>");
+    setListView(lv); lv->release();
+    getListView()->nameWatched("<avdAnalyzerGenotypeSelView(m_list_view)>");
+    getListView()->addColumn("Genome ID");
+    top_layout->addWidget(getListView());
+
+  QHBoxLayout *btn_layout = new QHBoxLayout(
+    top_layout, -1, "<avdAnalyzerGenotypeSelView(m_list_view)>");
+
+    m_add_btn = new QPushButton(
+      "Add ID", this, "<avdAnalyzerGenotypeSelView(m_add_btn)>");
+    QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding);
+    m_cancel_btn = new QPushButton(
+      "Close", this, "<avdAnalyzerGenotypeSelView(m_cancel_btn)>");
+    m_okay_btn = new QPushButton(
+      "Okay", this, "<avdAnalyzerGenotypeSelView(m_okay_btn)>");
+    btn_layout->addWidget(m_add_btn);
+    btn_layout->addItem(spacer);
+    btn_layout->addWidget(m_cancel_btn);
+    btn_layout->addWidget(m_okay_btn);
+
+    connect(getListView(), SIGNAL(itemRenamed(QListViewItem *, int, const QString &)),
+      this, SLOT(itemRenamed(QListViewItem *, int, const QString &)));
+    connect(getListView(), SIGNAL(deletePressed(QListViewItem *)),
+      this, SLOT(deletePressedSlot(QListViewItem *)));
+    connect(getAddBtn(), SIGNAL(clicked()), this, SLOT(addItem()));
+    connect(getCancelBtn(), SIGNAL(clicked()), this, SLOT(close()));
+}
+
+void avdAnalyzerGenotypeSelView::deletePressedSlot(QListViewItem *lvi){ if(lvi) delete lvi; }
+void avdAnalyzerGenotypeSelView::itemRenamed(
+  QListViewItem *, int, const QString &text
+){
+  bool ok;
+  text.toUInt(&ok);
+  if(!ok){
+    QMessageBox::warning(this, "Bad ID",
+    "Genotype ID should be a non-negative in=teger.");
+  }
+}
+void avdAnalyzerGenotypeSelView::addItem(){
+  QListViewItem *lvi = new QListViewItem(getListView());
+  lvi->setEnabled(true);
+  lvi->setSelectable(true);
+}
+
+// arch-tag: definition file for analyzer genotype selector gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_genotype_sel_view.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,54 @@
+#ifndef AVD_N_ANALYZER_GENOTYPE_SEL_VIEW_HH
+#define AVD_N_ANALYZER_GENOTYPE_SEL_VIEW_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QDIALOG_H
+#include <qdialog.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QCheckBox;
+class QListViewItem;
+class QPushButton;
+class avdAnalyzerListView;
+class avdAnalyzerGenotypeSelView : public QDialog, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<QCheckBox> m_num_cpus;;
+  QGuardedPtr<QCheckBox> m_total_cpus;;
+  QGuardedPtr<QCheckBox> m_fitness;;
+  QGuardedPtr<QCheckBox> m_merit;;
+  QGuardedPtr<avdAnalyzerListView> m_list_view;
+  QGuardedPtr<QPushButton> m_add_btn;
+  QGuardedPtr<QPushButton> m_okay_btn;
+  QGuardedPtr<QPushButton> m_cancel_btn;
+protected:
+  void setListView(avdAnalyzerListView *lv);
+public:
+  avdAnalyzerGenotypeSelView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    bool modal = false,
+    WFlags f = 0
+  );
+  QCheckBox *chooseNumCPUs(){ return m_num_cpus; }
+  QCheckBox *chooseTotalCPUs(){ return m_total_cpus; }
+  QCheckBox *chooseFitness(){ return m_fitness; }
+  QCheckBox *chooseMerit(){ return m_merit; }
+  avdAnalyzerListView *getListView(){ return m_list_view; }
+  QPushButton *getAddBtn(){ return m_add_btn; }
+  QPushButton *getOkayBtn(){ return m_okay_btn; }
+  QPushButton *getCancelBtn(){ return m_cancel_btn; }
+protected slots:
+  void deletePressedSlot(QListViewItem *lvi);
+  void itemRenamed(QListViewItem *item, int col, const QString &text);
+  void addItem();
+};
+
+#endif
+
+// arch-tag: header file for analyzer genotype selector gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_gui.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,70 @@
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+#ifndef AVD_N_ANALYZER_CTRL_HH
+#include "avd_n_analyzer_ctrl.hh"
+#endif
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "avd_n_analyzer_dbg_msgs.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+
+
+
+avdMessageType  Info_ANALYZER_avdMsg("Analyzer", avdMCInfo);
+avdMessageType Debug_ANALYZER_avdMsg("Analyzer", avdMCDebug);
+avdMessageType Error_ANALYZER_avdMsg("Analyzer", avdMCError);
+avdMessageType Fatal_ANALYZER_avdMsg("Analyzer", avdMCFatal);
+
+template <class avdAnalyzerCtrl> class pAnalyzerConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdAnalyzerCtrl *ctrl){
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+} };
+typedef tGUI<avdAnalyzerCtrl, pAnalyzerConnections> avdAnalyzerGUI;
+
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_ANALYZER_avdMsg);
+        m_msg_types->Register("Debug", &Debug_ANALYZER_avdMsg);
+        m_msg_types->Register("Error", &Error_ANALYZER_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_ANALYZER_avdMsg);
+        avdMessageSetTracker::Instance().Register("Analyzer", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("Analyzer");
+      if(m_msg_types) delete m_msg_types; 
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+  /* Registers avdAnalyzerGUI creator with GUIFactory. */
+  avdAbstractCtrl *createAnalyzerGUI(void){
+    avdAnalyzerGUI *g = new avdAnalyzerGUI(0, "<(avdAnalyzerGUI)>");
+    g->getCtrl()->nameWatched("<createAnalyzerGUI(avdAnalyzerCtrl)>");
+    return g;
+  }
+  QString s_key("avdAnalyzerGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createAnalyzerGUI);
+}       
+
+// arch-tag: implementation file for analyzer gui
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,91 @@
+#ifndef QDRAGOBJECT_H
+#include <qdragobject.h>
+#endif
+#ifndef QEVENT_H
+#include <qevent.h>
+#endif
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "analyzer/avd_n_analyzer_dbg_msgs.hh"
+#endif
+#ifndef AVD_N_ANALYZER_LISTVIEW_HH
+#include "analyzer/avd_n_analyzer_listview.hh"
+#endif
+
+
+avdAnalyzerListView::avdAnalyzerListView(
+  QWidget *parent,
+  const char *name,
+  WFlags f
+):QListView(parent, name, f)
+{}
+
+/*
+This provides deleting current listviewitem using delete or backspace
+key.
+*/
+void avdAnalyzerListView::keyPressEvent(QKeyEvent *e)
+{ 
+  QListView::keyPressEvent(e);
+
+  switch( e->key() ) {
+  case Key_Backspace:
+  case Key_Delete:
+    e->ignore();
+
+    if(!currentItem()
+    || !(currentItem()->isEnabled()
+      && currentItem()->isSelected())
+    ) break;
+
+    QListViewItem *next_selection = currentItem()->itemBelow();
+    if(!next_selection) next_selection = currentItem()->itemAbove();
+
+    emit deletePressed(currentItem());
+
+    if(viewport()->acceptDrops()
+    && next_selection
+    && next_selection->isEnabled()
+    && next_selection->isSelectable()
+    ) setSelected(next_selection, true);
+  }
+}
+
+QDragObject *avdAnalyzerListView::dragObject(void){
+  Debug << "entered.";
+  if(currentItem() && currentItem()->isEnabled() && currentItem()->isSelected()){
+    emit dragStartSig(currentItem());
+    QTextDrag *text_drag = new QTextDrag(
+      currentItem()->text(header()->mapToIndex(0)),
+      this, "<avdAnalyzerListView::dragObject(test_drag)>");
+    text_drag->setSubtype("avd_analyzer_list_view_format_choice");
+    /*
+    as currently used, a avdAnalyzerListView object can move items
+    within itself only if it accepts drops; if it doesn't accept drops
+    then items will be copied from it to another avdAnalyzerListView
+    instance.
+    */
+    if(viewport()->acceptDrops()) text_drag->dragMove();
+    else text_drag->dragCopy();
+
+    return text_drag;
+  } else return 0;
+  Debug << "done.";
+}
+
+void avdAnalyzerListView::contentsDragMoveEvent(QDragMoveEvent *e){
+  if(e->provides("text/avd_analyzer_list_view_format_choice")){
+    e->accept();
+  }
+}
+void avdAnalyzerListView::contentsDropEvent(QDropEvent *e){
+  if(e->provides("text/avd_analyzer_list_view_format_choice")){
+    e->accept();
+    emit dropEventSig(itemAt(contentsToViewport(e->pos())));
+  }
+}
+
+// arch-tag: implementation file for analyzer listview object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_listview.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,33 @@
+#ifndef AVD_N_ANALYZER_LISTVIEW_HH
+#define AVD_N_ANALYZER_LISTVIEW_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QDragObject;
+class QDragEnterEvent;
+class QKeyEvent;
+class QListViewItem;
+class avdAnalyzerListView : public QListView, public cRetainable {
+  Q_OBJECT
+protected:
+  void keyPressEvent(QKeyEvent *e);
+  QDragObject *dragObject(void);
+  virtual void contentsDragMoveEvent(QDragMoveEvent *e);
+  virtual void contentsDropEvent(QDropEvent *e);
+public:
+  avdAnalyzerListView(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+signals:
+  void deletePressed(QListViewItem *);
+  void dragStartSig(QListViewItem *);
+  void dropEventSig(QListViewItem *);
+};
+
+#endif
+
+// arch-tag: header file for analyzer listview object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,856 @@
+#ifndef ENVIRONMENT_HH
+#include "main/environment.hh"
+#endif
+#ifndef TASKS_HH
+#include "main/tasks.hh"
+#endif
+#ifndef TEST_CPU_HH
+#include "cpu/test_cpu.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "avd_n_analyzer_dbg_msgs.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_MDL_HH
+#include "avd_n_analyzer_mdl.hh"
+#endif
+
+
+bool avdAnalyzerMdl::LoadDetailDump(cString cur_string)
+{
+  Debug << "entered.";
+  // LOAD_DETAIL_DUMP
+
+  cString filename = cur_string.PopWord();
+
+  Info << "Loading: " << filename;
+
+  cInitFile input_file(filename);
+  if (!input_file.IsOpen()) {
+    Error << "Cannot load file: \"" << filename << "\".";
+    return false;
+  }
+  input_file.Load();
+  input_file.Compress();
+  input_file.Close();
+  
+  // Setup the genome...
+
+  for (int line_id = 0; line_id < input_file.GetNumLines(); line_id++) {
+    cString cur_line = input_file.GetLine(line_id);
+
+    // Setup the genotype for this line...
+
+    int id_num      = cur_line.PopWord().AsInt();
+    int parent_id   = cur_line.PopWord().AsInt();
+    int parent_dist = cur_line.PopWord().AsInt();
+    int num_cpus    = cur_line.PopWord().AsInt();
+    int total_cpus  = cur_line.PopWord().AsInt();
+    int length      = cur_line.PopWord().AsInt();
+    double merit    = cur_line.PopWord().AsDouble();
+    int gest_time   = cur_line.PopWord().AsInt();
+    double fitness  = cur_line.PopWord().AsDouble();
+    int update_born = cur_line.PopWord().AsInt();
+    int update_dead = cur_line.PopWord().AsInt();
+    int depth       = cur_line.PopWord().AsInt();
+    cString name = cStringUtil::Stringf("org-%d", id_num);
+
+    cAnalyzeGenotype *genotype =
+      new cAnalyzeGenotype(cur_line.PopWord(), inst_set);
+    if(!genotype){
+      Fatal << "Couldn't make new cAnalyzeGenotype.  Out of memory?";
+    }
+
+    genotype->SetID(id_num);
+    genotype->SetParentID(parent_id);
+    genotype->SetParentDist(parent_dist);
+    genotype->SetNumCPUs(num_cpus);
+    genotype->SetTotalCPUs(total_cpus);
+    genotype->SetLength(length);
+    genotype->SetMerit(merit);
+    genotype->SetGestTime(gest_time);
+    genotype->SetFitness(fitness);
+    genotype->SetUpdateBorn(update_born);
+    genotype->SetUpdateDead(update_dead);
+    genotype->SetDepth(depth);
+    genotype->SetName(name);
+
+    // Add this genotype to the proper batch.
+    batch[cur_batch].List().PushRear(genotype);
+  }
+  
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+
+  Debug << "done.";
+  return true;
+} 
+  
+
+bool avdAnalyzerMdl::LoadFile(cString cur_string)
+{ 
+  // LOAD
+  Debug << "entered.";
+
+  cString filename = cur_string.PopWord();
+
+  Info << "Loading: " << filename;
+
+  cInitFile input_file(filename);
+  if (!input_file.IsOpen()) {
+    Error << "Cannot load file: \"" << filename << "\".";
+    /* FIXME:  make an error window to give user feedback. -- kgn */
+    /* no other cleanup appears needed. -- kgn */
+    return false;
+  }
+  input_file.Load();
+  input_file.ReadHeader();
+  input_file.Compress();
+  input_file.Close();
+
+  const cString filetype = input_file.GetFiletype();
+  if (filetype != "population_data") {
+    Error << "Cannot load files of type \"" << filetype << "\".";
+    /* FIXME:  make an error window to give user feedback. -- kgn */
+    /* no other cleanup appears needed. -- kgn */
+    return false;
+  }
+
+  if (verbose == true) {
+    Info << "Loading file of type: " << filetype;
+  }
+
+
+  // Construct a linked list of data types that can be loaded...
+  tRetainableList< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > output_list;
+  tRetainableListIter< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > output_it(output_list);
+  LoadGenotypeDataList(input_file.GetFormat(), output_list);
+
+
+  // Setup the genome...
+  cGenome default_genome(1);
+  int load_count = 0;
+
+  for (int line_id = 0; line_id < input_file.GetNumLines(); line_id++) {
+    cString cur_line = input_file.GetLine(line_id);
+
+    cAnalyzeGenotype * genotype =
+      new cAnalyzeGenotype(default_genome, inst_set);
+    if(!genotype){
+      Fatal << "Couldn't make new cAnalyzeGenotype.  Out of memory?";
+    }
+
+    output_it.Reset();
+    avdAnalyzerDataEntryCommand<cAnalyzeGenotype> * data_command = NULL;
+    while ((data_command = output_it.Next()) != NULL) {
+      data_command->SetTarget(genotype);
+//        genotype->SetSpecialArgs(data_command->GetArgs());
+      data_command->SetValue(cur_line.PopWord());
+    }
+
+    // Make sure this genotype has a name...
+    if (genotype->GetName() == "") {
+      cString name = cStringUtil::Stringf("org-D%d", load_count++);
+      genotype->SetName(name);
+    }
+
+    // Add this genotype to the proper batch.
+    batch[cur_batch].List().PushRear(genotype);
+  }
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+
+
+  Debug << "done.";
+  return true;
+}
+
+void avdAnalyzerMdl::FindGenotype(cString cur_string)
+{
+  // If no arguments are passed in, just find max num_cpus.
+  if (cur_string.GetSize() == 0) cur_string = "num_cpus";
+
+  if (verbose == true) {
+    Debug << "Reducing batch " << cur_batch << " to genotypes: ";
+  }
+
+  tList<cAnalyzeGenotype> & gen_list = batch[cur_batch].List();
+  tList<cAnalyzeGenotype> found_list;
+  while (cur_string.CountNumWords() > 0) {
+    cString gen_desc(cur_string.PopWord());
+    if (verbose) Debug << gen_desc << " ";
+
+    // Determine by lin_type which genotype were are tracking...
+    cAnalyzeGenotype * found_gen = PopGenotype(gen_desc, cur_batch);
+
+    if (found_gen == NULL) {
+      Error << "  Warning: genotype not found!";
+      continue;
+    }
+
+    // Save this genotype...
+    found_list.Push(found_gen);
+  } 
+
+  // Delete all genotypes other than the ones found!
+  while (gen_list.GetSize() > 0) delete gen_list.Pop();
+
+  // And fill it back in with the good stuff.
+  while (found_list.GetSize() > 0) gen_list.Push(found_list.Pop());
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+}
+
+void avdAnalyzerMdl::FindLineage(cString cur_string)
+{
+  cString lin_type = "num_cpus";
+  if (cur_string.CountNumWords() > 0) lin_type = cur_string.PopWord();
+
+  if (verbose == true) {
+    Debug << "Reducing batch " << cur_batch
+   << " to " << lin_type << " lineage ";
+  } else Debug << "Performing lineage scan...";
+
+
+  // Determine by lin_type which genotype we are tracking...
+  cAnalyzeGenotype * found_gen = PopGenotype(lin_type, cur_batch);
+
+  if (found_gen == NULL) {
+    Debug << "  Warning: Genotype " << lin_type
+   << " not found.  Lineage scan aborted.";
+    return;
+  } 
+
+  // Otherwise, trace back through the id numbers to mark all of those
+  // in the ancestral lineage...
+
+  // Construct a list of genotypes found...
+
+  tList<cAnalyzeGenotype> found_list;
+  found_list.Push(found_gen);
+  int next_id = found_gen->GetParentID();
+  bool found = true;
+  while (found == true) {
+    found = false;
+
+    tListIterator<cAnalyzeGenotype> batch_it(batch[cur_batch].List());
+    while ((found_gen = batch_it.Next()) != NULL) {
+      if (found_gen->GetID() == next_id) {
+  batch_it.Remove();
+  found_list.Push(found_gen);
+  next_id = found_gen->GetParentID();
+  found = true;
+  break;
+      }
+    }
+  } 
+
+  // We now have all of the genotypes in this lineage, delete everything
+  // else.
+
+  const int total_removed = batch[cur_batch].List().GetSize();
+  while (batch[cur_batch].List().GetSize() > 0) {
+    delete batch[cur_batch].List().Pop();
+  } 
+
+  // And fill it back in with the good stuff.
+  int total_kept = found_list.GetSize();
+  while (found_list.GetSize() > 0) {
+    batch[cur_batch].List().PushRear(found_list.Pop());
+  } 
+
+  if (verbose == true) {
+    Debug << "  Lineage has " << total_kept << " genotypes; "
+   << total_removed << " were removed.";
+  } 
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(true);
+  batch[cur_batch].SetAligned(false);
+}
+
+void avdAnalyzerMdl::FindClade(cString cur_string)
+{
+  if (cur_string.GetSize() == 0) {
+    Error << "  Warning: No clade specified for FIND_CLADE.  Aborting.";
+    return;
+  }
+
+  cString clade_type( cur_string.PopWord() );
+
+  if (verbose == true) {
+    Debug << "Reducing batch " << cur_batch
+   << " to clade " << clade_type << ".";
+  } else Debug << "Performing clade scan...";
+
+
+  // Determine by clade_type which genotype we are tracking...
+  cAnalyzeGenotype * found_gen = PopGenotype(clade_type, cur_batch);
+
+  if (found_gen == NULL) {
+    Debug << "  Warning: Ancestral genotype " << clade_type
+   << " not found.  Clade scan aborted.";
+    return;
+  }
+
+  // Do this the brute force way... scan for one step at a time.
+
+  // Construct a list of genotypes found...
+
+  tList<cAnalyzeGenotype> found_list; // Found and finished.
+  tList<cAnalyzeGenotype> scan_list;  // Found, but need to scan for children.
+  scan_list.Push(found_gen);
+
+  // Keep going as long as there is something in the scan list...
+  while (scan_list.GetSize() > 0) {
+    // Move the next genotype from the scan list to the found_list.
+    found_gen = scan_list.Pop();
+    int parent_id = found_gen->GetID();
+    found_list.Push(found_gen);
+
+    // Seach for all of the children of this genotype...
+    tListIterator<cAnalyzeGenotype> batch_it(batch[cur_batch].List());
+    while ((found_gen = batch_it.Next()) != NULL) {
+      // If we found a child, place it into the scan list.
+      if (found_gen->GetParentID() == parent_id) {
+  batch_it.Remove();
+  scan_list.Push(found_gen);
+      }
+    }
+  }
+
+  // We now have all of the genotypes in this clade, delete everything else.
+
+  const int total_removed = batch[cur_batch].List().GetSize();
+  while (batch[cur_batch].List().GetSize() > 0) {
+    delete batch[cur_batch].List().Pop();
+  }
+
+  // And fill it back in with the good stuff.
+  int total_kept = found_list.GetSize();
+  while (found_list.GetSize() > 0) {
+    batch[cur_batch].List().PushRear(found_list.Pop());
+  }
+
+  if (verbose == true) {
+    Debug << "  Clade has " << total_kept << " genotypes; "
+   << total_removed << " were removed.";
+  }
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+}
+
+
+// Pass in the arguments for a command and fill out the entries in list
+// format....
+
+void avdAnalyzerMdl::LoadGenotypeDataList(
+  cStringList arg_list,
+  tRetainableList< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > & output_list)
+{ 
+  // For the moment, just put everything into the output list.
+  SetupGenotypeDataList();
+
+  // If no args were given, load all of the stats.
+  if (arg_list.GetSize() == 0) {
+    tRetainableListIter< avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+      genotype_data_it(m_genotype_data_list);
+    while (genotype_data_it.Next() != (void *) NULL) {
+      avdAnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+        new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>(genotype_data_it.Get());
+      output_list.PushRear(entry_command);
+      entry_command->nameWatched("<avdAnalyzerMdl::LoadGenotypeDataList(entry_command)>");
+      entry_command->release();
+    }
+  }
+  // Otherwise, load only those listed.
+  else {
+    while (arg_list.GetSize() != 0) {
+      // Setup the next entry
+      cString cur_args = arg_list.Pop();
+      cString cur_entry = cur_args.Pop(':');
+      bool found_entry = false;
+
+      // Scan the genotype data list for the current entry
+      tRetainableListIter< avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+        genotype_data_it(m_genotype_data_list);
+
+      while (genotype_data_it.Next() != (void *) NULL) {
+        if (genotype_data_it.Get()->GetName() == cur_entry) {
+          avdAnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+            new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>(genotype_data_it.Get(), cur_args);
+          output_list.PushRear(entry_command);
+          entry_command->nameWatched("(avdAnalyzerDataEntryCommand)");
+          entry_command->release();
+          found_entry = true;
+          break;
+        }   
+      }
+
+      // If the entry was not found, give a warning.
+      if (found_entry == false) {
+        int best_match = 1000;
+        cString best_entry;
+
+        genotype_data_it.Reset();
+        while (genotype_data_it.Next() != (void *) NULL) {
+          const cString & test_str = genotype_data_it.Get()->GetName();
+          const int test_dist = cStringUtil::EditDistance(test_str, cur_entry);
+          if (test_dist < best_match) {
+            best_match = test_dist;
+            best_entry = test_str;
+          }
+        }
+
+        Error << "Warning: Format entry \"" << cur_entry
+             << "\" not found.  Best match is \"" << best_entry << "\".";
+      }
+    }
+  }
+}
+
+void avdAnalyzerMdl::SetupGenotypeDataList()
+{
+  if (m_genotype_data_list.GetSize() != 0) return; // List already setup.
+  avdAnalyzerDataEntryBase<cAnalyzeGenotype> *de;
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, bool>
+    ("viable",      "Is Viable (0/1)", &cAnalyzeGenotype::GetViable,
+      &cAnalyzeGenotype::SetViable);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) viable");
+  de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("id",          "Genome ID",       &cAnalyzeGenotype::GetID,
+      &cAnalyzeGenotype::SetID);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) id"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+    ("tag",         "Genotype Tag",    &cAnalyzeGenotype::GetTag,
+      &cAnalyzeGenotype::SetTag,
+      &cAnalyzeGenotype::CompareNULL, "(none)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) tag"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("parent_id",   "Parent ID",       &cAnalyzeGenotype::GetParentID,
+      &cAnalyzeGenotype::SetParentID);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) parent_id"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("parent_dist", "Parent Distance", &cAnalyzeGenotype::GetParentDist,
+      &cAnalyzeGenotype::SetParentDist);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) parent_dist"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("ancestor_dist","Ancestor Distance",&cAnalyzeGenotype::GetAncestorDist,
+      &cAnalyzeGenotype::SetAncestorDist);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) ancestor_dist"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("num_cpus",    "Number of CPUs",  &cAnalyzeGenotype::GetNumCPUs,
+      &cAnalyzeGenotype::SetNumCPUs);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) num_cpus"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("total_cpus",  "Total CPUs Ever", &cAnalyzeGenotype::GetTotalCPUs,
+      &cAnalyzeGenotype::SetTotalCPUs);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) total_cpus"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("length",      "Genome Length",   &cAnalyzeGenotype::GetLength,
+      &cAnalyzeGenotype::SetLength, &cAnalyzeGenotype::CompareLength);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) length"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("copy_length", "Copied Length",   &cAnalyzeGenotype::GetCopyLength,
+      &cAnalyzeGenotype::SetCopyLength);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) copy_length"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("exe_length",  "Executed Length", &cAnalyzeGenotype::GetExeLength,
+      &cAnalyzeGenotype::SetExeLength);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) exe_length"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("merit",       "Merit",           &cAnalyzeGenotype::GetMerit,
+      &cAnalyzeGenotype::SetMerit, &cAnalyzeGenotype::CompareMerit);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) merit"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("comp_merit",  "Computational Merit", &cAnalyzeGenotype::GetCompMerit,
+      (void (cAnalyzeGenotype::*)(double)) NULL, &cAnalyzeGenotype::CompareCompMerit);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) comp_merit"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("comp_merit_ratio", "Computational Merit Ratio",
+      &cAnalyzeGenotype::GetCompMeritRatio,
+      (void (cAnalyzeGenotype::*)(double)) NULL,
+      &cAnalyzeGenotype::CompareCompMerit);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) comp_merit_ratio"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("gest_time",   "Gestation Time",  &cAnalyzeGenotype::GetGestTime,
+      &cAnalyzeGenotype::SetGestTime,
+      &cAnalyzeGenotype::CompareGestTime, "Inf.");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) gest_time"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("efficiency",  "Rep. Efficiency", &cAnalyzeGenotype::GetEfficiency,
+      (void (cAnalyzeGenotype::*)(double)) NULL,
+      &cAnalyzeGenotype::CompareEfficiency);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) efficiency"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("efficiency_ratio", "Rep. Efficiency Ratio",
+      &cAnalyzeGenotype::GetEfficiencyRatio,
+      (void (cAnalyzeGenotype::*)(double)) NULL,
+      &cAnalyzeGenotype::CompareEfficiency);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) efficiency_ratio"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("fitness",     "Fitness",         &cAnalyzeGenotype::GetFitness,
+      &cAnalyzeGenotype::SetFitness, &cAnalyzeGenotype::CompareFitness);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) fitness"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("div_type",     "Divide Type",         &cAnalyzeGenotype::GetDivType,
+      &cAnalyzeGenotype::SetDivType);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) div_type"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("fitness_ratio", "Fitness Ratio", &cAnalyzeGenotype::GetFitnessRatio,
+      (void (cAnalyzeGenotype::*)(double)) NULL,
+      &cAnalyzeGenotype::CompareFitness);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) fitness_ratio"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("update_born", "Update Born",     &cAnalyzeGenotype::GetUpdateBorn,
+      &cAnalyzeGenotype::SetUpdateBorn);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) update_born"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("update_dead", "Update Dead",     &cAnalyzeGenotype::GetUpdateDead,
+      &cAnalyzeGenotype::SetUpdateDead);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) update_dead"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("depth",       "Tree Depth",      &cAnalyzeGenotype::GetDepth,
+      &cAnalyzeGenotype::SetDepth);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) depth"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("frac_dead",   "Fraction Mutations Lethal",
+      &cAnalyzeGenotype::GetFracDead,
+      (void (cAnalyzeGenotype::*)(double)) NULL);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) frac_dead"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("frac_neg",   "Fraction Mutations Detrimental",
+      &cAnalyzeGenotype::GetFracNeg,
+      (void (cAnalyzeGenotype::*)(double)) NULL);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) frac_neg"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("frac_neut",   "Fraction Mutations Neutral",
+      &cAnalyzeGenotype::GetFracNeut,
+      (void (cAnalyzeGenotype::*)(double)) NULL);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) frac_neut"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, double>
+    ("frac_pos",   "Fraction Mutations Beneficial",
+      &cAnalyzeGenotype::GetFracPos,
+      (void (cAnalyzeGenotype::*)(double)) NULL);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) frac_pos"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+    ("parent_muts", "Mutations from Parent",
+      &cAnalyzeGenotype::GetParentMuts, &cAnalyzeGenotype::SetParentMuts,
+      &cAnalyzeGenotype::CompareNULL, "(none)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) parent_muts"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+    ("task_order", "Task Performance Order",
+      &cAnalyzeGenotype::GetTaskOrder, &cAnalyzeGenotype::SetTaskOrder,
+      &cAnalyzeGenotype::CompareNULL, "(none)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) task_order"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, cString>
+    ("sequence",    "Genome Sequence",
+      &cAnalyzeGenotype::GetSequence, &cAnalyzeGenotype::SetSequence,
+      &cAnalyzeGenotype::CompareNULL, "(N/A)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) sequence"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+    ("alignment",   "Aligned Sequence",
+      &cAnalyzeGenotype::GetAlignedSequence,
+      &cAnalyzeGenotype::SetAlignedSequence,
+      &cAnalyzeGenotype::CompareNULL, "(N/A)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) alignment"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, cString>
+    ("task_list",    "List of all tasks performed",
+      &cAnalyzeGenotype::GetTaskList,
+      (void (cAnalyzeGenotype::*)(cString)) NULL,
+      &cAnalyzeGenotype::CompareNULL, "(N/A)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) task_list"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, cString>
+    ("link.tasksites", "Phenotype Map", &cAnalyzeGenotype::GetMapLink,
+      (void (cAnalyzeGenotype::*)(cString)) NULL);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) link.tasksites"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, cString>
+    ("html.sequence",  "Genome Sequence",
+      &cAnalyzeGenotype::GetHTMLSequence,
+      (void (cAnalyzeGenotype::*)(cString)) NULL,
+      &cAnalyzeGenotype::CompareNULL, "(N/A)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) html.sequence"); de->release();
+  const cTaskLib & task_lib = cTestCPU::GetEnvironment()->GetTaskLib();
+  for (int i = 0; i < task_lib.GetSize(); i++) {
+    cString t_name, t_desc;
+    t_name.Set("task.%d", i);
+    t_desc = task_lib.GetTask(i).GetDesc();
+    de = new avdAnalyzerArgDataEntry<cAnalyzeGenotype, int, int>
+      (t_name, t_desc, &cAnalyzeGenotype::GetTaskCount, i,
+        &cAnalyzeGenotype::CompareTaskCount);
+    m_genotype_data_list.PushRear(de);
+    de->nameWatched("(avdAnalyzerDataEntry) a task"); de->release();
+  }
+  // The remaining values should actually go in a seperate list called
+  // "population_data_list", but for the moment we're going to put them
+  // here so that we only need to worry about a single system to load and
+  // save genotype information.
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("update",       "Update Output",
+      &cAnalyzeGenotype::GetUpdateDead, &cAnalyzeGenotype::SetUpdateDead);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) update"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("dom_num_cpus", "Number of Dominant Organisms",
+      &cAnalyzeGenotype::GetNumCPUs, &cAnalyzeGenotype::SetNumCPUs);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) dom_num_cpus"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("dom_depth",    "Tree Depth of Dominant Genotype",
+      &cAnalyzeGenotype::GetDepth, &cAnalyzeGenotype::SetDepth);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) dom_depth"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, int>
+    ("dom_id",       "Dominant Genotype ID",
+      &cAnalyzeGenotype::GetID, &cAnalyzeGenotype::SetID);
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) dom_id"); de->release();
+  de = new avdAnalyzerDataEntry<cAnalyzeGenotype, cString>
+    ("dom_sequence", "Dominant Genotype Sequence",
+      &cAnalyzeGenotype::GetSequence, &cAnalyzeGenotype::SetSequence,
+      &cAnalyzeGenotype::CompareNULL, "(N/A)", "");
+  m_genotype_data_list.PushRear(de);
+  de->nameWatched("(avdAnalyzerDataEntry) dom_sequence"); de->release();
+}
+
+bool avdAnalyzerMdl::loadCurrentGenotypes(cString){
+  Debug << "entered, but this method is currently empty.";
+  return true;
+}
+bool avdAnalyzerMdl::loadHistoricGenotypes(cString filename){
+  Debug << "entered.";
+  bool result = LoadDetailDump(filename);
+  Debug << "done.";
+  return result;
+}
+bool avdAnalyzerMdl::open(cString filename){
+  Debug << "entered.";
+  bool result = LoadFile(filename);
+  Debug << "done.";
+  return result;
+}
+void avdAnalyzerMdl::findGenotype(QString cur_string){
+  Debug << "entered.";
+  FindGenotype(cur_string.ascii());
+  Debug << "done.";
+}
+void avdAnalyzerMdl::findLineage(QString cur_string){
+  Debug << "entered.";
+  FindLineage(cur_string.ascii());
+  Debug << "done.";
+}
+void avdAnalyzerMdl::findClade(QString cur_string){
+  Debug << "entered.";
+  FindClade(cur_string.ascii());
+  Debug << "done.";
+}
+void avdAnalyzerMdl::batchPurge(int idx) { 
+  Debug << "entered.  deleting batch[" << idx << "].";
+  while (batch[idx].List().GetSize() > 0) {
+    delete batch[idx].List().Pop();
+  }
+
+  batch[idx].SetLineage(false);
+  batch[idx].SetAligned(false);
+  Debug << "done.";
+}
+void avdAnalyzerMdl::batchMerge(int into, int src) { 
+  Debug << "entered.  Merging batch[" << src << "] into batch[" << into << "].";
+  tListIterator<cAnalyzeGenotype> batch_from_it(batch[src].List());
+  cAnalyzeGenotype * genotype = NULL;
+  while ((genotype = batch_from_it.Next()) != NULL) {
+    cAnalyzeGenotype *new_genotype = new cAnalyzeGenotype(*genotype);
+    batch[into].List().PushRear(new_genotype);
+  }
+  batch[into].SetLineage(false);
+  batch[into].SetAligned(false);
+  Debug << "done.";
+}
+bool avdAnalyzerMdl::batchName(int idx, cString name) { 
+  Debug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  if (name.CountNumWords() == 0) {
+    Error << "didn't rename batch because no new name was given.";
+    return false;
+  }
+  batch[idx].Name() = name.PopWord();
+  Debug << "new name: \"" << batch[idx].Name() << "\".";
+  Debug << "done.";
+  return true;
+}
+
+const cString &avdAnalyzerMdl::getBatchName(int idx){
+  Debug << "...";
+  return batch[idx].Name();
+}
+
+
+void avdAnalyzerMdl::setCurrentBatchIdx(int idx){
+  Debug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  cur_batch = idx;
+  Debug << "new index: " << idx << ".";
+  Debug << "done.";
+}
+int avdAnalyzerMdl::getCurrentBatchIdx(void){
+  return cur_batch;
+}
+
+cGenotypeBatch *avdAnalyzerMdl::getBatchAt(int idx){
+  Debug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  Debug << "done.";
+  return batch + idx;
+  Debug << "done.";
+  return 0;
+}
+
+
+void avdAnalyzerMdl::LoadDataEntryCommands(
+  cStringList arg_list,
+  tRetainableList< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > &output_list
+){
+  Debug << "entered.";
+
+  // If no args were given, load all of the stats.
+  if (arg_list.GetSize() == 0) {
+    tRetainableListIter< avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+      genotype_data_it(getGenotypeDataList());
+    while (genotype_data_it.Next() != (void *) NULL) {
+      avdAnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+        new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>(genotype_data_it.Get());
+      output_list.PushRear(entry_command);
+      entry_command->nameWatched("<avdAnalyzerMdl::LoadDataEntryCommands(entry_command)>");
+      entry_command->release();
+    }
+  }
+  // Otherwise, load only those listed.
+  else {
+    while (arg_list.GetSize() != 0) {
+      // Setup the next entry
+      cString cur_args = arg_list.Pop();
+      cString cur_entry = cur_args.Pop(':');
+      bool found_entry = false;
+
+      Debug << "new arg: " << cur_args << ", entry: " << cur_entry;
+
+      // Scan the genotype data list for the current entry
+      tRetainableListIter< avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+        genotype_data_it(getGenotypeDataList());
+
+      while (genotype_data_it.Next() != (void *) NULL) {
+        if (genotype_data_it.Get()->GetName() == cur_entry) {
+          avdAnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+            new avdAnalyzerDataEntryCommand<cAnalyzeGenotype>
+            (genotype_data_it.Get(), cur_args);
+          output_list.PushRear(entry_command);
+          entry_command->nameWatched("<avdAnalyzerMdl::LoadDataEntryCommands(entry_command)>");
+          entry_command->release();
+          Debug << "added new entry command.";
+          found_entry = true;
+          break;
+        }
+      }
+
+      // If the entry was not found, give a warning.
+      if (found_entry == false) {
+        int best_match = 1000;
+        cString best_entry;
+
+        genotype_data_it.Reset();
+        while (genotype_data_it.Next() != (void *) NULL) {
+          const cString & test_str = genotype_data_it.Get()->GetName();
+          const int test_dist = cStringUtil::EditDistance(test_str, cur_entry);
+          if (test_dist < best_match) {
+            best_match = test_dist;
+            best_entry = test_str;
+          }
+        }
+
+        Error << "Warning: Format entry \"" << cur_entry
+             << "\" not found.  Best match is \""
+             << best_entry << "\".";
+      }
+
+    }
+  }
+
+  Debug << "output_list.GetSize(): " << output_list.GetSize();
+  Debug << "done.";
+}
+
+tRetainableList< avdAnalyzerDataEntryBase<cAnalyzeGenotype> > &
+avdAnalyzerMdl::getGenotypeDataList(void){
+  Debug << "entered.";
+  SetupGenotypeDataList();
+  if(m_genotype_data_list.GetSize() == 0){
+    tRetainableListIter<avdAnalyzerDataEntryBase<cAnalyzeGenotype> >
+      it(m_genotype_data_list);
+    it.Reset();
+    while(it.Next() != 0)
+      /*
+      This is so not typesafe:
+      */
+      m_genotype_data_list.PushRear(
+        static_cast<avdAnalyzerDataEntryBase<cAnalyzeGenotype> *>(it.Get())
+      );
+      /*
+      It only works because avdAnalyzerMdl::SetupGenotypeDataList(),
+      defined above, has pushed avdAnalyzerDataEntry objects into
+      m_genotype_data_list, instead of tDataEntry objects.
+      */
+  }
+  Debug << "done.";
+  return m_genotype_data_list;
+}
+
+avdAnalyzerMdl::avdAnalyzerMdl():cAnalyze(){
+  Debug << "constructor.";
+  m_genotype_data_list.nameWatched(
+    "<avdAnalyzerMdl(m_genotype_data_list)>");
+}
+
+// arch-tag: implementation file for analyzer model object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_N_ANALYZER_MDL_HH
+#define AVD_N_ANALYZER_MDL_HH
+
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_HH
+#include "analyzer/avd_n_analyzer_data_entry.hh"
+#endif
+#ifndef TRETAINABLE_LIST_HH
+#include "containers/tRetainable_list.hh"
+#endif
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_MDL_PROTO_HH
+#include "analyzer/avd_n_analyzer_mdl_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for analyzer model object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_mdl_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,49 @@
+#ifndef AVD_N_ANALYZER_MDL_PROTO_HH
+#define AVD_N_ANALYZER_MDL_PROTO_HH
+
+class cGenotypeBatch;
+class avdAnalyzerMdl : public cAnalyze, public cRetainable {
+protected:
+  //tList<avdAnalyzerDataEntryBase<cAnalyzeGenotype> > m_genotype_data_list;
+  tRetainableList<avdAnalyzerDataEntryBase<cAnalyzeGenotype> > m_genotype_data_list;
+protected:
+  bool LoadDetailDump(cString cur_string);
+  bool LoadFile(cString cur_string);
+  void LoadGenotypeDataList(
+    cStringList arg_list,
+    tRetainableList<avdAnalyzerDataEntryCommand<cAnalyzeGenotype> >&output_list);
+  void SetupGenotypeDataList();
+  void FindGenotype(cString cur_string);
+  void FindLineage(cString cur_string);
+  void FindClade(cString cur_string);
+public:
+  bool loadCurrentGenotypes(cString filename);
+  bool loadHistoricGenotypes(cString filename);
+  bool open(cString filename);
+  void findGenotype(QString cur_string);
+  void findLineage(QString cur_string);
+  void findClade(QString cur_string);
+  void batchPurge(int idx);
+  void batchMerge(int into, int src);
+  bool batchName(int idx, cString name);
+  const cString &getBatchName(int idx);
+
+  void setCurrentBatchIdx(int idx);
+  
+  int getCurrentBatchIdx(void);
+  cGenotypeBatch *getBatchAt(int idx);
+  //void LoadDataEntryCommands(
+  //  cStringList arg_list, tList< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > &output_list);
+  void LoadDataEntryCommands(
+    cStringList arg_list,
+    tRetainableList< avdAnalyzerDataEntryCommand<cAnalyzeGenotype> > &output_list
+  );
+  //tList< avdAnalyzerDataEntryBase<cAnalyzeGenotype> > &getGenotypeDataList(void);
+  tRetainableList< avdAnalyzerDataEntryBase<cAnalyzeGenotype> > &getGenotypeDataList(void);
+
+  avdAnalyzerMdl();
+};
+
+#endif
+
+// arch-tag: proto file for analyzer model object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,83 @@
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+#ifndef QPOPUPMENU_H
+#include <qpopupmenu.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "avd_n_analyzer_dbg_msgs.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_MENUBAR_HANDLER_HH
+#include "avd_n_analyzer_menubar_handler.hh"
+#endif
+
+
+void avdAnalyzerMenuBarHandler::setupMenuBar(QMenuBar *menubar){
+  if(menubar){
+      QPopupMenu *file_menu = new QPopupMenu(
+        menubar, "<avdAnalyzerMenuBarHandler(file_menu)"
+      );
+        file_menu->insertItem(
+          "Load Current Genotypes...", this, SIGNAL(loadCurrentGenotypesSig()));
+        file_menu->insertItem(
+          "Load Historic Genotypes...", this, SIGNAL(loadHistoricGenotypesSig()));  
+        file_menu->insertItem(
+          "Open...", this, SIGNAL(openSig()));  
+    menubar->insertItem("File", file_menu);
+  
+      QPopupMenu *edit_menu = new QPopupMenu(
+        menubar, "<avdAnalyzerMenuBarHandler(edit_menu)"
+      );
+        QPopupMenu *batches_submenu = new QPopupMenu(
+          edit_menu, "<avdAnalyzerMenuBarHandler(batches_submenu)"
+        );
+          batches_submenu->insertItem(
+            "Delete", this, SIGNAL(deleteBatchesSig()));
+          batches_submenu->insertItem(
+            "Merge", this, SIGNAL(mergeBatchesSig()));
+          batches_submenu->insertItem(
+            "Duplicate", this, SIGNAL(duplicateBatchesSig()));
+        edit_menu->insertItem("Batches", batches_submenu);
+        QPopupMenu *genotypes_submenu = new QPopupMenu(
+          edit_menu, "<avdAnalyzerMenuBarHandler(genotypes_submenu)"
+        );
+        edit_menu->insertItem(
+          "Genotypes", genotypes_submenu);
+    menubar->insertItem("Edit", edit_menu);
+
+      QPopupMenu *select_menu = new QPopupMenu(
+        menubar, "<avdAnalyzerMenuBarHandler(select_menu)"
+      );
+        QPopupMenu *reduction_submenu = new QPopupMenu(
+          select_menu, "<avdAnalyzerMenuBarHandler(reduction_submenu)"
+        );
+          reduction_submenu->insertItem(
+            "Find Genotype", this, SIGNAL(findGenotypeSig()));
+          reduction_submenu->insertItem(
+            "Find Lineage", this, SIGNAL(findLineageSig()));
+          reduction_submenu->insertItem(
+            "Find Clade", this, SIGNAL(findCladeSig()));
+          reduction_submenu->insertItem(
+            "Sample Organisms", this, SIGNAL(sampleOrganismsSig()));
+          reduction_submenu->insertItem(
+            "Sample Genotypes", this, SIGNAL(sampleGenotypesSig()));
+        select_menu->insertItem(
+          "Reduction", reduction_submenu);
+        select_menu->insertItem(
+          "Invert", this, SIGNAL(invertSig()));
+    menubar->insertItem("Select", select_menu);
+
+      QPopupMenu *analyze_menu = new QPopupMenu(
+        menubar, "<avdAnalyzerMenuBarHandler(analyze_menu)"
+      );
+        analyze_menu->insertItem(
+          "Genotype/Phenotype Map", this, SIGNAL(genotypePhenotypeMapSig()));
+        analyze_menu->insertItem(
+          "Choose Columns...", this, SIGNAL(chooseColumnsSig()));
+    menubar->insertItem("Analyze", analyze_menu);
+  } else { Error << "asked to setup null menubar!"; }
+}
+
+// arch-tag: implementation file for analyzer menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_menubar_handler.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,43 @@
+#ifndef AVD_N_ANALYZER_MENUBAR_HANDLER_HH
+#define AVD_N_ANALYZER_MENUBAR_HANDLER_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QMenuBar;
+class avdAnalyzerMenuBarHandler : public QObject, public cRetainable {
+  Q_OBJECT
+public:
+  avdAnalyzerMenuBarHandler(
+    QObject *parent = 0,
+    const char *name = 0
+  ):QObject(parent, name){}
+  void setupMenuBar(QMenuBar *menubar);
+signals:
+  void loadCurrentGenotypesSig();
+  void loadHistoricGenotypesSig();
+  void openSig();
+
+  void deleteBatchesSig();
+  void mergeBatchesSig();
+  void duplicateBatchesSig();
+
+  void findGenotypeSig();
+  void findLineageSig();
+  void findCladeSig();
+  void sampleOrganismsSig();
+  void sampleGenotypesSig();
+  void invertSig();
+
+  void genotypePhenotypeMapSig();
+  void chooseColumnsSig();
+};
+
+#endif
+
+// arch-tag: header file for analyzer menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,310 @@
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QSPLITTER_H
+#include <qsplitter.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "analyzer/avd_n_analyzer_data_entry_command_list_item.hh"
+#endif
+#ifndef AVD_N_ANALYZER_DBG_MSGS_HH
+#include "analyzer/avd_n_analyzer_dbg_msgs.hh"
+#endif
+#ifndef AVD_N_ANALYZER_LISTVIEW_HH
+#include "analyzer/avd_n_analyzer_listview.hh"
+#endif
+
+#ifndef AVD_N_ANALYZER_OUT_FMT_SEL_HH
+#include "analyzer/avd_n_analyzer_out_fmt_sel.hh"
+#endif
+
+
+void avdAnalyzerOutFmtSel::setMenuListView(avdAnalyzerListView *format_menu_lv)
+{ SETretainable(m_format_menu_lv, format_menu_lv); }
+void avdAnalyzerOutFmtSel::setChoiceListView(avdAnalyzerListView *formats_chosen_lv)
+{ SETretainable(m_formats_chosen_lv, formats_chosen_lv); }
+
+QListView *avdAnalyzerOutFmtSel::getMenuListView()
+{ return m_format_menu_lv; }
+QListView *avdAnalyzerOutFmtSel::getChoiceListView()
+{ return m_formats_chosen_lv; }
+QPushButton *avdAnalyzerOutFmtSel::getCancelButton()
+{ return m_cancel_button; }
+QPushButton *avdAnalyzerOutFmtSel::getApplyButton()
+{ return m_apply_button; }
+QPushButton *avdAnalyzerOutFmtSel::getOkayButton()
+{ return m_okay_button; }
+
+void avdAnalyzerOutFmtSel::deletePressedSlot(QListViewItem *lvi){
+  if(lvi) delete lvi;
+}
+
+/*
+Two methods supporting drag-and-drop.
+*/
+void avdAnalyzerOutFmtSel::dragStartSlot(QListViewItem *lvi){
+  m_source_drag_lvi =
+    static_cast<avdAnalyzerDataEntryCommandListItem *>(lvi);
+}
+void avdAnalyzerOutFmtSel::dropEventSlot(QListViewItem *lvi){
+  Debug << "entered.";
+  if(!getChoiceListView()){
+    Error << "null value in m_formats_chosen_lv.";
+    return;
+  }
+  /*
+  check whether this just a move within the formats-chosen listview.
+  */
+  if((getChoiceListView() == m_source_drag_lvi->listView())){
+    Debug << "move.";
+    /*
+    moving the source format item within the chosen list.
+    decide whether to place source immediately before or after
+    target.
+    */
+    bool place_source_after_target = true;
+    QListViewItemIterator it(lvi);
+    while((++it).current()){
+      if(m_source_drag_lvi == it.current()){
+        place_source_after_target = false;
+        break;
+    } }
+    // place source after target.
+    m_source_drag_lvi->moveItem(lvi);
+    if(!place_source_after_target)
+      // swap if we need to do so.
+      lvi->moveItem(m_source_drag_lvi);
+  } else {
+    /*
+    This is a copy from the format-choices listview to the
+    formats-chosen listview.
+    */
+    Debug << "copy.";
+    /*
+    see whether the source already exists in the formats-chosen
+    listview.
+    */
+    Debug << "src_lvi->getName(): " << m_source_drag_lvi->getName();
+    QListViewItem *duplicate = getChoiceListView()->findItem(m_source_drag_lvi->getName(), 0);
+    if(duplicate){
+      Debug << "duplicate.";
+      if(lvi) duplicate->moveItem(lvi);
+      else duplicate->moveItem(getChoiceListView()->lastItem());
+      getChoiceListView()->setSelected(duplicate, true);
+    } else {
+      Debug << "non-duplicate.";
+      /*
+      source isn't duplicated, so we can make a new one.
+      */
+      avdAnalyzerDataEntryCommandListItem *adec_lvi =
+        new avdAnalyzerDataEntryCommandListItem(getChoiceListView());
+      adec_lvi->setDataEntryCommand(m_source_drag_lvi->getDataEntryCommand());
+      adec_lvi->nameWatched("<avdAnalyzerOutFmtSel::dropEventSlot(adec_lvi)>");
+      adec_lvi->setDragEnabled(true);
+      adec_lvi->setDropEnabled(true);
+      if(lvi) adec_lvi->moveItem(lvi);
+      else adec_lvi->moveItem(getChoiceListView()->lastItem());
+      getChoiceListView()->setSelected(getChoiceListView()->selectedItem(), false);
+      getChoiceListView()->setSelected(adec_lvi, true);
+      getChoiceListView()->setCurrentItem(adec_lvi);
+    }
+  }
+  Debug << "done.";
+}
+void avdAnalyzerOutFmtSel::copyButtonSlot(){
+  Debug << "entered.";
+  if(getMenuListView()->currentItem()
+  && getMenuListView()->currentItem()->isEnabled()
+  && getMenuListView()->currentItem()->isSelected()
+  ){
+    /*
+    see whether the source already exists in the formats-chosen
+    listview.
+    */
+    avdAnalyzerDataEntryCommandListItem *src_lvi =
+      static_cast<avdAnalyzerDataEntryCommandListItem *>(
+        getMenuListView()->currentItem());
+    Debug << "src_lvi->getName(): " << src_lvi->getName();
+    QListViewItem *duplicate = getChoiceListView()->findItem(
+      src_lvi->getName(),
+      0);
+      //getChoiceListView()->header()->mapToIndex(0));
+    if(duplicate){
+      /*
+      move the duplicate up to the top of the formats-chosen listview.
+      */
+      getChoiceListView()->takeItem(duplicate);
+      getChoiceListView()->insertItem(duplicate);
+      getChoiceListView()->setSelected(duplicate, true);
+    } else {
+      /*
+      source isn't duplicated, so we can make a new one.
+      */
+      avdAnalyzerDataEntryCommandListItem *new_lvi =
+        new avdAnalyzerDataEntryCommandListItem(getChoiceListView());
+      new_lvi->setDataEntryCommand(src_lvi->getDataEntryCommand());
+      new_lvi->nameWatched("<avdAnalyzerOutFmtSel::copyButtonSlot(adec_lvi)>");
+      new_lvi->setDragEnabled(true);
+      new_lvi->setDropEnabled(true);
+      getChoiceListView()->setSelected(getChoiceListView()->selectedItem(), false);
+      getChoiceListView()->setSelected(new_lvi, true);
+      getChoiceListView()->setCurrentItem(new_lvi);
+    }
+  }
+  Debug << "done.";
+}
+
+avdAnalyzerOutFmtSel::~avdAnalyzerOutFmtSel(){
+  Debug << "...";
+  setMenuListView(0);
+  setChoiceListView(0);
+}
+avdAnalyzerOutFmtSel::avdAnalyzerOutFmtSel(
+  QWidget *parent,
+  const char *name,
+  WFlags f
+):QMainWindow(parent, name, f), m_format_menu_lv(0), m_formats_chosen_lv(0)
+{
+  Debug << "constructor.";
+
+  QWidget *central_widget = new QWidget(
+    this, "<avdAnalyzerOutFmtSel(central_widget)>");
+  QVBoxLayout *top_layout = new QVBoxLayout(
+    central_widget, 10, -1,
+    "<avdAnalyzerOutFmtSel(top_layout)>");
+  setCentralWidget(central_widget);
+
+    QSplitter *horizontal_splitter = new QSplitter(
+      Qt::Horizontal, central_widget,
+      "<avdAnalyzerOutFmtSel(horizontal_splitter)>");
+    horizontal_splitter->setOpaqueResize(true);
+    top_layout->addWidget(horizontal_splitter, 1);
+
+      QWidget *fmt_menu_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avdAnalyzerOutFmtSel(fmt_menu_layout_widget)>");
+      QHBoxLayout *fmt_menu_layout = new QHBoxLayout(
+        fmt_menu_layout_widget, 10, -1,
+        "<avdAnalyzerOutFmtSel(selector_layout)>");
+      horizontal_splitter->moveToFirst(fmt_menu_layout_widget);
+
+        m_format_menu_lv = new avdAnalyzerListView(
+          fmt_menu_layout_widget,
+          "<avdAnalyzerOutFmtSel(m_format_menu_lv)>");
+        m_format_menu_lv->nameWatched(
+          "<avdAnalyzerOutFmtSel::m_format_menu_lv>");
+        m_format_menu_lv->setSizePolicy(
+          QSizePolicy::Preferred, QSizePolicy::Preferred,
+          m_format_menu_lv->sizePolicy().hasHeightForWidth());
+        m_format_menu_lv->setSorting(-1);
+        m_format_menu_lv->setAllColumnsShowFocus(true);
+        m_format_menu_lv->viewport()->setAcceptDrops(false);
+        m_format_menu_lv->addColumn("Name");
+        m_format_menu_lv->addColumn("Description");
+        fmt_menu_layout->addWidget(m_format_menu_lv);
+
+      QWidget *selector_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avdAnalyzerOutFmtSel(selector_layout_widget)>");
+      QHBoxLayout *selector_layout = new QHBoxLayout(
+        selector_layout_widget, 10, -1,
+        "<avdAnalyzerOutFmtSel(selector_layout)>");
+      horizontal_splitter->moveToLast(selector_layout_widget);
+
+        QVBoxLayout *button_layout = new QVBoxLayout(
+          selector_layout, -1,
+          "<avdAnalyzerOutFmtSel(button_layout)>");
+
+          QPushButton *copy_btn = new QPushButton(
+            "  ->  ", selector_layout_widget);
+          button_layout->addWidget(copy_btn);
+          copy_btn->setMaximumWidth(copy_btn->sizeHint().width());
+
+        QVBoxLayout *chosen_layout = new QVBoxLayout(
+          selector_layout, -1,
+          "<avdAnalyzerOutFmtSel(chosen_layout)>");
+
+          m_formats_chosen_lv = new avdAnalyzerListView(
+            selector_layout_widget,
+            "<avdAnalyzerOutFmtSel(m_formats_chosen_lv)>");
+          m_formats_chosen_lv->setSizePolicy(
+            QSizePolicy::Preferred, QSizePolicy::Preferred,
+            m_formats_chosen_lv->sizePolicy().hasHeightForWidth());
+          m_formats_chosen_lv->nameWatched(
+            "<avdAnalyzerOutFmtSel::m_formats_chosen_lv>");
+          m_formats_chosen_lv->setSorting(-1);
+          m_formats_chosen_lv->setAllColumnsShowFocus(true);
+          m_formats_chosen_lv->viewport()->setAcceptDrops(true);
+          m_formats_chosen_lv->setDragAutoScroll(true);
+          m_formats_chosen_lv->addColumn("Name");
+          m_formats_chosen_lv->addColumn("Description");
+          m_formats_chosen_lv->setAcceptDrops(TRUE);
+          // Grr... can't disable multi selection...
+          m_formats_chosen_lv->setSelectionMode(QListView::Single);
+          m_formats_chosen_lv->setMultiSelection(false);
+          chosen_layout->addWidget(m_formats_chosen_lv);
+
+    QWidget *finishbuttons_layout_widget = new QWidget(
+      central_widget,
+      "<avdAnalyzerOutFmtSel(finishbuttons_layout_widget)");
+    QHBoxLayout *finishbuttons_layout = new QHBoxLayout(
+      finishbuttons_layout_widget, 10, -1,
+      "<avdAnalyzerOutFmtSel(finishbuttons_layout)>");
+    top_layout->addWidget(finishbuttons_layout_widget);
+
+      m_cancel_button = new QPushButton(
+        "Cancel", finishbuttons_layout_widget,
+        "<avdAnalyzerOutFmtSel(cancel_button)>");
+      finishbuttons_layout->addWidget(m_cancel_button);
+
+      QSpacerItem *finishbuttons_spacer = new QSpacerItem(
+        0, 0, QSizePolicy::MinimumExpanding
+      );
+      finishbuttons_layout->addItem(finishbuttons_spacer);
+
+      m_apply_button = new QPushButton(
+        "Apply", finishbuttons_layout_widget,
+        "<avdAnalyzerOutFmtSel(apply_button)>");
+      finishbuttons_layout->addWidget(m_apply_button);
+
+      m_okay_button = new QPushButton(
+        "Okay", finishbuttons_layout_widget,
+        "<avdAnalyzerOutFmtSel(okay_button)>");
+      finishbuttons_layout->addWidget(m_okay_button);
+
+      connect(
+        m_format_menu_lv,
+        SIGNAL(dragStartSig(QListViewItem *)),
+        this, SLOT(dragStartSlot(QListViewItem *)));
+      connect(
+        m_formats_chosen_lv,
+        SIGNAL(dragStartSig(QListViewItem *)),
+        this, SLOT(dragStartSlot(QListViewItem *)));
+      connect(
+        m_formats_chosen_lv,
+        SIGNAL(deletePressed(QListViewItem *)),
+        this, SLOT(deletePressedSlot(QListViewItem *)));
+      connect(
+        copy_btn, SIGNAL(clicked()),
+        this, SLOT(copyButtonSlot()));
+      connect(
+        m_formats_chosen_lv,
+        SIGNAL(dropEventSig(QListViewItem *)),
+        this, SLOT(dropEventSlot(QListViewItem *)));
+  Debug << "done.";
+}
+
+// arch-tag: implementation file for analyzer output format selector gui
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_out_fmt_sel.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,55 @@
+#ifndef AVD_N_ANALYZER_OUT_FMT_SEL_HH
+#define AVD_N_ANALYZER_OUT_FMT_SEL_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+
+class QListView;
+class QListViewItem;
+class QPushButton;
+class avdAnalyzerDataEntryCommandListItem;
+class avdAnalyzerListView;
+class avdAnalyzerOutFmtSel : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdAnalyzerListView> m_format_menu_lv;
+  QGuardedPtr<avdAnalyzerListView> m_formats_chosen_lv;
+  avdAnalyzerDataEntryCommandListItem *m_source_drag_lvi;
+  QPushButton *m_cancel_button;
+  QPushButton *m_apply_button;
+  QPushButton *m_okay_button;
+public:
+  avdAnalyzerOutFmtSel(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  ~avdAnalyzerOutFmtSel();
+
+  void setMenuListView(avdAnalyzerListView *format_menu_lv);
+  void setChoiceListView(avdAnalyzerListView *format_chosen_lv);
+
+  QListView *getMenuListView();
+  QListView *getChoiceListView();
+  QPushButton *getCancelButton();
+  QPushButton *getApplyButton();
+  QPushButton *getOkayButton();
+protected slots:
+  void deletePressedSlot(QListViewItem *lvi);
+  void dragStartSlot(QListViewItem *);
+  void dropEventSlot(QListViewItem *);
+  void copyButtonSlot();
+};
+
+#endif
+
+// arch-tag: header file for analyzer output format selector gui
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,85 @@
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+#ifndef QSPLITTER_H
+#include <qsplitter.h>
+#endif
+
+#ifndef AVD_N_ANALYZER_VIEW_HH
+#include "avd_n_analyzer_view.hh"
+#endif
+
+
+avdAnalyzerView::avdAnalyzerView( QWidget *parent, const char *name, WFlags f)
+:QMainWindow(parent, name, f){
+  QWidget *central_widget = new QWidget(
+    this, "<avdAnalyzerView(central_widget)>");
+  QVBoxLayout *top_layout = new QVBoxLayout(
+    central_widget, 10, -1,
+    "<avdAnalyzerView(top_layout)>");
+  setCentralWidget(central_widget);
+
+    //QLabel *experiment_editor_label = new QLabel(
+    //  central_widget,
+    //  "<avdAnalyzerView(experiment_editor_label)>"
+    //);
+    //experiment_editor_label->setText("experiment_editor_label.");
+    //top_layout->addWidget(experiment_editor_label);
+
+    QSplitter *horizontal_splitter = new QSplitter(
+      Qt::Horizontal, central_widget,
+      "<avdAnalyzerView(horizontal_splitter)>");
+    horizontal_splitter->setOpaqueResize(true);
+    top_layout->addWidget(horizontal_splitter, 1);
+
+      QWidget *batch_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avdAnalyzerView(batch_layout_widget)>");
+      batch_layout_widget->setSizePolicy(
+        QSizePolicy::Preferred,
+        batch_layout_widget->sizePolicy().verData(),
+        batch_layout_widget->sizePolicy().hasHeightForWidth());
+      horizontal_splitter->setResizeMode(
+        batch_layout_widget, QSplitter::KeepSize);
+      QVBoxLayout *selector_layout = new QVBoxLayout(
+        batch_layout_widget, 10, -1,
+        "<avdAnalyzerView(selector_layout)>");
+      horizontal_splitter->moveToFirst(batch_layout_widget);
+
+        m_batch_lv = new QListView(
+          batch_layout_widget,
+          "<avdAnalyzerView(m_batch_lv)>");
+        m_batch_lv->setSorting(-1);
+        m_batch_lv->addColumn("Batch Name");
+        selector_layout->addWidget(m_batch_lv);
+  
+      QWidget *genotype_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avdAnalyzerView(genotype_layout_widget)>");
+      QVBoxLayout *genotype_layout = new QVBoxLayout(
+        genotype_layout_widget, 10, -1,
+        "<avdAnalyzerView(genotype_layout)>");
+      horizontal_splitter->moveToLast(genotype_layout_widget);
+  
+        m_genotype_lv = new QListView(
+          genotype_layout_widget,
+          "<avdAnalyzerView(m_genotype_lv)>");
+        m_genotype_lv->setSizePolicy(
+          QSizePolicy::Preferred, QSizePolicy::Preferred,
+          m_genotype_lv->sizePolicy().hasHeightForWidth());
+        m_genotype_lv->setSorting(-1);
+        m_genotype_lv->header()->setMovingEnabled(true);
+        //m_genotype_lv->addColumn("id");
+        genotype_layout->addWidget(m_genotype_lv);
+}
+
+// arch-tag: implementation file for analyzer gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer/avd_n_analyzer_view.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,31 @@
+#ifndef AVD_N_ANALYZER_VIEW_HH
+#define AVD_N_ANALYZER_VIEW_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QListView;
+class avdAnalyzerView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<QListView> m_batch_lv, m_genotype_lv;
+public:
+  avdAnalyzerView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  QListView *getBatchesListView(){ return m_batch_lv; }
+  QListView *getGenotypesListView(){ return m_genotype_lv; }
+};
+
+#endif
+
+// arch-tag: header file for analyzer gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/analyzer_o.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/analyzer_o.pri:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/analyzer_o.pri	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,37 @@
+
+analyzer_o {
+  HEADERS += \
+    $$ANALYZER_O_HH/avd_analyzer_batchlist_item_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_batchlist_item.hh \
+    $$ANALYZER_O_HH/avd_analyzer_controller_data.hh \
+    $$ANALYZER_O_HH/avd_analyzer_controller.hh \
+    $$ANALYZER_O_HH/avd_analyzer_data_entry_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_data_entry.hh \
+    $$ANALYZER_O_HH/avd_analyzer_data_entry_command_list_item_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_data_entry_command_list_item.hh \
+    $$ANALYZER_O_HH/avd_analyzer_dbg_msgs_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_dbg_msgs.hh \
+    $$ANALYZER_O_HH/avd_analyzer_genotype_list_item_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_genotype_list_item.hh \
+    $$ANALYZER_O_HH/avd_analyzer_listview_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_listview.hh \
+    $$ANALYZER_O_HH/avd_analyzer_menubar_handler.hh \
+    $$ANALYZER_O_HH/avd_analyzer_model_proto.hh \
+    $$ANALYZER_O_HH/avd_analyzer_model.hh \
+    $$ANALYZER_O_HH/avd_analyzer_output_fmt_selector.hh \
+    $$ANALYZER_O_HH/avd_analyzer_utils.hh \
+    $$ANALYZER_O_HH/avd_analyzer_view.hh
+
+  SOURCES += \
+    $$ANALYZER_O_CC/avd_analyzer_controller_data.cc \
+    $$ANALYZER_O_CC/avd_analyzer_controller.cc \
+    $$ANALYZER_O_CC/avd_analyzer_data_entry_command_list_item.cc \
+    $$ANALYZER_O_CC/avd_analyzer_dbg_msgs.cc \
+    $$ANALYZER_O_CC/avd_analyzer_listview.cc \
+    $$ANALYZER_O_CC/avd_analyzer_menubar_handler.cc \
+    $$ANALYZER_O_CC/avd_analyzer_model.cc \
+    $$ANALYZER_O_CC/avd_analyzer_output_fmt_selector.cc \
+    $$ANALYZER_O_CC/avd_analyzer_view.cc
+}
+
+# arch-tag: qmake include file for old analyzer module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_ANALYZER_BATCHLIST_ITEM_HH
+#define AVD_ANALYZER_BATCHLIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef AVD_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+#include "avd_analyzer_batchlist_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for old analyzer batchlist item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_batchlist_item_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,25 @@
+#ifndef AVD_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+#define AVD_ANALYZER_BATCHLIST_ITEM_PROTO_HH
+
+
+class avd_o_AnalyzerBatchListItem : public QCheckListItem {
+protected:
+  const unsigned int m_batch_index;
+public:
+  avd_o_AnalyzerBatchListItem(
+    int idx,
+    QListView *parent,
+    const QString &text
+  ):QCheckListItem(
+      parent,
+      text,
+      QCheckListItem::CheckBox
+    ),
+    m_batch_index(idx)
+  {}
+  const unsigned int getBatchIndex(void){ return m_batch_index; }
+};
+
+#endif
+
+// arch-tag: proto file for old analyzer batchlist item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,62 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_ANALYZER_VIEW_HH
+#include "avd_analyzer_view.hh"
+#endif
+#ifndef AVD_ANALYZER_CONTROLLER_DATA_HH
+#include "avd_analyzer_controller_data.hh"
+#endif
+#ifndef AVD_ANALYZER_MODEL_HH
+#include "avd_analyzer_model.hh"
+#endif
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_CONTROLLER_HH
+#include "avd_analyzer_controller.hh"
+#endif
+
+
+namespace {
+  avdAbstractCtrl *createAnalyzerController(void){
+    avd_o_AnalyzerCtrl *ac = new avd_o_AnalyzerCtrl;
+    return ac;
+  }
+  QString s_key("avd_o_AnalyzerCtrl");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createAnalyzerController);
+}
+
+avd_o_AnalyzerCtrl::avd_o_AnalyzerCtrl(){
+  AnGuiDebug("entered; creating controller data.");
+  d = new avd_o_AnalyzerCtrlData;
+  if(d){
+    connect( d->m_analyzer_view, SIGNAL(destroyed()),
+      this, SLOT(deleteLater()));
+  }
+  AnGuiDebug("created controller data; done.");
+}
+avd_o_AnalyzerCtrl::~avd_o_AnalyzerCtrl(){
+  AnGuiDebug("entered destructor; deleting controller data.");
+  if(d){ delete d; }
+  AnGuiDebug("deleted controller data; done.");
+}
+
+bool avd_o_AnalyzerCtrl::setup(avdMCMediator *mediator)
+{
+  AnGuiDebug("entered a stub function; done.");
+  if(d && d->m_analyzer_view){ d->m_analyzer_view->show(); }
+  return true;
+}
+
+// arch-tag: implementation file for old analyzer gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,21 @@
+#ifndef AVD_ANALYZER_CONTROLLER_HH
+#define AVD_ANALYZER_CONTROLLER_HH
+
+
+class QMenuBar;
+class avd_o_AnalyzerCtrlData;
+class avdAvidaThreadDrvr;
+class avdMCMediator;
+class avd_o_AnalyzerCtrl : public QObject, public avdAbstractCtrl
+{
+private:
+  avd_o_AnalyzerCtrlData *d;
+public:
+  avd_o_AnalyzerCtrl();
+  ~avd_o_AnalyzerCtrl();
+  bool setup(avdMCMediator *mediator);
+};
+
+#endif
+
+// arch-tag: header file for old analyzer gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,460 @@
+#ifndef QFILEDIALOG_H
+#include <qfiledialog.h>
+#endif
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+#ifndef QMESSAGEBOX_H
+#include <qmessagebox.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef STRING_LIST_HH
+#include "string_list.hh"
+#endif
+
+#ifndef AVD_ANALYZER_BATCHLIST_ITEM_HH
+#include "avd_analyzer_batchlist_item.hh"
+#endif
+#ifndef AVD_ANALYZER_DATA_ENTRY_HH
+#include "avd_analyzer_data_entry.hh"
+#endif
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "avd_analyzer_data_entry_command_list_item.hh"
+#endif
+#ifndef AVD_ANALYZER_GENOTYPE_LIST_ITEM_HH
+#include "avd_analyzer_genotype_list_item.hh"
+#endif
+#ifndef AVD_ANALYZER_MODEL_HH
+#include "avd_analyzer_model.hh"
+#endif
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+#ifndef AVD_ANALYZER_VIEW_HH
+#include "avd_analyzer_view.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_ANALYZER_MENUBAR_HANDLER_HH
+#include "avd_analyzer_menubar_handler.hh"
+#endif
+#ifndef AVD_ANALYZER_OUTPUT_FMT_SELECTOR_HH
+#include "avd_analyzer_output_fmt_selector.hh"
+#endif
+
+#ifndef AVD_ANALYZER_CONTROLLER_DATA_HH
+#include "avd_analyzer_controller_data.hh"
+#endif
+
+
+avd_o_AnalyzerCtrlData::avd_o_AnalyzerCtrlData(){
+  AnGuiDebug << "entered.";
+
+  //m_data_entry_cmd_list.nameWatched(
+  //  "<avd_o_AnalyzerCtrlData(m_data_entry_cmd_list)>");
+
+  m_analyzer_model = new avd_o_AnalyzerModel;
+  if(!m_analyzer_model){
+    AnGuiFatal << "Couldn't create new avd_o_AnalyzerModel! Out of memory?"; }
+  m_analyzer_menubar_handler = new avd_o_AnalyzerMenuBarHandler(
+    this, "<avd_o_AnalyzerCtrlData::m_analyzer_menubar_handler>");
+  m_analyzer_view = new avd_o_AnalyzerView(
+    0, "<avd_o_AnalyzerCtrlData::m_analyzer_view>");
+  m_analyzer_menubar_handler->setupMenuBar(m_analyzer_view->menuBar());
+
+  //tListIterator<avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> >
+  //  it(m_analyzer_model->getGenotypeDataList());
+  //it.Reset();
+  //while (it.Prev() != 0){
+  //  avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command =
+  //    new avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype>(it.Get());
+  //  m_data_entry_cmd_list.PushRear(entry_command);
+  //}
+
+  /*
+  FIXME
+  specify initial data entry commands somewhere else, so that they can
+  be loaded as 'preferences'.
+  -- kgn
+  */
+  cStringList data_entry_cmd_strings;
+  data_entry_cmd_strings.PushRear("id");
+
+  //data_entry_cmd_strings.PushRear("tag");
+  data_entry_cmd_strings.PushRear("parent_id");
+  //data_entry_cmd_strings.PushRear("parent_dist");
+  //data_entry_cmd_strings.PushRear("length");
+  data_entry_cmd_strings.PushRear("merit");
+  //data_entry_cmd_strings.PushRear("gest_time");
+  data_entry_cmd_strings.PushRear("fitness");
+  ////data_entry_cmd_strings.PushRear("sequence");
+  //data_entry_cmd_strings.PushRear("task_list");
+  //data_entry_cmd_strings.PushRear("total_cpus");
+
+  m_analyzer_view->getGenotypesListView()->addColumn("id");
+  m_analyzer_view->getGenotypesListView()->addColumn("parent_id");
+  m_analyzer_view->getGenotypesListView()->addColumn("merit");
+  m_analyzer_view->getGenotypesListView()->addColumn("fitness");
+
+  m_analyzer_model->LoadDataEntryCommands(data_entry_cmd_strings, m_data_entry_cmd_list);
+  AnGuiDebug << "after initializing m_data_entry_cmd_list: m_data_entry_cmd_list.GetSize(): "
+    << m_data_entry_cmd_list.GetSize();
+
+  for(int i = 0; i < MAX_BATCHES; i++){ m_free_batch_list[i] = i; }
+  m_free_batch_list_idx = 0;
+  m_batch_id_ctr = 0;
+
+  connect( m_analyzer_menubar_handler, SIGNAL(loadCurrentGenotypesSig()),
+    this, SLOT(loadCurrentGenotypesSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(loadHistoricGenotypesSig()),
+    this, SLOT(loadHistoricGenotypesSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(openSig()),
+    this, SLOT(openSlot()));
+
+  connect( m_analyzer_menubar_handler, SIGNAL(deleteBatchesSig()),
+    this, SLOT(deleteBatchesSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(mergeBatchesSig()),
+    this, SLOT(mergeBatchesSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(duplicateBatchesSig()),
+    this, SLOT(duplicateBatchesSlot()));
+
+  connect( m_analyzer_menubar_handler, SIGNAL(findGenotypeSig()),
+    this, SLOT(findGenotypeSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(findLineageSig()),
+    this, SLOT(findLineageSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(findCladeSig()),
+    this, SLOT(findCladeSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(sampleOrganismsSig()),
+    this, SLOT(sampleOrganismsSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(sampleGenotypesSig()),
+    this, SLOT(sampleGenotypesSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(invertSig()),
+    this, SLOT(invertSlot()));
+
+  connect( m_analyzer_menubar_handler, SIGNAL(genotypePhenotypeMapSig()),
+    this, SLOT(genotypePhenotypeMapSlot()));
+  connect( m_analyzer_menubar_handler, SIGNAL(chooseColumnsSig()),
+    this, SLOT(chooseColumnsSlot()));
+
+  connect(
+    m_analyzer_view->getBatchesListView(),
+    SIGNAL(itemRenamed(
+      QListViewItem *, int, const QString &)),
+    this,
+    SLOT(batchListItemRenamedSlot(
+      QListViewItem *, int, const QString &)));
+  connect(
+    m_analyzer_view->getBatchesListView(),
+    SIGNAL(selectionChanged(void)),
+    this,
+    SLOT(batchListSelectionChangedSlot(void)));
+
+  AnGuiDebug << "done.";
+}
+avd_o_AnalyzerCtrlData::~avd_o_AnalyzerCtrlData(){
+  AnGuiDebug << "entered.";
+  if(m_analyzer_model) delete m_analyzer_model;
+  if(m_analyzer_view) delete m_analyzer_view;
+  if(m_columns_selector) delete m_columns_selector;
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::loadCurrentGenotypesSlot(){
+  AnGuiDebug << "entered.";
+  AnGuiDebug << "done.";
+}
+void avd_o_AnalyzerCtrlData::loadHistoricGenotypesSlot(){
+  AnGuiDebug << "entered.";
+  /*
+  Ask user for Historic Genotypes file to open.
+  */
+  QString filename = QFileDialog::getOpenFileName(
+    QString::null, QString::null, m_analyzer_view,
+    "Load Historic Genotypes", "Choose historic genotypes file to open");
+
+  /*
+  Bail early if user cancels Open File dialog.
+  */
+  if(QString::null == filename){
+    AnGuiDebug << "user has cancelled 'Load Historic Genotypes'; early exit.";
+    return;
+  }
+
+  /*
+  User didn't cancel; try to load the user's file.
+  */
+  m_analyzer_model->setCurrentBatchIdx(m_free_batch_list[m_free_batch_list_idx]);
+  bool got_file = m_analyzer_model->loadHistoricGenotypes(filename.ascii());
+
+  if(got_file){
+    /*
+    Successfully loaded Historic Genotypes file and created new batch.
+    Locate and name the new batch.
+    */
+    QString batch_name(QString("Batch%1").arg(m_batch_id_ctr));
+    m_analyzer_model->batchName(
+      m_free_batch_list[m_free_batch_list_idx],
+      batch_name.ascii());
+
+    /*
+    Create a new CheckListItem for the new batch, with addition data:
+    the index into the batch array stored in m_analyzer_model.
+    */
+    avd_o_AnalyzerBatchListItem *bli = new avd_o_AnalyzerBatchListItem(
+      m_free_batch_list[m_free_batch_list_idx],
+      m_analyzer_view->getBatchesListView(),
+      batch_name
+    );
+    bli->setRenameEnabled(0, true);
+
+    /*
+    Increment unique-id counter, take the new batch off of the free
+    batch list, and point m_free_batch_list_idx to the next free batch.
+    */
+    m_batch_id_ctr++;
+    m_free_batch_list[m_free_batch_list_idx] = -1;
+    m_free_batch_list_idx++;
+  } else {
+    /*
+    Oh no! failed to load Historic Genotypes file.  Give user warning
+    feedback.
+    */
+    AnGuiError
+    << "Failed to load Historic Genotypes file \"" << filename << "\".";
+  }
+  AnGuiDebug << "done.";
+}
+void avd_o_AnalyzerCtrlData::openSlot(){
+  AnGuiDebug << "entered.";
+  QString filename = QFileDialog::getOpenFileName(
+    QString::null, QString::null, m_analyzer_view,
+    "open file dialog", "Choose a file to open");
+  if(QString::null == filename){
+    AnGuiDebug << "User has cancelled 'Open'; early exit.";
+    return;
+  }
+  bool got_file = m_analyzer_model->open(filename.ascii());
+  if(!got_file) AnGuiError << "couldn't open file \"" << filename << "\".";
+
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::chooseColumnsSlot(){
+  AnGuiDebug << "entered.";
+  if(!m_columns_selector){
+    AnGuiDebug << "makinge new selector widget.";
+
+    m_columns_selector = new avd_o_AnalyzerViewOutputFmtSelector(
+      0, "<avd_o_AnalyzerCtrlData::m_columns_selector>");
+    m_analyzer_menubar_handler->setupMenuBar(
+      m_columns_selector->menuBar());
+
+    // Populate format-menu listview with analyze formats.
+    tListIterator<avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> >
+      fm_it(m_analyzer_model->getGenotypeDataList());
+    fm_it.Reset();
+    while (fm_it.Prev() != 0){
+      avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command =
+        new avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype>(fm_it.Get());
+      avd_o_AnalyzerDataEntryCommandListItem *lvi =
+        new avd_o_AnalyzerDataEntryCommandListItem(
+          entry_command, m_columns_selector->getMenuListView());
+      lvi->setDragEnabled(true);
+      lvi->setDropEnabled(false);
+    }
+
+    // Populate formats-chosen listview with analyze formats.
+    tListIterator<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> >
+      fc_it(m_data_entry_cmd_list);
+    fc_it.Reset();
+    while (fc_it.Prev() != 0){
+      avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command =
+        new avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype>(*fc_it.Get());
+      avd_o_AnalyzerDataEntryCommandListItem *lvi =
+        new avd_o_AnalyzerDataEntryCommandListItem(
+          entry_command, m_columns_selector->getChoiceListView());
+      lvi->setDragEnabled(true);
+      lvi->setDropEnabled(true);
+    }
+    connect(
+      m_columns_selector->getCancelButton(), 
+      SIGNAL(clicked()),
+      this, SLOT(selectorCancelButtonClickedSlot()));
+    connect(
+      m_columns_selector->getApplyButton(), 
+      SIGNAL(clicked()),
+      this, SLOT(selectorApplyButtonClickedSlot()));
+    connect(
+      m_columns_selector->getOkayButton(), 
+      SIGNAL(clicked()),
+      this, SLOT(selectorOkayButtonClickedSlot()));
+  }
+  m_columns_selector->show();
+  m_columns_selector->raise();
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::updateColumnsSlot(){
+  AnGuiDebug << "entered.";
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::batchListItemRenamedSlot(
+  QListViewItem *lvi,
+  int,
+  const QString &text
+){
+  AnGuiDebug << "entered.";
+  avd_o_AnalyzerBatchListItem *bli = static_cast<avd_o_AnalyzerBatchListItem *>(lvi);
+  if(bli){
+    AnGuiDebug << "index " << bli->getBatchIndex() << '.';
+    m_analyzer_model->batchName(bli->getBatchIndex(), text.ascii());
+    bli->setText(0, QString(
+      m_analyzer_model->getBatchAt(bli->getBatchIndex())->Name()));
+    /*
+    XXX:  current code, in analyze.cc, truncates name to one word if
+    full name has more than one word.  should we change that behavior? 
+    */
+    {
+      cString fullname(text.ascii());
+      if(fullname.CountNumWords() > 1){
+        AnGuiInfo << "Batch name \"" << fullname << "\" will be truncated.";
+        QMessageBox::warning(
+          m_analyzer_view,
+          "Name was truncated",
+          "Current code truncates the batch name\n"
+          "to one word if it is longer than one word.",
+          QMessageBox::Ok, 0, 0);
+      }
+    }
+  } else {
+    AnGuiError << "Trying to rename a null avd_o_AnalyzerBatchListItem!";
+  }
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::batchListSelectionChangedSlot(void){
+  AnGuiDebug << "entered.";
+  avd_o_AnalyzerBatchListItem *bli = static_cast<avd_o_AnalyzerBatchListItem *>(
+    m_analyzer_view->getBatchesListView()->selectedItem()
+  );
+
+  // clear existing rows.
+  m_analyzer_view->getGenotypesListView()->clear();
+
+  // Rebuild columns.
+  m_analyzer_view->getGenotypesListView()->setUpdatesEnabled(false);
+  m_analyzer_view->getGenotypesListView()->blockSignals(true);
+  tListIterator<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    fc_it(m_data_entry_cmd_list);
+  avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command = 0;
+  if(bli && m_analyzer_model->getBatchAt(bli->getBatchIndex())){
+    tListIterator<cAnalyzeGenotype> it(
+      m_analyzer_model->getBatchAt(bli->getBatchIndex())->List());
+    it.Reset();
+    cAnalyzeGenotype *genotype(0);
+    while((genotype = it.Next()) != 0){
+      QListViewItem *lvi = new avd_o_AnalyzerGenotypeListItem(
+        genotype,
+        m_analyzer_view->getGenotypesListView());
+      fc_it.Reset();
+      int col = 0;
+      while (fc_it.Next() != 0){
+        entry_command = fc_it.Get();
+        entry_command->SetTarget(genotype);
+        lvi->setText(
+          //m_analyzer_view->getGenotypesListView()->header()->mapToIndex(col),
+          col,
+          entry_command->text());
+        col++;
+      }
+    }
+  }
+  m_analyzer_view->getGenotypesListView()->blockSignals(false);
+  m_analyzer_view->getGenotypesListView()->setUpdatesEnabled(true);
+  m_analyzer_view->getGenotypesListView()->update();
+
+  AnGuiDebug << "done.";
+}
+
+void avd_o_AnalyzerCtrlData::selectorCancelButtonClickedSlot(){
+  AnGuiDebug << "entered.";
+  AnGuiDebug << "done.";
+}
+void avd_o_AnalyzerCtrlData::selectorApplyButtonClickedSlot(){
+  AnGuiDebug << "entered.";
+  int col = 0;
+  m_analyzer_view->getGenotypesListView()->setUpdatesEnabled(false);
+  m_analyzer_view->getGenotypesListView()->blockSignals(true);
+  // find and remove obsolete columns
+  tListIterator<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    dec_it(m_data_entry_cmd_list);
+  dec_it.Reset();
+  while(dec_it.Next()){
+    QListViewItem *lvi = m_columns_selector->getChoiceListView()->findItem(
+      QString(dec_it.Get()->GetName()), 0);
+    if(lvi){ col++; }
+    else {
+      m_data_entry_cmd_list.Remove(dec_it);
+      m_analyzer_view->getGenotypesListView()->removeColumn(col);
+  } }
+  // add new columns
+  tList<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> > new_dec_list;
+  QListViewItemIterator lvi_it(m_columns_selector->getChoiceListView());
+  while(lvi_it.current()){
+    avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *dec =
+      static_cast<avd_o_AnalyzerDataEntryCommandListItem *>(
+        lvi_it.current())->getDataEntryCommand();
+    dec_it.Reset();
+    bool found_the_dec = false;
+    while(dec_it.Next() != 0){
+      if(dec_it.Get()->GetName() == dec->GetName()) {
+        found_the_dec = true;
+        break;
+    } }
+    if(!found_the_dec){
+      m_analyzer_view->getGenotypesListView()->addColumn(
+        QString(dec->GetName()));
+      m_data_entry_cmd_list.PushRear(dec);
+      new_dec_list.PushRear(dec);
+    }
+    ++lvi_it;
+  }
+  // update new columns
+  tListIterator<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> >
+    new_dec_it(new_dec_list);
+  QListViewItemIterator genotype_it(m_analyzer_view->getGenotypesListView());
+  while(genotype_it.current()){
+    cAnalyzeGenotype *genotype = static_cast<avd_o_AnalyzerGenotypeListItem *>(
+      genotype_it.current())->getGenotype();
+    new_dec_it.Reset();
+    int new_col = col;
+    while(new_dec_it.Next() != 0){
+      avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *entry_command = new_dec_it.Get();
+      entry_command->SetTarget(genotype);
+      genotype_it.current()->setText(
+        new_col,
+        entry_command->text());
+      new_col++;
+    }
+    genotype_it++;
+  }
+  m_analyzer_view->getGenotypesListView()->blockSignals(false);
+  m_analyzer_view->getGenotypesListView()->setUpdatesEnabled(true);
+  m_analyzer_view->getGenotypesListView()->update();
+
+  AnGuiDebug << "done.";
+}
+void avd_o_AnalyzerCtrlData::selectorOkayButtonClickedSlot(){
+  AnGuiDebug << "entered.";
+  AnGuiDebug << "done.";
+}
+
+// arch-tag: implementation file for old analyzer gui controller private data
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_controller_data.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,88 @@
+#ifndef AVD_ANALYZER_CONTROLLER_DATA_HH
+#define AVD_ANALYZER_CONTROLLER_DATA_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef DATA_ENTRY_HH
+#include "data_entry.hh"
+#endif
+#ifndef TLIST_HH
+#include "tList.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_HH
+#include "avd_analyzer_data_entry.hh"
+#endif
+
+
+class avd_o_AnalyzerBatchListItem;
+class avd_o_AnalyzerMenuBarHandler;
+class avd_o_AnalyzerModel;
+class avd_o_AnalyzerView;
+class avd_o_AnalyzerViewOutputFmtSelector;
+class avd_o_AnalyzerCtrlData : public QObject {
+  Q_OBJECT
+public:
+  avd_o_AnalyzerModel *m_analyzer_model;
+  QGuardedPtr<avd_o_AnalyzerMenuBarHandler> m_analyzer_menubar_handler;
+  QGuardedPtr<avd_o_AnalyzerView> m_analyzer_view;
+  QGuardedPtr<avd_o_AnalyzerViewOutputFmtSelector> m_columns_selector;
+
+  tList<avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> > m_data_entry_cmd_list;
+
+  unsigned int m_batch_id_ctr;
+  int m_free_batch_list_idx;
+  int m_free_batch_list[MAX_BATCHES];
+
+public:
+  avd_o_AnalyzerCtrlData();
+  ~avd_o_AnalyzerCtrlData();
+
+// menu responders
+public slots:
+  void loadCurrentGenotypesSlot(); //
+  void loadHistoricGenotypesSlot(); //
+  void openSlot(); //
+
+  void deleteBatchesSlot(){ qDebug("<avd_o_AnalyzerCtrlData::deleteBatchesSlot>."); }
+  void mergeBatchesSlot(){ qDebug("<avd_o_AnalyzerCtrlData::mergeBatchesSlot>."); }
+  void duplicateBatchesSlot(){ qDebug("<avd_o_AnalyzerCtrlData::duplicateBatchesSlot>."); }
+
+  void findGenotypeSlot(){ qDebug("<avd_o_AnalyzerCtrlData::findGenotypeSlot>."); }
+  void findLineageSlot(){ qDebug("<avd_o_AnalyzerCtrlData::findLineageSlot>."); }
+  void findCladeSlot(){ qDebug("<avd_o_AnalyzerCtrlData::findCladeSlot>."); }
+  void sampleOrganismsSlot(){ qDebug("<avd_o_AnalyzerCtrlData::sampleOrganismsSlot>."); }
+  void sampleGenotypesSlot(){ qDebug("<avd_o_AnalyzerCtrlData::sampleGenotypesSlot>."); }
+  void invertSlot(){ qDebug("<avd_o_AnalyzerCtrlData::invertSlot>."); }
+
+  void genotypePhenotypeMapSlot(){ qDebug("<avd_o_AnalyzerCtrlData::genotypePhenotypeMapSlot>."); }
+
+// batch listview responders
+public slots:
+  void batchListItemRenamedSlot(QListViewItem *lvi, int col, const QString &text); //
+  void batchListSelectionChangedSlot(void); //
+
+public slots:
+  void chooseColumnsSlot();
+  void updateColumnsSlot();
+
+  void selectorCancelButtonClickedSlot();
+  void selectorApplyButtonClickedSlot();
+  void selectorOkayButtonClickedSlot();
+};
+
+
+#endif
+
+// arch-tag: header file for old analyzer gui controller private data
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_ANALYZER_CREATOR_HH
+#include "avd_analyzer_creator.hh"
+#endif
+
+avd_o_AnalyzerCreator::avd_o_AnalyzerCreator(
+  avdMissionControl *mc,
+  QObject *parent,
+  const char *name
+){
+  qDebug("<avd_o_AnalyzerCreator::avd_o_AnalyzerCreator>");
+  qDebug("<avd_o_AnalyzerCreator::avd_o_AnalyzerCreator> done.");
+}
+avd_o_AnalyzerCreator::~avd_o_AnalyzerCreator(void){
+  qDebug("<avd_o_AnalyzerCreator::~avd_o_AnalyzerCreator>");
+  qDebug("<avd_o_AnalyzerCreator::~avd_o_AnalyzerCreator> done.");
+}
+void avd_o_AnalyzerCreator::wrapupInit(void){
+  qDebug("<avd_o_AnalyzerCreator::wrapupInit>");
+  qDebug("<avd_o_AnalyzerCreator::wrapupInit> done.");
+}
+void avd_o_AnalyzerCreator::newAnalyzerSlot(void){
+  qDebug("<avd_o_AnalyzerCreator::newAnalyzerSlot>");
+  qDebug("<avd_o_AnalyzerCreator::newAnalyzerSlot> done.");
+}
+
+// arch-tag: implementation file for old analyzer gui creator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_creator.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,31 @@
+#ifndef AVD_ANALYZER_CREATOR_HH
+#define AVD_ANALYZER_CREATOR_HH
+
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+
+class avd_o_AnalyzerCreatorData;
+class avdMissionControl;
+
+class avd_o_AnalyzerCreator : public QObject
+{
+  Q_OBJECT
+public:
+  avd_o_AnalyzerCreator(
+    avdMissionControl *mc,
+    QObject *parent = 0,
+    const char *name = 0
+  );
+  ~avd_o_AnalyzerCreator(void);
+  void wrapupInit(void);
+public slots:
+  void newAnalyzerSlot(void);
+};
+
+
+#endif
+
+// arch-tag: header file for old analyzer gui creator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,28 @@
+#ifndef AVD_ANALYZER_DATA_ENTRY_HH
+#define AVD_ANALYZER_DATA_ENTRY_HH
+
+#ifndef QSTRING_H
+#include <qstring.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef DATA_ENTRY_HH
+#include "data_entry.hh"
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_PROTO_HH
+#include "avd_analyzer_data_entry_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for old analyzer data entry objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "avd_analyzer_data_entry_command_list_item.hh"
+#endif
+
+avd_o_AnalyzerDataEntryCommandListItem::avd_o_AnalyzerDataEntryCommandListItem(
+  avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *data_entry_command,
+  QListView *parent
+):QListViewItem(parent),
+  m_data_entry_command(data_entry_command),
+  m_name(data_entry_command->GetName())
+{
+  setText(0, QString(data_entry_command->GetName()));
+  setText(1, QString(data_entry_command->GetDesc()));
+}
+
+// arch-tag: implementation file for old analyzer data entry command list item objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,22 @@
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#define AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_HH
+#include "avd_analyzer_data_entry.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+#include "avd_analyzer_data_entry_command_list_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for old analyzer data entry command list item objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_command_list_item_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+#define AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_PROTO_HH
+
+
+class QDropEvent;
+class QMimeSource;
+class avd_o_AnalyzerDataEntryCommandListItem
+: public QListViewItem
+{
+protected:
+  avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *m_data_entry_command;
+  const QString m_name;
+public:
+  avd_o_AnalyzerDataEntryCommandListItem(
+    avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *data_entry_command,
+    QListView *parent
+  );
+  avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> *getDataEntryCommand(void){
+    return m_data_entry_command; }
+  virtual bool acceptDrop(const QMimeSource *mime) const { return true; }
+  const QString &getName(){ return m_name; }
+};
+
+#endif
+
+// arch-tag: proto file for old analyzer data entry command list item objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_data_entry_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,167 @@
+#ifndef AVD_ANALYZER_DATA_ENTRY_PROTO_HH
+#define AVD_ANALYZER_DATA_ENTRY_PROTO_HH
+
+/*
+With the exception of methods added to retreive data as a QString, each
+of the template classes
+
+  avd_o_AnalyzerDataEntryBase<T>, avd_o_AnalyzerDataEntry<T,U>,
+  avd_o_AnalyzerArgDataEntry<T,OUT,ARG>, and
+  avd_o_AnalyzerDataEntryCommand<T>
+
+is identical to the corresponding class
+
+  tDataEntryBase<T>, tDataEntry<T,U>, tArgDataEntry<T,OUT,ARG>, or
+  tDataEntryCommand<T>
+
+defined in tools/data_entry.hh.
+
+avd_o_AnalyzerDataEntryBase<T> objects, and avd_o_AnalyzerDataEntryBase<T>
+subclass objects, can be interchanged with tDataEntryBase<T> objects.
+*/
+
+template <class T> class avd_o_AnalyzerDataEntryBase
+: public tDataEntryBase<T>
+{
+public:
+  avd_o_AnalyzerDataEntryBase(
+    const cString & _name,
+    const cString & _desc,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):tDataEntryBase<T>(_name, _desc, _null, _html_cell)
+  {}
+  virtual QString text(void) { return QString::null; }
+};
+
+/*
+Since partial specialization of avd_o_AnalyzerDataEntry<T,U>::text() isn't
+allowed, we use this helper class to specialize for converting cStrings
+to QStrings in text().
+*/
+template <class U> class avd_o_AnalyzerDataEntryPrintHelper{
+public:
+  QString text(U data){
+    return QString("%1").arg(data);
+  }
+};
+template <> QString
+avd_o_AnalyzerDataEntryPrintHelper<cString>::text(cString data){
+  return QString(data);
+}
+template <> QString
+avd_o_AnalyzerDataEntryPrintHelper<const cString &>::text(const cString &data){
+  return QString(data);
+}
+
+template <class T, class OUT> class avd_o_AnalyzerDataEntry
+: public avd_o_AnalyzerDataEntryBase<T>
+{
+protected:
+  OUT  (T::*DataRetrieval)() const;
+  void (T::*DataSet)(OUT);
+  int  (T::*DataCompare)(T*) const;
+  int CmpNULL(T *) const { return 0; }
+  avd_o_AnalyzerDataEntryPrintHelper<OUT> m_printhelper;
+public:
+  avd_o_AnalyzerDataEntry(
+    const cString & _name,
+    const cString & _desc,
+    OUT (T::*_funR)() const,
+    void (T::*_funS)(OUT _val) = NULL,
+    int (T::*_funC)(T * _o) const = 0,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):avd_o_AnalyzerDataEntryBase<T>(_name, _desc, _null, _html_cell),
+    DataRetrieval(_funR),
+    DataSet(_funS),
+    DataCompare(_funC)
+  {}
+  bool Print(std::ostream & fp) const {
+    if (target == NULL) return false;
+    fp << (target->*DataRetrieval)();
+    return true;
+  }
+  int Compare(T * other) const {
+    return (DataCompare)?((target->*DataCompare)(other)):(0);
+  }
+  bool Set(const cString & value) {
+    OUT new_value(0);
+    if (DataSet == 0) return false;
+    (target->*DataSet)( cStringUtil::Convert(value, new_value) );
+    return true;
+  }
+  QString text(void) {
+    if (target == 0) return QString::null;
+    else return m_printhelper.text((target->*DataRetrieval)());
+  }
+};
+
+template <class T, class OUT, class ARG> class avd_o_AnalyzerArgDataEntry
+  : public avd_o_AnalyzerDataEntryBase<T> {
+protected:
+  OUT (T::*DataRetrieval)(ARG) const;
+  int (T::*DataCompare)(T*,ARG) const;
+  ARG arg;
+  avd_o_AnalyzerDataEntryPrintHelper<OUT> m_printhelper;
+public:
+  avd_o_AnalyzerArgDataEntry(
+    const cString & _name,
+    const cString & _desc,
+    OUT (T::*_funR)(ARG) const, ARG _arg,
+    int (T::*_funC)(T * _o, ARG _i) const = 0,
+    const cString & _null="0",
+    const cString & _html_cell="align=center"
+  ):avd_o_AnalyzerDataEntryBase<T>(_name, _desc, _null, _html_cell),
+    DataRetrieval(_funR),
+    DataCompare(_funC),
+    arg(_arg)
+  {}
+  bool Print(std::ostream & fp) const {
+    if (target == NULL) return false;
+    fp << (target->*DataRetrieval)(arg);
+    return true;
+  }
+  int Compare(T * other) const {
+    return (DataCompare)?((target->*DataCompare)(other, arg)):(0);
+  }
+  QString text(void) {
+    return m_printhelper.text((target->*DataRetrieval)(arg));
+  }
+};
+
+
+template <class T> class avd_o_AnalyzerDataEntryCommand {
+protected:
+  avd_o_AnalyzerDataEntryBase<T> * data_entry;
+  cStringList args;
+public:
+  avd_o_AnalyzerDataEntryCommand(
+    avd_o_AnalyzerDataEntryBase<T> * _entry,
+    const cString & _args=""
+  ):data_entry(_entry),
+    args(_args, ':')
+  {}
+  avd_o_AnalyzerDataEntryBase<T> & GetEntry() { return *data_entry; }
+  const cStringList & GetArgs() const { return args; }
+  bool HasArg(const cString & test_arg) { return args.HasString(test_arg); }
+  const cString & GetName() const { return data_entry->GetName(); }
+  const cString & GetDesc() const { return data_entry->GetDesc(); }
+  const cString & GetNull() const { return data_entry->GetNull(); }
+  const cString & GetHtmlCellFlags() const
+    { return data_entry->GetHtmlCellFlags(); }
+  void SetTarget(T * _target) { data_entry->SetTarget(_target); }
+  bool Print(std::ostream & fp) const { return data_entry->Print(fp); }
+  int Compare(T * other) const { return data_entry->Compare(other); }
+  bool SetValue(const cString & value) { return data_entry->Set(value); }
+  void HTMLPrint(std::ostream & fp, int compare=0, bool print_text=true)
+    { data_entry->HTMLPrint(fp, compare, print_text); }
+  QString text(void) const {
+    return data_entry->text();
+  }
+};
+
+
+#endif /* AVD_ANALYZER_DATA_ENTRY_PROTO_HH */
+
+// arch-tag: proto file for old analyzer data entry objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,10 @@
+#ifndef AVD_ANALYZER_DBG_MSGS_HH
+#include "avd_analyzer_dbg_msgs.hh"
+#endif
+
+cMessageType Info_GUI_ANALYZE_Msg("avd_Analyze", MCInfo);
+cMessageType Debug_GUI_ANALYZE_Msg("avd_Analyze", MCDebug);
+cMessageType Error_GUI_ANALYZE_Msg("avd_Analyze", MCError);
+cMessageType Fatal_GUI_ANALYZE_Msg("avd_Analyze", MCFatal);
+
+// arch-tag: implementation file for old analyzer debug message objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_ANALYZER_DBG_MSGS_HH
+#define AVD_ANALYZER_DBG_MSGS_HH
+
+#ifndef MESSAGE_DISPLAY_HDRS_HH
+#include "tools/message_display_hdrs.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DBG_MSGS_PROTO_HH
+#include "avd_analyzer_dbg_msgs_proto.hh"
+#endif
+
+
+#endif
+
+// arch-tag: header file for old analyzer debug message objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_dbg_msgs_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_ANALYZER_DBG_MSGS_PROTO_HH
+#define AVD_ANALYZER_DBG_MSGS_PROTO_HH
+
+extern cMessageType Info_GUI_ANALYZE_Msg;
+extern cMessageType Debug_GUI_ANALYZE_Msg;
+extern cMessageType Error_GUI_ANALYZE_Msg;
+extern cMessageType Fatal_GUI_ANALYZE_Msg;
+#define AnGuiInfo _INFO_MSG(GUI_ANALYZE)
+#define AnGuiDebug _DEBUG_MSG(GUI_ANALYZE)
+#define AnGuiError _ERROR_MSG(GUI_ANALYZE)
+#define AnGuiFatal _FATAL_MSG(GUI_ANALYZE)
+
+
+#endif
+
+// arch-tag: proto file for old analyzer debug message objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,19 @@
+#ifndef AVD_ANALYZER_GENOTYPE_LIST_ITEM_HH
+#define AVD_ANALYZER_GENOTYPE_LIST_ITEM_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+
+#ifndef AVD_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+#include "avd_analyzer_genotype_list_item_proto.hh"
+#endif
+
+
+#endif
+
+// arch-tag: header file for old analyzer genotype list item objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_genotype_list_item_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,20 @@
+#ifndef AVD_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+#define AVD_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH
+
+
+class cAnalyzeGenotype;
+class avd_o_AnalyzerGenotypeListItem : public QListViewItem {
+protected:
+  cAnalyzeGenotype *m_genotype;
+public:
+  avd_o_AnalyzerGenotypeListItem(
+    cAnalyzeGenotype *genotype,
+    QListView *parent
+  ):QListViewItem(parent), m_genotype(genotype)
+  {}
+  cAnalyzeGenotype *getGenotype(){ return m_genotype; }
+};
+
+#endif /* AVD_ANALYZER_GENOTYPE_LIST_ITEM_PROTO_HH */
+
+// arch-tag: proto file for old analyzer genotype list item objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,87 @@
+#ifndef QDRAGOBJECT_H
+#include <qdragobject.h>
+#endif
+#ifndef QEVENT_H
+#include <qevent.h>
+#endif
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_LISTVIEW_HH
+#include "avd_analyzer_listview.hh"
+#endif
+
+avd_o_AnalyzerListView::avd_o_AnalyzerListView(
+  QWidget *parent,
+  const char *name,
+  WFlags f
+):QListView(parent, name, f)
+{}
+
+/*
+This provides deleting current listviewitem using delete or backspace
+key.
+*/
+void avd_o_AnalyzerListView::keyPressEvent(QKeyEvent *e)
+{
+  QListView::keyPressEvent(e);
+
+  switch( e->key() ) {
+  case Key_Backspace:
+  case Key_Delete:
+    e->ignore();
+
+    if(!currentItem()
+    || !(currentItem()->isEnabled()
+      && currentItem()->isSelected())
+    ) break;
+
+    QListViewItem *next_selection = currentItem()->itemBelow();
+    if(!next_selection) next_selection = currentItem()->itemAbove();
+
+    emit deletePressed(currentItem());
+
+    if(viewport()->acceptDrops()
+    && next_selection
+    && next_selection->isEnabled()
+    && next_selection->isSelectable()
+    ) setSelected(next_selection, true);
+  }
+}
+
+QDragObject *avd_o_AnalyzerListView::dragObject(void){
+  if(currentItem() && currentItem()->isEnabled() && currentItem()->isSelected()){
+    emit dragStartSig(currentItem());
+    QTextDrag *text_drag = new QTextDrag(
+      currentItem()->text(header()->mapToIndex(0)),
+      this, "<avd_o_AnalyzerListView::dragObject(test_drag)>");
+    text_drag->setSubtype("avd_o_AnalyzerListView_format_choice");
+    /*
+    as currently used, a avd_o_AnalyzerListView object can move items
+    within itself only if it accepts drops; if it doesn't accept drops
+    then items will be copied from it to another avd_o_AnalyzerListView
+    instance.
+    */
+    if(viewport()->acceptDrops()) text_drag->dragMove();
+    else text_drag->dragCopy();
+
+    return text_drag;
+  } else return 0;
+}
+
+void avd_o_AnalyzerListView::contentsDragMoveEvent(QDragMoveEvent *e){
+  e->accept(e->provides("text/avd_analyzerlistview_format_choice"));
+}
+void avd_o_AnalyzerListView::contentsDropEvent(QDropEvent *e){
+  if(e->provides("text/avd_analyzerlistview_format_choice")){
+    e->accept();
+    emit dropEventSig(itemAt(contentsToViewport(e->pos())));
+  }
+}
+
+// arch-tag: implementation file for old analyzer list view object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,10 @@
+#ifndef AVD_ANALYZER_LISTVIEW_HH
+#define AVD_ANALYZER_LISTVIEW_HH
+
+#ifndef AVD_ANALYZER_LISTVIEW_PROTO_HH
+#include "avd_analyzer_listview_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for old analyzer list view object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_listview_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,30 @@
+#ifndef AVD_ANALYZER_LISTVIEW_PROTO_HH
+#define AVD_ANALYZER_LISTVIEW_PROTO_HH
+
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+
+class QDragObject;
+class QDragEnterEvent;
+class QKeyEvent;
+class QListViewItem;
+class avd_o_AnalyzerListView : public QListView {
+  Q_OBJECT
+protected:
+  void keyPressEvent(QKeyEvent *e);
+  QDragObject *dragObject(void);
+  virtual void contentsDragMoveEvent(QDragMoveEvent *e);
+  virtual void contentsDropEvent(QDropEvent *e);
+public:
+  avd_o_AnalyzerListView(
+    QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+signals:
+  void deletePressed(QListViewItem *);
+  void dragStartSig(QListViewItem *);
+  void dropEventSig(QListViewItem *);
+};
+
+#endif
+
+// arch-tag: proto file for old analyzer list view object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,97 @@
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+#ifndef QPOPUPMENU_H
+#include <qpopupmenu.h>
+#endif
+
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_MENUBAR_HANDLER_HH
+#include "avd_analyzer_menubar_handler.hh"
+#endif
+
+void avd_o_AnalyzerMenuBarHandler::setupMenuBar(QMenuBar *menubar){
+  if(menubar){
+      QPopupMenu *file_menu = new QPopupMenu(
+        menubar, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(file_menu)");
+        file_menu->insertItem(
+          "Load Current Genotypes...",
+          this, SIGNAL(loadCurrentGenotypesSig())
+        );
+        file_menu->insertItem(
+          "Load Historic Genotypes...",
+          this, SIGNAL(loadHistoricGenotypesSig())
+        );  
+        file_menu->insertItem(
+          "Open...", this, SIGNAL(openSig())
+        );  
+    menubar->insertItem("File", file_menu);
+
+      QPopupMenu *edit_menu = new QPopupMenu(
+        menubar, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(edit_menu)"
+      );
+        QPopupMenu *batches_submenu = new QPopupMenu(
+          edit_menu, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(batches_submenu)"
+        );
+          batches_submenu->insertItem(
+            "Delete", this, SIGNAL(deleteBatchesSig())
+          );
+          batches_submenu->insertItem(
+            "Merge", this, SIGNAL(mergeBatchesSig())
+          );
+          batches_submenu->insertItem(
+            "Duplicate", this, SIGNAL(duplicateBatchesSig())
+          );
+        edit_menu->insertItem("Batches", batches_submenu);
+        QPopupMenu *genotypes_submenu = new QPopupMenu(
+          edit_menu, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(genotypes_submenu)"
+        );
+        edit_menu->insertItem("Genotypes", genotypes_submenu);
+    menubar->insertItem("Edit", edit_menu);
+
+      QPopupMenu *select_menu = new QPopupMenu(
+        menubar, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(select_menu)"
+      );
+        QPopupMenu *reduction_submenu = new QPopupMenu(
+          select_menu, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(reduction_submenu)"
+        );
+          reduction_submenu->insertItem(
+            "Find Genotype", this, SIGNAL(findGenotypeSig())
+          );
+          reduction_submenu->insertItem(
+            "Find Lineage", this, SIGNAL(findLineageSig())
+          );
+          reduction_submenu->insertItem(
+            "Find Clade", this, SIGNAL(findCladeSig())
+          );
+          reduction_submenu->insertItem(
+            "Sample Organisms", this, SIGNAL(sampleOrganismsSig())
+          );
+          reduction_submenu->insertItem(
+            "Sample Genotypes", this, SIGNAL(sampleGenotypesSig())
+          );
+        select_menu->insertItem("Reduction", reduction_submenu);
+        select_menu->insertItem(
+          "Invert", this, SIGNAL(invertSig())
+        );
+    menubar->insertItem("Select", select_menu);
+
+      QPopupMenu *analyze_menu = new QPopupMenu(
+        menubar, "<avd_o_AnalyzerMenuBarHandler::setupMenuBar(analyze_menu)"
+      );
+        analyze_menu->insertItem(
+          "Genotype/Phenotype Map", this, SIGNAL(genotypePhenotypeMapSig())
+        );
+        analyze_menu->insertItem(
+          "Choose Columns...", this, SIGNAL(chooseColumnsSig())
+        );
+    menubar->insertItem("Analyze", analyze_menu);
+  } else {
+    AnGuiError << "asked to setup null menubar!";
+  }
+}
+
+// arch-tag: implementation file for old analyzer menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_menubar_handler.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,41 @@
+#ifndef AVD_ANALYZER_MENUBAR_HANDLER_HH
+#define AVD_ANALYZER_MENUBAR_HANDLER_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+
+class QMenuBar;
+class avd_o_AnalyzerMenuBarHandler : public QObject {
+  Q_OBJECT
+public:
+  avd_o_AnalyzerMenuBarHandler(
+    QObject *parent = 0,
+    const char *name = 0
+  ):QObject(parent, name){}
+  void setupMenuBar(QMenuBar *menubar);
+signals:
+  void loadCurrentGenotypesSig();
+  void loadHistoricGenotypesSig();
+  void openSig();
+
+  void deleteBatchesSig();
+  void mergeBatchesSig();
+  void duplicateBatchesSig();
+
+  void findGenotypeSig();
+  void findLineageSig();
+  void findCladeSig();
+  void sampleOrganismsSig();
+  void sampleGenotypesSig();
+  void invertSig();
+
+  void genotypePhenotypeMapSig();
+  void chooseColumnsSig();
+};
+
+
+#endif
+
+// arch-tag: header file for old analyzer menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,484 @@
+#ifndef ENVIRONMENT_HH
+#include "main/environment.hh"
+#endif
+#ifndef TASKS_HH
+#include "main/tasks.hh"
+#endif
+#ifndef TEST_CPU_HH
+#include "cpu/test_cpu.hh"
+#endif
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_HH
+#include "avd_analyzer_data_entry.hh"
+#endif
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_MODEL_HH
+#include "avd_analyzer_model.hh"
+#endif
+
+
+bool avd_o_AnalyzerModel::LoadDetailDump(cString cur_string)
+{
+  AnGuiDebug << "entered.";
+  // LOAD_DETAIL_DUMP
+
+  cString filename = cur_string.PopWord();
+
+  AnGuiInfo << "Loading: " << filename;
+
+  cInitFile input_file(filename);
+  if (!input_file.IsOpen()) {
+    AnGuiError << "Cannot load file: \"" << filename << "\".";
+    return false;
+  }
+  input_file.Load();
+  input_file.Compress();
+  input_file.Close();
+
+  // Setup the genome...
+
+  for (int line_id = 0; line_id < input_file.GetNumLines(); line_id++) {
+    cString cur_line = input_file.GetLine(line_id);
+
+    // Setup the genotype for this line...
+
+    int id_num      = cur_line.PopWord().AsInt();
+    int parent_id   = cur_line.PopWord().AsInt();
+    int parent_dist = cur_line.PopWord().AsInt();
+    int num_cpus    = cur_line.PopWord().AsInt();
+    int total_cpus  = cur_line.PopWord().AsInt();
+    int length      = cur_line.PopWord().AsInt();
+    double merit    = cur_line.PopWord().AsDouble();
+    int gest_time   = cur_line.PopWord().AsInt();
+    double fitness  = cur_line.PopWord().AsDouble();
+    int update_born = cur_line.PopWord().AsInt();
+    int update_dead = cur_line.PopWord().AsInt();
+    int depth       = cur_line.PopWord().AsInt();
+    cString name = cStringUtil::Stringf("org-%d", id_num);
+
+    cAnalyzeGenotype * genotype =
+      new cAnalyzeGenotype(cur_line.PopWord(), inst_set);
+    if(!genotype){
+      AnGuiFatal << "Couldn't make new cAnalyzeGenotype.  Out of memory?";
+    }
+
+    genotype->SetID(id_num);
+    genotype->SetParentID(parent_id);
+    genotype->SetParentDist(parent_dist);
+    genotype->SetNumCPUs(num_cpus);
+    genotype->SetTotalCPUs(total_cpus);
+    genotype->SetLength(length);
+    genotype->SetMerit(merit);
+    genotype->SetGestTime(gest_time);
+    genotype->SetFitness(fitness);
+    genotype->SetUpdateBorn(update_born);
+    genotype->SetUpdateDead(update_dead);
+    genotype->SetDepth(depth);
+    genotype->SetName(name);
+
+    // Add this genotype to the proper batch.
+    batch[cur_batch].List().PushRear(genotype);
+  }
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+
+  AnGuiDebug << "done.";
+  return true;
+}
+
+bool avd_o_AnalyzerModel::LoadFile(cString cur_string)
+{
+  // LOAD
+  AnGuiDebug << "entered.";
+
+  cString filename = cur_string.PopWord();
+
+  AnGuiInfo << "Loading: " << filename;
+
+  cInitFile input_file(filename);
+  if (!input_file.IsOpen()) {
+    AnGuiError << "Cannot load file: \"" << filename << "\".";
+    /* FIXME:  make an error window to give user feedback. -- kgn */
+    /* no other cleanup appears needed. -- kgn */
+    return false;
+  }
+  input_file.Load();
+  input_file.ReadHeader();
+  input_file.Compress();
+  input_file.Close();
+
+  const cString filetype = input_file.GetFiletype();
+  if (filetype != "population_data") {
+    AnGuiError << "Cannot load files of type \"" << filetype << "\".";
+    /* FIXME:  make an error window to give user feedback. -- kgn */
+    /* no other cleanup appears needed. -- kgn */
+    return false;
+  }
+
+  if (verbose == true) {
+    AnGuiInfo << "Loading file of type: " << filetype;
+  }
+
+
+  // Construct a linked list of data types that can be loaded...
+  tList< tDataEntryCommand<cAnalyzeGenotype> > output_list;
+  tListIterator< tDataEntryCommand<cAnalyzeGenotype> > output_it(output_list);
+  LoadGenotypeDataList(input_file.GetFormat(), output_list);
+
+
+  // Setup the genome...
+  cGenome default_genome(1);
+  int load_count = 0;
+
+  for (int line_id = 0; line_id < input_file.GetNumLines(); line_id++) {
+    cString cur_line = input_file.GetLine(line_id);
+
+    cAnalyzeGenotype * genotype =
+      new cAnalyzeGenotype(default_genome, inst_set);
+    if(!genotype){
+      AnGuiFatal << "Couldn't make new cAnalyzeGenotype.  Out of memory?";
+    }
+
+    output_it.Reset();
+    tDataEntryCommand<cAnalyzeGenotype> * data_command = NULL;
+    while ((data_command = output_it.Next()) != NULL) {
+      data_command->SetTarget(genotype);
+//        genotype->SetSpecialArgs(data_command->GetArgs());
+      data_command->SetValue(cur_line.PopWord());
+    }
+
+    // Make sure this genotype has a name...
+    if (genotype->GetName() == "") {
+      cString name = cStringUtil::Stringf("org-D%d", load_count++);
+      genotype->SetName(name);
+    }
+
+    // Add this genotype to the proper batch.
+    batch[cur_batch].List().PushRear(genotype);
+  }
+
+  // Adjust the flags on this batch
+  batch[cur_batch].SetLineage(false);
+  batch[cur_batch].SetAligned(false);
+
+
+  AnGuiDebug << "done.";
+  return true;
+}
+
+void avd_o_AnalyzerModel::SetupGenotypeDataList()
+{
+  if (genotype_data_list.GetSize() != 0) return; // List already setup.
+
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, bool>
+       ("viable",      "Is Viable (0/1)", &cAnalyzeGenotype::GetViable,
+        &cAnalyzeGenotype::SetViable));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("id",          "Genome ID",       &cAnalyzeGenotype::GetID,
+        &cAnalyzeGenotype::SetID));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+       ("tag",         "Genotype Tag",    &cAnalyzeGenotype::GetTag,
+        &cAnalyzeGenotype::SetTag,
+        &cAnalyzeGenotype::CompareNULL, "(none)", ""));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("parent_id",   "Parent ID",       &cAnalyzeGenotype::GetParentID,
+        &cAnalyzeGenotype::SetParentID));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("parent_dist", "Parent Distance", &cAnalyzeGenotype::GetParentDist,
+        &cAnalyzeGenotype::SetParentDist));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("ancestor_dist","Ancestor Distance",&cAnalyzeGenotype::GetAncestorDist,
+        &cAnalyzeGenotype::SetAncestorDist));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("num_cpus",    "Number of CPUs",  &cAnalyzeGenotype::GetNumCPUs,
+        &cAnalyzeGenotype::SetNumCPUs));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("total_cpus",  "Total CPUs Ever", &cAnalyzeGenotype::GetTotalCPUs,
+        &cAnalyzeGenotype::SetTotalCPUs));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("length",      "Genome Length",   &cAnalyzeGenotype::GetLength,
+        &cAnalyzeGenotype::SetLength, &cAnalyzeGenotype::CompareLength));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("copy_length", "Copied Length",   &cAnalyzeGenotype::GetCopyLength,
+        &cAnalyzeGenotype::SetCopyLength));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("exe_length",  "Executed Length", &cAnalyzeGenotype::GetExeLength,
+        &cAnalyzeGenotype::SetExeLength));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("merit",       "Merit",           &cAnalyzeGenotype::GetMerit,
+        &cAnalyzeGenotype::SetMerit, &cAnalyzeGenotype::CompareMerit));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("comp_merit",  "Computational Merit", &cAnalyzeGenotype::GetCompMerit,
+        (void (cAnalyzeGenotype::*)(double)) NULL, &cAnalyzeGenotype::CompareCompMerit));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("comp_merit_ratio", "Computational Merit Ratio",
+        &cAnalyzeGenotype::GetCompMeritRatio,
+        (void (cAnalyzeGenotype::*)(double)) NULL,
+        &cAnalyzeGenotype::CompareCompMerit));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("gest_time",   "Gestation Time",  &cAnalyzeGenotype::GetGestTime,
+        &cAnalyzeGenotype::SetGestTime,
+        &cAnalyzeGenotype::CompareGestTime, "Inf."));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("efficiency",  "Rep. Efficiency", &cAnalyzeGenotype::GetEfficiency,
+        (void (cAnalyzeGenotype::*)(double)) NULL,
+        &cAnalyzeGenotype::CompareEfficiency));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("efficiency_ratio", "Rep. Efficiency Ratio",
+        &cAnalyzeGenotype::GetEfficiencyRatio,
+        (void (cAnalyzeGenotype::*)(double)) NULL,
+        &cAnalyzeGenotype::CompareEfficiency));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("fitness",     "Fitness",         &cAnalyzeGenotype::GetFitness,
+        &cAnalyzeGenotype::SetFitness, &cAnalyzeGenotype::CompareFitness));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("div_type",     "Divide Type",         &cAnalyzeGenotype::GetDivType,
+        &cAnalyzeGenotype::SetDivType));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("fitness_ratio", "Fitness Ratio", &cAnalyzeGenotype::GetFitnessRatio,
+        (void (cAnalyzeGenotype::*)(double)) NULL,
+        &cAnalyzeGenotype::CompareFitness));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("update_born", "Update Born",     &cAnalyzeGenotype::GetUpdateBorn,
+        &cAnalyzeGenotype::SetUpdateBorn));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("update_dead", "Update Dead",     &cAnalyzeGenotype::GetUpdateDead,
+        &cAnalyzeGenotype::SetUpdateDead));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("depth",       "Tree Depth",      &cAnalyzeGenotype::GetDepth,
+        &cAnalyzeGenotype::SetDepth));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("frac_dead",   "Fraction Mutations Lethal",
+        &cAnalyzeGenotype::GetFracDead,
+        (void (cAnalyzeGenotype::*)(double)) NULL));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("frac_neg",   "Fraction Mutations Detrimental",
+        &cAnalyzeGenotype::GetFracNeg,
+        (void (cAnalyzeGenotype::*)(double)) NULL));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("frac_neut",   "Fraction Mutations Neutral",
+        &cAnalyzeGenotype::GetFracNeut,
+        (void (cAnalyzeGenotype::*)(double)) NULL));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, double>
+       ("frac_pos",   "Fraction Mutations Beneficial",
+        &cAnalyzeGenotype::GetFracPos,
+        (void (cAnalyzeGenotype::*)(double)) NULL));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+       ("parent_muts", "Mutations from Parent",
+        &cAnalyzeGenotype::GetParentMuts, &cAnalyzeGenotype::SetParentMuts,
+        &cAnalyzeGenotype::CompareNULL, "(none)", ""));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+       ("task_order", "Task Performance Order",
+        &cAnalyzeGenotype::GetTaskOrder, &cAnalyzeGenotype::SetTaskOrder,
+        &cAnalyzeGenotype::CompareNULL, "(none)", ""));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, cString>
+       ("sequence",    "Genome Sequence",
+        &cAnalyzeGenotype::GetSequence, &cAnalyzeGenotype::SetSequence,
+        &cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, const cString &>
+       ("alignment",   "Aligned Sequence",
+        &cAnalyzeGenotype::GetAlignedSequence,
+        &cAnalyzeGenotype::SetAlignedSequence,
+        &cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, cString>
+       ("task_list",    "List of all tasks performed",
+        &cAnalyzeGenotype::GetTaskList,
+        (void (cAnalyzeGenotype::*)(cString)) NULL,
+        &cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, cString>
+       ("link.tasksites", "Phenotype Map", &cAnalyzeGenotype::GetMapLink,
+        (void (cAnalyzeGenotype::*)(cString)) NULL));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, cString>
+       ("html.sequence",  "Genome Sequence",
+        &cAnalyzeGenotype::GetHTMLSequence,
+        (void (cAnalyzeGenotype::*)(cString)) NULL,
+        &cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+
+  const cTaskLib & task_lib = cTestCPU::GetEnvironment()->GetTaskLib();
+  for (int i = 0; i < task_lib.GetSize(); i++) {
+    cString t_name, t_desc;
+    t_name.Set("task.%d", i);
+    t_desc = task_lib.GetTask(i).GetDesc();
+    genotype_data_list.PushRear(new avd_o_AnalyzerArgDataEntry<cAnalyzeGenotype, int, int>
+        (t_name, t_desc, &cAnalyzeGenotype::GetTaskCount, i,
+         &cAnalyzeGenotype::CompareTaskCount));
+  }
+
+  // The remaining values should actually go in a seperate list called
+  // "population_data_list", but for the moment we're going to put them
+  // here so that we only need to worry about a single system to load and
+  // save genotype information.
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("update",       "Update Output",
+        &cAnalyzeGenotype::GetUpdateDead, &cAnalyzeGenotype::SetUpdateDead));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("dom_num_cpus", "Number of Dominant Organisms",
+        &cAnalyzeGenotype::GetNumCPUs, &cAnalyzeGenotype::SetNumCPUs));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("dom_depth",    "Tree Depth of Dominant Genotype",
+        &cAnalyzeGenotype::GetDepth, &cAnalyzeGenotype::SetDepth));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, int>
+       ("dom_id",       "Dominant Genotype ID",
+        &cAnalyzeGenotype::GetID, &cAnalyzeGenotype::SetID));
+  genotype_data_list.PushRear(new avd_o_AnalyzerDataEntry<cAnalyzeGenotype, cString>
+       ("dom_sequence", "Dominant Genotype Sequence",
+        &cAnalyzeGenotype::GetSequence, &cAnalyzeGenotype::SetSequence,
+        &cAnalyzeGenotype::CompareNULL, "(N/A)", ""));
+}
+
+bool avd_o_AnalyzerModel::loadCurrentGenotypes(cString filename){
+  AnGuiDebug << "entered, but this method is currently empty.";
+  return true;
+}
+bool avd_o_AnalyzerModel::loadHistoricGenotypes(cString filename){
+  AnGuiDebug << "entered.";
+  bool result = LoadDetailDump(filename);
+  AnGuiDebug << "done.";
+  return result;
+}
+bool avd_o_AnalyzerModel::open(cString filename){
+  AnGuiDebug << "entered.";
+  bool result = LoadFile(filename);
+  AnGuiDebug << "done.";
+  return result;
+}
+bool avd_o_AnalyzerModel::batchName(int idx, cString name) { 
+  AnGuiDebug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  if (name.CountNumWords() == 0) {
+    AnGuiError << "didn't rename batch because no new name was given.";
+    return false;
+  }
+  batch[idx].Name() = name.PopWord();
+  AnGuiDebug << "new name: \"" << batch[idx].Name() << "\".";
+  AnGuiDebug << "done.";
+  return true;
+}
+
+
+void avd_o_AnalyzerModel::setCurrentBatchIdx(int idx){
+  AnGuiDebug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  cur_batch = idx;
+  AnGuiDebug << "new index: " << idx << ".";
+  AnGuiDebug << "done.";
+}
+int avd_o_AnalyzerModel::getCurrentBatchIdx(void){
+  return cur_batch;
+}
+
+cGenotypeBatch *avd_o_AnalyzerModel::getBatchAt(int idx){
+  AnGuiDebug << "entered.";
+  assert(0<=idx && idx<MAX_BATCHES);
+  AnGuiDebug << "done.";
+  return batch + idx;
+}
+
+void avd_o_AnalyzerModel::LoadDataEntryCommands(
+  cStringList arg_list,
+  tList< avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> > &output_list
+){
+  AnGuiDebug << "entered.";
+
+  // If no args were given, load all of the stats.
+  if (arg_list.GetSize() == 0) {
+    tListIterator< avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> >
+      genotype_data_it(getGenotypeDataList());
+    while (genotype_data_it.Next() != (void *) NULL) {
+      avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+        new avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype>(genotype_data_it.Get());
+      output_list.PushRear(entry_command);
+    }
+  }
+  // Otherwise, load only those listed.
+  else {
+    while (arg_list.GetSize() != 0) {
+      // Setup the next entry
+      cString cur_args = arg_list.Pop();
+      cString cur_entry = cur_args.Pop(':');
+      bool found_entry = false;
+
+      AnGuiDebug << "new arg: " << cur_args << ", entry: " << cur_entry;
+
+      // Scan the genotype data list for the current entry
+      tListIterator< avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> >
+        genotype_data_it(getGenotypeDataList());
+
+      while (genotype_data_it.Next() != (void *) NULL) {
+        if (genotype_data_it.Get()->GetName() == cur_entry) {
+          avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> * entry_command =
+            new avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype>
+            (genotype_data_it.Get(), cur_args);
+          output_list.PushRear(entry_command);
+          AnGuiDebug << "added new entry command.";
+          found_entry = true;
+          break;
+        }
+      }
+
+      // If the entry was not found, give a warning.
+      if (found_entry == false) {
+        int best_match = 1000;
+        cString best_entry;
+
+        genotype_data_it.Reset();
+        while (genotype_data_it.Next() != (void *) NULL) {
+          const cString & test_str = genotype_data_it.Get()->GetName();
+          const int test_dist = cStringUtil::EditDistance(test_str, cur_entry);
+          if (test_dist < best_match) {
+            best_match = test_dist;
+            best_entry = test_str;
+          }
+        }
+
+        AnGuiError << "Warning: Format entry \"" << cur_entry
+             << "\" not found.  Best match is \""
+             << best_entry << "\".";
+      }
+
+    }
+  }
+
+  AnGuiDebug << "output_list.GetSize(): " << output_list.GetSize();
+  AnGuiDebug << "done.";
+}
+
+avd_o_AnalyzerModel::avd_o_AnalyzerModel():cAnalyze(){
+  AnGuiDebug << "constructor.";
+  //m_genotype_data_list.nameWatched(
+  //  "<avd_o_AnalyzerModel(m_genotype_data_list)>");
+}
+
+tList< avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> > &
+avd_o_AnalyzerModel::getGenotypeDataList(void){
+  AnGuiDebug << "entered.";
+  SetupGenotypeDataList();
+  if(m_genotype_data_list.GetSize() == 0){
+    tListIterator<tDataEntryBase<cAnalyzeGenotype> >
+      it(genotype_data_list);
+    it.Reset();
+    while(it.Next() != 0)
+      /*
+      This is so not typesafe:
+      */
+      m_genotype_data_list.PushRear(
+        static_cast<avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> *>(it.Get())
+      );
+      /*
+      It only works because avd_o_AnalyzerModel::SetupGenotypeDataList(),
+      defined above, has pushed avd_o_AnalyzerDataEntry objects into
+      genotype_data_list, instead of tDataEntry objects.
+      */
+  }
+  AnGuiDebug << "done.";
+  return m_genotype_data_list;
+}
+
+// arch-tag: implementation file for old analyzer model
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,17 @@
+#ifndef AVD_ANALYZER_MODEL_HH
+#define AVD_ANALYZER_MODEL_HH
+
+#ifndef ANALYZE_HH
+#include "main/analyze.hh"
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+
+#ifndef AVD_ANALYZER_MODEL_PROTO_HH
+#include "avd_analyzer_model_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for old analyzer model
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_model_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,34 @@
+#ifndef AVD_ANALYZER_MODEL_PROTO_HH
+#define AVD_ANALYZER_MODEL_PROTO_HH
+
+
+class cGenotypeBatch;
+class avd_o_AnalyzerModel : public cAnalyze {
+protected:
+  tList<avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> > m_genotype_data_list;
+protected:
+  bool LoadDetailDump(cString cur_string);
+  bool LoadFile(cString cur_string);
+  void SetupGenotypeDataList();
+public:
+  bool loadCurrentGenotypes(cString filename);
+  bool loadHistoricGenotypes(cString filename);
+  bool open(cString filename);
+  bool batchName(int idx, cString name);
+
+  void setCurrentBatchIdx(int idx);
+
+  int getCurrentBatchIdx(void);
+  cGenotypeBatch *getBatchAt(int idx);
+  tList< avd_o_AnalyzerDataEntryBase<cAnalyzeGenotype> > &getGenotypeDataList(void);
+  void LoadDataEntryCommands(
+    cStringList arg_list,
+    tList< avd_o_AnalyzerDataEntryCommand<cAnalyzeGenotype> > &output_list
+  );
+
+  avd_o_AnalyzerModel();
+};
+
+#endif
+
+// arch-tag: proto file for old analyzer model
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,299 @@
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QSPLITTER_H
+#include <qsplitter.h>
+#endif
+
+
+#ifndef AVD_ANALYZER_DATA_ENTRY_COMMAND_LIST_ITEM_HH
+#include "avd_analyzer_data_entry_command_list_item.hh"
+#endif
+#ifndef AVD_ANALYZER_LISTVIEW_HH
+#include "avd_analyzer_listview.hh"
+#endif
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_OUTPUT_FMT_SELECTOR_HH
+#include "avd_analyzer_output_fmt_selector.hh"
+#endif
+
+
+struct avd_o_AnalyzerViewOutputFmtSelectorData {
+  avd_o_AnalyzerListView *m_format_menu_lv;
+  avd_o_AnalyzerListView *m_formats_chosen_lv;
+  avd_o_AnalyzerDataEntryCommandListItem *m_source_drag_lvi;
+  QPushButton *m_cancel_button;
+  QPushButton *m_apply_button;
+  QPushButton *m_okay_button;
+};
+
+QListView *avd_o_AnalyzerViewOutputFmtSelector::getMenuListView()
+{ return d->m_format_menu_lv; }
+QListView *avd_o_AnalyzerViewOutputFmtSelector::getChoiceListView()
+{ return d->m_formats_chosen_lv; }
+QPushButton *avd_o_AnalyzerViewOutputFmtSelector::getCancelButton()
+{ return d->m_cancel_button; }
+QPushButton *avd_o_AnalyzerViewOutputFmtSelector::getApplyButton()
+{ return d->m_apply_button; }
+QPushButton *avd_o_AnalyzerViewOutputFmtSelector::getOkayButton()
+{ return d->m_okay_button; }
+
+void avd_o_AnalyzerViewOutputFmtSelector::deletePressedSlot(QListViewItem *lvi){
+  if(lvi) delete lvi;
+}
+
+/*
+Two methods supporting drag-and-drop.
+*/
+void avd_o_AnalyzerViewOutputFmtSelector::dragStartSlot(QListViewItem *lvi){
+  d->m_source_drag_lvi =
+    static_cast<avd_o_AnalyzerDataEntryCommandListItem *>(lvi);
+}
+void avd_o_AnalyzerViewOutputFmtSelector::dropEventSlot(QListViewItem *lvi){
+  AnGuiDebug << "entered.";
+  /*
+  check whether this just a move within the formats-chosen listview.
+  */
+  if(d->m_formats_chosen_lv == d->m_source_drag_lvi->listView()){
+    AnGuiDebug << "move.";
+    /*
+    moving the source format item within the chosen list.
+    decide whether to place source immediately before or after
+    target.
+    */
+    bool place_source_after_target = true;
+    QListViewItemIterator it(lvi);
+    while((++it).current()){
+      if(d->m_source_drag_lvi == it.current()){
+        place_source_after_target = false;
+        break;
+    } }
+    // place source after target.
+    d->m_source_drag_lvi->moveItem(lvi);
+    if(!place_source_after_target)
+      // swap if we need to do so.
+      lvi->moveItem(d->m_source_drag_lvi);
+  } else {
+    /*
+    This is a copy from the format-choices listview to the
+    formats-chosen listview.
+    */
+    AnGuiDebug << "copy.";
+    /*
+    see whether the source already exists in the formats-chosen
+    listview.
+    */
+    QListViewItem *duplicate = d->m_formats_chosen_lv->findItem(
+      d->m_source_drag_lvi->getName(),
+      d->m_formats_chosen_lv->header()->mapToIndex(0));
+    if(duplicate){
+      duplicate->moveItem(lvi);
+      d->m_formats_chosen_lv->setSelected(duplicate, true);
+    } else {
+      /*
+      source isn't duplicated, so we can make a new one.
+      */
+      avd_o_AnalyzerDataEntryCommandListItem *adec_lvi =
+        new avd_o_AnalyzerDataEntryCommandListItem(
+          d->m_source_drag_lvi->getDataEntryCommand(),
+          d->m_formats_chosen_lv);
+      adec_lvi->setDragEnabled(true);
+      adec_lvi->setDropEnabled(true);
+      adec_lvi->moveItem(lvi);
+      d->m_formats_chosen_lv->setSelected(adec_lvi, true);
+    }
+  }
+  AnGuiDebug << "done.";
+}
+void avd_o_AnalyzerViewOutputFmtSelector::copyButtonSlot(){
+  AnGuiDebug << "entered.";
+  if(d->m_format_menu_lv->currentItem()
+  && d->m_format_menu_lv->currentItem()->isEnabled()
+  && d->m_format_menu_lv->currentItem()->isSelected()
+  ){
+    /*
+    see whether the source already exists in the formats-chosen
+    listview.
+    */
+    avd_o_AnalyzerDataEntryCommandListItem *src_lvi =
+      static_cast<avd_o_AnalyzerDataEntryCommandListItem *>(
+        d->m_format_menu_lv->currentItem());
+    QListViewItem *duplicate = d->m_formats_chosen_lv->findItem(
+      src_lvi->getName(),
+      0);
+      //d->m_formats_chosen_lv->header()->mapToIndex(0));
+    if(duplicate){
+      /*
+      move the duplicate up to the top of the formats-chosen listview.
+      */
+      d->m_formats_chosen_lv->takeItem(duplicate);
+      d->m_formats_chosen_lv->insertItem(duplicate);
+      d->m_formats_chosen_lv->setSelected(duplicate, true);
+    } else {
+      /*
+      source isn't duplicated, so we can make a new one.
+      */
+      avd_o_AnalyzerDataEntryCommandListItem *new_lvi =
+        new avd_o_AnalyzerDataEntryCommandListItem(
+          src_lvi->getDataEntryCommand(),
+          d->m_formats_chosen_lv);
+      new_lvi->setDragEnabled(true);
+      new_lvi->setDropEnabled(true);
+      d->m_formats_chosen_lv->setSelected(new_lvi, true);
+    }
+  }
+  AnGuiDebug << "done.";
+}
+
+avd_o_AnalyzerViewOutputFmtSelector::~avd_o_AnalyzerViewOutputFmtSelector(){
+  AnGuiDebug << "...";
+}
+avd_o_AnalyzerViewOutputFmtSelector::avd_o_AnalyzerViewOutputFmtSelector(
+  QWidget *parent,
+  const char *name,
+  WFlags f
+):QMainWindow(parent, name, f)
+{
+  AnGuiDebug << "constructor.";
+
+  d = new avd_o_AnalyzerViewOutputFmtSelectorData;
+  if(!d){
+    AnGuiFatal
+    << "Couldn't allocate new avd_o_AnalyzerViewOutputFmtSelectorData! "
+    << "Out of memory?";
+  }
+
+  QWidget *central_widget = new QWidget(
+    this, "<avd_o_AnalyzerViewOutputFmtSelector(central_widget)>");
+  QVBoxLayout *top_layout = new QVBoxLayout(
+    central_widget, 10, -1,
+    "<avd_o_AnalyzerViewOutputFmtSelector(top_layout)>");
+  setCentralWidget(central_widget);
+
+    QSplitter *horizontal_splitter = new QSplitter(
+      Qt::Horizontal, central_widget,
+      "<avd_o_AnalyzerViewOutputFmtSelector(horizontal_splitter)>");
+    horizontal_splitter->setOpaqueResize(true);
+    top_layout->addWidget(horizontal_splitter, 1);
+
+      QWidget *fmt_menu_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avd_o_AnalyzerViewOutputFmtSelector(fmt_menu_layout_widget)>");
+      QHBoxLayout *fmt_menu_layout = new QHBoxLayout(
+        fmt_menu_layout_widget, 10, -1,
+        "<avd_o_AnalyzerViewOutputFmtSelector(selector_layout)>");
+      horizontal_splitter->moveToFirst(fmt_menu_layout_widget);
+
+        d->m_format_menu_lv = new avd_o_AnalyzerListView(
+          fmt_menu_layout_widget,
+          "<avd_o_AnalyzerViewOutputFmtSelector(m_format_menu_lv)>");
+        d->m_format_menu_lv->setSizePolicy(
+          QSizePolicy::Preferred, QSizePolicy::Preferred,
+          d->m_format_menu_lv->sizePolicy().hasHeightForWidth());
+        d->m_format_menu_lv->setSorting(-1);
+        d->m_format_menu_lv->setAllColumnsShowFocus(true);
+        d->m_format_menu_lv->viewport()->setAcceptDrops(false);
+        d->m_format_menu_lv->addColumn("Name");
+        d->m_format_menu_lv->addColumn("Description");
+        fmt_menu_layout->addWidget(d->m_format_menu_lv);
+
+      QWidget *selector_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avd_o_AnalyzerViewOutputFmtSelector(selector_layout_widget)>");
+      QHBoxLayout *selector_layout = new QHBoxLayout(
+        selector_layout_widget, 10, -1,
+        "<avd_o_AnalyzerViewOutputFmtSelector(selector_layout)>");
+      horizontal_splitter->moveToLast(selector_layout_widget);
+
+        QVBoxLayout *button_layout = new QVBoxLayout(
+          selector_layout, -1,
+          "<avd_o_AnalyzerViewOutputFmtSelector(button_layout)>");
+
+          QPushButton *copy_btn = new QPushButton(
+            "  ->  ", selector_layout_widget);
+          button_layout->addWidget(copy_btn);
+          copy_btn->setMaximumWidth(copy_btn->sizeHint().width());
+
+        QVBoxLayout *chosen_layout = new QVBoxLayout(
+          selector_layout, -1,
+          "<avd_o_AnalyzerViewOutputFmtSelector(chosen_layout)>");
+
+          d->m_formats_chosen_lv = new avd_o_AnalyzerListView(
+            selector_layout_widget,
+            "<avd_o_AnalyzerViewOutputFmtSelector(m_formats_chosen_lv)>");
+          d->m_formats_chosen_lv->setSizePolicy(
+            QSizePolicy::Preferred, QSizePolicy::Preferred,
+            d->m_formats_chosen_lv->sizePolicy().hasHeightForWidth());
+          d->m_formats_chosen_lv->setSorting(-1);
+          d->m_formats_chosen_lv->setAllColumnsShowFocus(true);
+          d->m_formats_chosen_lv->viewport()->setAcceptDrops(true);
+          d->m_formats_chosen_lv->setDragAutoScroll(true);
+          d->m_formats_chosen_lv->addColumn("Name");
+          d->m_formats_chosen_lv->addColumn("Description");
+          chosen_layout->addWidget(d->m_formats_chosen_lv);
+
+    QWidget *finishbuttons_layout_widget = new QWidget(
+      central_widget,
+      "<avd_o_AnalyzerViewOutputFmtSelector(finishbuttons_layout_widget)");
+    QHBoxLayout *finishbuttons_layout = new QHBoxLayout(
+      finishbuttons_layout_widget, 10, -1,
+      "<avd_o_AnalyzerViewOutputFmtSelector(finishbuttons_layout)>");
+    top_layout->addWidget(finishbuttons_layout_widget);
+
+      d->m_cancel_button = new QPushButton(
+        "Cancel", finishbuttons_layout_widget,
+        "<avd_o_AnalyzerViewOutputFmtSelector(cancel_button)>");
+      finishbuttons_layout->addWidget(d->m_cancel_button);
+
+      QSpacerItem *finishbuttons_spacer = new QSpacerItem(
+        0, 0, QSizePolicy::MinimumExpanding
+      );
+      finishbuttons_layout->addItem(finishbuttons_spacer);
+
+      d->m_apply_button = new QPushButton(
+        "Apply", finishbuttons_layout_widget,
+        "<avd_o_AnalyzerViewOutputFmtSelector(apply_button)>");
+      finishbuttons_layout->addWidget(d->m_apply_button);
+
+      d->m_okay_button = new QPushButton(
+        "Okay", finishbuttons_layout_widget,
+        "<avd_o_AnalyzerViewOutputFmtSelector(okay_button)>");
+      finishbuttons_layout->addWidget(d->m_okay_button);
+
+      connect(
+        d->m_format_menu_lv,
+        SIGNAL(dragStartSig(QListViewItem *)),
+        this, SLOT(dragStartSlot(QListViewItem *)));
+      connect(
+        d->m_formats_chosen_lv,
+        SIGNAL(dragStartSig(QListViewItem *)),
+        this, SLOT(dragStartSlot(QListViewItem *)));
+      connect(
+        d->m_formats_chosen_lv,
+        SIGNAL(deletePressed(QListViewItem *)),
+        this, SLOT(deletePressedSlot(QListViewItem *)));
+      connect(
+        copy_btn, SIGNAL(clicked()),
+        this, SLOT(copyButtonSlot()));
+      connect(
+        d->m_formats_chosen_lv,
+        SIGNAL(dropEventSig(QListViewItem *)),
+        this, SLOT(dropEventSlot(QListViewItem *)));
+}
+
+// arch-tag: implementation file for old analyzer view output format selector
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_output_fmt_selector.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,38 @@
+#ifndef AVD_ANALYZER_OUTPUT_FMT_SELECTOR_HH
+#define AVD_ANALYZER_OUTPUT_FMT_SELECTOR_HH
+
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+
+
+class QListView;
+class QListViewItem;
+class QPushButton;
+class avd_o_AnalyzerViewOutputFmtSelectorData;
+class avd_o_AnalyzerViewOutputFmtSelector : public QMainWindow {
+  Q_OBJECT
+protected:
+  avd_o_AnalyzerViewOutputFmtSelectorData *d;
+public:
+  avd_o_AnalyzerViewOutputFmtSelector(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  ~avd_o_AnalyzerViewOutputFmtSelector();
+  QListView *getMenuListView();
+  QListView *getChoiceListView();
+  QPushButton *getCancelButton();
+  QPushButton *getApplyButton();
+  QPushButton *getOkayButton();
+protected slots:
+  void deletePressedSlot(QListViewItem *lvi);
+  void dragStartSlot(QListViewItem *);
+  void dropEventSlot(QListViewItem *);
+  void copyButtonSlot();
+};
+
+#endif
+
+// arch-tag: header file for old analyzer view output format selector
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_utils.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_utils.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_utils.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_ANALYZER_UTILS_HH
+#define AVD_ANALYZER_UTILS_HH
+
+#ifndef SCOPEGUARD_H_
+#include "memory_mgt/ScopeGuard.h"
+#endif
+
+#ifndef AVD_ANALYZER_DBG_MSGS_HH
+#include "avd_analyzer_dbg_msgs.hh"
+#endif
+
+
+#endif /* AVD_ANALYZER_UTILS_HH */
+
+// arch-tag: header file for old analyzer debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.cc	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,115 @@
+#ifndef QHEADER_H
+#include <qheader.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+#ifndef QSPLITTER_H
+#include <qsplitter.h>
+#endif
+
+#ifndef AVD_ANALYZER_UTILS_HH
+#include "avd_analyzer_utils.hh"
+#endif
+
+#ifndef AVD_ANALYZER_VIEW_HH
+#include "avd_analyzer_view.hh"
+#endif
+
+
+struct avd_o_AnalyzerViewData {
+  QListView *m_batch_lv, *m_genotype_lv; 
+};
+
+QListView *avd_o_AnalyzerView::getBatchesListView(void){
+  return (d)?(d->m_batch_lv):(0); }
+QListView *avd_o_AnalyzerView::getGenotypesListView(void){
+  return (d)?(d->m_genotype_lv):(0); }
+
+avd_o_AnalyzerView::~avd_o_AnalyzerView(){
+  AnGuiDebug << "destructor.";
+}
+
+avd_o_AnalyzerView::avd_o_AnalyzerView(
+  QWidget *parent,
+  const char *name,
+  WFlags f
+): QMainWindow(parent, name, f)
+{
+  AnGuiDebug << "entered.";
+
+  d = new avd_o_AnalyzerViewData;
+
+  QWidget *central_widget = new QWidget(
+    this, "<avd_o_AnalyzerView::avd_o_AnalyzerView(central_widget)>");
+  QVBoxLayout *top_layout = new QVBoxLayout(
+    central_widget, 10, -1,
+    "<avd_o_AnalyzerView::avd_o_AnalyzerView(top_layout)>");
+  setCentralWidget(central_widget);
+
+    //QLabel *experiment_editor_label = new QLabel(
+    //  central_widget,
+    //  "<avd_o_AnalyzerView::avd_o_AnalyzerView(experiment_editor_label)>"
+    //);
+    //experiment_editor_label->setText("experiment_editor_label.");
+    //top_layout->addWidget(experiment_editor_label);
+
+    QSplitter *horizontal_splitter = new QSplitter(
+      Qt::Horizontal, central_widget,
+      "<avd_o_AnalyzerView::avd_o_AnalyzerView(horizontal_splitter)>");
+    horizontal_splitter->setOpaqueResize(true);
+    top_layout->addWidget(horizontal_splitter, 1);
+
+      QWidget *batch_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avd_o_AnalyzerView::avd_o_AnalyzerView(batch_layout_widget)>");
+      batch_layout_widget->setSizePolicy(
+        QSizePolicy::Preferred,
+        batch_layout_widget->sizePolicy().verData(),
+        batch_layout_widget->sizePolicy().hasHeightForWidth());
+      horizontal_splitter->setResizeMode(
+        batch_layout_widget, QSplitter::KeepSize);
+      QVBoxLayout *selector_layout = new QVBoxLayout(
+        batch_layout_widget, 10, -1,
+        "<avd_o_AnalyzerView::avd_o_AnalyzerView(selector_layout)>");
+      horizontal_splitter->moveToFirst(batch_layout_widget);
+
+        d->m_batch_lv = new QListView(
+          batch_layout_widget,
+          "<avd_o_AnalyzerView::avd_o_AnalyzerView(m_batch_lv)>");
+        d->m_batch_lv->setSorting(-1);
+        d->m_batch_lv->addColumn("Batch Name");
+        selector_layout->addWidget(d->m_batch_lv);
+
+      QWidget *genotype_layout_widget = new QWidget(
+        horizontal_splitter,
+        "<avd_o_AnalyzerView::avd_o_AnalyzerView(genotype_layout_widget)>");
+      QVBoxLayout *genotype_layout = new QVBoxLayout(
+        genotype_layout_widget, 10, -1,
+        "<avd_o_AnalyzerView::avd_o_AnalyzerView(genotype_layout)>");
+      horizontal_splitter->moveToLast(genotype_layout_widget);
+
+        d->m_genotype_lv = new QListView(
+          genotype_layout_widget,
+          "<avd_o_AnalyzerView::avd_o_AnalyzerView(m_genotype_lv)>");
+        d->m_genotype_lv->setSizePolicy(
+          QSizePolicy::Preferred, QSizePolicy::Preferred,
+          d->m_genotype_lv->sizePolicy().hasHeightForWidth());
+        d->m_genotype_lv->setSorting(-1);
+        d->m_genotype_lv->header()->setMovingEnabled(true);
+        //d->m_genotype_lv->addColumn("id");
+        genotype_layout->addWidget(d->m_genotype_lv);
+
+  AnGuiDebug << "done.";
+}
+
+// arch-tag: implementation file for old analyzer gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/analyzer_o/avd_analyzer_view.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,47 @@
+#ifndef AVD_ANALYZER_VIEW_HH
+#define AVD_ANALYZER_VIEW_HH
+
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+
+
+class avd_o_AnalyzerViewData;
+class QListView;
+class avd_o_AnalyzerView : public QMainWindow
+{
+  Q_OBJECT
+private:
+  avd_o_AnalyzerViewData *d;
+public:
+  avd_o_AnalyzerView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  ~avd_o_AnalyzerView();
+  QListView *getBatchesListView(void);
+  QListView *getGenotypesListView(void);
+signals:
+  void loadCurrentGenotypesSig();
+  void loadHistoricGenotypesSig();
+  void openSig();
+
+  void deleteBatchesSig();
+  void mergeBatchesSig();
+  void duplicateBatchesSig();
+
+  void findGenotypeSig();
+  void findLineageSig();
+  void findCladeSig();
+  void sampleOrganismsSig();
+  void sampleGenotypesSig();
+  void invertSig();
+
+  void genotypePhenotypeMapSig();
+  void chooseColumnsSig();
+};
+
+#endif
+
+// arch-tag: header file for old analyzer gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/containers/containers.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/containers/containers.pri:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/containers/containers.pri	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,10 @@
+
+containers {
+  HEADERS += \
+    $$CONTAINERS_HH/tRetainable_list_proto.hh \
+    $$CONTAINERS_HH/tRetainable_list.hh \
+    $$CONTAINERS_HH/tRList_proto.hh \
+    $$CONTAINERS_HH/tRList.hh
+}
+
+# arch-tag: qmake include file for containers module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,17 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology             //
+//                                                                          //
+// Read the COPYING and README files, or contact 'avida at alife.org',         //
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef TRLIST_HH
+#define TRLIST_HH
+
+#ifndef TRLIST_PROTO_HH
+#include "tRList_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for template list objects that can retain their elements
Index: avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRList_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,512 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology             //
+//                                                                          //
+// Read the COPYING and README files, or contact 'avida at alife.org',         //
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef TRLIST_PROTO_HH
+#define TRLIST_PROTO_HH
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+template <class T> class pUseRetains {
+public:
+  T * Retain(T * _in){ if(_in) _in->retain(); return _in; }
+  T * Release(T * _in){ if(_in) _in->release(); return _in; }
+};
+
+template <class T> class pNoRetains {
+public:
+  T * Retain(T * _in){ return _in; }
+  T * Release(T * _in){ return _in; }
+};
+
+template <
+  class T,
+	template <class> class RetainPolicy = pNoRetains
+> class tRListNode {
+public:
+  T * data;
+  tRListNode<T, RetainPolicy> * next;
+  tRListNode<T, RetainPolicy> * prev;
+
+  tRListNode() : data(NULL), next(this), prev(this) { ; }
+};
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> class tRList;
+
+template <
+  class T,
+	template <class> class RetainPolicy = pNoRetains
+> class tRBaseIterator {
+  friend class tRList<T, RetainPolicy>;
+protected:
+  virtual const tRList<T, RetainPolicy> & GetConstList() = 0;
+  virtual const tRListNode<T, RetainPolicy> * GetConstNode() = 0;
+public:
+  tRBaseIterator() { ; }
+  virtual ~tRBaseIterator() { ; }
+
+  virtual const T * GetConst() = 0;
+  virtual const T * NextConst() = 0;
+  virtual const T * PrevConst() = 0;
+
+  virtual bool AtRoot() const = 0;
+  virtual bool AtEnd() const = 0;
+};
+
+template <
+  class T,
+	template <class> class RetainPolicy = pNoRetains
+> class tRListIterator
+: public tRBaseIterator<T, RetainPolicy>
+{
+  friend class tRList<T, RetainPolicy>;
+private:
+  tRList<T, RetainPolicy> & list;
+  tRListNode<T, RetainPolicy> * node;
+
+  const tRList<T, RetainPolicy> & GetConstList() { return list; }
+  const tRListNode<T, RetainPolicy> * GetConstNode() { return node; }
+public:
+  explicit tRListIterator(tRList<T, RetainPolicy> & _list);
+  ~tRListIterator();
+
+  void Reset();
+
+  T * Get();
+  T * Next();
+  T * Prev();
+  const T * GetConst() { return Get(); }
+  const T * NextConst() { return Next(); }
+  const T * PrevConst() { return Prev(); }
+
+  bool Find(T * test_data);
+
+  bool AtRoot() const;
+  bool AtEnd() const;
+
+  // Unique methods...
+  T * Remove();
+};
+
+template <
+  class T,
+	template <class> class RetainPolicy = pNoRetains
+> class tConstRListIterator : public tRBaseIterator<T, RetainPolicy> {
+  friend class tRList<T, RetainPolicy>;
+private:
+  const tRList<T, RetainPolicy> & list;
+  const tRListNode<T, RetainPolicy> * node;
+
+  const tRList<T, RetainPolicy> & GetConstList() { return list; }
+  const tRListNode<T, RetainPolicy> * GetConstNode() { return node; }
+public:
+  explicit tConstRListIterator(const tRList<T, RetainPolicy> & _list);
+  ~tConstRListIterator();
+
+  void Reset();
+
+  const T * Get();
+  const T * Next();
+  const T * Prev();
+  const T * GetConst() { return Get(); }
+  const T * NextConst() { return Next(); }
+  const T * PrevConst() { return Prev(); }
+  bool Find(const T * test_data);
+
+  bool AtRoot() const;
+  bool AtEnd() const;
+};
+
+template <
+  class T,
+	template <class> class RetainPolicy = pNoRetains
+> class tRList : public RetainPolicy<T> {
+  friend class tRBaseIterator<T, RetainPolicy>;
+  friend class tRListIterator<T, RetainPolicy>;
+  friend class tConstRListIterator<T, RetainPolicy>;
+protected:
+  tRListNode<T, RetainPolicy> root;                     // Data root
+  int size;
+  mutable tRListNode< tRBaseIterator<T, RetainPolicy>, RetainPolicy > it_root; // Iterator root
+  mutable int it_count;
+
+  T * RemoveNode(tRListNode<T, RetainPolicy> * out_node) {
+    // Make sure we're not trying to delete the root node!
+    if (out_node == &root) return NULL;
+
+    // Adjust any iterators on the deleted node.
+    tRListNode< tRBaseIterator<T, RetainPolicy>, RetainPolicy > * test_it = it_root.next;
+    while (test_it != &it_root) {
+      // If this iterator is on this node, move it back one.
+      if (test_it->data->GetConstNode() == out_node) {
+	      test_it->data->PrevConst();
+      }
+      test_it = test_it->next;
+    }
+
+    // Save the data and patch up the linked list.
+    T * out_data = out_node->data;
+    out_node->prev->next = out_node->next;
+    out_node->next->prev = out_node->prev;
+
+    // Cleanup and return
+    size--;
+    delete out_node;
+    Release(out_data);
+    return out_data;
+  }
+
+  // To be called from iterator constructor only!
+  void AddIterator(tRBaseIterator<T, RetainPolicy> * new_it) const {
+    tRListNode< tRBaseIterator<T, RetainPolicy>, RetainPolicy > * new_node =
+      new tRListNode< tRBaseIterator<T, RetainPolicy>, RetainPolicy >;
+    new_node->data = new_it;
+    new_node->next = it_root.next;
+    new_node->prev = &it_root;
+    it_root.next->prev = new_node;
+    it_root.next = new_node;
+    it_count++;
+  }
+
+  // To be called from iterator destructor only!
+  void RemoveIterator(tRBaseIterator<T, RetainPolicy> * old_it) const {
+    tRListNode< tRBaseIterator<T, RetainPolicy>, RetainPolicy > * test_it =
+      it_root.next;
+    while (test_it->data != old_it) test_it = test_it->next;
+    test_it->prev->next = test_it->next;
+    test_it->next->prev = test_it->prev;
+    delete test_it;
+    it_count--;
+  }
+
+public:
+  T * Pop() { return RemoveNode(root.next); }
+  T * PopRear() { return RemoveNode(root.prev); }
+
+  void Push(T * _in) {
+    Retain(_in);
+    tRListNode<T, RetainPolicy> * new_node = new tRListNode<T, RetainPolicy>;
+    new_node->data = _in;
+    new_node->next = root.next;
+    new_node->prev = &root;
+    root.next->prev = new_node;
+    root.next = new_node;
+    size++;
+  }
+
+  void PushRear(T * _in) {
+    Retain(_in);
+    tRListNode<T, RetainPolicy> * new_node = new tRListNode<T, RetainPolicy>;
+    new_node->data = _in;
+    new_node->next = &root;
+    new_node->prev = root.prev;
+    root.prev->next = new_node;
+    root.prev = new_node;
+    size++;
+  }
+
+  void Clear() { while (size > 0) Pop(); }
+
+  const T * GetFirst() const { return root.next->data; }
+  const T * GetLast()  const { return root.prev->data; }
+  T * GetFirst()             { return root.next->data; }
+  T * GetLast()              { return root.prev->data; }
+
+  T * GetPos(int pos) {
+    if (pos >= GetSize()) return NULL;
+    tRListNode<T, RetainPolicy> * test_node = root.next;
+    for (int i = 0; i < pos; i++) test_node = test_node->next;
+    return test_node->data;
+  }
+
+  const T * GetPos(int pos) const {
+    if (pos >= GetSize()) return NULL;
+    tRListNode<T, RetainPolicy> * test_node = root.next;
+    for (int i = 0; i < pos; i++) test_node = test_node->next;
+    return test_node->data;
+  }
+
+  void CircNext() { if (size > 0) PushRear(Pop()); }
+  void CircPrev() { if (size > 0) Push(PopRear()); }
+
+  T * Remove(tRListIterator<T, RetainPolicy> & other) {
+    if (&(other.list) != this) return NULL;
+    return RemoveNode(other.node);
+  }
+
+  T * Insert(tRBaseIterator<T, RetainPolicy> & list_it, T * in_data) {
+    Retain(in_data);
+    tRListNode<T, RetainPolicy> * new_node = new tRListNode<T, RetainPolicy>;
+    new_node->data = in_data;
+    new_node->next = list_it.node->next;
+    new_node->prev = list_it.node;
+
+    list_it.node->next->prev = new_node;
+    list_it.node->next = new_node;
+    size++;
+    return in_data;
+  }
+
+
+  bool Remove(T * other) {
+    tRListNode<T, RetainPolicy> * test = root.next;
+    while (test != &root) {
+      if (test->data == other) {
+	      RemoveNode(test);
+	      return true;
+      }
+      test = test->next;
+    }
+    return false;
+  }
+
+  int GetSize() const { return size; }
+
+  void Append(tRList<T, RetainPolicy> & other_list) {
+    tRListIterator<T, RetainPolicy> other_it(other_list);
+    while (other_it.Next() != NULL) PushRear(other_it.Get());
+  }
+
+  T * Find(T * _in) const {
+    tRListNode<T, RetainPolicy> * test = root.next;
+    while (test != &root) {
+      if ( *(test->data) == *(_in) ) return test->data;
+      test = test->next;
+    }
+    return NULL;
+  }
+
+  T * PopIntValue(int (T::*fun)() const, int value) {
+    tRListNode<T, RetainPolicy> * test = root.next;
+    while (test != &root) {
+      if ( (test->data->*fun)() == value) return RemoveNode(test);
+      test = test->next;
+    }
+    return NULL;
+  }
+
+  T * PopIntMax(int (T::*fun)() const) { 
+    if (size == 0) return NULL;
+    tRListNode<T, RetainPolicy> * test = root.next;
+    tRListNode<T, RetainPolicy> * best = test;
+    int max_val = (test->data->*fun)();
+    while (test != &root) {
+      const int cur_val = (test->data->*fun)();
+      if ( cur_val > max_val ) {
+	      max_val = cur_val;
+	      best = test;
+      }
+      test = test->next;
+    }
+    return RemoveNode(best);
+  }
+
+  T * PopDoubleMax(double (T::*fun)() const) {
+    if (size == 0) return NULL;
+    tRListNode<T, RetainPolicy> * test = root.next;
+    tRListNode<T, RetainPolicy> * best = test;
+    double max_val = (test->data->*fun)();
+    while (test != &root) {
+      const double cur_val = (test->data->*fun)();
+      if ( cur_val > max_val ) {
+	      max_val = cur_val;
+	      best = test;
+      }
+      test = test->next;
+    }
+    return RemoveNode(best);
+  }
+public:
+  tRList() : size(0), it_count(0) { }
+  ~tRList() { Clear(); }
+private:
+  tRList(tRList & _list) { ; }  // Never should be used...
+};
+
+////////////////////
+//  tRListIterator
+
+template <
+  class T,
+  template <class> class RetainPolicy
+> tRListIterator<T, RetainPolicy>::tRListIterator(
+  tRList<T, RetainPolicy> & _list)
+  : list(_list), node(&(_list.root))
+{
+  list.AddIterator(this);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> tRListIterator<T, RetainPolicy>::~tRListIterator()
+{
+  list.RemoveIterator(this);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> void tRListIterator<T, RetainPolicy>::Reset()
+{
+  node = &(list.root);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> T * tRListIterator<T, RetainPolicy>::Get()
+{
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> T * tRListIterator<T, RetainPolicy>::Next()
+{
+  node = node->next;
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> T * tRListIterator<T, RetainPolicy>::Prev()
+{
+  node = node->prev;
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tRListIterator<T, RetainPolicy>::Find(T * test_data)
+{
+  for (node = list.root.next;
+       node != &(list.root);
+       node = node->next) {
+    if (node->data == test_data) return true;
+  }
+  return false;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tRListIterator<T, RetainPolicy>::AtRoot() const
+{
+  return (node == &(list.root));
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tRListIterator<T, RetainPolicy>::AtEnd() const
+{
+  return (node->next == &(list.root));
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> T* tRListIterator<T, RetainPolicy>::Remove()
+{
+  return list.RemoveNode(node);
+}
+
+/////////////////////////
+//  tConstRListIterator
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> tConstRListIterator<T, RetainPolicy>::tConstRListIterator(
+  const tRList<T, RetainPolicy> & _list)
+  : list(_list), node(&(_list.root))
+{
+  list.AddIterator(this);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> tConstRListIterator<T, RetainPolicy>::~tConstRListIterator()
+{
+  list.RemoveIterator(this);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> void tConstRListIterator<T, RetainPolicy>::Reset()
+{
+  node = &(list.root);
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> const T * tConstRListIterator<T, RetainPolicy>::Get()
+{
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> const T * tConstRListIterator<T, RetainPolicy>::Next()
+{
+  node = node->next;
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> const T * tConstRListIterator<T, RetainPolicy>::Prev()
+{
+  node = node->prev;
+  return node->data;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tConstRListIterator<T, RetainPolicy>::Find(const T * test_data)
+{
+  for (node = list.root.next;
+       node != &(list.root);
+       node = node->next) {
+    if (node->data == test_data) return true;
+  }
+  return false;
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tConstRListIterator<T, RetainPolicy>::AtRoot() const
+{
+  return (node == &(list.root));
+}
+
+template <
+  class T,
+	template <class> class RetainPolicy
+> bool tConstRListIterator<T, RetainPolicy>::AtEnd() const
+{
+  return (node->next == &(list.root));
+}
+
+#endif
+
+// arch-tag: proto file for template list objects that can retain their elements
Index: avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,25 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology             //
+//                                                                          //
+// Read the COPYING and README files, or contact 'avida at alife.org',         //
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef TRETAINABLE_LIST_HH
+#define TRETAINABLE_LIST_HH
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef TRLIST_HH
+#include "containers/tRList.hh"
+#endif
+
+#ifndef TRETAINABLE_LIST_PROTO_HH
+#include "tRetainable_list_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for retainable list template objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/containers/tRetainable_list_proto.hh	Mon Dec 29 14:55:10 2003
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology             //
+//                                                                          //
+// Read the COPYING and README files, or contact 'avida at alife.org',         //
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef TRETAINABLE_LIST_PROTO_HH
+#define TRETAINABLE_LIST_PROTO_HH
+
+template <class T> class tRetainableList
+: public tRList<T, pUseRetains>, public cRetainable {};
+
+template <class T> class tRetainableListIter
+: public tRListIterator<T, pUseRetains>, public cRetainable {
+public:
+  explicit tRetainableListIter(
+    tRetainableList<T> & _list
+  ):tRListIterator<T, pUseRetains>(_list){}
+};
+
+template <class T> class tRetainableConstListIter
+: public tConstRListIterator<T, pUseRetains>, public cRetainable {
+public:
+  explicit tRetainableConstListIter(
+    const tRetainableList<T> & _list
+  ):tConstRListIterator<T, pUseRetains>(_list){}
+};
+
+#endif
+
+// arch-tag: proto file for retainable list template objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,60 @@
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+
+#ifndef AVD_DUMB_GUI_DBG_HH
+#include "avd_dumb_gui_dbg.hh"
+#endif
+#ifndef AVD_DUMB_VIEW_HH
+#include "avd_dumb_view.hh"
+#endif
+
+#ifndef AVD_DUMB_CTRL_HH
+#include "avd_dumb_ctrl.hh"
+#endif
+
+
+void avdDumbCtrl::setView(avdDumbView *view){ SETretainable(m_view, view); }
+
+avdDumbCtrl::avdDumbCtrl(QObject *parent, const char *name)
+:QObject(parent, name){
+  DumbGuiDebug << "constructor; creating view.";
+  avdDumbView *view = new avdDumbView(0, "<avdDumbCtrl(m_view)>");
+  setView(view); view->release();
+  getView()->nameWatched("<avdDumbCtrl(m_view)>");
+  connect(getView(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+  connect(
+    getView()->startBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doStartAvidaSig()));
+  connect(
+    getView()->pauseBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doPauseAvidaSig()));
+  connect(
+    getView()->updateBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doUpdateAvidaSig()));
+
+  connect(
+    getView()->resetBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doResetAvidaSig()));
+  connect(
+    getView()->openBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doOpenAvidaSig()));
+  connect(
+    getView()->closeBtn(), SIGNAL(clicked()),
+    this, SIGNAL(doCloseAvidaSig()));
+
+  DumbGuiDebug << "created view; done.";
+}
+avdDumbCtrl::~avdDumbCtrl(){
+  setView(0);
+  DumbGuiDebug << "entered empty destructor.";
+}
+bool avdDumbCtrl::setup(){
+  DumbGuiDebug << "entered stub method.";
+  emit(doResetMenuBar(getView()->menuBar()));
+  getView()->show();
+  return true;
+}
+void avdDumbCtrl::avidaStateChangedSlot(cAvidaDriver_Population *pop){ }
+
+// arch-tag: implementation file for dumb gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_ctrl.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,45 @@
+#ifndef AVD_DUMB_CTRL_HH
+#define AVD_DUMB_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QMenuBar;
+class avdDumbView;
+class cAvidaDriver_Population;
+class avdDumbCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdDumbView> m_view;
+protected:
+  void setView(avdDumbView *view);
+  avdDumbView *getView(){ return m_view; }
+public:
+  avdDumbCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdDumbCtrl();
+  bool setup();
+public slots:
+  void avidaStateChangedSlot(cAvidaDriver_Population *pop);
+signals:
+  void doStartAvidaSig();
+  void doPauseAvidaSig();
+  void doUpdateAvidaSig();
+  void doStepAvidaSig(int cell_id);
+
+  void doResetAvidaSig();
+  void doOpenAvidaSig();
+  void doCloseAvidaSig();
+
+  void doResetMenuBar(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for dumb gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,72 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_DUMB_CTRL_HH
+#include "dumb_gui/avd_dumb_ctrl.hh"
+#endif
+#ifndef AVD_DUMB_GUI_DBG_HH
+#include "dumb_gui/avd_dumb_gui_dbg.hh"
+#endif
+#ifndef AVD_DUMB_VIEW_HH
+#include "dumb_gui/avd_dumb_view.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+
+
+/* Definitions of debugging messages. */
+cMessageType Info_DUMB_GUI_Msg("avdDumbGUI", MCInfo);
+cMessageType Debug_DUMB_GUI_Msg("avdDumbGUI", MCDebug);
+cMessageType Error_DUMB_GUI_Msg("avdDumbGUI", MCError);
+cMessageType Fatal_DUMB_GUI_Msg("avdDumbGUI", MCFatal);
+
+template <class avdDumbCtrl> class pDumbConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdDumbCtrl *ctrl){
+    avdConnections cnct(ctrl, med->getAvidaStateMediator());
+    cnct.add(SIGNAL(doStartAvidaSig()), SIGNAL(doStartAvidaSig()));
+    cnct.add(SIGNAL(doPauseAvidaSig()), SIGNAL(doPauseAvidaSig()));
+    cnct.add(SIGNAL(doUpdateAvidaSig()), SIGNAL(doUpdateAvidaSig()));
+    cnct.add(SIGNAL(doStepAvidaSig(int)), SIGNAL(doStepAvidaSig(int)));
+    cnct.add(SIGNAL(doResetAvidaSig()), SIGNAL(doResetAvidaSig()));
+    cnct.add(SIGNAL(doOpenAvidaSig()), SIGNAL(doOpenAvidaSig()));
+    cnct.add(SIGNAL(doCloseAvidaSig()), SIGNAL(doCloseAvidaSig()));
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+    QObject::connect(
+      med->getAvidaStateMediator(), SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)),
+      ctrl, SLOT(avidaStateChangedSlot(cAvidaDriver_Population *)));
+} };
+typedef tGUI<avdDumbCtrl, pDumbConnections> avdDumbGUI;
+
+/* Registers avdDumbGUI creator with GUIFactory. */
+namespace {
+  avdAbstractCtrl *createDumbGUI(void){
+    avdDumbGUI *g = new avdDumbGUI(0, "<(avdDumbGUI)>");
+    g->getCtrl()->nameWatched("<createDumbGUI(avdDumbCtrl)>");
+    //if(!g) DumbGuiError("couldn't create new avdDumbGUI.");
+    return g; }
+  QString s_key("avdDumbGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createDumbGUI);
+}
+
+// arch-tag: implementation file for dumb gui factory and message display objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_DUMB_GUI_DBG_HH
+#define AVD_DUMB_GUI_DBG_HH
+
+#ifndef MESSAGE_DISPLAY_HDRS_HH
+#include "tools/message_display_hdrs.hh"
+#endif
+
+#ifndef AVD_DUMB_GUI_DBG_PROTO_HH
+#include "avd_dumb_gui_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for dumb gui message display objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_gui_dbg_proto.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_DUMB_GUI_DBG_PROTO_HH
+#define AVD_DUMB_GUI_DBG_PROTO_HH
+
+extern cMessageType Info_DUMB_GUI_Msg;
+extern cMessageType Debug_DUMB_GUI_Msg;
+extern cMessageType Error_DUMB_GUI_Msg;
+extern cMessageType Fatal_DUMB_GUI_Msg;
+#define DumbGuiInfo _INFO_MSG(DUMB_GUI)
+#define DumbGuiDebug _DEBUG_MSG(DUMB_GUI)
+#define DumbGuiError _ERROR_MSG(DUMB_GUI)
+#define DumbGuiFatal _FATAL_MSG(DUMB_GUI)
+
+#endif
+
+// arch-tag: proto file for dumb gui message display objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,63 @@
+#ifndef QLINEEDIT_H
+#include <qlineedit.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+
+#ifndef AVD_DUMB_VIEW_HH
+#include "avd_dumb_view.hh"
+#endif
+
+
+avdDumbView::avdDumbView( QWidget *parent, const char *name, WFlags f)
+:QMainWindow(parent, name, f){
+  QWidget *central = new QWidget(
+    this, "<avdDumbView(central)>");
+  setCentralWidget(central);
+  QVBoxLayout *layout = new QVBoxLayout(
+    central, 10, -1, "<avdDumbView(layout)>");
+  m_start_btn = new QPushButton(
+    "Start", central, "<avdDumbView::m_start_btn>");
+  layout->addWidget(m_start_btn);
+  m_pause_btn = new QPushButton(
+    "Pause", central, "<avdDumbView::m_pause_btn>");
+  layout->addWidget(m_pause_btn);
+  m_update_btn = new QPushButton(
+    "Update", central, "<avdDumbView::m_update_btn>");
+  layout->addWidget(m_update_btn);
+  m_step_btn = new QPushButton(
+    "Step", central, "<avdDumbView::m_step_btn>");
+  layout->addWidget(m_step_btn);
+  QLabel *step_label = new QLabel(
+    "Step Cell ID:", central, "<avdDumbView::step_label>");
+  layout->addWidget(step_label);
+  m_step_id_le = new QLineEdit(central, "<avdDumbView::m_step_id_le>");
+  layout->addWidget(m_step_id_le);
+  m_reset_btn = new QPushButton(
+    "Reset", central, "<avdDumbView::m_reset_btn>");
+  layout->addWidget(m_reset_btn);
+  m_open_btn = new QPushButton(
+    "Open", central, "<avdDumbView::m_open_btn>");
+  layout->addWidget(m_open_btn);
+  m_close_btn = new QPushButton(
+    "Close", central, "<avdDumbView::m_close_btn>");
+  layout->addWidget(m_close_btn);
+  QLabel *msg_label = new QLabel(
+    "DebugMessages:", central, "<avdDumbView::msg_label>");
+  layout->addWidget(msg_label);
+  m_msg_te = new QTextEdit(central, "<avdDumbView::m_msg_te>");
+  m_msg_te->setReadOnly(true);
+  layout->addWidget(m_msg_te);
+}
+
+// arch-tag: implementation file for dumb gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/avd_dumb_view.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,45 @@
+#ifndef AVD_DUMB_VIEW_HH
+#define AVD_DUMB_VIEW_HH
+
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QLineEdit;
+class QPushButton;
+class QTextEdit;
+class avdDumbView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QPushButton *m_start_btn;
+  QPushButton *m_pause_btn;
+  QPushButton *m_update_btn;
+  QPushButton *m_step_btn;
+  QPushButton *m_reset_btn;
+  QPushButton *m_open_btn;
+  QPushButton *m_close_btn;
+  QLineEdit *m_step_id_le;
+  QTextEdit *m_msg_te;
+public:
+  avdDumbView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  QPushButton *startBtn() { return m_start_btn; }
+  QPushButton *pauseBtn() { return m_pause_btn; }
+  QPushButton *updateBtn() { return m_update_btn; }
+  QPushButton *stepBtn() { return m_step_btn; }
+  QPushButton *resetBtn() { return m_reset_btn; }
+  QPushButton *openBtn() { return m_open_btn; }
+  QPushButton *closeBtn() { return m_close_btn; }
+  QLineEdit *stepIdLineEd() { return m_step_id_le; }
+  QTextEdit *msgTextEd() { return m_msg_te; }
+};
+
+#endif
+
+// arch-tag: header file for dumb gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/dumb_gui.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/dumb_gui.pri:1.2
--- /dev/null	Mon Dec 29 14:55:18 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/dumb_gui/dumb_gui.pri	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,15 @@
+
+dumb_gui {
+  HEADERS += \
+    $$DUMB_GUI_HH/avd_dumb_ctrl.hh \
+    $$DUMB_GUI_HH/avd_dumb_gui_dbg_proto.hh \
+    $$DUMB_GUI_HH/avd_dumb_gui_dbg.hh \
+    $$DUMB_GUI_HH/avd_dumb_view.hh
+
+  SOURCES += \
+    $$DUMB_GUI_CC/avd_dumb_ctrl.cc \
+    $$DUMB_GUI_CC/avd_dumb_gui.cc \
+    $$DUMB_GUI_CC/avd_dumb_view.cc
+}
+
+# arch-tag: qmake include file for dumb gui module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,50 @@
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef AVD_EXP_GUI_DBG_HH
+#include "avd_exp_gui_dbg.hh"
+#endif
+#ifndef AVD_EXP_VIEW_HH
+#include "avd_exp_view.hh"
+#endif
+#ifndef TEST_THING_HH
+#include "exp_gui/test_thing.hh"
+#endif
+
+#ifndef AVD_EXP_CTRL_HH
+#include "avd_exp_ctrl.hh"
+#endif
+
+
+void avdExpCtrl::setView(avdExpView *view){ SETretainable(m_view, view); }
+
+avdExpCtrl::avdExpCtrl(QObject *parent, const char *name)
+:QObject(parent, name) {
+  Debug << "<avdExpCtrl> ctor; creating view.";
+  avdExpView *view = new avdExpView(0, "<avdExpCtrl(m_view)>");
+  setView(view); view->release();
+  view->nameWatched("<avdExpCtrl::m_view>");
+  getView()->nameWatched("<avdExpCtrl(m_view)>");
+  connect(getView(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+  connect(getView()->scopeguardTestBtn(), SIGNAL(clicked()), this, SLOT(scopeguardTestBtnClickedSlot()));
+  Debug << "<avdExpCtrl> created view; done.";
+}
+avdExpCtrl::~avdExpCtrl(){
+  setView(0);
+  Debug << "<avdExpCtrl> dtor.";
+}
+bool avdExpCtrl::setup(){
+  Debug << "entered stub method.";
+  emit(doResetMenuBar(getView()->menuBar()));
+  getView()->show();
+  return true;
+}
+void avdExpCtrl::scopeguardTestBtnClickedSlot(){
+  Debug << "\"Test ScopeGuard\" button clicked.";
+  cTestThing test_thing;
+  Debug << "doing scopeguard test thing...";
+  test_thing.doScopeGuardTest();
+  Debug << "done.";
+}
+
+// arch-tag: implementation file for devel-experimentation gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_ctrl.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,35 @@
+#ifndef AVD_EXP_CTRL_HH
+#define AVD_EXP_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QMenuBar;
+class avdExpView;
+class avdExpCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdExpView> m_view;
+protected:
+  void setView(avdExpView *view);
+  avdExpView *getView(){ return m_view; }
+public:
+  avdExpCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdExpCtrl();
+  bool setup();
+public slots:
+  void scopeguardTestBtnClickedSlot();
+signals:
+  void doResetMenuBar(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for devel-experimentation gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,78 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_EXP_CTRL_HH
+#include "avd_exp_ctrl.hh"
+#endif
+#ifndef AVD_EXP_GUI_DBG_HH
+#include "avd_exp_gui_dbg.hh"
+#endif
+#ifndef AVD_EXP_VIEW_HH
+#include "avd_exp_view.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+
+
+/* Definitions of debugging messages. */
+avdMessageType  Info_EXP_GUI_avdMsg("ExpGUI", avdMCInfo);
+avdMessageType Debug_EXP_GUI_avdMsg("ExpGUI", avdMCDebug);
+avdMessageType Error_EXP_GUI_avdMsg("ExpGUI", avdMCError);
+avdMessageType Fatal_EXP_GUI_avdMsg("ExpGUI", avdMCFatal);
+
+template <class avdExpCtrl> class pExpConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdExpCtrl *ctrl){
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+} };
+typedef tGUI<avdExpCtrl, pExpConnections> avdExpGUI;
+
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_EXP_GUI_avdMsg);
+        m_msg_types->Register("Debug", &Debug_EXP_GUI_avdMsg);
+        m_msg_types->Register("Error", &Error_EXP_GUI_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_EXP_GUI_avdMsg);
+        avdMessageSetTracker::Instance().Register("ExpGUI", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("ExpGUI");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+
+  /* Registers avdExpGUI creator with GUIFactory. */
+  avdAbstractCtrl *createExpGUI(void){
+    avdExpGUI *g = new avdExpGUI(0, "<(avdExpGUI)>");
+    g->getCtrl()->nameWatched("<createExpGUI(avdExpCtrl)>");
+    return g;
+  }
+  QString s_key("avdExpGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createExpGUI);
+}
+
+// arch-tag: implementation file for devel-experimentation gui factory and debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_EXP_GUI_DBG_HH
+#define AVD_EXP_GUI_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+#ifndef AVD_EXP_GUI_DBG_PROTO_HH
+#include "avd_exp_gui_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for devel-experimentation debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_gui_dbg_proto.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_EXP_GUI_DBG_PROTO_HH
+#define AVD_EXP_GUI_DBG_PROTO_HH
+
+extern avdMessageType  Info_EXP_GUI_avdMsg;
+extern avdMessageType Debug_EXP_GUI_avdMsg;
+extern avdMessageType Error_EXP_GUI_avdMsg;
+extern avdMessageType Fatal_EXP_GUI_avdMsg;
+#define  Info  AVD_INFO_MSG(EXP_GUI)
+#define Debug AVD_DEBUG_MSG(EXP_GUI)
+#define Error AVD_ERROR_MSG(EXP_GUI)
+#define Fatal AVD_FATAL_MSG(EXP_GUI)
+
+#endif
+
+// arch-tag: proto file for devel-experimentation debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,34 @@
+#ifndef QLINEEDIT_H
+#include <qlineedit.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+
+#ifndef AVD_EXP_VIEW_HH
+#include "avd_exp_view.hh"
+#endif
+
+
+avdExpView::avdExpView( QWidget *parent, const char *name, WFlags f)
+:QMainWindow(parent, name, f){
+  QWidget *central = new QWidget(
+    this, "<avdExpView(central)>");
+  setCentralWidget(central);
+  QVBoxLayout *layout = new QVBoxLayout(
+    central, 10, -1, "<avdExpView(layout)>");
+  m_scopeguard_test_btn = new QPushButton(
+    "Test ScopeGuard", central, "<avdExpView::m_scopeguard_test_btn>");
+  layout->addWidget(m_scopeguard_test_btn);
+}
+
+// arch-tag: implementation file for devel-experimentation gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/avd_exp_view.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,27 @@
+#ifndef AVD_EXP_VIEW_HH
+#define AVD_EXP_VIEW_HH
+
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QPushButton;
+class avdExpView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QPushButton *m_scopeguard_test_btn;
+public:
+  avdExpView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  QPushButton *scopeguardTestBtn() { return m_scopeguard_test_btn; }
+};
+
+#endif
+
+// arch-tag: header file for devel-experimentation gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/exp_gui.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/exp_gui.pri:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/exp_gui.pri	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,19 @@
+
+exp_gui {
+  HEADERS += \
+    $$EXP_GUI_HH/avd_exp_ctrl.hh \
+    $$EXP_GUI_HH/avd_exp_gui_dbg_proto.hh \
+    $$EXP_GUI_HH/avd_exp_gui_dbg.hh \
+    $$EXP_GUI_HH/avd_exp_view.hh \
+    $$EXP_GUI_HH/test_thing_proto.hh \
+    $$EXP_GUI_HH/test_thing.hh \
+    $$EXP_GUI_HH/testing_interface.hh
+
+  SOURCES += \
+    $$EXP_GUI_CC/avd_exp_ctrl.cc \
+    $$EXP_GUI_CC/avd_exp_gui.cc \
+    $$EXP_GUI_CC/avd_exp_view.cc \
+    $$EXP_GUI_CC/test_thing.cc \
+}
+
+# arch-tag: qmake include file for experimental gui module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,67 @@
+#ifndef TEST_THING_HH
+#include "test_thing.hh"
+#endif
+#ifndef AVD_EXP_GUI_DBG_HH
+#include "avd_exp_gui_dbg.hh"
+#endif
+
+void cTestThing::doAllTests(){
+  Debug << "in.";
+  doScopeGuardTest();
+  Debug << "out.";
+}
+
+/*
+ScopeGuard test and demonstration.
+*/
+#ifndef SCOPEGUARD_H_
+#include "memory_mgt/ScopeGuard.h"
+#endif
+/* XXX disables the small-object allocator; it crashes under OSX10.2.6. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+/* XXX -- kaben */
+#ifndef FUNCTOR_INC_
+#include "third-party/Loki/Functor.h"
+#endif
+class cScopeGuardTestObj {
+  bool m_initialized;
+  bool m_deinitialized;
+public:
+  cScopeGuardTestObj():m_initialized(false), m_deinitialized(false){}
+  ~cScopeGuardTestObj(){ Debug("init'd: ")(m_initialized); Debug("deinit'd: ")(m_deinitialized); }
+  void init(){ m_initialized = true; }
+  void deinit(cTestThing *){ Debug << "in."; m_deinitialized = true; Debug << "out."; }
+  void deinittoo(cTestThing &){ Debug << "in."; m_deinitialized = true; Debug << "out."; }
+  void testy(){ Debug << "in"; }
+};
+void testy(){ Debug << "..."; }
+void cTestThing::doScopeGuardTest(){
+  Debug << "in.";
+  { ScopeGuard foo = MakeGuard(testy);
+    //foo.Dismiss();
+  }
+  { cScopeGuardTestObj fu; fu.init();
+    ScopeGuard foo = MakeObjGuard(fu, &cScopeGuardTestObj::testy);
+    //foo.Dismiss();
+  }
+  { cScopeGuardTestObj fu; fu.init();
+    ScopeGuard foo = MakeObjGuard(fu, &cScopeGuardTestObj::deinit, this);
+    //foo.Dismiss();
+  }
+  { cScopeGuardTestObj fu; fu.init();
+    Loki::Functor<void> funct(&fu, &cScopeGuardTestObj::testy);
+    ScopeGuard foo = MakeGuard(funct);
+    //foo.Dismiss();
+  }
+  { cScopeGuardTestObj fu; fu.init();
+    Loki::Functor<void, TYPELIST_1(cTestThing &)> funct(&fu, &cScopeGuardTestObj::deinittoo);
+    Loki::Functor<void> bind_funct(BindFirst(funct, *this));
+    ScopeGuard foo = MakeGuard(bind_funct);
+    //foo.Dismiss();
+  }
+  Debug << "out.";
+}
+
+// arch-tag: implementation file for devel-experimentation testing class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,14 @@
+#ifndef TEST_THING_HH
+#define TEST_THING_HH
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef TEST_THING_PROTO_HH
+#include "test_thing_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for devel-experimentation testing class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/test_thing_proto.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,12 @@
+#ifndef TEST_THING_PROTO_HH
+#define TEST_THING_PROTO_HH
+
+class cTestThing : public cRetainable
+{ public:
+  void doAllTests();
+  void doScopeGuardTest();
+};
+
+#endif
+
+// arch-tag: proto file for devel-experimentation testing class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/testing_interface.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/testing_interface.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/exp_gui/testing_interface.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,14 @@
+#ifndef TESTING_INTERFACE_HH
+#define TESTING_INTERFACE_HH
+
+class cTestThing;
+class cTestInterface 
+{ public:
+  virtual void testFunction() = 0;
+  virtual void setThing(cTestThing *thing) = 0;
+  virtual cTestThing *getThing() = 0;
+};
+
+#endif
+
+// arch-tag: header file for devel-experimentation testing interface class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_ABSTRACT_GUI_HH
+#define AVD_ABSTRACT_GUI_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_ABSTRACT_GUI_PROTO_HH
+#include "avd_abstract_gui_proto.hh"
+#endif
+
+#endif /* AVD_ABSTRACT_GUI_HH */
+
+// arch-tag: header file for generic gui object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_abstract_gui_proto.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,10 @@
+#ifndef AVD_ABSTRACT_GUI_PROTO_HH
+#define AVD_ABSTRACT_GUI_PROTO_HH
+
+class avdMCMediator;
+class avdAbstractCtrl : public cRetainable
+{ public: virtual bool setup(avdMCMediator *mediator) = 0; };
+
+#endif
+
+// arch-tag: proto file for generic gui object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.cc	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,38 @@
+#include <iostream>
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+
+
+struct _avdControllerFactoryPrv { QValueList<QString> m_keys; };
+
+_avdControllerFactory::_avdControllerFactory():m_d(0){ m_d = new _avdControllerFactoryPrv; }
+_avdControllerFactory::~_avdControllerFactory(){ delete m_d; }
+bool _avdControllerFactory::Register(
+  const QString &id, Loki::Functor<avdAbstractCtrl *> creator)
+{
+  bool retval = __avdControllerFactory::Register(id, creator);
+  if(retval){
+    std::cout
+    << "<__avdControllerFactory::Register> succeeded registering \""
+    << id << "\"." << std::endl;
+    m_d->m_keys.push_back(id);
+  } else {
+    std::cout
+    << "<__avdControllerFactory::Register> failed registering \""
+    << id << "\"." << std::endl;
+  }
+  return retval;
+}
+bool _avdControllerFactory::Unregister(const QString &id){
+  bool retval = __avdControllerFactory::Unregister(id);
+  if(retval){
+    QValueList<QString>::iterator it(m_d->m_keys.find(id));
+    if(it != (m_d->m_keys.end())) m_d->m_keys.erase(it);
+  }
+  return retval;
+}
+bool _avdControllerFactory::IsRegistered(const QString &id)
+{ return ((m_d->m_keys.contains(id))); }
+
+// arch-tag: implementation file for generic gui object factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory.hh	Mon Dec 29 14:55:11 2003
@@ -0,0 +1,37 @@
+#ifndef AVD_GUI_FACTORY_HH
+#define AVD_GUI_FACTORY_HH
+
+
+#ifndef QSTRING_H
+#include <qstring.h>
+#endif
+
+/* XXX disables the small-object allocator; it crashes under OSX10.2.6. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+/* XXX -- kaben */
+#ifndef FUNCTOR_INC_
+#include "third-party/Loki/Functor.h"
+#endif
+#ifndef FACTORY_INC_
+#include "third-party/Loki/Factory.h"
+#endif
+#ifndef SINGLETON_INC_
+#include "third-party/Loki/Singleton.h"
+#endif
+
+#ifndef AVD_ABSTRACT_GUI_HH
+#include "avd_abstract_gui.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_ERROR_POLICY_HH
+#include "avd_gui_factory_error_policy.hh"
+#endif
+
+#ifndef AVD_GUI_FACTORY_PROTO_HH
+#include "avd_gui_factory_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for generic gui object factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_error_policy.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_error_policy.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_error_policy.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_GUI_FACTORY_ERROR_POLICY_HH
+#define AVD_GUI_FACTORY_ERROR_POLICY_HH
+
+
+template <typename IdentifierType, class AbstractProduct>
+struct avdControllerFactoryErrorPolicy {
+  static AbstractProduct* OnUnknownType(IdentifierType) {
+    Error << "trying to instantiate unknown class type.";
+    return 0;
+} };
+
+template <class AbstractProduct>
+struct avdControllerFactoryErrorPolicy<QString, AbstractProduct> {
+  static AbstractProduct* OnUnknownType(const QString &id) {
+    Error
+    << "\n"
+    << "\n\tFor some reason, class \"" << id << "\""
+    << "\n\tis not registered with the GUI creation code."
+    << "\n\tPerhaps it was not compiled into this version of Avida?"
+    << "\n";
+    return 0;
+} };
+
+#endif
+
+// arch-tag: header file for generic gui object factory error policy
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/avd_gui_factory_proto.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,27 @@
+#ifndef AVD_GUI_FACTORY_PROTO_HH
+#define AVD_GUI_FACTORY_PROTO_HH
+
+typedef
+Loki::Factory<
+  avdAbstractCtrl,
+  QString,
+  Loki::Functor<avdAbstractCtrl *>,
+  avdControllerFactoryErrorPolicy
+> __avdControllerFactory;
+
+class _avdControllerFactoryPrv;
+class _avdControllerFactory : public __avdControllerFactory {
+  _avdControllerFactoryPrv *m_d;
+public:
+  _avdControllerFactory();
+  ~_avdControllerFactory();
+  bool Register(const QString &id, Loki::Functor<avdAbstractCtrl *> creator);
+  bool Unregister(const QString &id);
+  bool IsRegistered(const QString &id);
+};
+
+typedef Loki::SingletonHolder<_avdControllerFactory> avdControllerFactory;
+
+#endif
+
+// arch-tag: proto file for generic gui object factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/gui_factory.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/gui_factory.pri:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/gui_factory.pri	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,16 @@
+
+gui_factory {
+  HEADERS += \
+    $$GUI_FACTORY_HH/avd_abstract_gui_proto.hh \
+    $$GUI_FACTORY_HH/avd_abstract_gui.hh \
+    $$GUI_FACTORY_HH/avd_gui_factory_error_policy.hh \
+    $$GUI_FACTORY_HH/avd_gui_factory_proto.hh \
+    $$GUI_FACTORY_HH/avd_gui_factory.hh \
+    $$GUI_FACTORY_HH/tGUI_proto.hh \
+    $$GUI_FACTORY_HH/tGUI.hh
+
+  SOURCES += \
+    $$GUI_FACTORY_CC/avd_gui_factory.cc
+}
+
+# arch-tag: qmake include file for generic gui factory module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,21 @@
+#ifndef TGUI_HH
+#define TGUI_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+
+#ifndef AVD_ABSTRACT_GUI_HH
+#include "avd_abstract_gui.hh"
+#endif
+
+#ifndef TGUI_PROTO_HH
+#include "tGUI_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for generic gui template object factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/gui_factory/tGUI_proto.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,141 @@
+#ifndef TGUI_PROTO_HH
+#define TGUI_PROTO_HH
+
+/*
+The main purpose of these two connection classes is decoupling of your
+gui classes from class avdMCMediator and class avdAbstractCtrl.
+
+The second purpose is giving means to easily select which avdMCMediator
+signals to connect to your gui classes.  Here's how it works.
+
+You provide a gui controller class that looks like this (the arguments
+to the constructor, and the return types and arguments to setup(),
+wrapupInit(), and menuBar() are the important parts):
+
+  class MyController {
+    Q_OBJECT
+  public:
+    MyController(QObject *parent = 0, const char *name = 0);
+    void setup(avdAvidaThreadDrvr *driver = 0);
+    void wrapupInit(void);
+    QMenuBar *menuBar(void);
+
+  // You fill in the variables, methods, signals and slots as needed:
+  protected;
+    cFoo m_my_foo;
+  protected:
+    void myMethod();
+  signals:
+    void aSignal();
+    void anotherSignal(int cell_id);
+  public slots:
+    void aSlot();
+  };
+
+You provide a signal/slot connection policy that looks like this (the
+return type and arguments to setupConnections() are important, and the
+class has to be a template class):
+
+  template <class MyController> class MyConnectionPolicy {
+  protected:
+    void setupConnections(avdMCMediator *mediator, MyController *controller){
+
+      // You fill-in your version of setupConnections() to connect signals
+      // and slots between the mediator and the controller, as needed:
+      QObject::connect(
+        mediator, SIGNAL(avidaStateChangedSig()),
+        controller, SLOT(aSlot())
+      );
+      QObject::connect(
+        controller, SIGNAL(aSignal()),
+        mediator, SIGNAL(doStartAvidaSig())
+      );
+      QObject::connect(
+        controller, SIGNAL(anotherSignal(int)),
+        mediator, SIGNAL(doStepAvidaSig(int))
+      );
+    }
+  };
+
+Finally you define your gui datatype, for use by the gui factory, as
+follows:
+
+  typedef tGUI<MyController, MyConnectionPolicy> myGUI;
+
+****
+
+Here's how to register the class myGUI with the gui factor:
+
+Write a creation function for use by the gui factor that looks something
+like this:
+
+  avdAbstractCtrl *createMyGUI(void){
+    myGUI *g = new myGUI(myParentObject, "myName");
+    return g;
+  }
+
+Create a key for the factory to use to identify createMyGUI():
+
+  QString s_key("myGUIKey");
+
+Now register the key and the creation function:
+
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createMyGUI);
+
+Finally, if you like, head over to the file "avd_menubar_hdlr_prv.cc" to
+add an menu item for creating myGUI objects, using the key "myGUIKey".
+*/
+
+
+class avdAvidaThreadDrvr;
+class avdMCMediator;
+
+/*
+This null policy doesn't connect mediator to gui in any way.  If you
+provide one, your connection policy should provide the function
+
+- setupConnections(avdMCMediator *mediator, avdAbstractCtrl *gui)
+
+in which you can connect mediator to gui as you like.  Your version of
+setupConnections() will be called in the template class below.
+*/
+template <class Ctrl> class pNullConnectionPolicy {
+protected:
+  void setupConnections(avdMCMediator *, Ctrl *){}
+};
+
+template <
+  class Ctrl,
+  template <class> class ConnectionPolicy = pNullConnectionPolicy
+> class tGUI
+: public QObject
+, public avdAbstractCtrl
+, public ConnectionPolicy<Ctrl>
+{
+protected:
+  QGuardedPtr<Ctrl> m_ctrl;
+protected:
+  Ctrl *setCtrl(Ctrl *ctrl)
+  { SETretainable(m_ctrl, ctrl);
+    return getCtrl();
+  }
+public:
+  Ctrl *getCtrl() { return m_ctrl; }
+public:
+  ~tGUI(){ setCtrl(0); }
+  tGUI(QObject *parent = 0, const char *name = 0)
+  : QObject(parent, name)
+  { setCtrl(new Ctrl(0, "<tGUI(m_ctrl)>"))->release();
+    connect(getCtrl(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+  }
+  bool setup(avdMCMediator *mediator){
+    if(!getCtrl()){ return false; }
+    if(!getCtrl()->setup()){ return false; }
+    setupConnections(mediator, getCtrl()); return true;
+  }
+};
+
+#endif
+
+// arch-tag: proto file for generic gui object factory template
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_MAP_CANVAS_HH
+#include "map_gui/avd_map_canvas.hh"
+#endif
+
+avdMapCanvas::avdMapCanvas(QObject *parent, const char *name)
+: QCanvas(parent, name)
+{}
+avdMapCanvas::avdMapCanvas(int w, int h)
+: QCanvas(w, h)
+{}
+avdMapCanvas::avdMapCanvas(QPixmap p, int h, int v, int tilewidth, int tileheight)
+: QCanvas(p, h, v, tilewidth, tileheight)
+{}
+
+// arch-tag: implementation file for map canvas object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,23 @@
+#ifndef AVD_MAP_CANVAS_HH
+#define AVD_MAP_CANVAS_HH
+
+#ifndef QCANVAS_H
+#include <qcanvas.h>
+#endif
+#ifndef QPIXMAP_H
+#include <qpixmap.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class avdMapCanvas : public QCanvas, public cRetainable {
+public:
+  avdMapCanvas(QObject *parent = 0, const char *name = 0);
+  avdMapCanvas(int w, int h);
+  avdMapCanvas(QPixmap p, int h, int v, int tilewidth, int tileheight);
+};
+
+#endif
+
+// arch-tag: header file for map canvas object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_MAP_CANVAS_RECTANGLE_HH
+#include "map_gui/avd_map_canvas_rectangle.hh"
+#endif
+
+avdMapCanvasRectangle::avdMapCanvasRectangle(QCanvas *canvas)
+: QCanvasRectangle(canvas)
+{}
+avdMapCanvasRectangle::avdMapCanvasRectangle(const QRect &r, QCanvas *canvas)
+: QCanvasRectangle(r, canvas)
+{}
+avdMapCanvasRectangle::avdMapCanvasRectangle(int x, int y, int width, int height, QCanvas *canvas)
+: QCanvasRectangle(x, y, width, height, canvas)
+{}
+
+// arch-tag: implementation file for map canvas rectangle object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_MAP_CANVAS_RECTANGLE_HH
+#define AVD_MAP_CANVAS_RECTANGLE_HH
+
+#ifndef QCANVAS_H
+#include <qcanvas.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef AVD_MAP_CANVAS_RECTANGLE_PROTO_HH
+#include "map_gui/avd_map_canvas_rectangle_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for map canvas rectangle object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_rectangle_proto.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_MAP_CANVAS_RECTANGLE_PROTO_HH
+#define AVD_MAP_CANVAS_RECTANGLE_PROTO_HH
+
+class QCanvas;
+class QRect;
+class avdMapCanvasRectangle : public QCanvasRectangle, public cRetainable {
+public:
+  avdMapCanvasRectangle(QCanvas *canvas);
+  avdMapCanvasRectangle(const QRect &r, QCanvas *canvas);
+  avdMapCanvasRectangle(int x, int y, int width, int height, QCanvas *canvas);
+};
+
+#endif
+
+// arch-tag: proto file for map canvas rectangle object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,12 @@
+#ifndef AVD_MAP_CANVAS_VIEW_HH
+#include "map_gui/avd_map_canvas_view.hh"
+#endif
+
+avdMapCanvasView::avdMapCanvasView(QWidget *parent, const char *name, WFlags f)
+: QCanvasView(parent, name, f)
+{}
+avdMapCanvasView::avdMapCanvasView(QCanvas *canvas, QWidget *parent, const char *name, WFlags f)
+: QCanvasView(canvas, parent, name, f)
+{}
+
+// arch-tag: implementation file for map canvas view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_canvas_view.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,19 @@
+#ifndef AVD_MAP_CANVAS_VIEW_HH
+#define AVD_MAP_CANVAS_VIEW_HH
+
+#ifndef QCANVAS_H
+#include <qcanvas.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class avdMapCanvasView : public QCanvasView, public cRetainable {
+public:
+  avdMapCanvasView(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+  avdMapCanvasView(QCanvas *canvas, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+};
+
+#endif
+
+// arch-tag: header file for map canvas view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,63 @@
+#ifndef AVD_MAP_CANVAS_HH
+#include "map_gui/avd_map_canvas.hh"
+#endif
+#ifndef AVD_MAP_CANVAS_VIEW_HH
+#include "map_gui/avd_map_canvas_view.hh"
+#endif
+#ifndef AVD_MAP_GUI_DBG_HH
+#include "map_gui/avd_map_gui_dbg.hh"
+#endif
+#ifndef AVD_MAP_LAYER_HH
+#include "map_gui/avd_map_layer.hh"
+#endif
+#ifndef AVD_MAP_VIEW_HH
+#include "map_gui/avd_map_view.hh"
+#endif
+#ifndef AVD_MAP_CTRL_HH
+#include "map_gui/avd_map_ctrl.hh"
+#endif
+
+void avdMapCtrl::setCanvas(avdMapCanvas *canvas){ SETretainable(m_canvas, canvas); }
+void avdMapCtrl::setTestLayer(avdMapLayer *test_layer){ SETretainable(m_test_layer, test_layer); }
+void avdMapCtrl::setView(avdMapView *view){ SETretainable(m_view, view); }
+
+avdMapCtrl::avdMapCtrl(QObject *parent, const char *name)
+: QObject(parent, name)
+, m_test_layer(0)
+{
+  Debug << "<avdMapCtrl> ctor; creating view.";
+
+  avdMapView *view = new avdMapView(0, "<avdMapCtrl(m_view)>");
+  setView(view); view->release();
+  getView()->nameWatched("<avdMapCtrl(m_view)>");
+  connect(getView(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+
+  avdMapCanvas *canvas = new avdMapCanvas(getView(), "<avdMapCtrl(m_canvas)>");
+  setCanvas(canvas); getCanvas()->release();
+  getCanvas()->nameWatched("<avdMapCtrl(m_canvas)>");
+  getView()->getCanvasView()->setCanvas(getCanvas());
+
+  avdMapLayer *test_layer = new avdMapLayer(getCanvas(), 0);
+  setTestLayer(test_layer); getTestLayer()->release();
+  getTestLayer()->nameWatched("<avdMapCtrl(m_test_layer)>");
+
+  Debug << "<avdMapCtrl> created view; done.";
+}
+avdMapCtrl::~avdMapCtrl(){
+  setCanvas(0);
+  setTestLayer(0);
+  setView(0);
+  Debug << "<avdMapCtrl> dtor.";
+}
+bool avdMapCtrl::setup(){
+  Debug << "entered stub method.";
+  emit(doResetMenuBar(getView()->menuBar()));
+  getView()->show();
+  return true;
+}
+
+void avdMapCtrl::avidaStateChangedSlot(cAvidaDriver_Population *pop){
+  Debug << "entered stub method.";
+}
+
+// arch-tag: implementation file for map controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_ctrl.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,45 @@
+#ifndef AVD_MAP_CTRL_HH
+#define AVD_MAP_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+
+class QMenuBar;
+class avdMapCanvas;
+class avdMapLayer;
+class avdMapView;
+class cAvidaDriver_Population;
+class avdMapCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdMapCanvas> m_canvas;
+  avdMapLayer *m_test_layer;
+  QGuardedPtr<avdMapView> m_view;
+protected:
+  void setCanvas(avdMapCanvas *canvas);
+  void setTestLayer(avdMapLayer *test_layer);
+  void setView(avdMapView *view);
+  avdMapCanvas *getCanvas(){ return m_canvas; }
+  avdMapLayer *getTestLayer(){ return m_test_layer; }
+  avdMapView *getView(){ return m_view; }
+public:
+  avdMapCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdMapCtrl();
+  bool setup();
+public slots:
+  void avidaStateChangedSlot(cAvidaDriver_Population *pop);
+signals:
+  void doResetMenuBar(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for map controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,84 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MAP_CTRL_HH
+#include "map_gui/avd_map_ctrl.hh"
+#endif
+#ifndef AVD_MAP_GUI_DBG_HH
+#include "map_gui/avd_map_gui_dbg.hh"
+#endif
+#ifndef AVD_MAP_VIEW_HH
+#include "map_gui/avd_map_view.hh"
+#endif
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+
+/* Definitions of debugging messages. */
+avdMessageType  Info_MAP_GUI_avdMsg("MapGUI", avdMCInfo);
+avdMessageType Debug_MAP_GUI_avdMsg("MapGUI", avdMCDebug);
+avdMessageType Error_MAP_GUI_avdMsg("MapGUI", avdMCError);
+avdMessageType Fatal_MAP_GUI_avdMsg("MapGUI", avdMCFatal);
+
+template <class avdMapCtrl> class pMapConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdMapCtrl *ctrl){
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+    QObject::connect(
+      med->getAvidaStateMediator(),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)),
+      ctrl, SLOT(avidaStateChangedSlot(cAvidaDriver_Population *)));
+} };
+typedef tGUI<avdMapCtrl, pMapConnections> avdMapGUI;
+
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_MAP_GUI_avdMsg);
+        m_msg_types->Register("Debug", &Debug_MAP_GUI_avdMsg);
+        m_msg_types->Register("Error", &Error_MAP_GUI_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_MAP_GUI_avdMsg);
+        avdMessageSetTracker::Instance().Register("MapGUI", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("MapGUI");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+
+  /* Registers avdMapGUI creator with GUIFactory. */
+  avdAbstractCtrl *createMapGUI(void){
+    avdMapGUI *g = new avdMapGUI(0, "<(avdMapGUI)>");
+    g->getCtrl()->nameWatched("<createMapGUI(avdMapCtrl)>");
+    return g;
+  }
+  QString s_key("avdMapGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createMapGUI);
+}
+
+// arch-tag: implementation file for map gui factory and debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_MAP_GUI_DBG_HH
+#define AVD_MAP_GUI_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+#ifndef AVD_MAP_GUI_DBG_PROTO_HH
+#include "map_gui/avd_map_gui_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for map gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_gui_dbg_proto.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_MAP_GUI_DBG_PROTO_HH
+#define AVD_MAP_GUI_DBG_PROTO_HH
+
+extern avdMessageType  Info_MAP_GUI_avdMsg;
+extern avdMessageType Debug_MAP_GUI_avdMsg;
+extern avdMessageType Error_MAP_GUI_avdMsg;
+extern avdMessageType Fatal_MAP_GUI_avdMsg;
+#define  Info  AVD_INFO_MSG(MAP_GUI)
+#define Debug AVD_DEBUG_MSG(MAP_GUI)
+#define Error AVD_ERROR_MSG(MAP_GUI)
+#define Fatal AVD_FATAL_MSG(MAP_GUI)
+
+#endif
+
+// arch-tag: proto file for map gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,24 @@
+#ifndef AVD_MAP_CANVAS_HH
+#include "map_gui/avd_map_canvas.hh"
+#endif
+#ifndef AVD_MAP_LAYER_HH
+#include "map_gui/avd_map_layer.hh"
+#endif
+
+avdMapLayer::avdMapLayer(avdMapCanvas *canvas, cPopulation *population)
+: m_population(0)
+{
+  setCanvas(canvas);
+  setPopulation(population);
+}
+avdMapLayer::~avdMapLayer()
+{
+  setCanvas(0);
+  setPopulation(0);
+}
+void avdMapLayer::setCanvas(avdMapCanvas *canvas)
+{ SETretainable(m_canvas, canvas); }
+void avdMapLayer::setPopulation(cPopulation *population)
+{ m_population = population; }
+
+// arch-tag: implementation file for map layer objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_MAP_LAYER_HH
+#define AVD_MAP_LAYER_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef AVD_MAP_LAYER_PROTO_HH
+#include "map_gui/avd_map_layer_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for map layer objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_layer_proto.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,20 @@
+#ifndef AVD_MAP_LAYER_PROTO_HH
+#define AVD_MAP_LAYER_PROTO_HH
+
+class avdMapCanvas;
+class cPopulation;
+class avdMapLayer : public cRetainable {
+  QGuardedPtr<avdMapCanvas> m_canvas;
+  cPopulation *m_population;
+public:
+  avdMapLayer(avdMapCanvas *canvas, cPopulation *population);
+  ~avdMapLayer();
+  void setCanvas(avdMapCanvas *canvas);
+  void setPopulation(cPopulation *population);
+  avdMapCanvas *getCanvas(){ return m_canvas; }
+  cPopulation *getPopulation(){ return m_population; }
+};
+
+#endif
+
+// arch-tag: proto file for map layer objects
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.cc	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,43 @@
+#ifndef QLINEEDIT_H
+#include <qlineedit.h>
+#endif
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+#ifndef AVD_MAP_CANVAS_VIEW_HH
+#include "map_gui/avd_map_canvas_view.hh"
+#endif
+#ifndef AVD_MAP_VIEW_HH
+#include "map_gui/avd_map_view.hh"
+#endif
+
+
+avdMapView::avdMapView( QWidget *parent, const char *name, WFlags f)
+:QMainWindow(parent, name, f){
+  QWidget *central = new QWidget(
+    this, "<avdMapView(central)>");
+  setCentralWidget(central);
+  QVBoxLayout *layout = new QVBoxLayout(
+    central, 10, -1, "<avdMapView(layout)>");
+  avdMapCanvasView *canvas_view = new avdMapCanvasView(
+    central, "<avdMapView(canvas_view)>");
+  setCanvasView(canvas_view); getCanvasView()->release();
+  getCanvasView()->nameWatched("<avdMapView(canvas_view)>");
+  layout->addWidget(getCanvasView());
+}
+avdMapView::~avdMapView(){
+  setCanvasView(0);
+}
+void avdMapView::setCanvasView(avdMapCanvasView *canvas_view)
+{ SETretainable(m_canvas_view, canvas_view); }
+
+// arch-tag: implementation file for map gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/avd_map_view.hh	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,32 @@
+#ifndef AVD_MAP_VIEW_HH
+#define AVD_MAP_VIEW_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class avdMapCanvasView;
+class avdMapView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdMapCanvasView> m_canvas_view;
+  void setCanvasView(avdMapCanvasView *m_canvas_view);
+public:
+  avdMapView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel | WDestructiveClose
+  );
+  ~avdMapView();
+  avdMapCanvasView *getCanvasView(){ return m_canvas_view; }
+};
+
+#endif
+
+// arch-tag: header file for map gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/map_gui.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/map_gui.pri:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/map_gui/map_gui.pri	Mon Dec 29 14:55:12 2003
@@ -0,0 +1,25 @@
+
+map_gui {
+  HEADERS += \
+    $$MAP_GUI_HH/avd_map_canvas.hh \
+    $$MAP_GUI_HH/avd_map_canvas_rectangle.hh \
+    $$MAP_GUI_HH/avd_map_canvas_rectangle_proto.hh \
+    $$MAP_GUI_HH/avd_map_canvas_view.hh \
+    $$MAP_GUI_HH/avd_map_ctrl.hh \
+    $$MAP_GUI_HH/avd_map_gui_dbg.hh \
+    $$MAP_GUI_HH/avd_map_gui_dbg_proto.hh \
+    $$MAP_GUI_HH/avd_map_layer_proto.hh \
+    $$MAP_GUI_HH/avd_map_layer.hh \
+    $$MAP_GUI_HH/avd_map_view.hh
+
+  SOURCES += \
+    $$MAP_GUI_CC/avd_map_canvas.cc \
+    $$MAP_GUI_CC/avd_map_canvas_rectangle.cc \
+    $$MAP_GUI_CC/avd_map_canvas_view.cc \
+    $$MAP_GUI_CC/avd_map_ctrl.cc \
+    $$MAP_GUI_CC/avd_map_gui.cc \
+    $$MAP_GUI_CC/avd_map_layer.cc \
+    $$MAP_GUI_CC/avd_map_view.cc
+}
+
+# arch-tag: qmake include file for map module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_avida_state_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_avida_state_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:19 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_avida_state_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,36 @@
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#define AVD_AVIDA_STATE_MEDIATOR_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class cAvidaDriver_Population;
+class avdAvidaStateMediator : public QObject {
+  Q_OBJECT
+public:
+  avdAvidaStateMediator(
+    QObject *parent = 0, const char *name = "(avdAvidaStateMediator)")
+  :QObject(parent, name){}
+signals:
+  void doStartAvidaSig();
+  void doPauseAvidaSig();
+  void doUpdateAvidaSig();
+  void doStepAvidaSig(int cell_id);
+  void doStepAvidaSig();
+
+  void doResetAvidaSig();
+  void doOpenAvidaSig();
+  void doCloseAvidaSig();
+signals:
+  void avidaStateChangedSig(cAvidaDriver_Population *pop);
+  void avidaUpdatedSig(cAvidaDriver_Population *pop);
+  void avidaSteppedSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaBreakSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaOpenedSig(cAvidaDriver_Population *pop);
+  void avidaClosedSig(cAvidaDriver_Population *pop);
+};
+
+#endif
+
+// arch-tag: header file for avida state mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,12 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+
+bool avdConnections::add(const char *sender_signal, const char *receiver_member)
+{ return QObject::connect(m_sender, sender_signal, m_receiver, receiver_member); }
+
+// arch-tag: implementation file for qt-connections convenience utility object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_connections.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,20 @@
+#ifndef AVD_CONNECTIONS_HH
+#define AVD_CONNECTIONS_HH
+
+class QObject;
+class avdConnections {
+private:
+  /* disabled */ avdConnections();
+  /* disabled */ avdConnections(const avdConnections &);
+  /* disabled */ avdConnections& operator=(const avdConnections &);
+protected:
+  const QObject *m_sender, *m_receiver;
+public:
+  avdConnections(const QObject *sender, const QObject *receiver)
+  : m_sender(sender), m_receiver(receiver){}
+  bool add(const char *sender_signal, const char *receiver_member);
+};
+
+#endif
+
+// arch-tag: header file for qt-connections convenience utility object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_gui_factory_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_gui_factory_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_gui_factory_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,20 @@
+#ifndef AVD_GUI_FACTORY_MEDIATOR_HH
+#define AVD_GUI_FACTORY_MEDIATOR_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class avdGUIFactoryMediator : public QObject {
+  Q_OBJECT
+public:
+  avdGUIFactoryMediator(
+    QObject *parent = 0, const char *name = "(avdGUIFactoryMediator)")
+  :QObject(parent, name){}
+signals:
+  void newGUIControllerSig(const QString &);
+};
+
+#endif
+
+// arch-tag: header file for gui factory mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,32 @@
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+
+#ifndef AVD_MC_DBG_HH
+#include "avd_mc_dbg.hh"
+#endif
+
+avdMessageType  Info_MC_avdMsg("MainController", avdMCInfo);
+avdMessageType Debug_MC_avdMsg("MainController", avdMCDebug);
+avdMessageType Error_MC_avdMsg("MainController", avdMCError);
+avdMessageType Fatal_MC_avdMsg("MainController", avdMCFatal);
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_MC_avdMsg);  
+        m_msg_types->Register("Debug", &Debug_MC_avdMsg);  
+        m_msg_types->Register("Error", &Error_MC_avdMsg);  
+        m_msg_types->Register("Fatal", &Fatal_MC_avdMsg);  
+        avdMessageSetTracker::Instance().Register("MainController", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("MainController");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
+
+// arch-tag: implementation file for mission-control factory and debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_MC_DBG_HH
+#define AVD_MC_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+#ifndef AVD_MC_DBG_PROTO_HH
+#include "avd_mc_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for mission-control debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_dbg_proto.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_MC_DBG_PROTO_HH
+#define AVD_MC_DBG_PROTO_HH
+
+extern avdMessageType  Info_MC_avdMsg;
+extern avdMessageType Debug_MC_avdMsg;
+extern avdMessageType Error_MC_avdMsg;
+extern avdMessageType Fatal_MC_avdMsg;
+#define  Info  AVD_INFO_MSG(MC)
+#define Debug AVD_DEBUG_MSG(MC)
+#define Error AVD_ERROR_MSG(MC)
+#define Fatal AVD_FATAL_MSG(MC)
+
+#endif
+
+// arch-tag: proto file for mission-control debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,53 @@
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_MEDIATOR_HH
+#include "mc/avd_gui_factory_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef AVD_WINDOWS_MEDIATOR_HH
+#include "mc/avd_windows_mediator.hh"
+#endif
+
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+
+class avdMCMediator_prv : public cRetainable {
+public:
+  avdGUIFactoryMediator m_gui_factory_mediator;
+  avdAvidaStateMediator m_avida_state_mediator;
+  avdMenuBarMediator m_menubar_mediator;
+  avdSettingsMediator m_settings_mediator;
+  avdWindowsMediator m_windows_mediator;
+};
+
+avdMCMediator::avdMCMediator(QObject *parent, const char *name)
+: QObject(parent, name), m_d(0)
+{ avdMCMediator_prv *d = new avdMCMediator_prv; setD(d)->release(); }
+avdMCMediator::~avdMCMediator()
+{ setD(0); }
+avdMCMediator_prv *avdMCMediator::setD(avdMCMediator_prv *d)
+{ SETretainable(m_d, d); return D(); }
+
+avdAvidaStateMediator *avdMCMediator::getAvidaStateMediator()
+{ return &D()->m_avida_state_mediator; }
+avdGUIFactoryMediator *avdMCMediator::getGUIFactoryMediator()
+{ return &D()->m_gui_factory_mediator; }
+avdMenuBarMediator *avdMCMediator::getMenuBarMediator()
+{ return &D()->m_menubar_mediator; }
+avdSettingsMediator *avdMCMediator::getSettingsMediator()
+{ return &D()->m_settings_mediator; }
+avdWindowsMediator *avdMCMediator::getWindowsMediator()
+{ return &D()->m_windows_mediator; }
+
+// arch-tag: implementation file for mission-control mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mc_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,47 @@
+#ifndef AVD_MC_MEDIATOR_HH
+#define AVD_MC_MEDIATOR_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+
+class avdAvidaStateMediator;
+class avdGUIFactoryMediator;
+class avdMenuBarMediator;
+class avdSettingsMediator;
+class avdWindowsMediator;
+
+// XXX FIXME this can probably be removed (see below).
+class avdAbstractCtrl;
+
+class avdMCMediator_prv;
+class avdMCMediator : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  avdMCMediator_prv *m_d;
+public:
+  avdMCMediator(QObject *parent = 0, const char *name = 0);
+  ~avdMCMediator();
+  avdMCMediator_prv *setD(avdMCMediator_prv *d);
+  avdMCMediator_prv *D(){ return m_d; }
+public:
+  avdGUIFactoryMediator *getGUIFactoryMediator();
+  avdAvidaStateMediator *getAvidaStateMediator();
+  avdMenuBarMediator *getMenuBarMediator();
+  avdSettingsMediator *getSettingsMediator();
+  avdWindowsMediator *getWindowsMediator();
+signals:
+  // XXX FIXME this can probably be removed, or moved to avdMenuBarMediator.
+  void doSetupMyMenu(avdAbstractCtrl *);
+};
+
+#endif
+
+// arch-tag: header file for mission-control mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_menubar_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_menubar_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_menubar_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,25 @@
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#define AVD_MENUBAR_MEDIATOR_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QMenuBar;
+class avdAbstractCtrl;
+class avdMenuBarMediator : public QObject {
+  Q_OBJECT
+public:
+  avdMenuBarMediator(
+    QObject *parent = 0, const char *name = "(avdMenuBarMediator)")
+  :QObject(parent, name){}
+signals:
+  void setupMenuBarSig(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for menu bar mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,155 @@
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QMUTEX_H
+#include <qmutex.h>
+#endif
+
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+
+#ifndef AVD_MC_DBG_HH
+#include "mc/avd_mc_dbg.hh"
+#endif
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_MEDIATOR_HH
+#include "mc/avd_gui_factory_mediator.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef REQUESTS_ARGV_HH
+#include "mc/attributes/requests_argv.hh"
+#endif
+#ifndef SCOPEGUARD_H_
+#include "memory_mgt/ScopeGuard.h"
+#endif
+
+#ifndef AVD_MISSION_CONTROL_HH
+#include "mc/avd_mission_control.hh"
+#endif
+
+
+using namespace std;
+
+
+void avdMissionControl::setMediator(avdMCMediator *mdtr)
+{ SETretainable(m_mdtr, mdtr); }
+void avdMissionControl::setMenuBarHdlr(avdAbstractCtrl *menubar_hdlr)
+{ SETretainable(m_menubar_hdlr, menubar_hdlr); }
+void avdMissionControl::setPrefsCtrl(avdAbstractCtrl *prefs_ctrl)
+{ SETretainable(m_prefs_ctrl, prefs_ctrl); }
+void avdMissionControl::setConsoleCtrl(avdAbstractCtrl *console_ctrl)
+{ SETretainable(m_console_ctrl, console_ctrl); }
+void avdMissionControl::setAvidaThreadHdlr(avdAbstractCtrl *avida_thread_hdlr)
+{ SETretainable(m_avida_thread_hdlr, avida_thread_hdlr); }
+
+void avdMissionControl::provideArgvSlot(aReqArgcArgv &requestor)
+{ requestor.setArgcArgv(argc(), argv()); };
+int avdMissionControl::argc(void){ return m_argc; }
+char **avdMissionControl::argv(void){ return m_argv; }
+
+void avdMissionControl::quitSlot(void){ QApplication::exit(0); }   
+
+avdAbstractCtrl *avdMissionControl::newGUIController(const QString &ctrl_type){
+  avdAbstractCtrl *c = avdControllerFactory::Instance().CreateObject(ctrl_type);
+  //if(c){ c->setup(getMediator()); }
+  if(!c) {
+    Error
+    << "Couldn't allocate new user interface of type \"" << ctrl_type << "\".\n"
+    << "Normally the user interface factory \"avdControllerFactory\"\n"
+    << "creates a user interface of a type specified by name.\n"
+    << "In this case, the factory couldn't produce the requested object,\n"
+    << "but I'm going to try to continue running anyway.\n";
+    return 0;
+  }
+  ScopeGuard c_guard = MakeObjGuard(*c, &cRetainable::release);
+  if(!c->setup(getMediator())){
+    Error
+    << "Couldn't setup new user interface of type \"" << ctrl_type << "\".\n"
+    << "Normally, after the user interface is created, it's told to setup\n"
+    << "its visible elements.  In this case, the user interface was\n"
+    << "unable to complete its setup, so i'm going to delete the user\n"
+    << "interface; then I'm going to try to continue running.\n";
+    return 0;
+  }
+  c_guard.Dismiss();
+  return c;
+}   
+
+avdMissionControl::avdMissionControl(
+  int argc,
+  char **argv,
+  QObject *parent,
+  const char *name
+):QObject(parent, name)
+{ 
+  m_argc = argc;
+  m_argv = argv;
+
+  setMediator(new avdMCMediator(0, "<avdMissionControl::m_mdtr>"));
+  if(!getMediator())
+  { Fatal << "Couldn't create main message mediator (out of memory?)"; }
+  getMediator()->release();
+  getMediator()->nameWatched("<avdMissionControl::m_mdtr>");
+
+  connect(this, SIGNAL(openAvidaSig()),
+    getMediator()->getAvidaStateMediator(),
+    SIGNAL(doOpenAvidaSig()));
+  connect(getMediator()->getGUIFactoryMediator(),
+    SIGNAL(newGUIControllerSig(const QString &)),
+    this, SLOT(newGUIControllerSlot(const QString &)));
+  connect(getMediator()->getSettingsMediator(),
+    SIGNAL(requestArgvSig(aReqArgcArgv &)),
+    this, SLOT(provideArgvSlot(aReqArgcArgv &)));
+
+  setMenuBarHdlr(newGUIController("avdMenuBarHdlr"));
+  if(!getMenuBarHdlr())
+  { Fatal << "Couldn't create menubar handler."; }
+  getMenuBarHdlr()->release();
+  getMenuBarHdlr()->nameWatched("<avdMissionControl::m_menubar_hdlr>");
+
+  setPrefsCtrl(newGUIController("avdPrefsGUI"));
+  if(!getPrefsCtrl())
+  { Fatal << "Couldn't create preferences controller."; }
+  getPrefsCtrl()->release();
+  getPrefsCtrl()->nameWatched("<avdMissionControl::m_prefs_ctrl>");
+
+  setConsoleCtrl(newGUIController("avdUserMsgGUI"));
+  if(!getConsoleCtrl())
+  { Fatal << "Couldn't create info console controller."; }
+  getConsoleCtrl()->release();
+  getConsoleCtrl()->nameWatched("<avdMissionControl::m_console_ctrl>");
+
+  setAvidaThreadHdlr(newGUIController("avdAvidaThreadHdlr"));
+  if(!getAvidaThreadHdlr())
+  { Fatal << "Couldn't create avida thread handler."; }
+  getAvidaThreadHdlr()->release();
+  getAvidaThreadHdlr()->nameWatched("<avdMissionControl::m_avida_thread_hdlr>");
+
+  emit(openAvidaSig());
+
+  newGUIController("avdDumbGUI");
+  //newGUIController("avdUserMsgGUI");
+  newGUIController("avdAnalyzerGUI");
+}                   
+
+avdMissionControl::~avdMissionControl(){
+  setAvidaThreadHdlr(0);
+  setConsoleCtrl(0);
+  setPrefsCtrl(0);
+  setMenuBarHdlr(0);
+  setMediator(0);
+}   
+
+// arch-tag: implementation file for mission-control
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_mission_control.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,60 @@
+#ifndef AVD_MISSION_CONTROL_HH
+#define AVD_MISSION_CONTROL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class avdAbstractCtrl;
+class avdMCMediator;
+class aReqArgcArgv;
+
+class avdMissionControl : public QObject, public cRetainable { 
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdMCMediator> m_mdtr;
+  avdAbstractCtrl *m_menubar_hdlr;
+  avdAbstractCtrl *m_prefs_ctrl;
+  avdAbstractCtrl *m_console_ctrl;
+  avdAbstractCtrl *m_avida_thread_hdlr;
+  int m_argc;
+  char **m_argv;
+protected:
+  void setMediator(avdMCMediator *mdtr);
+  void setMenuBarHdlr(avdAbstractCtrl *menubar_hdlr);
+  void setPrefsCtrl(avdAbstractCtrl *prefs_ctrl);
+  void setConsoleCtrl(avdAbstractCtrl *console_ctrl);
+  void setAvidaThreadHdlr(avdAbstractCtrl *avida_thread_hdlr);
+  avdMCMediator *getMediator(){ return m_mdtr; }
+  avdAbstractCtrl *getMenuBarHdlr(){ return m_menubar_hdlr; }
+  avdAbstractCtrl *getPrefsCtrl(){ return m_prefs_ctrl; }
+  avdAbstractCtrl *getConsoleCtrl(){ return m_console_ctrl; }
+  avdAbstractCtrl *getAvidaThreadHdlr(){ return m_avida_thread_hdlr; }
+  int argc(void);
+  char **argv(void);
+  avdAbstractCtrl *newGUIController(const QString &controller_type);
+public:
+  avdMissionControl(
+    int argc, char **argv, QObject *parent = 0, const char *name = 0);
+  ~avdMissionControl();
+protected slots:
+  void quitSlot(void);
+  void newGUIControllerSlot(const QString &controller_type)
+  { newGUIController(controller_type); }
+  void provideArgvSlot(aReqArgcArgv &requestor);
+signals:
+  void openAvidaSig(void);
+};
+
+
+#endif
+
+// arch-tag: header file for mission-control
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_settings_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_settings_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_settings_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,35 @@
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#define AVD_SETTINGS_MEDIATOR_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_USER_MSG_CTRL_FUNCT_HH
+#include "user_msg/avd_user_msg_ctrl_funct.hh"
+#endif
+
+
+class aReqArgcArgv;
+class cTestInterface;
+class avdUserMsgCtrl;
+
+class avdSettingsMediator : public QObject {
+  Q_OBJECT
+public:
+  avdSettingsMediator(
+    QObject *parent = 0, const char *name = "(avdSettingsMediator)")
+  :QObject(parent, name){}
+signals:
+  void requestArgvSig(aReqArgcArgv &receiver);
+  void settingsChangedSig();
+  void userMsgPrefsChangedSig();
+  void userMsgPrefsChangedSig(avdUserMsgCtrlFunct &funct);
+  void requestUserMsgPrefsSig(const avdUserMsgCtrl &ctrl);
+
+  void doSendSig(cTestInterface *test_ifc);
+};
+
+#endif
+
+// arch-tag: header file for settings mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_windows_mediator.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_windows_mediator.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/avd_windows_mediator.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,21 @@
+#ifndef AVD_WINDOWS_MEDIATOR_HH
+#define AVD_WINDOWS_MEDIATOR_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class avdWindowsMediator : public QObject {
+  Q_OBJECT
+public:
+  avdWindowsMediator(
+    QObject *parent = 0, const char *name = "(avdWindowsMediator)")
+  :QObject(parent, name){}
+signals:
+  void showUserMsgGUISig();
+  void showPrefsGUISig();
+};
+
+#endif
+
+// arch-tag: header file for windows mediator
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/mc.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/mc.pri:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/mc.pri	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,26 @@
+
+mc {
+  HEADERS += \
+    $$MC_HH/avd_avida_state_mediator.hh \
+    $$MC_HH/avd_connections.hh \
+    $$MC_HH/avd_gui_factory_mediator.hh \
+    $$MC_HH/avd_menubar_mediator.hh \
+    $$MC_HH/avd_settings_mediator.hh \
+    $$MC_HH/avd_windows_mediator.hh \
+    $$MC_HH/avd_mc_dbg_proto.hh \
+    $$MC_HH/avd_mc_dbg.hh \
+    $$MC_HH/avd_mc_mediator.hh \
+    $$MC_HH/avd_mission_control.hh \
+    $$MC_HH/setup_avida.hh \
+    \
+    $$MC_HH/attributes/requests_argv.hh
+
+  SOURCES += \
+    $$MC_CC/avd_connections.cc \
+    $$MC_CC/avd_mc_dbg.cc \
+    $$MC_CC/avd_mc_mediator.cc \
+    $$MC_CC/avd_mission_control.cc \
+    $$MC_CC/setup_avida.cc
+}
+
+# arch-tag: qmake include file for misson-control module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,111 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2003 California Institute of Technology             //
+//                                                                          //
+// Read the COPYING and README files, or contact 'avida at alife.org',         //
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.     //
+//////////////////////////////////////////////////////////////////////////////
+
+// needs paths to src/tools, src/main, src/cpu, src/event
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <signal.h>
+
+#include "main/avida.hh"
+#include "main/callback_util.hh"
+#include "main/config.hh"
+#include "cpu/hardware_method.hh"
+#include "main/environment.hh"
+#include "main/population.hh"
+#include "cpu/test_cpu.hh"
+#include "cpu/hardware_util.hh"
+/* FIXME beware of hardwiring. -- kgn */
+#include "cpu/hardware_cpu.hh"
+#include "cpu/hardware_4stack.hh"
+/* XXX */
+
+#include <qapplication.h>
+
+//#include "avida_driver.hh"
+
+// #include "setup_wizard.hh"
+// #include "setup_wizard2.hh"
+// #include "testwizard.hh"
+
+
+#ifndef SETUP_AVIDA_HH
+#include "mc/setup_avida.hh"
+#endif
+
+
+using namespace std;
+
+  
+void ExitAvidaQtMultithreading(int exit_code)
+{
+  signal(SIGINT, SIG_IGN);          // Ignore all future interupts.
+  //QApplication::exit(exit_code);
+  //delete cAvidaDriver_Base::main_driver;
+  exit(exit_code);
+}
+
+
+void SetupAvidaQtMultithreading(
+  int argc,
+  char *argv[],
+  cEnvironment &environment,
+  cPopulationInterface &test_interface
+){
+  // Catch Interrupt making sure to close appropriately
+  signal(SIGINT, ExitAvidaQtMultithreading);
+
+  // output copyright message
+  printf( "Avida version %s\nCopyright (C) 1993-2001 California Institute of Technology.\n\n", AVIDA_VERSION );
+  printf( "Avida comes with ABSOLUTELY NO WARRANTY.\n" );
+  printf( "This is free software, and you are welcome to redistribute it\nunder certain conditions. See file COPYING for details.\n\n" );
+
+  //TestWizard test_wizard(argc, argv);
+  //test_wizard.exec();
+
+  
+  // Initialize the configuration data...
+  cConfig::Setup(argc, argv);
+  cConfig::SetupMS();
+  
+  // Initialize the default environment...
+   if (environment.Load(cConfig::GetEnvironmentFilename()) == false) {
+    cerr << "Unable to load environment... aborting!" << endl;
+    ExitAvida(-1);
+  }
+
+  if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_ORIGINAL) {
+    environment.GetInstSet().SetInstLib(cHardwareCPU::GetInstLib());
+    cHardwareUtil::LoadInstSet_CPUOriginal(cConfig::GetInstFilename(),
+					   environment.GetInstSet());
+  }
+  else if (cConfig::GetHardwareType() == HARDWARE_TYPE_CPU_4STACK) {
+    environment.GetInstSet().SetInstLib(cHardware4Stack::GetInstLib());
+    cHardwareUtil::LoadInstSet_CPU4Stack(cConfig::GetInstFilename(),
+					   environment.GetInstSet());
+  }
+
+
+  cConfig::SetNumInstructions(environment.GetInstSet().GetSize());
+  cConfig::SetNumTasks(environment.GetTaskLib().GetSize());
+  cConfig::SetNumReactions(environment.GetReactionLib().GetSize());
+  cConfig::SetNumResources(environment.GetResourceLib().GetSize());
+    
+  // Build a test population interface.
+  test_interface.SetFun_NewHardware(&cCallbackUtil::CB_NewHardware);
+  test_interface.SetFun_Recycle(&cCallbackUtil::CB_RecycleHardware);
+  test_interface.SetFun_Divide(&cCallbackUtil::CB_TestDivide);
+  test_interface.SetFun_GetInput(&cCallbackUtil::CB_GetInput);
+  test_interface.SetFun_GetResources(&cCallbackUtil::CB_GetResources);
+  test_interface.SetFun_UpdateResources(&cCallbackUtil::CB_UpdateResources);
+
+  // Setup the test CPUs.
+  cTestCPU::Setup( &(environment.GetInstSet()), &environment, test_interface );
+} 
+
+// arch-tag: implementation file for avida multithreading setup function
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/setup_avida.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,17 @@
+#ifndef SETUP_AVIDA_HH
+#define SETUP_AVIDA_HH
+
+class cEnvironment;
+class cPopulationInterface;
+
+void ExitAvidaQtMultithreading(int exit_code);
+void SetupAvidaQtMultithreading(
+  int argc,
+  char *argv[],
+  cEnvironment &environment,
+  cPopulationInterface &test_interface
+);
+
+#endif
+
+// arch-tag: header file for avida multithreading setup function
Index: avida/current/source/qt-viewer/exp/exp_cleanup/mc/attributes/requests_argv.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/mc/attributes/requests_argv.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/mc/attributes/requests_argv.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,9 @@
+#ifndef REQUESTS_ARGV_HH
+#define REQUESTS_ARGV_HH
+
+class aReqArgcArgv
+{ public: virtual void setArgcArgv(int argc, char **argv) = 0; };
+
+#endif
+
+// arch-tag: header file for argv requests interface
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/ScopeGuard.h
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/ScopeGuard.h:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/ScopeGuard.h	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,284 @@
+#ifndef SCOPEGUARD_H_
+#define SCOPEGUARD_H_
+
+template <class T>
+class RefHolder
+{
+	T& ref_;
+public:
+	RefHolder(T& ref) : ref_(ref) {}
+	operator T& () const 
+	{
+		return ref_;
+	}
+private:
+    // Disable assignment - not implemented
+    RefHolder& operator=(const RefHolder&);
+};
+
+template <class T>
+inline RefHolder<T> ByRef(T& t)
+{
+	return RefHolder<T>(t);
+}
+
+class ScopeGuardImplBase
+{
+	ScopeGuardImplBase& operator =(const ScopeGuardImplBase&);
+protected:
+	~ScopeGuardImplBase()
+	{
+	}
+	ScopeGuardImplBase(const ScopeGuardImplBase& other) throw() 
+		: dismissed_(other.dismissed_)
+	{
+		other.Dismiss();
+	}
+	template <typename J>
+	static void SafeExecute(J& j) throw() 
+	{
+		if (!j.dismissed_)
+			try
+			{
+				j.Execute();
+			}
+			catch(...)
+			{
+			}
+	}
+	
+	mutable bool dismissed_;
+public:
+	ScopeGuardImplBase() throw() : dismissed_(false) 
+	{
+	}
+	void Dismiss() const throw() 
+	{
+		dismissed_ = true;
+	}
+};
+
+typedef const ScopeGuardImplBase& ScopeGuard;
+
+template <typename F>
+class ScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl0<F> MakeGuard(F fun)
+	{
+		return ScopeGuardImpl0<F>(fun);
+	}
+	~ScopeGuardImpl0() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		fun_();
+	}
+protected:
+	ScopeGuardImpl0(F fun) : fun_(fun) 
+	{
+	}
+	F fun_;
+};
+
+template <typename F> 
+inline ScopeGuardImpl0<F> MakeGuard(F fun)
+{
+	return ScopeGuardImpl0<F>::MakeGuard(fun);
+}
+
+template <typename F, typename P1>
+class ScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+	{
+		return ScopeGuardImpl1<F, P1>(fun, p1);
+	}
+	~ScopeGuardImpl1() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_);
+	}
+protected:
+	ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+};
+
+template <typename F, typename P1> 
+inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+{
+	return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
+}
+
+template <typename F, typename P1, typename P2>
+class ScopeGuardImpl2: public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+	{
+		return ScopeGuardImpl2<F, P1, P2>(fun, p1, p2);
+	}
+	~ScopeGuardImpl2() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_, p2_);
+	}
+protected:
+	ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+	const P2 p2_;
+};
+
+template <typename F, typename P1, typename P2>
+inline ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+{
+	return ScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2);
+}
+
+template <typename F, typename P1, typename P2, typename P3>
+class ScopeGuardImpl3 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+	{
+		return ScopeGuardImpl3<F, P1, P2, P3>(fun, p1, p2, p3);
+	}
+	~ScopeGuardImpl3() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_, p2_, p3_);
+	}
+protected:
+	ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+	const P2 p2_;
+	const P3 p3_;
+};
+
+template <typename F, typename P1, typename P2, typename P3>
+inline ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+{
+	return ScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3);
+}
+
+//************************************************************
+
+template <class Obj, typename MemFun>
+class ObjScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+	{
+		return ObjScopeGuardImpl0<Obj, MemFun>(obj, memFun);
+	}
+	~ObjScopeGuardImpl0() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)();
+	}
+protected:
+	ObjScopeGuardImpl0(Obj& obj, MemFun memFun) 
+		: obj_(obj), memFun_(memFun) {}
+	Obj& obj_;
+	MemFun memFun_;
+};
+
+template <class Obj, typename MemFun>
+inline ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+{
+	return ObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun);
+}
+
+template <class Obj, typename MemFun, typename P1>
+class ObjScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+	{
+		return ObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1);
+	}
+	~ObjScopeGuardImpl1() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)(p1_);
+	}
+protected:
+	ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1) 
+		: obj_(obj), memFun_(memFun), p1_(p1) {}
+	Obj& obj_;
+	MemFun memFun_;
+	const P1 p1_;
+};
+
+template <class Obj, typename MemFun, typename P1>
+inline ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+{
+	return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
+}
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+class ObjScopeGuardImpl2 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+	{
+		return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2);
+	}
+	~ObjScopeGuardImpl2() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)(p1_, p2_);
+	}
+protected:
+	ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2) 
+		: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {}
+	Obj& obj_;
+	MemFun memFun_;
+	const P1 p1_;
+	const P2 p2_;
+};
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+inline ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+{
+	return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>::MakeObjGuard(obj, memFun, p1, p2);
+}
+
+#define CONCATENATE_DIRECT(s1, s2) s1##s2
+#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
+#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
+
+#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
+#define ON_BLOCK_EXIT_OBJ ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
+
+#endif //SCOPEGUARD_H_
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,17 @@
+#ifndef ACTIVATE_WATCHER_HH
+#define ACTIVATE_WATCHER_HH
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef WATCH_RETAINS_HH
+#include "memory_mgt/watch_retains.hh"
+#endif
+
+#ifndef ACTIVATE_WATCHER_PROTO_HH
+#include "activate_watcher_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for retainable-object watcher activation
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/activate_watcher_proto.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,23 @@
+#ifndef ACTIVATE_WATCHER_PROTO_HH
+#define ACTIVATE_WATCHER_PROTO_HH
+
+class cActivateWatcher : public cRetainable {
+private:
+  /* disabled */ cActivateWatcher(const cActivateWatcher &);
+  /* disabled */ cActivateWatcher operator =(const cActivateWatcher &);
+protected:
+  cWatchRetains *m_w;
+protected:
+  void setWatch(cWatchRetains *w){
+    if(w) w->retain(); if(m_w) m_w->release(); m_w = w; }
+  cWatchRetains *getWatch(){ return m_w; }
+public:
+  cActivateWatcher(cWatchRetains *w):m_w(0){
+    setWatch(w); if(getWatch()) getWatch()->activate(); }
+  ~cActivateWatcher(){
+    if(getWatch()) getWatch()->deactivate(); setWatch(0); }
+};
+
+#endif
+
+// arch-tag: proto file for retainable-object watcher activation
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/memory_mgt.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/memory_mgt.pri:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/memory_mgt.pri	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,19 @@
+
+memory_mgt {
+  HEADERS += \
+    $$MEMORY_MGT_HH/activate_watcher_proto.hh \
+    $$MEMORY_MGT_HH/activate_watcher.hh \
+    $$MEMORY_MGT_HH/retainable_dbg_proto.hh \
+    $$MEMORY_MGT_HH/retainable_dbg.hh \
+    $$MEMORY_MGT_HH/retainable_proto.hh \
+    $$MEMORY_MGT_HH/retainable.hh \
+    $$MEMORY_MGT_HH/ScopeGuard.h \
+    $$MEMORY_MGT_HH/watch_retains_proto.hh \
+    $$MEMORY_MGT_HH/watch_retains.hh
+
+  SOURCES += \
+    $$MEMORY_MGT_CC/retainable.cc \
+    $$MEMORY_MGT_CC/watch_retains.cc
+}
+
+# arch-tag: qmake include file for memory-management module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,39 @@
+#ifndef RETAINABLE_DBG_HH
+#include "retainable_dbg.hh"
+#endif
+#ifndef WATCH_RETAINS_HH
+#include "memory_mgt/watch_retains.hh"
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+// This is for displaying error messages.
+cMessageType Error_cRetainable_Msg("Memory", MCError);
+
+
+tRList<cWatchRetains> cRetainable::s_retain_watchlist;
+cString cRetainable::s_noname_str("(unnamed)");
+cString cRetainable::s_copyof_str("(copy of)");
+
+void cRetainable::nameWatched(const cString &name){
+  m_ret_name = name;
+  if(!m_watcher){
+    cRetainableError
+    << "Warning: told to watch object \"" << watchedName() << "\"";
+    cRetainableError
+    << " for memory leaks, but no leak-watch is installed.";
+} }
+void cRetainable::endWatch(){
+  if(m_watcher) m_watcher->m_watchset.erase(this);
+  m_watcher = 0;
+}
+void cRetainable::beWatched(){
+  if(0 < s_retain_watchlist.GetSize()){
+    m_watcher = s_retain_watchlist.GetFirst();
+    m_watcher->m_watchset.insert(this);
+  } else m_watcher = 0;
+}
+
+// arch-tag: implementation file for retainable object base class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,16 @@
+#ifndef RETAINABLE_HH
+#define RETAINABLE_HH
+
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+#ifndef TRLIST_HH
+#include "containers/tRList.hh"
+#endif
+#ifndef RETAINABLE_PROTO_HH
+#include "memory_mgt/retainable_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for retainable object base class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,13 @@
+#ifndef RETAINABLE_DBG_HH
+#define RETAINABLE_DBG_HH
+
+#ifndef MESSAGE_DISPLAY_HDRS_HH
+#include "tools/message_display_hdrs.hh"
+#endif
+#ifndef RETAINABLE_DBG_PROTO_HH
+#include "retainable_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for retainable object debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_dbg_proto.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,9 @@
+#ifndef RETAINABLE_DBG_PROTO_HH
+#define RETAINABLE_DBG_PROTO_HH
+
+extern cMessageType Error_cRetainable_Msg;
+#define cRetainableError _ERROR_MSG(cRetainable)
+
+#endif
+
+// arch-tag: proto file for retainable object debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/retainable_proto.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,260 @@
+#ifndef RETAINABLE_PROTO_HH
+#define RETAINABLE_PROTO_HH
+
+/*
+Inherit from cRetainable to provide primitive garbage collection via
+retain counting a la Objective C.  The important part of the exposed
+interface:
+
+  class cRetainable {
+  public:
+    void retain();
+    void release();
+    int refs() const;
+  };
+
+where:
+
+  void retain()
+    Increments its retain count.
+  void release()
+    Decrements its retain count.
+    If the retain count drops to zero, deletes itself.
+  int refs()
+    Returns its retain count (for debugging).
+  void nameWatched(const cString &name)
+    For debugging purposes, gives it a name.
+  const cString &watchedName()
+    Retrieves its name, for debugging purposes.
+
+The following discussion is adapted from Don Yackman's article "Hold
+Me, Use Me, Free Me" on StepWise.com:
+
+  http://www.stepwise.com/Articles/Technical/HoldMe.html
+
+(Note:  use QGuardedPtr<> to store any object inheriting from both
+cRetainable and QObject.  See Rule 7 for an explanation.)
+
+Rule 1:  The retention count rule:
+
+- Within a given block the use of new and retain() should equal the use
+  of release().
+  - Example:
+    void Foo::hello(){
+      cSomethingRetainable *bar = new cSomethingRetainable;
+      // do stuff.
+      bar->release();
+      // bar deletes itself if nobody else has retained bar.
+    }
+
+Rule 2:  Always use accessor methods:
+
+- Sometimes it might seem tedious or pedantic, but if you use accessor
+  methods consistently the chances of problems with memory management
+  will decrease considerably. 
+- If you are using retain() and release() on a class' instance variables
+  throughout your code, you're almost certainly doing the wrong thing.
+- Example:
+
+  class MyRetainableClass : public cRetainable {
+    ...
+  };
+
+  class I_use_a_retainable_class {
+    MyRetainableClass *m_retainable;
+  public:
+    // To get and set m_retainable we should use two accessor methods:
+    MyRetainableClass *getRetainableThing(){
+      return m_retainable;
+      // no retain or release since we're just passing back a variable.
+    }
+    void setRetainableThing(MyRetainableClass *retainable){
+      if(retainable) retainable->retain();
+      if(m_retainable) m_retainable->release();
+      m_retainable = retainable;
+    }
+
+    // In the class constructors, initialize m_retainable to 'null'.
+    I_use_a_retainable_class():m_retainable(0){
+      // do stuff.
+    }
+    // Since we have a retainable instance variable, we must deallocate
+    // it in the class destructors.
+    ~I_use_a_retainable_class(){
+      setRetainableThing(0);
+      // Whatever m_retainable contained earlier has had its retain
+      // count decremented.  If nobody else has retained it, it deletes
+      // itself.
+    }
+
+    // Suppose we want to implement a method to reset the retainable
+    // instance variable.  According to the retention count rule, we
+    // must balance the 'new' with a release.
+    void reset(){
+      MyRetainableClass *retainable = new MyRetainableClass();
+      // 'retainable' now has a retain count of 1.
+      setRetainableThing(retainable);
+      // 'retainable' now has a retain count of 2;
+      // whatever m_retainable contained earlier has had its retain
+      // count decremented.  If nobody else has retained it, it deletes
+      // itself.
+      retainable->release().
+      // 'retainable' now has a retain count of 1.
+    }
+
+    // Common mistakes:
+      // The following will almost certainly work for some simple cases,
+      // but tempting as it may be to eschew accessor methods, this will
+      // almost certainly lead to a mistake at some stage (if for
+      // example you forget to release the retainable thing, or try to
+      // reference a null pointer).
+      void reset(){
+        MyRetainableClass *retainable = new MyRetainableClass();
+        if(m_retainable) m_retainable->release();
+        m_retainable = retainable;
+      }
+      // The following results in a memory leak; the retain count of the
+      // new retainable thing is 1 from 'new' and 2 from
+      // setRetainableThing(), and we have not balanced the 'new' with a
+      // release within the scope of the block.
+      void reset(){
+        MyRetainableClass *retainable = new MyRetainableClass();
+        setRetainableThing(retainable);
+      }
+  };
+
+
+Rules 1 & 2 should be sufficient.  But read further discussion if you
+wish.
+
+
+If you follow the retention and accessor rules then:
+
+Rule 3: If a block of code did not allocate or retain an object, then
+that block of code should not release it.
+
+Rule 4: When you obtain an object as a result of a method call it should
+remain valid until the end of your code block, and your code block can
+safely return the object.  If you need the object to live longer than
+this -- for example if you plan to store it in an instance variable --
+then you need to retain() it.
+
+Rule 5: Factory methods are an exception.  A factory method should
+behave like 'new' in that the factory method returns an object with
+retain count of 1, and relinquishes ownership of the object to the
+caller.
+
+
+There is a problem that the preceding rules do *not* handle: the problem
+of "retain cycles".  A retain cycle is a special kind of memory leak
+that can occur with a retain counting scheme when object A retains
+object B, and object B retains object A.  These two objects never reach
+a zero retain count, but when they are no longer used by any part of the
+program, they hit a count of one, so never delete themselves.  It is
+possible to have very complex retain cycles where the minimum retain
+count is higher than one (multiple objects referring to each other), or
+a long chain of objects retaining each other in what looks like a
+circular linked list.
+
+The best solution to the problem is to be careful with your designs;
+decide who owns who, and retain accordingly.  For example, in a
+child-parent relationship in which the child knows about the parent and
+the parent knows about the child, you can have the parent retain() the
+child but not the other way around.  This would seem to break rule 4
+above since the child wants a guarantee that the parent will stick
+around, but with careful design the retain() is not needed to guarantee
+this condition and would, in effect, be redundant.  The one thing that
+should be done for safety is that the parent should instruct the child
+to set its parent pointer to 'null' when the parent releases the child.
+As long as the parent is retaining the child, the childs pointer to the
+parent will be valid.  When the child is released, the pointer will be
+taken away.  No problem.
+
+Unfortunately there isn't a much better solution to this problem than
+starting with a careful design.  Be sure to expend adequate thought
+about how your program's object will interact.
+
+
+On the other hand (as you might have noticed) say you want to give the
+child to another parent.  If you just remove it from its current parent
+then the child will be released and destroyed.  You must first obtain
+the child, retain() it, remove it from its parent, hand it off to its
+new parent, and then release() it.  Which leads to a sixth rule:
+
+Rule 6: Use retain() and release() when you want to prevent an object
+from being destroyed as a side effect of the operations you're
+performing.
+
+
+Note: interactions with Qt's QObject class: any object inheriting from
+both cRetainable and QObject can be deleted by Qt, even if the object is
+retained.  To prevent dangling pointers to deleted QObjects:
+
+Rule 7: Use QGuardedPtr<> to store retainable QObjects.  If you follow
+this rule, your accessor getThingy() will return 0 (as it should) when
+the thingy has been deleted.  The code looks like this:
+
+  class MyClass {
+    // m_thing behaves like a pointer, so *m_thingy, m_thingy->, and
+    // m_thingy= all work fine.
+    QGuardedPtr<cThingy> m_thingy;
+  public:
+    void setThingy(cThingy *thingy){ 
+      if(thingy) thingy->retain();
+      // don't worry, if m_thingy was deleted by Qt, it won't be
+      // released below.
+      if(m_thingy) m_thingy->release();
+      m_thingy = thingy;
+    }
+    // m_thingy is automatically converted to a pointer below, unless it
+    // was deleted by Qt, in which case it's converted to 0.
+    cThingy *getThingy(){ return m_thingy; }
+  }
+*/
+
+
+class cWatchRetains;
+class cRetainable {
+  friend class cWatchRetains;
+private:
+  /* disabled */ cRetainable operator =(const cRetainable &other);
+protected:
+  static tRList<cWatchRetains> s_retain_watchlist;
+  static cString s_noname_str;
+  static cString s_copyof_str;
+protected:
+  cWatchRetains *m_watcher;
+  int m_retain_count;
+  cString m_ret_name;
+protected:
+  cRetainable()
+  : m_retain_count(0)
+  , m_ret_name(s_noname_str)
+  { beWatched(); retain(); }
+  cRetainable(const cRetainable &other)
+  : m_retain_count(0)
+  , m_ret_name(s_copyof_str + other.watchedName())
+  { beWatched(); retain(); }
+  virtual ~cRetainable(){ endWatch(); }
+  void endWatch();
+  void beWatched();
+public:
+  const int refs() const { return m_retain_count; }
+  void retain(){ ++m_retain_count; }
+  void release(){ if(--m_retain_count < 1) delete this; }
+  const cString &watchedName() const { return m_ret_name; }
+  void nameWatched(const cString &name);
+};
+
+
+#define SETretainable(storage,arg) \
+{ \
+  if(arg) (arg)->retain(); \
+  if(storage) (storage)->release(); \
+  (storage) = (arg); \
+}
+
+
+#endif
+
+// arch-tag: proto file for retainable object base class
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,23 @@
+#ifndef RETAINABLE_DBG_HH
+#include "retainable_dbg.hh"
+#endif
+
+#ifndef WATCH_RETAINS_HH
+#include "memory_mgt/watch_retains.hh"
+#endif
+
+cWatchRetains::~cWatchRetains(){
+  cRetainable::s_retain_watchlist.Remove(this);
+  for(std::set<cRetainable *>::const_iterator i(m_watchset.begin());
+      i != m_watchset.end(); i++){
+    cRetainableError
+    << "Warning: possible memory leak of object \""
+    << (*i)->watchedName() << "\"";
+    cRetainableError
+    << " (retain count " << (*i)->refs()
+    << " at finish of leak-watch \"" << watchedName() << "\").";
+    (*i)->m_watcher = 0;
+} }
+void cWatchRetains::nameWatched(const cString &name){ m_ret_name = name; }
+
+// arch-tag: implementatioin file for retainable-object watcher
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,18 @@
+#ifndef WATCH_RETAINS_HH
+#define WATCH_RETAINS_HH
+
+#ifndef _CPP_SET
+#include <set>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef WATCH_RETAINS_PROTO_HH
+#include "watch_retains_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for retainable-object watcher
Index: avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/memory_mgt/watch_retains_proto.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,56 @@
+#ifndef WATCH_RETAINS_PROTO_HH
+#define WATCH_RETAINS_PROTO_HH
+
+/*
+Instantiate cWatchRetains "watcher" objects to check for memory leaks of
+cRetainable ("watched") objects.  Any cRetainable objects created
+between instantiation and deletion of a watcher will be
+watched for memory leaks.
+
+Multiple watchers can be instantiated, but only the most recently
+created watcher will be used to track new cRetainable objects, until
+the watcher is deleted; then the previously created watcher, if one
+exists, will be used to track new cRetainable objects.
+
+The watched objects can be named using nameWatched(); the watcher object
+can be named using nameWatcher().  When a watcher is deleted, it prints
+a list of objects it was watching that haven't been deleted.  The
+printout includes the name of the watched objects, its retain count, and
+the name of the watcher.
+
+Here's a good way to use watcher objects:
+
+void Foo::bar(){
+  cWatchRetains watcher;
+  // Do a bunch of stuff that causes cRetainable to be instantiated and
+  // hopefully, eventually, deleted.
+
+  // As Foo::bar() finishes, "watcher" will go out of scope and be
+  // deleted, listing the undeleted cRetainable objects it was
+  // watching.
+}
+*/
+
+
+class cActivateWatcher;
+class cWatchRetains : public cRetainable {
+  friend class cRetainable;
+  friend class cActivateWatcher;
+private:
+  /* disabled */ cWatchRetains(const cWatchRetains &);
+  /* disabled */ cWatchRetains operator =(const cWatchRetains &);
+protected:
+  std::set<cRetainable *> m_watchset;
+protected:
+  void activate(){ deactivate(); cRetainable::s_retain_watchlist.Push(this); }
+  void deactivate(){ cRetainable::s_retain_watchlist.Remove(this); }
+public:
+  cWatchRetains(){ cRetainable::s_retain_watchlist.Push(this); }
+  ~cWatchRetains();
+  void nameWatched(const cString &name);
+};
+
+
+#endif
+
+// arch-tag: proto file for retainable-object watcher
Index: avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,77 @@
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+#ifndef QPOPUPMENU_H
+#include <qpopupmenu.h>
+#endif
+
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+
+#ifndef AVD_MENUBAR_HANDLER_HH
+#include "avd_menubar_handler.hh"
+#endif
+
+
+void avdMenuBarCtrl::setupMenuBarSlot(QMenuBar *menubar){
+  if(menubar){
+      QPopupMenu *simulation_menu = new QPopupMenu(
+        menubar, "<avdMenuBarCtrl::setupMenuBar(simulation_menu)");
+
+      simulation_menu->insertItem(
+        "Start", this, SIGNAL(doStartAvidaSig()), CTRL+SHIFT+Key_U);
+      simulation_menu->insertItem(
+        "Pause", this, SIGNAL(doPauseAvidaSig()), CTRL+SHIFT+Key_P);
+      simulation_menu->insertItem(
+        "Step", this, SIGNAL(doStepAvidaSig()), CTRL+SHIFT+Key_Comma);
+      simulation_menu->insertItem(
+        "Update", this, SIGNAL(doUpdateAvidaSig()), CTRL+SHIFT+Key_Period);
+
+      simulation_menu->insertSeparator();
+
+      if(avdControllerFactory::Instance().IsRegistered("avdDumbGUI"))
+      { simulation_menu->insertItem(
+          "Dumb Controls", this, SLOT(newDumbGUI()));
+      }
+      if(avdControllerFactory::Instance().IsRegistered("avdExpGUI"))
+      { simulation_menu->insertItem(
+          "Exp Controls", this, SLOT(newExpGUI()));
+      }
+      if(avdControllerFactory::Instance().IsRegistered("avdMapGUI"))
+      { simulation_menu->insertItem(
+          "Map", this, SLOT(newMapGUI()));
+      }
+      if(avdControllerFactory::Instance().IsRegistered("avdAnalyzerGUI"))
+      { simulation_menu->insertItem(
+          "New Analyzer", this, SLOT(newAnalyzerControllerSlot()));
+      }
+      if(avdControllerFactory::Instance().IsRegistered("avd_o_AnalyzerCtrl"))
+      { simulation_menu->insertItem(
+          "Original Analyzer", this, SLOT(new_o_AnalyzerControllerSlot()));
+      }
+      simulation_menu->insertSeparator();
+      if(avdControllerFactory::Instance().IsRegistered("avdUserMsgGUI"))
+      { simulation_menu->insertItem(
+          "Log Window", this, SIGNAL(showUserMsgGUISig()));
+      }
+      if(avdControllerFactory::Instance().IsRegistered("avdPrefsGUI"))
+      { simulation_menu->insertItem(
+          "Settings", this, SIGNAL(showPrefsGUISig()));
+      }
+
+    menubar->insertItem("Simulation", simulation_menu);
+} }
+
+void avdMenuBarCtrl::newDumbGUI(void)
+{ emit newGUIControllerSig("avdDumbGUI"); }
+void avdMenuBarCtrl::newExpGUI(void)
+{ emit newGUIControllerSig("avdExpGUI"); }
+void avdMenuBarCtrl::newMapGUI(void)
+{ emit newGUIControllerSig("avdMapGUI"); }
+void avdMenuBarCtrl::newAnalyzerControllerSlot(void)
+{ emit newGUIControllerSig("avdAnalyzerGUI"); }
+void avdMenuBarCtrl::new_o_AnalyzerControllerSlot(void)
+{ emit newGUIControllerSig("avd_o_AnalyzerCtrl"); }
+
+// arch-tag: implementation file for menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_handler.hh	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,46 @@
+#ifndef AVD_MENUBAR_HANDLER_HH
+#define AVD_MENUBAR_HANDLER_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QMenuBar;
+class avdMCMediator;
+class avdMenuBarCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+public:
+  avdMenuBarCtrl(
+    QObject *parent = 0,
+    const char *name = 0)
+  : QObject(parent, name){}
+  bool setup(){return true;}
+/*
+I wish that popup menu items could emit strings as SIGNAL parameters;
+since they can't, I'm using a parameterless SLOT for each of the gui
+types that can be created via a menu item.  The menu item calls this
+slot, which emits a SIGNAL taking the appropriate string parameter.
+*/
+public slots:
+  void setupMenuBarSlot(QMenuBar *menubar);
+  void newAnalyzerControllerSlot();
+  void new_o_AnalyzerControllerSlot();
+  void newDumbGUI();
+  void newExpGUI();
+  void newMapGUI();
+signals:
+  void newGUIControllerSig(const QString &controller_type);
+  void showUserMsgGUISig();
+  void showPrefsGUISig();
+  void doStartAvidaSig();
+  void doPauseAvidaSig();
+  void doStepAvidaSig();
+  void doUpdateAvidaSig();
+};
+
+#endif
+
+// arch-tag: header file for menubar handler
Index: avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_hdlr_creator.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_hdlr_creator.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/menubar/avd_menubar_hdlr_creator.cc	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,64 @@
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_MEDIATOR_HH
+#include "mc/avd_gui_factory_mediator.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef AVD_WINDOWS_MEDIATOR_HH
+#include "mc/avd_windows_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_HANDLER_HH
+#include "avd_menubar_handler.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+
+template <class avdMenuBarCtrl> class pMenuBarConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdMenuBarCtrl *hdlr){
+    avdConnections cnct(hdlr, med->getAvidaStateMediator());
+    cnct.add(SIGNAL(doStartAvidaSig()), SIGNAL(doStartAvidaSig()));
+    cnct.add(SIGNAL(doPauseAvidaSig()), SIGNAL(doPauseAvidaSig()));
+    cnct.add(SIGNAL(doUpdateAvidaSig()), SIGNAL(doUpdateAvidaSig()));
+    cnct.add(SIGNAL(doStepAvidaSig()), SIGNAL(doStepAvidaSig()));
+
+    avdConnections cnct2(hdlr, med->getWindowsMediator());
+    cnct2.add(SIGNAL(showUserMsgGUISig()), SIGNAL(showUserMsgGUISig()));
+    cnct2.add(SIGNAL(showPrefsGUISig()), SIGNAL(showPrefsGUISig()));
+
+    QObject::connect(
+      hdlr, SIGNAL(newGUIControllerSig(const QString &)),
+      med->getGUIFactoryMediator(),
+      SIGNAL(newGUIControllerSig(const QString &)));
+    QObject::connect(
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)),
+      hdlr, SLOT(setupMenuBarSlot(QMenuBar *)));
+} };
+typedef tGUI<avdMenuBarCtrl, pMenuBarConnections> avdMenuBarHdlr;
+
+/* Registers avdDumbGUI creator with GUIFactory. */
+namespace {
+  avdAbstractCtrl *createMenuBarHdlr(void){
+    avdMenuBarHdlr *m = new avdMenuBarHdlr(0, "<avdMenuBarHdlr>");
+    m->getCtrl()->nameWatched("<avdMenuBarCtrl>");
+    m->nameWatched("<avdMenuBarHdlr>");
+    return m; }
+  QString s_key("avdMenuBarHdlr");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createMenuBarHdlr);
+}
+
+// arch-tag: implementation file for menubar handler factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/menubar/menubar.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/menubar/menubar.pri:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/menubar/menubar.pri	Mon Dec 29 14:55:13 2003
@@ -0,0 +1,11 @@
+
+menubar {
+  HEADERS += \
+    $$MENUBAR_HH/avd_menubar_handler.hh
+
+  SOURCES += \
+    $$MENUBAR_CC/avd_menubar_hdlr_creator.cc \
+    $$MENUBAR_CC/avd_menubar_handler.cc
+}
+
+# arch-tag: qmake include file for menubar handler module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,108 @@
+#ifndef QWIDGETSTACK_H
+#include <qwidgetstack.h>
+#endif
+
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_PREFS_DBG_HH
+#include "avd_prefs_dbg.hh"
+#endif
+#ifndef AVD_PREFS_GUI_FACTORY_HH
+#include "prefs_gui_factory/avd_prefs_gui_factory.hh"
+#endif
+#ifndef AVD_PREFS_ITEM_VIEW_HH
+#include "preferences/avd_prefs_item_view.hh"
+#endif
+#ifndef AVD_PREFS_ITEM_HH
+#include "avd_prefs_item.hh"
+#endif
+#ifndef AVD_PREFS_VIEW_HH
+#include "avd_prefs_view.hh"
+#endif
+
+#ifndef AVD_PREFS_CTRL_HH
+#include "avd_prefs_ctrl.hh"
+#endif
+
+
+void avdPrefsCtrl::setMdtr(avdMCMediator *mdtr){ SETretainable(m_mdtr, mdtr); }
+void avdPrefsCtrl::setView(avdPrefsView *view){ SETretainable(m_view, view); }
+void avdPrefsCtrl::setPrefsItemsList(tRetainableList<avdPrefsItem> *itemlist)
+{ SETretainable(m_prefs_items, itemlist); }
+
+avdPrefsCtrl::avdPrefsCtrl(QObject *parent, const char *name)
+: QObject(parent, name), m_view(0), m_prefs_items(0), m_mdtr(0) {
+  avdPrefsView *view = new avdPrefsView(0, "<avdPrefsCtrl(m_view)>");
+  setView(view);
+  if(!getView()){ Error << "can't create avdPrefsView."; return; }
+  view->release();
+  getView()->nameWatched("<avdPrefsCtrl::m_view>");
+
+  tRetainableList<avdPrefsItem> *prefs_items = new tRetainableList<avdPrefsItem>;
+  setPrefsItemsList(prefs_items);
+  if(!getPrefsItemsList()){ Error << "can't create tRetainableList."; return; }
+  prefs_items->release();
+  getPrefsItemsList()->nameWatched("<avdPrefsCtrl::m_prefs_items>");
+}
+avdPrefsCtrl::~avdPrefsCtrl(){
+  setMdtr(0);
+  /*
+  The order of next two set(0)'s (i.e., deletions) is important.
+  Deleting the PrefsItemsList results in deletion of its PrefsItems.
+  This causes the QListBox in the View to forget about the PrefsItems,
+  so it won't later try to double-free them.
+  
+  If the View is deleted first, its QListBox will delete the PrefsItems,
+  but PrefsItemsList won't know that the PrefsItems have already been
+  deleted, and consequently will double-free them.
+  */
+  setPrefsItemsList(0);
+  setView(0);
+}
+
+bool avdPrefsCtrl::setup(){
+  emit(doResetMenuBar(getView()->menuBar()));
+  if(avdPrefsControllerFactory::Instance().IsRegistered("avdUserMsgPrefsGUI")){
+    // Create a pref-pane gui
+    avdAbstractPrefsCtrl *c =
+      avdPrefsControllerFactory::Instance().CreateObject("avdUserMsgPrefsGUI");
+    if(!c) { Error << "couldn't create avdUserMsgPrefsGUI."; }
+    else {
+      c->setup(getMdtr());
+      // Create a pref-pane item
+      avdPrefsItem *pi = new avdPrefsItem(getView()->listBox(), "Info Console");
+      if(!pi){ Error << "couldn't create avdPrefsItem."; }
+      else {
+        //m_prefs_items.Push(pi);
+        getPrefsItemsList()->Push(pi);
+        pi->setPrefsGUI(c);
+        pi->release();
+      }
+      c->release();
+  } }
+
+  //tRetainableListIter<avdPrefsItem> it(m_prefs_items);
+  tRetainableListIter<avdPrefsItem> it(*getPrefsItemsList());
+  it.Reset();
+  while(it.Next())
+  { getView()->widgetStack()->addWidget(it.Get()->getPrefsGUI()->getView()); }
+  // XXX
+  //if(m_prefs_items.GetSize() > 0)
+  if(getPrefsItemsList()->GetSize() > 0)
+  //{ getView()->widgetStack()->raiseWidget(m_prefs_items.GetFirst()->getPrefsGUI()->getView()); }
+  { getView()->widgetStack()->raiseWidget(getPrefsItemsList()->GetFirst()->getPrefsGUI()->getView()); }
+  return true;
+}
+
+void avdPrefsCtrl::showPrefsGUISlot(){
+  Debug << "<showPrefsGUISlot>";
+  if(getView()){
+    Debug << "<showPrefsGUISlot> showing, raising...";
+    getView()->show();
+    getView()->raise();
+  }
+  Debug << "<showPrefsGUISlot> done.";
+}
+
+// arch-tag: implementation file for preferencess gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_ctrl.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,60 @@
+#ifndef AVD_PREFS_CTRL_HH
+#define AVD_PREFS_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef TRETAINABLE_LIST_HH
+#include "containers/tRetainable_list.hh"
+#endif
+
+
+class QMenuBar;
+
+class avdMCMediator;
+class avdPrefsView;
+class avdPrefsItem;
+class avdPrefsItemView;
+
+class myInterface;
+class cTestInterface;
+
+class avdPrefsCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdPrefsView> m_view;
+  tRetainableList<avdPrefsItem> *m_prefs_items;
+  QGuardedPtr<avdMCMediator> m_mdtr;
+public:
+  void setView(avdPrefsView *view);
+  void setPrefsItemsList(tRetainableList<avdPrefsItem> *itemlist);
+  void setMdtr(avdMCMediator *mdtr);
+
+  avdPrefsView *getView(){ return m_view; }
+  tRetainableList<avdPrefsItem> *getPrefsItemsList(){ return m_prefs_items; }
+  avdMCMediator *getMdtr(){ return m_mdtr; }
+public:
+  avdPrefsCtrl(QObject *parent=0, const char *name=0);
+  ~avdPrefsCtrl();
+  bool setup();
+signals:
+  void doResetMenuBar(QMenuBar *);
+
+  void settingsChangedSig();
+
+  void doSendMyInterface(myInterface *);
+  void doSendTestInterface(cTestInterface *);
+public slots:
+  void showPrefsGUISlot();
+};
+
+#endif
+
+// arch-tag: header file for preferences gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,32 @@
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+
+#ifndef AVD_PREFS_DBG_HH
+#include "avd_prefs_dbg.hh"
+#endif
+
+avdMessageType  Info_PREFS_avdMsg("Prefs", avdMCInfo);
+avdMessageType Debug_PREFS_avdMsg("Prefs", avdMCDebug);
+avdMessageType Error_PREFS_avdMsg("Prefs", avdMCError);
+avdMessageType Fatal_PREFS_avdMsg("Prefs", avdMCFatal);
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if(m_msg_types = new avdMessageTypeSet){
+        m_msg_types->Register("Info",   &Info_PREFS_avdMsg);  
+        m_msg_types->Register("Debug", &Debug_PREFS_avdMsg);  
+        m_msg_types->Register("Error", &Error_PREFS_avdMsg);  
+        m_msg_types->Register("Fatal", &Fatal_PREFS_avdMsg);  
+        avdMessageSetTracker::Instance().Register("Prefs", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("Prefs");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
+
+// arch-tag: implementation file for preferences gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_PREFS_DBG_HH
+#define AVD_PREFS_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif 
+
+#ifndef AVD_PREFS_DBG_PROTO_HH
+#include "avd_prefs_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for preferences gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_dbg_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_PREFS_DBG_PROTO_HH
+#define AVD_PREFS_DBG_PROTO_HH
+
+extern avdMessageType  Info_PREFS_avdMsg; 
+extern avdMessageType Debug_PREFS_avdMsg;
+extern avdMessageType Error_PREFS_avdMsg;
+extern avdMessageType Fatal_PREFS_avdMsg;
+#define  Info  AVD_INFO_MSG(PREFS)
+#define Debug AVD_DEBUG_MSG(PREFS)
+#define Error AVD_ERROR_MSG(PREFS)
+#define Fatal AVD_FATAL_MSG(PREFS)
+
+#endif
+
+// arch-tag: proto file for preferences gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:20 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_gui.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,72 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef AVD_PREFS_DBG_HH
+#include "avd_prefs_dbg.hh"
+#endif
+#ifndef AVD_PREFS_CTRL_HH
+#include "avd_prefs_ctrl.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef AVD_WINDOWS_MEDIATOR_HH
+#include "mc/avd_windows_mediator.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+
+
+template <class avdPrefsCtrl> class pPrefsConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdPrefsCtrl *ctrl){
+    Debug << "<pPrefsConnections> entered.";
+    ctrl->setMdtr(med);
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+    QObject::connect(
+      ctrl, SIGNAL(settingsChangedSig()),
+      med->getSettingsMediator(), SIGNAL(settingsChangedSig()));
+    QObject::connect(
+      med->getWindowsMediator(), SIGNAL(showPrefsGUISig()),
+      ctrl, SLOT(showPrefsGUISlot()));
+    Debug << "<pPrefsConnections> done.";
+} };
+
+typedef tGUI<avdPrefsCtrl, pPrefsConnections> avdPrefsGUI;
+
+namespace {
+  avdAbstractCtrl *createPrefsGUI(){
+    avdPrefsGUI *g = new avdPrefsGUI(0, "<avdPrefsGUI>");
+    if(!g)
+    { Error << "can't create avdPrefsGUI.";
+      return 0; }
+    g->nameWatched("<avdPrefsGUI>");
+    if(!g->getCtrl())
+    { Error << "can't create avdPrefsCtrl.";
+      g->release();
+      return 0; }
+    g->getCtrl()->nameWatched("<avdPrefsCtrl>");
+    return g;
+  }
+  QString s_key("avdPrefsGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createPrefsGUI);
+}
+
+// arch-tag: implementation file for preferences gui factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,16 @@
+#ifndef AVD_ABSTRACT_PREFS_GUI_HH
+#include "prefs_gui_factory/avd_abstract_prefs_gui.hh"
+#endif
+#ifndef AVD_PREFS_ITEM_VIEW_HH
+#include "preferences/avd_prefs_item_view.hh"
+#endif
+
+#ifndef AVD_PREFS_ITEM_HH
+#include "avd_prefs_item.hh"
+#endif
+
+
+void avdPrefsItem::setPrefsGUI(avdAbstractPrefsCtrl *prefs_gui)
+{ SETretainable(m_prefs_gui, prefs_gui); }
+
+// arch-tag: implementation file for preferences item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_PREFS_ITEM_HH
+#define AVD_PREFS_ITEM_HH
+
+#ifndef QLISTBOX_H
+#include <qlistbox.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_PREFS_ITEM_PROTO_HH
+#include "avd_prefs_item_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for preferences item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,30 @@
+#ifndef AVD_PREFS_ITEM_PROTO_HH
+#define AVD_PREFS_ITEM_PROTO_HH
+
+class avdAbstractPrefsCtrl;
+class avdPrefsItemView;
+class avdPrefsItem
+: public QListBoxText
+, public cRetainable
+{
+protected:
+  avdAbstractPrefsCtrl *m_prefs_gui;
+public:
+  void setPrefsGUI(avdAbstractPrefsCtrl *prefs_gui);
+  avdAbstractPrefsCtrl *getPrefsGUI(){ return m_prefs_gui; }
+public:
+  avdPrefsItem(
+    QListBox *listbox,
+    const QString &text = QString::null
+  ):QListBoxText(listbox, text), m_prefs_gui(0){}
+  avdPrefsItem(
+    QListBox *listbox,
+    const QString &text,
+    QListBoxItem *after
+  ):QListBoxText(listbox, text), m_prefs_gui(0){}
+  ~avdPrefsItem(){ setPrefsGUI(0); }
+};
+
+#endif
+
+// arch-tag: proto file for preferences item object
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_PREFS_ITEM_VIEW_HH
+#define AVD_PREFS_ITEM_VIEW_HH
+
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_PREFS_ITEM_VIEW_PROTO_HH
+#include "avd_prefs_item_view_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for preferences item gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_item_view_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_PREFS_ITEM_VIEW_PROTO_HH
+#define AVD_PREFS_ITEM_VIEW_PROTO_HH
+
+class avdPrefsItemView : public QWidget, public cRetainable {
+public:
+  explicit avdPrefsItemView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = 0
+  ):QWidget(parent, name, f){}
+};
+
+#endif
+
+// arch-tag: proto file for preferences item gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,54 @@
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QLISTBOX_H
+#include <qlistbox.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGETSTACK_H
+#include <qwidgetstack.h>
+#endif
+
+#ifndef AVD_PREFS_DBG_HH
+#include "avd_prefs_dbg.hh"
+#endif
+
+#ifndef AVD_PREFS_VIEW_HH
+#include "avd_prefs_view.hh"
+#endif
+
+
+avdPrefsView::avdPrefsView(QWidget *parent, const char *name, WFlags f)
+: QMainWindow(parent, name, f)
+{
+  QWidget *central = new QWidget(this, "<avdPrefsView(central)>");
+  setCentralWidget(central);
+    QVBoxLayout *central_layout = new QVBoxLayout
+    ( central, 10, -1, "<avdPrefsView(central_layout)>");
+      QHBoxLayout *top_sublayout = new QHBoxLayout
+      ( central_layout, -1, "<avdPrefsView(top_sublayout)>");
+      QHBoxLayout *settings_sublayout = new QHBoxLayout
+      ( central_layout, -1, "<avdPrefsView(settings_sublayout)>");
+        m_listbox = new QListBox(central, "<avdPrefsView(m_listbox)>");
+      settings_sublayout->addWidget(m_listbox);
+        m_widgetstack = new QWidgetStack
+        ( central, "<avdPrefsView(m_widgetstack)>");       
+      settings_sublayout->addWidget(m_widgetstack);
+      //QHBoxLayout *buttons_sublayout = new QHBoxLayout
+      //( central_layout, -1, "<avdPrefsView(buttons_sublayout)>");
+      //  m_cancel_pb = new QPushButton
+      //  ( "Cancel", central, "<avdPrefsView(m_cancel_pb)>");
+      //buttons_sublayout->addWidget(m_cancel_pb);
+      //  QSpacerItem *button_spacer = new QSpacerItem(10, 10);
+      //buttons_sublayout->addItem(button_spacer);
+      //  m_apply_pb = new QPushButton
+      //  ( "Apply", central, "<avdPrefsView(m_apply_pb)>");
+      //buttons_sublayout->addWidget(m_apply_pb);
+      //  QPushButton *m_okay_pb = new QPushButton
+      //  ( "Okay", central, "<avdPrefsView(m_okay_pb)>");
+      //buttons_sublayout->addWidget(m_okay_pb);
+}
+
+// arch-tag: implementation file for preferences gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/avd_prefs_view.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,37 @@
+#ifndef AVD_PREFS_VIEW_HH
+#define AVD_PREFS_VIEW_HH
+
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QListBox;
+class QPushButton;
+class QWidgetStack;
+class avdPrefsView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QListBox *m_listbox;
+  //QPushButton *m_cancel_pb;
+  //QPushButton *m_apply_pb;
+  //QPushButton *m_okay_pb;
+  QWidgetStack *m_widgetstack;
+public:
+  avdPrefsView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel
+  );
+  QListBox *listBox() { return m_listbox; }
+  //QPushButton *cancelBtn() { return m_cancel_pb; }
+  //QPushButton *applyBtn() { return m_apply_pb; }
+  //QPushButton *okayBtn() { return m_okay_pb; }
+  QWidgetStack *widgetStack() { return m_widgetstack; }
+};
+
+#endif
+
+// arch-tag: header file for preferences gui view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/preferences/preferences.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/preferences/preferences.pri:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/preferences/preferences.pri	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,21 @@
+
+preferences {
+  HEADERS += \
+    $$PREFERENCES_HH/avd_prefs_dbg_proto.hh \
+    $$PREFERENCES_HH/avd_prefs_dbg.hh \
+    $$PREFERENCES_HH/avd_prefs_ctrl.hh \
+    $$PREFERENCES_HH/avd_prefs_view.hh \
+    $$PREFERENCES_HH/avd_prefs_item_proto.hh \
+    $$PREFERENCES_HH/avd_prefs_item_view_proto.hh \
+    $$PREFERENCES_HH/avd_prefs_item_view.hh \
+    $$PREFERENCES_HH/avd_prefs_item.hh
+
+  SOURCES += \
+    $$PREFERENCES_CC/avd_prefs_ctrl.cc \
+    $$PREFERENCES_CC/avd_prefs_dbg.cc \
+    $$PREFERENCES_CC/avd_prefs_gui.cc \
+    $$PREFERENCES_CC/avd_prefs_view.cc \
+    $$PREFERENCES_CC/avd_prefs_item.cc
+}
+
+# arch-tag: qmake include file for preferences module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_ABSTRACT_PREFS_GUI_HH
+#define AVD_ABSTRACT_PREFS_GUI_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVD_ABSTRACT_PREFS_GUI_PROTO_HH
+#include "avd_abstract_prefs_gui_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for generic preferences gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_abstract_prefs_gui_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_ABSTRACT_PREFS_GUI_PROTO_HH
+#define AVD_ABSTRACT_PREFS_GUI_PROTO_HH
+
+class avdMCMediator;
+class avdPrefsItemView;
+class QWidget;
+class avdAbstractPrefsCtrl : public cRetainable {
+public:
+  virtual void setup(avdMCMediator *mediator) = 0;
+  virtual QWidget *getView() = 0;
+};
+
+#endif
+
+// arch-tag: proto file for generic preferences gui controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,39 @@
+#include <iostream>
+#ifndef AVD_PREFS_GUI_FACTORY_HH
+#include "prefs_gui_factory/avd_prefs_gui_factory.hh"
+#endif
+
+
+struct _avdPrefsControllerFactoryPrv { QValueList<QString> m_keys; };
+
+_avdPrefsControllerFactory::_avdPrefsControllerFactory():m_d(0){ m_d = new _avdPrefsControllerFactoryPrv; }
+_avdPrefsControllerFactory::~_avdPrefsControllerFactory(){ delete m_d; }
+bool _avdPrefsControllerFactory::Register(
+  const QString &id, Loki::Functor<avdAbstractPrefsCtrl *> creator)
+{
+  bool retval = __avdPrefsControllerFactory::Register(id, creator);
+  if(retval){
+    std::cout
+    << "<__avdPrefsControllerFactory::Register> succeeded registering \""
+    << id << "\"." << std::endl;
+    m_d->m_keys.push_back(id);
+  } else {
+    std::cout
+    << "<__avdPrefsControllerFactory::Register> failed registering \""
+    << id << "\"." << std::endl;
+  }
+  return retval;
+}
+bool _avdPrefsControllerFactory::Unregister(const QString &id){
+  bool retval = __avdPrefsControllerFactory::Unregister(id);
+  if(retval){
+    QValueList<QString>::iterator it(m_d->m_keys.find(id));
+    if(it != (m_d->m_keys.end())) m_d->m_keys.erase(it);
+  }
+  return retval;
+}
+bool _avdPrefsControllerFactory::IsRegistered(const QString &id)
+{ return ((m_d->m_keys.contains(id))); }
+
+
+// arch-tag: implementation file for generic preferences gui controller factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,37 @@
+#ifndef AVD_PREFS_GUI_FACTORY_HH
+#define AVD_PREFS_GUI_FACTORY_HH
+
+
+#ifndef QSTRING_H
+#include <qstring.h>
+#endif
+
+/* XXX disables the small-object allocator; it crashes under OSX10.2.6. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+/* XXX -- kaben */
+#ifndef FUNCTOR_INC_
+#include "third-party/Loki/Functor.h"
+#endif
+#ifndef FACTORY_INC_
+#include "third-party/Loki/Factory.h"
+#endif
+#ifndef SINGLETON_INC_
+#include "third-party/Loki/Singleton.h"
+#endif
+
+#ifndef AVD_ABSTRACT_PREFS_GUI_HH
+#include "prefs_gui_factory/avd_abstract_prefs_gui.hh"
+#endif
+#ifndef AVD_PREFS_GUI_FACTORY_ERROR_POLICY_HH
+#include "avd_prefs_gui_factory_error_policy.hh"
+#endif
+
+#ifndef AVD_PREFS_GUI_FACTORY_PROTO_HH
+#include "avd_prefs_gui_factory_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for generic preferences gui controller factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_error_policy.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_error_policy.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_error_policy.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_PREFS_GUI_FACTORY_ERROR_POLICY_HH
+#define AVD_PREFS_GUI_FACTORY_ERROR_POLICY_HH
+
+
+template <typename IdentifierType, class AbstractProduct>
+struct avdPrefsControllerFactoryErrorPolicy {
+  static AbstractProduct* OnUnknownType(IdentifierType) {
+    Error << "trying to instantiate unknown class type.";
+    return 0;
+} };
+
+template <class AbstractProduct>
+struct avdPrefsControllerFactoryErrorPolicy<QString, AbstractProduct> {
+  static AbstractProduct* OnUnknownType(const QString &id) {
+    Error
+    << "\n"
+    << "\n\tFor some reason, class \"" << id << "\""
+    << "\n\tis not registered with the GUI creation code."
+    << "\n\tPerhaps it was not compiled into this version of Avida?"
+    << "\n";
+    return 0;
+} };
+
+#endif
+
+// arch-tag: header file for generic preferences gui controller factory error policies
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/avd_prefs_gui_factory_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,27 @@
+#ifndef AVD_PREFS_GUI_FACTORY_PROTO_HH
+#define AVD_PREFS_GUI_FACTORY_PROTO_HH
+
+typedef
+Loki::Factory<
+  avdAbstractPrefsCtrl,
+  QString,
+  Loki::Functor<avdAbstractPrefsCtrl *>,
+  avdPrefsControllerFactoryErrorPolicy
+> __avdPrefsControllerFactory;
+
+class _avdPrefsControllerFactoryPrv;
+class _avdPrefsControllerFactory : public __avdPrefsControllerFactory {
+  _avdPrefsControllerFactoryPrv *m_d;
+public:
+  _avdPrefsControllerFactory();
+  ~_avdPrefsControllerFactory();
+  bool Register(const QString &id, Loki::Functor<avdAbstractPrefsCtrl *> creator);
+  bool Unregister(const QString &id);
+  bool IsRegistered(const QString &id);
+};
+
+typedef Loki::SingletonHolder<_avdPrefsControllerFactory> avdPrefsControllerFactory;
+
+#endif
+
+// arch-tag: proto file for generic preferences gui controller factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/prefs_gui_factory.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/prefs_gui_factory.pri:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/prefs_gui_factory.pri	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+prefs_gui_factory {
+  HEADERS += \
+    $$PREFS_GUI_FACTORY_HH/avd_abstract_prefs_gui_proto.hh \
+    $$PREFS_GUI_FACTORY_HH/avd_abstract_prefs_gui.hh \
+    $$PREFS_GUI_FACTORY_HH/avd_prefs_gui_factory_error_policy.hh \
+    $$PREFS_GUI_FACTORY_HH/avd_prefs_gui_factory_proto.hh \
+    $$PREFS_GUI_FACTORY_HH/avd_prefs_gui_factory.hh \
+    $$PREFS_GUI_FACTORY_HH/tPrefsGUI_proto.hh \
+    $$PREFS_GUI_FACTORY_HH/tPrefsGUI.hh
+
+  SOURCES += \
+    $$PREFS_GUI_FACTORY_CC/avd_prefs_gui_factory.cc
+}
+
+# arch-tag: qmake include file for abstract preferences gui factory module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,21 @@
+#ifndef TPREFSGUI_HH
+#define TPREFSGUI_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+
+#ifndef AVD_ABSTRACT_PREFS_GUI_HH
+#include "prefs_gui_factory/avd_abstract_prefs_gui.hh"
+#endif
+
+#ifndef TPREFSGUI_PROTO_HH
+#include "tPrefsGUI_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for generic preferences gui template
Index: avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/prefs_gui_factory/tPrefsGUI_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,46 @@
+#ifndef TPREFSGUI_PROTO_HH
+#define TPREFSGUI_PROTO_HH
+
+
+class avdMCMediator;
+class QWidget;
+
+template <class Ctrl> class pNullConnectionPolicy2 {
+protected:
+  void setupConnections(avdMCMediator *, Ctrl *){}
+};
+
+template <
+  class Ctrl,
+  template <class> class ConnectionPolicy = pNullConnectionPolicy2
+> class tPrefsGUI
+: public QObject
+, public avdAbstractPrefsCtrl
+, public ConnectionPolicy<Ctrl>
+{
+protected:
+  QGuardedPtr<Ctrl> m_ctrl;
+protected:
+  Ctrl *setCtrl(Ctrl *ctrl)
+  { SETretainable(m_ctrl, ctrl);
+    return getCtrl();
+  }
+public:
+  Ctrl *getCtrl() { return m_ctrl; }
+public:
+  ~tPrefsGUI(){ setCtrl(0); }
+  tPrefsGUI(QObject *parent = 0, const char *name = 0)
+  : QObject(parent, name)
+  { setCtrl(new Ctrl(0, "<tPrefsGUI(m_ctrl)>"))->release();
+    connect(getCtrl(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+  }
+  void setup(avdMCMediator *mediator)
+  { setupConnections(mediator, getCtrl());
+    if(getCtrl()) getCtrl()->setup();
+  }
+  QWidget *getView(){ return (getCtrl())?(getCtrl()->getView()):(0); }
+};
+
+#endif
+
+// arch-tag: proto file for generic preferences gui template
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,277 @@
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QDATETIME_H
+#include <qdatetime.h>
+#endif
+#ifndef QEVENT_H
+#include <qevent.h>
+#endif
+#ifndef QSTRINGLIST_H
+#include <qstringlist.h>
+#endif
+#ifndef QTIMER_H
+#include <qtimer.h>
+#endif
+
+#ifndef GENEBANK_HH
+#include "main/genebank.hh"
+#endif
+#ifndef GENOTYPE_HH
+#include "main/genotype.hh"
+#endif
+#ifndef POPULATION_CELL_HH
+#include "main/population_cell.hh"
+#endif
+#ifndef HARDWARE_FACTORY_HH
+#include "cpu/hardware_factory.hh"
+#endif
+#ifndef ORGANISM_HH
+#include "main/organism.hh"
+#endif
+#ifndef HARDWARE_BASE_HH
+#include "cpu/hardware_base.hh"
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+#ifndef CONFIG_HH
+#include "main/config.hh"
+#endif
+#ifndef POPULATION_HH
+#include "main/population.hh"
+#endif
+
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_HH
+#include "avd_avida_thread_drvr_dbg.hh"
+#endif
+#ifndef AVD_GUI_MSG_EVENT_HH
+#include "avd_gui_msg_event.hh"
+#endif
+
+#ifndef AVD_AVIDA_DRIVER_HH
+#include "avd_avida_driver.hh"
+#endif
+
+using namespace std;
+
+
+avdAvidaThreadDrvr::avdAvidaThreadDrvr(cEnvironment &environment)
+: cAvidaDriver_Population(environment)
+{
+  m_mode_function = &avdAvidaThreadDrvr::fastMode;
+  m_fast_stage_function = &avdAvidaThreadDrvr::preUpdate;
+  m_step_stage_function = &avdAvidaThreadDrvr::preUpdate;
+  m_emit_function = &avdAvidaThreadDrvr::emitUpdatedSig;
+  m_run_continuously = false;
+  m_step_mode = false;
+  m_step_cell_id = 0;
+  m_breakpoint_cell_id = 0;
+  m_mutex = new QMutex(false);
+}
+
+avdAvidaThreadDrvr::~avdAvidaThreadDrvr(void){
+  doCloseAvidaSlot();
+  delete m_mutex;
+}
+
+void avdAvidaThreadDrvr::Run(void){
+  /*
+  Qt/X11 doesn't check for non-X11 events except in passing when an X11
+  event occurs.  The 50-millisecond timer below doesn't connect to
+  anything, but timer events are really X11 events, and they make Qt
+  check for notification events from the Avida processing thread to the
+  gui thread.
+  
+  OSX doesn't require this; probably neither does Windows.  We'll see.
+  */
+  startTimer(50);
+  start(); /* Starts the processing thread. */
+}
+
+void avdAvidaThreadDrvr::doStartAvidaSlot(){ wakeProcessingThread(true, false); }
+void avdAvidaThreadDrvr::doUpdateAvidaSlot(){ wakeProcessingThread(false, false); }
+void avdAvidaThreadDrvr::doStepAvidaSlot(int cell_id){
+  m_mutex->lock();
+  m_step_cell_id = cell_id;
+  m_mutex->unlock();
+  wakeProcessingThread(false, true);
+}
+void avdAvidaThreadDrvr::doPauseAvidaSlot(){
+  m_mutex->lock();
+  m_run_continuously = false;
+  m_mutex->unlock();
+}
+void avdAvidaThreadDrvr::doCloseAvidaSlot(){
+  m_mutex->lock();
+  m_mode_function = &avdAvidaThreadDrvr::closingMode;
+  m_mutex->unlock();
+  m_wait_condition.wakeAll();
+  wait();
+}
+void avdAvidaThreadDrvr::wakeProcessingThread(bool continuous, bool step){
+  m_mutex->lock();
+  m_run_continuously = continuous;
+  m_step_mode = step;
+  m_mutex->unlock();
+  m_wait_condition.wakeAll();
+}
+
+/* Main loop of the Avida processing thread. */
+void avdAvidaThreadDrvr::run(void){
+  m_mutex->lock();
+  for(;;){
+    m_wait_condition.wait(m_mutex);
+    while((this->*(m_mode_function))())
+    { m_mutex->unlock(); m_mutex->lock(); }
+    QApplication::postEvent(this, new avdGuiMsgEvent);
+} }
+
+bool avdAvidaThreadDrvr::fastMode(){ return (this->*(m_fast_stage_function))(); }
+bool avdAvidaThreadDrvr::stepMode(){ return (this->*(m_step_stage_function))(); }
+bool avdAvidaThreadDrvr::closingMode(){
+  m_emit_function = &avdAvidaThreadDrvr::emitClosedSig;
+  m_mutex->unlock();
+  QApplication::postEvent(this, new avdGuiMsgEvent);
+  exit(); /* Terminates the processing thread. */
+  return false; /* never reached. */
+}
+
+bool avdAvidaThreadDrvr::preUpdate() {
+  GetEvents();
+  if (done_flag == true){
+    m_emit_function = &avdAvidaThreadDrvr::emitClosedSig;
+    return false; }
+  // Increment the Update.
+  cStats & stats = population->GetStats();
+  stats.IncCurrentUpdate();
+  // Handle all data collection for previous update.
+  if (stats.GetUpdate() > 0) {
+    // Tell the stats object to do update calculations and printing.
+    stats.ProcessUpdate();
+    // Update all the genotypes for the end of this update.
+    cGenebank & genebank = population->GetGenebank();
+    for(cGenotype * cur_genotype = genebank.ResetThread(0);
+	      cur_genotype != NULL && cur_genotype->GetThreshold();
+	      cur_genotype = genebank.NextGenotype(0)){
+      cur_genotype->UpdateReset();
+  } }
+  m_UD_size = cConfig::GetAveTimeslice() * population->GetNumOrganisms();
+  m_step_size = 1. / (double) m_UD_size;
+  m_UD_progress = 0;
+  m_fast_stage_function = &avdAvidaThreadDrvr::fastUpdate;
+  m_step_stage_function = &avdAvidaThreadDrvr::stepUpdate;
+  return true;
+}
+bool avdAvidaThreadDrvr::fastUpdate() {
+  const int bite_size = cConfig::GetAveTimeslice();
+  for(int i = 0; i < bite_size; i++){
+    if(m_UD_progress < m_UD_size){
+      m_UD_progress++;
+      m_current_cell_id = population->ScheduleOrganism();
+      population->ProcessStep(m_step_size, m_current_cell_id); }
+    else {
+      m_fast_stage_function = &avdAvidaThreadDrvr::postUpdate;
+      m_step_stage_function = &avdAvidaThreadDrvr::postUpdate;
+      return true;
+  } }
+  return true;
+}
+bool avdAvidaThreadDrvr::stepUpdate() {
+  const int bite_size = cConfig::GetAveTimeslice();
+  for(int i = 0; i < bite_size; i++){
+    if(m_UD_progress < m_UD_size){
+      m_UD_progress++;
+      m_current_cell_id = population->ScheduleOrganism();
+      population->ProcessStep(m_step_size, m_current_cell_id);
+      if (m_current_cell_id == m_step_cell_id){
+        //cout << "Stepping through instructions in cell "
+        //  << m_current_cell_id << "." << endl;
+        Message << "Stepping through instructions in cell "
+                << m_current_cell_id << ".";
+        m_emit_function = &avdAvidaThreadDrvr::emitUpdatedSig;
+        return false;
+    } }
+    else {
+      m_fast_stage_function = &avdAvidaThreadDrvr::postUpdate;
+      m_step_stage_function = &avdAvidaThreadDrvr::postUpdate;
+      return true;
+  } }
+  return true;
+}
+bool avdAvidaThreadDrvr::postUpdate() {
+  // end of update stats...
+  population->CalcUpdateStats();
+  // No viewer; print out status for this update....
+  cStats & stats = population->GetStats();
+  //cout << "UD: "  << stats.GetUpdate() << "\t"
+  //     << "Gen: " << stats.SumGeneration().Average() << "\t"
+  //     << "Fit: " << stats.GetAveFitness() << "\t"
+  //     << "Size: " << population->GetNumOrganisms()
+  //     << endl;
+  Message << "UD: "  << stats.GetUpdate() << "\t"
+          << "Gen: " << stats.SumGeneration().Average() << "\t"
+          << "Fit: " << stats.GetAveFitness() << "\t"
+          << "Size: " << population->GetNumOrganisms();
+  // Check whether to do point mutations
+  if (cConfig::GetPointMutProb() > 0 ) {
+    m_mutations_progress = 0;
+    m_fast_stage_function = &avdAvidaThreadDrvr::ptMutations;
+    m_step_stage_function = &avdAvidaThreadDrvr::ptMutations; }
+  else {
+    m_fast_stage_function = &avdAvidaThreadDrvr::postPtMutations;
+    m_step_stage_function = &avdAvidaThreadDrvr::postPtMutations; }
+  return true;
+}
+bool avdAvidaThreadDrvr::ptMutations() {
+  if (m_mutations_progress < population->GetSize()) {
+    if (population->GetCell(m_mutations_progress).IsOccupied()) {
+	    population->GetCell(m_mutations_progress).GetOrganism()->
+	      GetHardware().PointMutate(cConfig::GetPointMutProb()); }
+    m_mutations_progress++; }
+  else {
+    m_fast_stage_function = &avdAvidaThreadDrvr::postPtMutations;
+    m_step_stage_function = &avdAvidaThreadDrvr::postPtMutations; }
+  return true;
+}
+bool avdAvidaThreadDrvr::postPtMutations() {
+#ifdef DEBUG_CHECK_OK
+  // If we're in a debug mode, make sure the population is OK.
+  if (population->OK() == false)
+  { g_debug.Warning("Population::OK() is failing."); }
+#endif
+  // Do any cleanup in the hardware factory...
+  cHardwareFactory::Update();
+  // Exit conditons...
+  if (population->GetNumOrganisms() == 0){
+    done_flag = true;
+    m_emit_function = &avdAvidaThreadDrvr::emitClosedSig;
+  } else m_emit_function = &avdAvidaThreadDrvr::emitUpdatedSig;
+  m_fast_stage_function = &avdAvidaThreadDrvr::preUpdate;
+  m_step_stage_function = &avdAvidaThreadDrvr::preUpdate;
+  return false;
+}
+
+void avdAvidaThreadDrvr::SignalBreakpoint(void){
+  m_breakpoint_cell_id = m_current_cell_id;
+  m_emit_function = &avdAvidaThreadDrvr::emitBreakpointSig;
+  QApplication::postEvent(this, new avdGuiMsgEvent);
+  m_wait_condition.wait(m_mutex);
+}
+
+void avdAvidaThreadDrvr::emitUpdatedSig(){
+  emit(avidaUpdatedSig(this));
+  if(m_run_continuously){ emit(doStartAvidaSig()); }
+}
+void avdAvidaThreadDrvr::emitSteppedSig()
+{ emit(avidaSteppedSig(this, m_step_cell_id)); }
+void avdAvidaThreadDrvr::emitBreakpointSig()
+{ emit(avidaBreakSig(this, m_breakpoint_cell_id)); }
+void avdAvidaThreadDrvr::emitClosedSig()
+{ emit(avidaClosedSig(this)); }
+void avdAvidaThreadDrvr::customEvent(QCustomEvent *custom_event){
+  if (custom_event->type() == static_cast<int>(avdGuiMsgEvent::EventType)){
+    (this->*(m_emit_function))();
+} }
+
+// arch-tag: implementation file for avida processing thread
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_driver.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,139 @@
+#ifndef AVD_AVIDA_DRIVER_HH
+#define AVD_AVIDA_DRIVER_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif  
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif  
+#ifndef QTHREAD_H
+#include <qthread.h>
+#endif  
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+#ifndef AVIDA_HH
+#include "main/avida.hh"
+#endif
+
+
+class QCustomEvent;
+class QWaitCondition;
+class avdAvidaThreadDrvr :
+  public QObject
+, public QThread
+, public cAvidaDriver_Population
+, public cRetainable
+{ Q_OBJECT
+protected:
+  QMutex *m_mutex;
+  QWaitCondition m_wait_condition;
+  bool (avdAvidaThreadDrvr::*m_mode_function)();
+  bool (avdAvidaThreadDrvr::*m_fast_stage_function)();
+  bool (avdAvidaThreadDrvr::*m_step_stage_function)();
+  void (avdAvidaThreadDrvr::*m_emit_function)();
+  bool m_run_continuously;
+  bool m_step_mode;
+  int m_step_cell_id;
+  int m_breakpoint_cell_id;
+  int m_current_cell_id;
+  int m_UD_size;
+  double m_step_size;
+  int m_UD_progress;
+  int m_mutations_progress;
+public:
+  avdAvidaThreadDrvr();
+  avdAvidaThreadDrvr(cEnvironment &environment);
+  ~avdAvidaThreadDrvr();
+public:
+  /*
+  Entry point into the driver by the gui thread; all it really does is
+  start the processing thread, and then return.
+  */
+  virtual void Run();
+public slots:
+  /*
+  The following six slots are called by the gui, and control the
+  processing thread.
+  */
+  void doPauseAvidaSlot();
+  void doStartAvidaSlot();
+  void doUpdateAvidaSlot();
+  void doStepAvidaSlot(int cell_id);
+  void doCloseAvidaSlot();
+protected:
+  void wakeProcessingThread(bool continuous, bool step);
+signals:
+  void avidaUpdatedSig(cAvidaDriver_Population *pop);
+  void avidaSteppedSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaBreakSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaClosedSig(cAvidaDriver_Population *pop);
+  void doStartAvidaSig();
+protected:
+  /*
+  Entry point into the driver by the processing thread, and contains the
+  main loop of the processing thread.  The loop continues until told by
+  the gui thread to exit.  The processing thread is a state machine; the
+  loop drives the transitions between states.
+  */
+  virtual void run();
+protected:
+  /*
+  State transitions are effected by setting the pointers
+  m_mode_function, m_fast_stage_function, and m_step_stage_function to
+  point to various of the following nine functions.
+  */
+  /*
+  m_mode_function is set by the gui thread to one of following three
+  functions, which is then executed by the processing thread.
+  */
+  bool fastMode();
+  bool stepMode();
+  bool closingMode();
+  /*
+  m_fast_stage_function, and m_step_stage_function are each set to one
+  of the following functions by the processing thread.  If the
+  processing thread is in fast mode then fastMode() will execute
+  m_fast_stage_function; otherwise stepMode() will execute
+  m_step_stage_function.
+
+  If the processing thread is in closingMode() then it shuts itself down.
+  */
+  bool preUpdate();
+  bool fastUpdate();
+  bool stepUpdate();
+  bool postUpdate();
+  bool ptMutations();
+  bool postPtMutations();
+protected:
+  virtual void SignalBreakpoint(void);
+protected:
+  /*
+  When the processing thread is about to perform an important state
+  transition (e.g., from the end of the current update to the start of
+  the next one), it sets the pointer m_emit_function to one of the
+  following four functions; then it alerts the gui thread of the pending
+  state transition by sending an event of type "avdGuiMsgEvent" to the
+  gui thread.  The gui thread catches this event in customEvent(),
+  below.  After catching the event, the gui thread calls the function
+  pointed to by m_emit_function.  This alerts the various user interface
+  elements of the state change.
+
+  Meanwhile, the processing thread stops and waits for new instructions
+  by the gui thread.
+  */
+  void emitUpdatedSig();
+  void emitSteppedSig();
+  void emitBreakpointSig();
+  void emitClosedSig();
+protected:
+  void customEvent(QCustomEvent *custom_event);
+};
+ 
+#endif
+    
+// arch-tag: header file for avida processing thread
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_HH
+#define AVD_AVIDA_THREAD_DRVR_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_PROTO_HH
+#include "avd_avida_thread_drvr_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for avida processing thread debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_avida_thread_drvr_dbg_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_PROTO_HH
+#define AVD_AVIDA_THREAD_DRVR_DBG_PROTO_HH
+
+extern avdMessageType  Info_THRD_DRVR_avdMsg;
+extern avdMessageType Debug_THRD_DRVR_avdMsg;
+extern avdMessageType Error_THRD_DRVR_avdMsg;
+extern avdMessageType Fatal_THRD_DRVR_avdMsg;
+#define  Info  AVD_INFO_MSG(THRD_DRVR)
+#define Debug AVD_DEBUG_MSG(THRD_DRVR)
+#define Error AVD_ERROR_MSG(THRD_DRVR)
+#define Fatal AVD_FATAL_MSG(THRD_DRVR)
+
+#endif
+
+// arch-tag: proto file for avida processing thread debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_driver_creator.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_driver_creator.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_driver_creator.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,109 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_AVIDA_STATE_MEDIATOR_HH
+#include "mc/avd_avida_state_mediator.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_ORIG_DRIVER_CONTROLLER_HH
+#include "avd_orig_driver_controller.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_HH
+#include "avd_avida_thread_drvr_dbg.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+
+
+avdMessageType  Info_THRD_DRVR_avdMsg("ThreadHdlr", avdMCInfo);
+avdMessageType Debug_THRD_DRVR_avdMsg("ThreadHdlr", avdMCDebug);
+avdMessageType Error_THRD_DRVR_avdMsg("ThreadHdlr", avdMCError);
+avdMessageType Fatal_THRD_DRVR_avdMsg("ThreadHdlr", avdMCFatal);
+
+
+template <class avdAvidaThreadCtrl> class pAvidaThreadDrvrConnections {
+protected:
+  void setupConnections(avdMCMediator *mdtr, avdAvidaThreadCtrl *hdlr){
+    Debug << "in .";
+    avdConnections cnct(mdtr->getAvidaStateMediator(), hdlr);
+    cnct.add(SIGNAL(doOpenAvidaSig()), SLOT(openAvidaSlot()));
+    cnct.add(SIGNAL(doCloseAvidaSig()), SLOT(closeAvidaSlot()));
+    //cnct.add(SIGNAL(doResetAvidaSig()), SLOT(resetAvidaSlot()));
+
+    cnct.add(SIGNAL(doStartAvidaSig()), SIGNAL(doStartAvidaSig()));
+    cnct.add(SIGNAL(doPauseAvidaSig()), SIGNAL(doPauseAvidaSig()));
+    cnct.add(SIGNAL(doUpdateAvidaSig()), SIGNAL(doUpdateAvidaSig()));
+    cnct.add(SIGNAL(doStepAvidaSig(int)), SIGNAL(doStepAvidaSig(int)));
+    
+    avdConnections cnct2(hdlr, mdtr->getAvidaStateMediator());
+    cnct2.add(SIGNAL(avidaUpdatedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaUpdatedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaUpdatedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaSteppedSig(cAvidaDriver_Population *, int)),
+      SIGNAL(avidaSteppedSig(cAvidaDriver_Population *, int)));
+    cnct2.add(SIGNAL(avidaSteppedSig(cAvidaDriver_Population *, int)),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaBreakSig(cAvidaDriver_Population *, int)),
+      SIGNAL(avidaBreakSig(cAvidaDriver_Population *, int)));
+    cnct2.add(SIGNAL(avidaBreakSig(cAvidaDriver_Population *, int)),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaOpenedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaOpenedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaOpenedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaClosedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaClosedSig(cAvidaDriver_Population *)));
+    cnct2.add(SIGNAL(avidaClosedSig(cAvidaDriver_Population *)),
+      SIGNAL(avidaStateChangedSig(cAvidaDriver_Population *)));
+
+    QObject::connect(hdlr, SIGNAL(requestArgvSig(aReqArgcArgv &)),
+      mdtr->getSettingsMediator(), SIGNAL(requestArgvSig(aReqArgcArgv &)));
+} };
+typedef tGUI<avdAvidaThreadCtrl, pAvidaThreadDrvrConnections> avdAvidaThreadHdlr;
+
+namespace {
+  avdAbstractCtrl *createDriverHdlr(void){
+    avdAvidaThreadHdlr *m = new avdAvidaThreadHdlr(0, "<avdAvidaThreadHdlr>");
+    m->nameWatched("<avdAvidaThreadHdlr>");
+    m->getCtrl()->nameWatched("<avdAvidaThreadCtrl>");
+    return m; }
+  QString s_key("avdAvidaThreadHdlr");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createDriverHdlr);
+
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_THRD_DRVR_avdMsg);
+        m_msg_types->Register("Debug", &Debug_THRD_DRVR_avdMsg);  
+        m_msg_types->Register("Error", &Error_THRD_DRVR_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_THRD_DRVR_avdMsg);
+        avdMessageSetTracker::Instance().Register("ThreadHdlr", m_msg_types);
+    } } 
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("ThreadHdlr");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
+
+// arch-tag: implementation file for avida processing thread factory and debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_gui_msg_event.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_gui_msg_event.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_gui_msg_event.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,18 @@
+#ifndef AVD_GUI_MSG_EVENT_HH
+#define AVD_GUI_MSG_EVENT_HH
+
+#ifndef QEVENT_H
+#include <qevent.h>
+#endif
+
+
+class avdGuiMsgEvent : public QCustomEvent {
+public:
+  enum eEventType { EventType = 1002 };
+  avdGuiMsgEvent(void): QCustomEvent(EventType){}
+};
+
+
+#endif
+
+// arch-tag: header file for debug-message display events
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,100 @@
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif  
+  
+#ifndef AVIDA_HH
+#include "main/avida.hh"
+#endif
+#ifndef CONFIG_HH
+#include "main/config.hh"
+#endif
+#ifndef ENVIRONMENT_HH
+#include "main/environment.hh"
+#endif
+#ifndef POPULATION_HH
+#include "main/population.hh"
+#endif
+
+#ifndef AVD_AVIDA_DRIVER_HH
+#include "avd_avida_driver.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_AVIDA_THREAD_DRVR_DBG_HH
+#include "avd_avida_thread_drvr_dbg.hh"
+#endif
+#ifndef SETUP_AVIDA_HH
+#include "mc/setup_avida.hh"
+#endif
+ 
+#ifndef AVD_ORIG_DRIVER_CONTROLLER_HH
+#include "avd_orig_driver_controller.hh"
+#endif
+
+using namespace std;
+
+
+void avdAvidaThreadCtrl::openAvidaSlot(){
+  closeAvidaSlot();
+  m_environment = new cEnvironment();
+  m_test_interface = new cPopulationInterface();
+  emit(requestArgvSig(*this));
+  SetupAvidaQtMultithreading(m_argc, m_argv, *m_environment, *m_test_interface);
+  setThreadDriver(new avdAvidaThreadDrvr(*m_environment));
+  if(!getThreadDriver()){
+    Fatal << "couldn't create new avida thread driver.";
+  }
+  getThreadDriver()->release();
+  
+  cAvidaDriver_Base::main_driver = getThreadDriver();
+
+  avdConnections cnct(this, getThreadDriver());
+  cnct.add(SIGNAL(doPauseAvidaSig()), SLOT(doPauseAvidaSlot()));
+  cnct.add(SIGNAL(doStartAvidaSig()), SLOT(doStartAvidaSlot()));
+  cnct.add(SIGNAL(doUpdateAvidaSig()), SLOT(doUpdateAvidaSlot()));
+  cnct.add(SIGNAL(doStepAvidaSig(int)), SLOT(doStepAvidaSlot(int)));
+  cnct.add(SIGNAL(doCloseAvidaSig()), SLOT(doCloseAvidaSlot()));
+
+  avdConnections cnct2(getThreadDriver(), this);
+  cnct2.add(SIGNAL(avidaUpdatedSig(cAvidaDriver_Population *)),
+    SIGNAL(avidaUpdatedSig(cAvidaDriver_Population*)));
+  cnct2.add(SIGNAL(avidaSteppedSig(cAvidaDriver_Population *, int)),
+    SIGNAL(avidaSteppedSig(cAvidaDriver_Population *, int)));
+  cnct2.add(SIGNAL(avidaBreakSig(cAvidaDriver_Population *, int)),
+    SIGNAL(avidaBreakSig(cAvidaDriver_Population *, int)));
+  cnct2.add(SIGNAL(avidaClosedSig(cAvidaDriver_Population *)),
+    SIGNAL(avidaClosedSig(cAvidaDriver_Population *)));
+  cnct2.add(SIGNAL(doStartAvidaSig()), SIGNAL(doStartAvidaSig()));
+
+  getThreadDriver()->Run();
+  emit(avidaOpenedSig(getThreadDriver()));
+}
+
+void avdAvidaThreadCtrl::closeAvidaSlot(){
+  emit(doCloseAvidaSig());
+  setThreadDriver(0);
+  if(m_environment){ delete m_environment; m_environment = 0; }
+  if(m_test_interface){ delete m_test_interface; m_test_interface = 0; }
+}
+
+void avdAvidaThreadCtrl::setThreadDriver(avdAvidaThreadDrvr *driver)
+{ SETretainable(m_driver, driver); }
+void avdAvidaThreadCtrl::setArgcArgv(int argc, char **argv)
+{ m_argc = argc; m_argv = argv; }
+
+cEnvironment *avdAvidaThreadCtrl::getEnvironment()
+{ return m_environment; }
+cPopulationInterface * avdAvidaThreadCtrl::getPopulationInterface()
+{ return m_test_interface; }
+
+avdAvidaThreadCtrl::avdAvidaThreadCtrl(QObject *parent, const char *name)
+: QObject(parent, name),
+  m_environment(0),
+  m_test_interface(0),
+  m_driver(0)
+{} 
+avdAvidaThreadCtrl::~avdAvidaThreadCtrl(){ closeAvidaSlot(); }
+
+// arch-tag: implementation file for avida thread controller
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/avd_orig_driver_controller.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,70 @@
+#ifndef AVD_ORIG_DRIVER_CONTROLLER_HH
+#define AVD_ORIG_DRIVER_CONTROLLER_HH
+  
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif  
+
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef REQUESTS_ARGV_HH
+#include "mc/attributes/requests_argv.hh"
+#endif
+
+
+class avdAvidaThreadDrvr;
+class avdMCMediator;
+class cAvidaDriver_Population;
+class cEnvironment;
+class cPopulationInterface;
+class avdAvidaThreadCtrl
+: public QObject
+, public cRetainable
+, public aReqArgcArgv
+{
+  Q_OBJECT
+protected:
+  cEnvironment *m_environment;
+  cPopulationInterface *m_test_interface;
+  //QGuardedPtr<avdAvidaThreadDrvr> m_driver;
+  avdAvidaThreadDrvr *m_driver;
+protected:
+  void setThreadDriver(avdAvidaThreadDrvr *driver);
+  avdAvidaThreadDrvr *getThreadDriver(){ return m_driver; }
+public:
+  int m_argc; char **m_argv;
+  void setArgcArgv(int argc, char **argv);
+public:
+  avdAvidaThreadCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdAvidaThreadCtrl();
+  bool setup(){ return true; }
+  cEnvironment *getEnvironment();
+  cPopulationInterface *getPopulationInterface();
+  bool avidaIsRunning();
+public slots:
+  void openAvidaSlot(void);
+  void closeAvidaSlot(void);
+signals:
+  void doPauseAvidaSig();
+  void doStartAvidaSig();
+  void doUpdateAvidaSig();
+  void doStepAvidaSig(int cell_id);
+  void doCloseAvidaSig();
+
+  void avidaUpdatedSig(cAvidaDriver_Population *pop);
+  void avidaSteppedSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaBreakSig(cAvidaDriver_Population *pop, int cell_id);
+  void avidaOpenedSig(cAvidaDriver_Population *pop);
+  void avidaClosedSig(cAvidaDriver_Population *pop);
+signals:
+  void requestArgvSig(aReqArgcArgv &);
+};
+
+#endif
+  
+// arch-tag: header file for avida thread controller
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/threaded_driver.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/threaded_driver.pri:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/threaded_driver/threaded_driver.pri	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,16 @@
+
+threaded_driver {
+  HEADERS += \
+    $$THREADED_DRIVER_HH/avd_avida_driver.hh \
+    $$THREADED_DRIVER_HH/avd_avida_thread_drvr_dbg_proto.hh \
+    $$THREADED_DRIVER_HH/avd_avida_thread_drvr_dbg.hh \
+    $$THREADED_DRIVER_HH/avd_gui_msg_event.hh \
+    $$THREADED_DRIVER_HH/avd_orig_driver_controller.hh
+
+  SOURCES += \
+    $$THREADED_DRIVER_CC/avd_avida_driver.cc \
+    $$THREADED_DRIVER_CC/avd_driver_creator.cc \
+    $$THREADED_DRIVER_CC/avd_orig_driver_controller.cc
+}
+
+# arch-tag: qmake include file for avida thread module
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,309 @@
+#ifndef _LIMITS_H___
+#include <limits.h>
+#endif
+#ifndef _STDIO_H_
+#include <stdio.h>
+#endif
+#ifndef _STDARG_H
+#include <stdarg.h>
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "avd_message_display_typetrack.hh"
+#endif
+
+#ifndef TRIO_TRIO_H
+#include "third-party/trio/trio.h"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+
+using namespace std;
+
+
+avdDefaultMessageDisplay s_avd_info_msg_out(&cout);
+avdDefaultMessageDisplay s_avd_debug_msg_out(&cout);
+avdDefaultMessageDisplay s_avd_error_msg_out(&cerr);
+avdDefaultMessageDisplay s_avd_fatal_msg_out(&cerr);
+avdDefaultMessageDisplay s_avd_plain_msg_out(&cout);
+avdMessageDisplay *s_avd_info_display(&s_avd_info_msg_out);
+avdMessageDisplay *s_avd_debug_display(&s_avd_debug_msg_out);
+avdMessageDisplay *s_avd_error_display(&s_avd_error_msg_out);
+avdMessageDisplay *s_avd_fatal_display(&s_avd_fatal_msg_out);
+avdMessageDisplay *s_avd_plain_display(&s_avd_plain_msg_out);
+avdMessageClass   avdMCInfo("Info:",  &s_avd_info_display, false, false, false);
+avdMessageClass avdMCDebug("Debug:", &s_avd_debug_display, false, false, false);
+avdMessageClass avdMCError("Error:", &s_avd_error_display, false, true, false);
+avdMessageClass avdMCFatal("Fatal:", &s_avd_fatal_display, true, true, false);
+avdMessageClass avdMCPlain("Plain:", &s_avd_plain_display, false, true, true);
+avdMessageType  Info_GEN_avdMsg("General", avdMCInfo);
+avdMessageType Debug_GEN_avdMsg("General", avdMCDebug);
+avdMessageType Error_GEN_avdMsg("General", avdMCError);
+avdMessageType Fatal_GEN_avdMsg("General", avdMCFatal);
+avdMessageType Plain_avdMsg("General", avdMCPlain);
+void setAvdInfoDisplay(avdMessageDisplay &md) { s_avd_info_display = &md; }
+void setAvdDebugDisplay(avdMessageDisplay &md) { s_avd_debug_display = &md; }
+void setAvdErrorDisplay(avdMessageDisplay &md) { s_avd_error_display = &md; }
+void setAvdFatalDisplay(avdMessageDisplay &md) { s_avd_fatal_display = &md; }
+void setAvdPlainDisplay(avdMessageDisplay &md) { s_avd_plain_display = &md; }
+
+/*
+A private namespace containing load-time initializations; these register
+the default error types with the avdMessageSetTracker singleton.  (The
+avdMessageSetTracker singleton is used in the GUI by the log window to
+keep track of how messages of a given type should be displayed).
+*/
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Plain",   &Plain_avdMsg);
+        m_msg_types->Register("Info",   &Info_GEN_avdMsg);
+        m_msg_types->Register("Debug", &Debug_GEN_avdMsg);
+        m_msg_types->Register("Error", &Error_GEN_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_GEN_avdMsg);
+        avdMessageSetTracker::Instance().Register("General", m_msg_types);
+      } else {
+        cerr << "* Error in message display system *" << endl;
+        cerr << "* in class DebugMsgTypeSetRegistration constructor *" << endl;
+        cerr << endl;
+        cerr << "Couldn't allocate \"avdMessageTypeSet\" object for use in" << endl;
+        cerr << "registering general message types \"Plain\", \"Info\"," << endl;
+        cerr << "\"Debug\", \"Error\", and \"Fatal\" with the message-type" << endl;
+        cerr << "tracking system." << endl;
+        cerr << "Normally the message-type tracking system is used by a log" << endl;
+        cerr << "window, available in the graphic user interface, to" << endl;
+        cerr << "determine how messages of a given type should be" << endl;
+        cerr << "displayed to the user." << endl;
+        cerr << endl;
+      }
+    }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("General");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
+
+void avdDefaultMessageDisplay::out(const cString &final_msg){
+  if(m_out){
+    *m_out << final_msg << endl; m_out->flush();
+  } else {
+    cerr << "* Error in message display system in method *" << endl;
+    cerr << "* \"void avdDefaultMessageDisplay::out(const cString &)\" *" << endl;
+    cerr << endl;
+    cerr << "Trying to display a message to the user, but my pointer to" << endl;
+    cerr << "the default output device doesn't point anywhere.  So I'm" << endl;
+    cerr << "going to send the message to the \"standard error\" device." << endl;
+    cerr << "Here's the message:" << endl;
+    cerr << endl;
+    cerr << final_msg << endl;
+    cerr << endl;
+  }
+}
+void avdMessageClass::configure(avdMessageType *message_type){
+  if(!message_type){
+    cerr << "* Error in message display system in method *" << endl;
+    cerr << "* void avdMessageClass::configure(avdMessageType *) *" << endl;
+    cerr << endl;
+    cerr << "Trying to configure a message type, but the pointer" << endl;
+    cerr << "I was given to the message type doesn't point anywhere." << endl;
+  } else {
+    message_type->m_is_active = true;
+    message_type->m_show_where = true;
+    message_type->m_show_function = true;
+  }
+}
+avdMessageType::avdMessageType(
+  const char *type_name,
+  avdMessageClass &message_class
+):m_type_name(type_name),
+  m_message_class(message_class)
+{ message_class.configure(this); }
+avdMessageClosure::avdMessageClosure(
+  avdMessageType &type,
+  const char *function_name,
+  const char *file_name,
+  int line_number
+):m_type(type),
+  m_function(function_name),
+  m_file(file_name),
+  m_line(line_number),
+  m_error(INT_MAX),
+  m_op_count(0)
+{}
+avdMessageClosure::~avdMessageClosure(void){
+  if(!m_type.m_message_class.m_msg_display){
+    cerr << "* Error in message display system *" << endl;
+    cerr << "* in class avdMessageClosure destructor *" << endl;
+    cerr << endl;
+    cerr << "Trying to display a message to the user, but my pointer to" << endl;
+    cerr << "my message-displayer doesn't point anywhere.  So I'm" << endl;
+    cerr << "going to send the message to the \"standard error\" device." << endl;
+    cerr << "Here's the message:" << endl;
+    cerr << endl;
+    cerr << m_msg << endl;
+    cerr << endl;
+    if(m_type.m_message_class.m_is_fatal) abort();
+  } else {
+    (*m_type.m_message_class.m_msg_display)->out(m_msg);
+    if(m_type.m_message_class.m_is_fatal) (*m_type.m_message_class.m_msg_display)->abort();
+  }
+}
+void avdMessageClosure::prefix(void){
+  if(m_op_count++ == 0 && !m_type.m_message_class.m_no_prefix){
+    if(m_type.m_message_class.m_is_prefix){
+      m_msg += m_type.m_type_name;
+      m_msg += '-';
+    }
+    m_msg += m_type.m_message_class.m_class_name;
+    if(!m_type.m_message_class.m_is_prefix
+      ||m_type.m_show_function
+      ||m_type.m_show_where
+    ){
+      bool colon = false;
+      if(!m_type.m_message_class.m_is_prefix){
+        m_msg += m_type.m_type_name;
+        m_msg += ": ";
+      }
+      if(m_type.m_show_function || m_type.m_show_where){
+        m_msg += "<";
+      }
+      if(m_type.m_show_function){
+        if(!m_function){
+          cerr << "* Error in message display system in *" << endl;
+          cerr << "* void avdMessageClosure::prefix() *" << endl;
+          cerr << endl;
+          cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+          cerr << "supposed to print the name of the function" << endl;
+          cerr << "from which the message originates, but I" << endl; 
+          cerr << "wasn't given the function name." << endl;
+          cerr << "But I'll try to print the rest of the message." << endl;
+        } else { m_msg += m_function; }
+        colon = true;
+      }
+      if(m_type.m_show_where){
+        if(colon){m_msg += ':';}
+        if(!m_file){
+          cerr << "* Error in message display system in *" << endl;
+          cerr << "* void avdMessageClosure::prefix() *" << endl;
+          cerr << endl;
+          cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+          cerr << "supposed to print the name of the file" << endl;
+          cerr << "from which the message originates, but I" << endl; 
+          cerr << "wasn't given the file name." << endl;
+          cerr << "But I'll try to print the rest of the message." << endl;
+        } else { m_msg += m_file; }
+        m_msg += ':';
+        // FIXME:  consider move this varargs gunk to cString.  -- kgn.
+        {
+          int size = trio_snprintf((char *) 0, 0, "%i", m_line);
+          char *buf = new char[size + 1];
+          //assert(buf != 0);
+          if(!buf){
+            cerr << "* Error in message display system in *" << endl;
+            cerr << "* void avdMessageClosure::prefix() *" << endl;
+            cerr << endl;
+            cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+            cerr << "supposed to print the line number of the source-code" << endl;
+            cerr << "file from which the message originates, but I can't" << endl; 
+            cerr << "allocate enough space to print the line number." << endl;
+            cerr << "But I'll try to print the rest of the message." << endl;
+          } else {
+            trio_snprintf(buf, size+1, "%i", m_line);
+            m_msg += buf;
+            delete[] buf;
+          }
+        }
+      }
+      if(m_type.m_show_function || m_type.m_show_where){
+        m_msg += ">";
+      }
+      m_msg += ' ';
+    } else {
+      m_msg += ':';
+    }
+  }
+}
+avdMessageClosure &avdMessageClosure::operator<<(char c)
+{ prefix(); m_msg += c; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(unsigned char c)
+{ prefix(); m_msg += c; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(const char *s)
+{ prefix(); m_msg += s; return *this; }
+
+//avdMessageClosure &avdMessageClosure::operator<<(int i)
+//{ return va("%d", i); }
+//avdMessageClosure &avdMessageClosure::operator<<(unsigned int i)
+//{ return va("%u", i); }
+//avdMessageClosure &avdMessageClosure::operator<<(long i)
+//{ return va("%ld", i); }
+//avdMessageClosure &avdMessageClosure::operator<<(unsigned long i)
+//{ return va("%lu", i); }
+//avdMessageClosure &avdMessageClosure::operator<<(float f)
+//{ return va("%g", f); }
+//avdMessageClosure &avdMessageClosure::operator<<(double f)
+//{ return va("%g", f); }
+//avdMessageClosure &avdMessageClosure::operator<<(const void *p)
+//{ return va("%p", p); }
+
+avdMessageClosure &avdMessageClosure::operator<<(int i)
+{ char buf[32]; trio_snprintf(buf, 32, "%d", i); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(unsigned int i)
+{ char buf[32]; trio_snprintf(buf, 32, "%u", i); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(long i)
+{ char buf[32]; trio_snprintf(buf, 32, "%ld", i); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(unsigned long i)
+{ char buf[32]; trio_snprintf(buf, 32, "%lu", i); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(float f)
+{ char buf[32]; trio_snprintf(buf, 32, "%g", f); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(double f)
+{ char buf[32]; trio_snprintf(buf, 32, "%g", f); m_msg += buf; return *this; }
+avdMessageClosure &avdMessageClosure::operator<<(const void *p)
+{ char buf[32]; trio_snprintf(buf, 32, "%p", p); m_msg += buf; return *this; }
+
+avdMessageClosure &avdMessageClosure::va(const char *fmt, ...)
+{
+  if(!fmt){
+    cerr << "* Error in message display system in *" << endl;
+    cerr << "* avdMessageClosure &avdMessageClosure::va(const char *, ...) *" << endl;
+    cerr << endl;
+    cerr << "I'm trying to prepare part of a message for you, but I" << endl; 
+    cerr << "nonsensical directions for printing this part of the message." << endl;
+    cerr << "But I'll try to print the rest of the message." << endl;
+
+    return *this;
+  }
+  va_list ap;
+
+  va_start(ap, fmt);
+  int size = trio_vsnprintf((char *) 0, 0, fmt, ap);
+  va_end(ap);
+
+  char *buf = new char[size + 1];
+  //assert(buf != 0);
+
+  if(!buf){
+    cerr << "* Error in message display system in *" << endl;
+    cerr << "* avdMessageClosure &avdMessageClosure::va(const char *, ...) *" << endl;
+    cerr << endl;
+    cerr << "I'm trying to prepare part of a message for you, but I can't" << endl; 
+    cerr << "allocate enough space to print this part of the message." << endl;
+    cerr << "But I'll try to print the rest of the message." << endl;
+  } else {
+    va_start(ap, fmt);
+    trio_vsnprintf(buf, size+1, fmt, ap);
+    va_end(ap);
+
+    prefix();
+    m_msg += buf;
+    delete[] buf;
+  }
+  return *this;
+}
+
+// arch-tag: implementation file for debug-message display handling
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,17 @@
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#define AVD_MESSAGE_DISPLAY_HH
+
+#ifndef _CPP_IOSTREAM
+#include <iostream>
+#endif
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_PROTO_HH
+#include "avd_message_display_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for debug-message display handling
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,154 @@
+#ifndef AVD_MESSAGE_DISPLAY_PROTO_HH
+#define AVD_MESSAGE_DISPLAY_PROTO_HH
+
+
+class avdMessageDisplay{
+public:
+  virtual void out(const cString &){}
+  virtual void abort(){ abort(); }
+};
+
+class avdDefaultMessageDisplay : public avdMessageDisplay {
+protected:
+  std::ostream *m_out;
+public:
+  avdDefaultMessageDisplay(std::ostream *stream):m_out(stream){}
+  void out(const cString &final_msg);
+};
+extern avdDefaultMessageDisplay s_avd_info_msg_out;
+extern avdDefaultMessageDisplay s_avd_debug_msg_out;
+extern avdDefaultMessageDisplay s_avd_error_msg_out;
+extern avdDefaultMessageDisplay s_avd_fatal_msg_out;
+extern avdDefaultMessageDisplay s_avd_plain_msg_out;
+void setAvdInfoDisplay(avdMessageDisplay &info);
+void setAvdDebugDisplay(avdMessageDisplay &md);
+void setAvdErrorDisplay(avdMessageDisplay &md);
+void setAvdFatalDisplay(avdMessageDisplay &md);
+void setAvdPlainDisplay(avdMessageDisplay &md);
+
+class avdMessageType;
+class avdMessageClass{
+public:
+  avdMessageClass(
+    const char *class_name,
+    avdMessageDisplay **msg_display,
+    bool is_fatal,
+    bool is_prefix,
+    bool no_prefix
+  ):m_class_name(class_name), m_msg_display(msg_display),
+  m_is_fatal(is_fatal), m_is_prefix(is_prefix), m_no_prefix(no_prefix){}
+public:
+  void configure(avdMessageType *message_type);
+public:
+  const char *const m_class_name;
+  avdMessageDisplay **m_msg_display;
+  bool const m_is_fatal;
+  bool const m_is_prefix;
+  bool const m_no_prefix;
+};
+
+class avdMessageType{
+public:
+  avdMessageType(const char *type_name, avdMessageClass &message_class);
+public:
+  const char *m_type_name;
+  const avdMessageClass &m_message_class;
+  bool m_is_active;
+  bool m_show_where;
+  bool m_show_function;
+};
+
+class QString;
+class avdMessageClosure{
+protected:
+  avdMessageType &m_type;
+  const char *m_function;
+  const char *m_file;
+  int m_line;
+  int m_error;
+  int m_op_count;
+  cString m_msg;
+public:
+  avdMessageClosure(
+    avdMessageType &type,
+    const char *function_name,
+    const char *file_name,
+    int line_number
+  );
+  ~avdMessageClosure(void);
+public:
+  avdMessageClosure &operator<<(char c);
+  avdMessageClosure &operator<<(unsigned char c);
+  avdMessageClosure &operator<<(const char *s);
+  avdMessageClosure &operator<<(int i);
+  avdMessageClosure &operator<<(unsigned int i);
+  avdMessageClosure &operator<<(long i);
+  avdMessageClosure &operator<<(unsigned long i);
+  avdMessageClosure &operator<<(float f);
+  avdMessageClosure &operator<<(double f);
+  avdMessageClosure &operator<<(const void *p);
+  avdMessageClosure &operator<<(const QString &s);
+
+  avdMessageClosure &operator()(char c){ return operator<<(c); }
+  avdMessageClosure &operator()(unsigned char c){ return operator<<(c); }
+  avdMessageClosure &operator()(const char *s){ return operator<<(s); }
+  avdMessageClosure &operator()(int i){ return operator<<(i); }
+  avdMessageClosure &operator()(unsigned int i){ return operator<<(i); }
+  avdMessageClosure &operator()(long i){ return operator<<(i); }
+  avdMessageClosure &operator()(unsigned long i){ return operator<<(i); }
+  avdMessageClosure &operator()(float f){ return operator<<(f); }
+  avdMessageClosure &operator()(double f){ return operator<<(f); }
+  avdMessageClosure &operator()(const void *p){ return operator<<(p); }
+  avdMessageClosure &operator()(const QString &s){ return operator<<(s); }
+
+  avdMessageClosure &va(const char *fmt, ...);
+  void prefix(void);
+};
+
+#define AVD_MSG_CLOSURE_FL(x)\
+  avdMessageClosure(\
+    x,\
+    __PRETTY_FUNCTION__,\
+    __FILE__,\
+    __LINE__\
+  )
+
+#define AVD_INFO_MSG(type)\
+  if (Info_ ## type ## _avdMsg.m_is_active)\
+    AVD_MSG_CLOSURE_FL(Info_ ## type ## _avdMsg)
+
+#define AVD_DEBUG_MSG(type)\
+  if (Debug_ ## type ## _avdMsg.m_is_active)\
+    AVD_MSG_CLOSURE_FL(Debug_ ## type ## _avdMsg)
+
+#define AVD_ERROR_MSG(type)\
+  if (Error_ ## type ## _avdMsg.m_is_active)\
+    AVD_MSG_CLOSURE_FL(Error_ ## type ## _avdMsg)
+
+#define AVD_FATAL_MSG(type)\
+  if (Fatal_ ## type ## _avdMsg.m_is_active)\
+    AVD_MSG_CLOSURE_FL(Fatal_ ## type ## _avdMsg)
+
+#define AVD_PLAIN_MSG(type)\
+  if (type ## _avdMsg.m_is_active)\
+    AVD_MSG_CLOSURE_FL(type ## _avdMsg)
+
+extern avdMessageClass avdMCInfo;
+extern avdMessageClass avdMCDebug;
+extern avdMessageClass avdMCError;
+extern avdMessageClass avdMCFatal;
+extern avdMessageClass avdMCPlain;
+extern avdMessageType     Info_GEN_avdMsg;
+extern avdMessageType    Debug_GEN_avdMsg;
+extern avdMessageType    Error_GEN_avdMsg;
+extern avdMessageType    Fatal_GEN_avdMsg;
+#define avdInfo   AVD_INFO_MSG(GEN)
+#define avdDebug AVD_DEBUG_MSG(GEN)
+#define avdError AVD_ERROR_MSG(GEN)
+#define avdFatal AVD_FATAL_MSG(GEN)
+extern avdMessageType Plain_avdMsg;
+#define Message AVD_PLAIN_MSG(Plain)
+
+#endif
+
+// arch-tag: proto file for debug-message display handling
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#define AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+
+/* XXX disables the small-object allocator; it crashes under OSX10.2.6. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+/* XXX -- kaben */
+#ifndef ASSOCVECTOR_INC_
+#include "third-party/Loki/AssocVector.h"
+#endif
+#ifndef SINGLETON_INC_
+#include "third-party/Loki/Singleton.h"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_PROTO_HH
+#include "avd_message_display_typetrack_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for debug-message display-type tracking
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_message_display_typetrack_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,57 @@
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_PROTO_HH
+#define AVD_MESSAGE_DISPLAY_TYPETRACK_PROTO_HH
+
+
+class avdMessageTypeSet{
+public:
+  bool Register(const std::string &id, avdMessageType *mt)
+  { return m_associations.insert(IdToMTMap::value_type(id, mt)).second; }
+  bool Unregister(const std::string &id)
+  { return m_associations.erase(id) == 1; }
+  avdMessageType *GetTypeTracker(const std::string &id){
+    IdToMTMap::iterator i = m_associations.find(id);
+    if (i != m_associations.end()) return i->second;
+    return 0;
+  }
+  Loki::AssocVector<std::string, avdMessageType *>::iterator
+  begin(){ return m_associations.begin(); }
+  Loki::AssocVector<std::string, avdMessageType *>::iterator
+  end(){ return m_associations.end(); }
+  Loki::AssocVector<std::string, avdMessageType *>::size_type
+  size(){ return m_associations.size(); }
+protected:
+  typedef Loki::AssocVector<std::string, avdMessageType *> IdToMTMap;
+  typedef Loki::AssocVector<std::string, avdMessageType *>::iterator Iterator;
+  IdToMTMap m_associations;
+};
+class _avdMessageSetTracker{
+public:
+  bool Register(const std::string &id, avdMessageTypeSet *ts)
+  { return m_associations.insert(IdToTSMap::value_type(id, ts)).second; }
+  bool Unregister(const std::string &id)
+  { return m_associations.erase(id) == 1; }
+  avdMessageTypeSet *GetTypeTracker(const std::string &id){
+    IdToTSMap::iterator i = m_associations.find(id);
+    if (i != m_associations.end()) return i->second;
+    return 0;
+  }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  begin(){ return m_associations.begin(); }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  end(){ return m_associations.end(); }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::size_type
+  size(){ return m_associations.size(); }
+protected:
+  typedef Loki::AssocVector<std::string, avdMessageTypeSet *> IdToTSMap;
+  typedef Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator Iterator;
+  IdToTSMap m_associations;
+};
+typedef Loki::AssocVector<std::string, avdMessageType *>::iterator
+  avdMessageTypeIterator;
+typedef Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  avdMessageSetTrackerIterator;
+typedef Loki::SingletonHolder<_avdMessageSetTracker> avdMessageSetTracker;
+
+#endif
+
+// arch-tag: proto file for debug-message display-type tracking
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_qstr_message_display.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_qstr_message_display.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_qstr_message_display.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef QSTRING_H
+#include <qstring.h>
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+
+avdMessageClosure &avdMessageClosure::operator<<(const QString &s){
+  prefix();
+  m_msg += (QString::null == s)?("(null)"):(s.latin1());
+  return *this;
+}
+
+// arch-tag: implementation file for debug-message display of QStrings
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,136 @@
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QEVENT_H
+#include <qevent.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#include "avd_user_msg_gui_dbg.hh"
+#endif
+#ifndef AVD_USER_MSG_VIEW_HH
+#include "avd_user_msg_view.hh"
+#endif
+
+#ifndef AVD_USER_MSG_CTRL_HH
+#include "avd_user_msg_ctrl.hh"
+#endif
+
+
+class avdUserMsgEvent : public QCustomEvent {
+public:
+  avdUserMsgEvent(const QString &msg):QCustomEvent(1002), m_msg(msg){}
+  QString msg() const { return m_msg; }
+protected:
+  QString m_msg;
+};
+
+class avdUserMsgDply : public avdMessageDisplay, public cRetainable {
+protected:
+  avdUserMsgCtrl *m_msg_rcvr;
+public:
+  avdUserMsgDply(avdUserMsgCtrl *msg_rcvr):m_msg_rcvr(msg_rcvr)
+  {
+    setAvdInfoDisplay(*this);
+    setAvdDebugDisplay(*this);
+    setAvdErrorDisplay(*this);
+    setAvdFatalDisplay(*this);
+    setAvdPlainDisplay(*this);
+  }
+  ~avdUserMsgDply(){
+    setAvdInfoDisplay(s_avd_info_msg_out);
+    setAvdDebugDisplay(s_avd_debug_msg_out);
+    setAvdErrorDisplay(s_avd_error_msg_out);
+    setAvdFatalDisplay(s_avd_fatal_msg_out);
+    setAvdPlainDisplay(s_avd_plain_msg_out);
+  }
+  void out(const cString &final_msg){
+    avdUserMsgEvent *msg_ev = new avdUserMsgEvent(QString(final_msg));
+    QApplication::postEvent(m_msg_rcvr, msg_ev);
+  }
+  /*
+  XXX FIXME:  abort() below fails bcz of multithreading.  Should try to
+  quit processing thread if possible, even though avida is now unstable.
+  Easiest to try to signal to mediator, so this class should become a
+  QObject, and be connected to UserMsgCtrl to pass an abort signal up.
+  -- K
+  */
+  void abort(){ QApplication::exit(1); }
+};
+
+/*
+Don't call any Message macros in the next two functions,
+or you'll trigger an infinite loop.
+*/
+void avdUserMsgCtrl::customEvent(QCustomEvent *e){
+  if(e->type() == 1002){
+    avdUserMsgEvent *msg_ev = (avdUserMsgEvent *)e;
+    getView()->textEdit()->append(msg_ev->msg());   // append to info window
+    trimTextEdit();
+    //std::cout << msg_ev->msg() << std::endl;        // and echo to stdout
+  }
+}
+void avdUserMsgCtrl::trimTextEdit(){
+  if(getView() && getView()->textEdit())
+    for(int sl = savedLines(), p = getView()->textEdit()->paragraphs(); sl < p; p--)
+      getView()->textEdit()->removeParagraph(0);
+}
+
+void avdUserMsgCtrl::setView(avdUserMsgView *view)
+{ SETretainable(m_view, view); }
+void avdUserMsgCtrl::setDply(avdUserMsgDply *dply)
+{ SETretainable(m_dply, dply); }
+
+avdUserMsgCtrl::avdUserMsgCtrl(QObject *parent, const char *name)
+:QObject(parent, name), m_view(0), m_dply(0){
+  Debug << "user message system controller constructor.";
+  avdUserMsgView *view = new avdUserMsgView(0, "<avdUserMsgCtrl(m_view)>");
+  setView(view); view->release();
+  getView()->nameWatched("<avdUserMsgCtrl(m_view)>");
+  connect(getView(), SIGNAL(destroyed()), this, SLOT(deleteLater()));
+  Debug << "Transferring message output from stdout/stderr to info console.";
+  avdUserMsgDply *dply = new avdUserMsgDply(this);
+  setDply(dply); dply->release();
+  getDply()->nameWatched("<avdUserMsgCtrl(m_dply)>");
+  Debug << "<avdUserMsgCtrl> setSavedLines(1000)...";
+  setSavedLines(1000);
+  Debug << "<avdUserMsgCtrl> ctor done.";
+}
+avdUserMsgCtrl::~avdUserMsgCtrl(){
+  avdDebug << "user message system controller destructor.";
+  setDply(0);
+  setView(0);
+  Debug << "Transferred message output from info console to stdout/stderr.";
+  avdDebug << "user message system controller dtor done.";
+}
+bool avdUserMsgCtrl::setup(){
+  Info << "entered message system setup.";
+  emit(doResetMenuBar(getView()->menuBar()));
+  emit(requestUserMsgPrefsSig(*this));
+  Info << "message system setup done.";
+  return true;
+}
+
+void avdUserMsgCtrl::userMsgPrefsChangedSlot(avdUserMsgCtrlFunct &funct){
+  Debug << "entered userMsgPrefsChangedSlot(avdUserMsgCtrlFunct &).";
+  funct(*this);
+  Debug << "userMsgPrefsChangedSlot(avdUserMsgCtrlFunct &) done.";
+}
+
+void avdUserMsgCtrl::showUserMsgGUISlot(){
+  Debug << "<showUserMsgGUISlot>";
+  if(getView()){
+    Debug << "<showUserMsgGUISlot> showing, raising...";
+    getView()->show();
+    getView()->raise();
+  }
+  Debug << "<showUserMsgGUISlot> done.";
+}
+
+// arch-tag: implementation file for user debug-message display controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,53 @@
+#ifndef AVD_USER_MSG_CTRL_HH
+#define AVD_USER_MSG_CTRL_HH
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef AVD_USER_MSG_CTRL_FUNCT_HH
+#include "avd_user_msg_ctrl_funct.hh"
+#endif
+
+
+class QCustomEvent;
+class QMenuBar;
+class avdAvidaThreadDrvr;
+class avdUserMsgDply;
+class avdUserMsgView;
+class avdUserMsgCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdUserMsgView> m_view;
+  avdUserMsgDply *m_dply;
+  int m_saved_lines;
+public:
+  void setView(avdUserMsgView *view);
+  void setDply(avdUserMsgDply *dply);
+  void setSavedLines(int saved_lines){ m_saved_lines = saved_lines; trimTextEdit(); }
+
+  avdUserMsgView *getView(){ return m_view; }
+  avdUserMsgDply *getDply(){ return m_dply; }
+  int savedLines(){ return m_saved_lines; }
+public:
+  avdUserMsgCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdUserMsgCtrl();
+  bool setup();
+  void customEvent(QCustomEvent *e);
+  void trimTextEdit();
+public slots:
+  void userMsgPrefsChangedSlot(avdUserMsgCtrlFunct &funct);
+  void showUserMsgGUISlot();
+signals:
+  void requestUserMsgPrefsSig(const avdUserMsgCtrl &ctrl);
+  void doResetMenuBar(QMenuBar *);
+};
+
+#endif
+
+// arch-tag: header file for user debug-message display controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,19 @@
+#ifndef AVD_USER_MSG_CTRL_FUNCT_HH
+#define AVD_USER_MSG_CTRL_FUNCT_HH
+
+/* XXX disables the small-object allocator; it crashes under OSX10.2.6. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+/* XXX -- kaben */
+#ifndef FUNCTOR_INC_
+#include "third-party/Loki/Functor.h"
+#endif
+
+#ifndef AVD_USER_MSG_CTRL_FUNCT_PROTO_HH
+#include "avd_user_msg_ctrl_funct_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for user debug-message display controller functors
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_ctrl_funct_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,10 @@
+#ifndef AVD_USER_MSG_CTRL_FUNCT_PROTO_HH
+#define AVD_USER_MSG_CTRL_FUNCT_PROTO_HH
+
+class avdUserMsgCtrl;
+typedef Loki::Functor<void, TYPELIST_1(const avdUserMsgCtrl &)>
+avdUserMsgCtrlFunct;
+
+#endif
+
+// arch-tag: proto file for user debug-message display controller functors
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,94 @@
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMENUBAR_H
+#include <qmenubar.h>
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#include "avd_user_msg_gui_dbg.hh"
+#endif
+#ifndef AVD_GUI_FACTORY_HH
+#include "gui_factory/avd_gui_factory.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_MENUBAR_MEDIATOR_HH
+#include "mc/avd_menubar_mediator.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef AVD_WINDOWS_MEDIATOR_HH
+#include "mc/avd_windows_mediator.hh"
+#endif
+#ifndef AVD_USER_MSG_CTRL_HH
+#include "avd_user_msg_ctrl.hh"
+#endif
+#ifndef TGUI_HH
+#include "gui_factory/tGUI.hh"
+#endif
+
+
+avdMessageType  Info_USER_MSG_avdMsg("UsrMsgSys", avdMCInfo);
+avdMessageType Debug_USER_MSG_avdMsg("UsrMsgSys", avdMCDebug);
+avdMessageType Error_USER_MSG_avdMsg("UsrMsgSys", avdMCError);
+avdMessageType Fatal_USER_MSG_avdMsg("UsrMsgSys", avdMCFatal);
+
+template <class avdUserMsgCtrl> class pUserMsgCtrlConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdUserMsgCtrl *ctrl){
+    Debug << "setupConnections entered.";
+    QObject::connect(
+      ctrl, SIGNAL(doResetMenuBar(QMenuBar *)),
+      med->getMenuBarMediator(), SIGNAL(setupMenuBarSig(QMenuBar *)));
+    QObject::connect(
+      med->getSettingsMediator(),
+      SIGNAL(userMsgPrefsChangedSig(avdUserMsgCtrlFunct &)),
+      ctrl, SLOT(userMsgPrefsChangedSlot(avdUserMsgCtrlFunct &)));
+    QObject::connect(
+      ctrl, SIGNAL(requestUserMsgPrefsSig(const avdUserMsgCtrl &)),
+      med->getSettingsMediator(),
+      SIGNAL(requestUserMsgPrefsSig(const avdUserMsgCtrl &)));
+    QObject::connect(
+      med->getWindowsMediator(), SIGNAL(showUserMsgGUISig()),
+      ctrl, SLOT(showUserMsgGUISlot()));
+    Debug << "setupConnections done.";
+} };
+
+typedef tGUI<avdUserMsgCtrl, pUserMsgCtrlConnections> avdUserMsgGUI;
+
+namespace {
+  avdAbstractCtrl *createUserMsgGUI(void){
+    avdUserMsgGUI *g = new avdUserMsgGUI(0, "<(avdUserMsgGUI)>");
+    g->nameWatched("<(avdUserMsgGUI)>");
+    g->getCtrl()->nameWatched("<(avdUserMsgCtrl)>");
+    return g;
+  }
+  QString s_key("avdUserMsgGUI");
+  const bool s_registered =
+    avdControllerFactory::Instance().Register(s_key, createUserMsgGUI);
+
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Info",   &Info_USER_MSG_avdMsg);  
+        m_msg_types->Register("Debug", &Debug_USER_MSG_avdMsg);  
+        m_msg_types->Register("Error", &Error_USER_MSG_avdMsg);  
+        m_msg_types->Register("Fatal", &Fatal_USER_MSG_avdMsg);  
+        avdMessageSetTracker::Instance().Register("UsrMsgSys", m_msg_types);
+    } }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("UsrMsgSys");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
+
+// arch-tag: implementation file for user debug-message display gui factory and debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,14 @@
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#define AVD_USER_MSG_GUI_DBG_HH
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+ 
+#ifndef AVD_USER_MSG_GUI_DBG_PROTO_HH
+#include "avd_user_msg_gui_dbg_proto.hh"
+#endif
+
+#endif
+
+// arch-tag: header file for user debug-message display gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg_proto.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg_proto.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_gui_dbg_proto.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,15 @@
+#ifndef AVD_USER_MSG_GUI_DBG_PROTO_HH
+#define AVD_USER_MSG_GUI_DBG_PROTO_HH
+
+extern avdMessageType  Info_USER_MSG_avdMsg;
+extern avdMessageType Debug_USER_MSG_avdMsg;
+extern avdMessageType Error_USER_MSG_avdMsg;
+extern avdMessageType Fatal_USER_MSG_avdMsg;
+#define  Info  AVD_INFO_MSG(USER_MSG)
+#define Debug AVD_DEBUG_MSG(USER_MSG)
+#define Error AVD_ERROR_MSG(USER_MSG)
+#define Fatal AVD_FATAL_MSG(USER_MSG)
+
+#endif
+
+// arch-tag: proto file for user debug-message display gui debug messages
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,206 @@
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QFONTDIALOG_H
+#include <qfontdialog.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QSETTINGS_H
+#include <qsettings.h>
+#endif
+#ifndef QSPINBOX_H
+#include <qspinbox.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+
+#ifndef DEFS_HH
+#include "defs.hh"
+#endif
+
+#ifndef AVD_PREFS_ITEM_VIEW_HH
+#include "preferences/avd_prefs_item_view.hh"
+#endif
+#ifndef AVD_USER_MSG_CTRL_HH
+#include "avd_user_msg_ctrl.hh"
+#endif
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#include "avd_user_msg_gui_dbg.hh"
+#endif
+#ifndef AVD_USER_MSG_PREFS_VIEW_HH
+#include "avd_user_msg_prefs_view.hh"
+#endif
+#ifndef AVD_USER_MSG_VIEW_HH
+#include "avd_user_msg_view.hh"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_TYPETRACK_HH
+#include "user_msg/avd_message_display_typetrack.hh"
+#endif
+
+#ifndef AVD_USER_MSG_PREFS_CTRL_HH
+#include "avd_user_msg_prefs_ctrl.hh"
+#endif
+
+
+avdMsgModuleLVI::avdMsgModuleLVI(QListView *parent, QString label)
+: QListViewItem(parent, label)
+{
+  setExpandable(true);
+}
+avdMsgTypeLVI::avdMsgTypeLVI(
+  avdMsgModuleLVI *parent,
+  const QString &parent_text,
+  const QString &text,
+  avdMessageType &mt)
+: QListViewItem(parent, text)
+{
+  QString settings_key('/' + parent_text + '/' + text);
+  setExpandable(true);
+  avdMsgCnfgCLI *is_active = new avdMsgCnfgCLI
+  ( this, "Is Active", settings_key + "/is_active", mt.m_is_active);
+  avdMsgCnfgCLI *show_where = new avdMsgCnfgCLI
+  ( this, "Show Where", settings_key + "/show_where", mt.m_show_where);
+  avdMsgCnfgCLI *show_function = new avdMsgCnfgCLI
+  ( this, "Show Function", settings_key + "/show_function", mt.m_show_function);
+}
+
+avdMsgCnfgCLI::avdMsgCnfgCLI(
+  avdMsgTypeLVI *parent,
+  const QString &text,
+  const QString &key,
+  bool &flag)
+: QCheckListItem(parent, text, QCheckListItem::CheckBox)
+, m_flag(flag)
+, m_key(key)
+{
+  QSettings settings;
+  settings.setPath("Avida", AVIDA_VERSION);
+  settings.beginGroup("/avdUserMsgPrefs/avdMessageTypeSet");
+  m_flag = settings.readBoolEntry(m_key, m_flag);
+  setOn(m_flag);
+}
+void avdMsgCnfgCLI::stateChange(bool state){
+  m_flag = state;
+  QSettings settings;
+  settings.setPath("Avida", AVIDA_VERSION);
+  settings.writeEntry("/avdUserMsgPrefs/avdMessageTypeSet" + m_key, state);
+};
+
+void avdUserMsgPrefsCtrl::setView(avdUserMsgPrefsView *view)
+{ SETretainable(m_view, view); }
+void avdUserMsgPrefsCtrl::setConsoleFont(QFont console_font)
+{ m_console_font = console_font; }
+QWidget *avdUserMsgPrefsCtrl::getView()
+{ return m_view; }
+avdUserMsgPrefsView *avdUserMsgPrefsCtrl::getUserMsgPrefsView()
+{ return m_view; }
+
+avdUserMsgPrefsCtrl::avdUserMsgPrefsCtrl(
+  QObject *parent, const char *name)
+: QObject(parent, name), m_view(0)
+{
+  Debug << "<avdUserMsgPrefsCtrl> ctor.";
+  avdUserMsgPrefsView *view = new avdUserMsgPrefsView(
+    0, "<avdUserMsgPrefsCtrl(m_view)>");
+  Debug << " --- created view at " << getView();
+  setView(view);
+  Debug << " --- setPrefsItemView() done...";
+  if(!getView())
+  { Error << "can't create avdUserMsgPrefsView."; return; }
+  Debug << " --- setPrefsItemView() non-null; done...";
+  view->nameWatched("<avdUserMsgPrefsCtrl::(view)>");
+  view->release();
+  connect(getUserMsgPrefsView()->fontBtn(), SIGNAL(clicked()),
+    this, SLOT(fontBtnClickedSlot()));
+  connect(getUserMsgPrefsView()->spinBox(), SIGNAL(valueChanged(int)),
+    this, SLOT(spinBoxValueChangedSlot(int)));
+}
+avdUserMsgPrefsCtrl::~avdUserMsgPrefsCtrl(){
+  Debug << "<avdUserMsgPrefsCtrl> dtor entered.";
+  setView(0);
+  Debug << "<avdUserMsgPrefsCtrl> dtor done.";
+}
+void avdUserMsgPrefsCtrl::setup()
+{
+  Debug << "<avdUserMsgPrefsCtrl::setup()>.";
+
+  if(!getUserMsgPrefsView()){
+    Error << "Can't obtain user message preferences viewer.";
+  } else {
+    QSettings settings;
+    settings.setPath("Avida", AVIDA_VERSION);
+    settings.beginGroup("/avdUserMsgPrefs");
+    { int saved_lines = settings.readNumEntry("/saved_lines", 1000);
+      if((saved_lines < 5) || (1000 < saved_lines)) saved_lines = 1000;
+      setSavedLines(saved_lines);
+      getUserMsgPrefsView()->spinBox()->setValue(savedLines()); }
+    { QString console_font_str
+        = settings.readEntry("/console_font", QApplication::font().toString());
+      QFont console_font;
+      bool font_available = console_font.fromString(console_font_str);
+      setConsoleFont(console_font);
+    }
+    settings.endGroup();
+
+    for(
+      avdMessageSetTrackerIterator
+      stit = avdMessageSetTracker::Instance().begin(),
+      stend = avdMessageSetTracker::Instance().end()
+    ; stit != stend; ++stit){
+      Debug << stit->first << ":" << stit->second->size();
+      avdMsgModuleLVI *mmlvi = new avdMsgModuleLVI(getUserMsgPrefsView()->listView(), stit->first);
+      for(
+        avdMessageTypeIterator
+        tit = stit->second->begin(),
+        tend = stit->second->end()
+      ; tit != tend; ++tit){
+        Debug << "  " << tit->first;
+        avdMsgTypeLVI *mtcli = new avdMsgTypeLVI(mmlvi, stit->first, tit->first, *tit->second);
+      }
+    }
+  }
+}
+void avdUserMsgPrefsCtrl::consoleFontFunctor(const avdUserMsgCtrl &user_msg_ctrl){
+  Debug << "<avdUserMsgPrefsCtrl::consoleFontFunctor(...)> entered.";
+  user_msg_ctrl.getView()->textEdit()->setCurrentFont(consoleFont());
+  Debug << "<avdUserMsgPrefsCtrl::consoleFontFunctor(...)> done.";
+}
+void avdUserMsgPrefsCtrl::savedLinesFunctor(const avdUserMsgCtrl &user_msg_ctrl){
+  Debug << "<avdUserMsgPrefsCtrl::savedLinesFunctor(const avdUserMsgCtrl &)> entered.";
+  user_msg_ctrl.setSavedLines(savedLines());
+  Debug << "<avdUserMsgPrefsCtrl::savedLinesFunctor(...)> done.";
+}
+void avdUserMsgPrefsCtrl::requestUserMsgPrefsSlot(const avdUserMsgCtrl &ctrl){
+  consoleFontFunctor(ctrl);
+  savedLinesFunctor(ctrl);
+}
+void avdUserMsgPrefsCtrl::fontBtnClickedSlot(){
+  Debug << "<avdUserMsgPrefsCtrl::fontBtnClickedSlot()>";
+  bool ok;
+  QFont console_font = QFontDialog::getFont(&ok, consoleFont(), getView());
+  if(ok){
+    QSettings settings;
+    settings.setPath("Avida", AVIDA_VERSION);
+    settings.writeEntry("/avdUserMsgPrefs/console_font", console_font.toString());
+    setConsoleFont(console_font);
+    avdUserMsgCtrlFunct funct(this, &avdUserMsgPrefsCtrl::consoleFontFunctor);
+    emit(userMsgPrefsChangedSig(funct));
+  }
+  Debug << "<avdUserMsgPrefsCtrl::fontBtnClickedSlot()> done.";
+}
+void avdUserMsgPrefsCtrl::spinBoxValueChangedSlot(int value){
+  Debug << "<avdUserMsgPrefsCtrl::spinBoxValueChangedSlot()>";
+  setSavedLines(value);
+  QSettings settings;
+  settings.setPath("Avida", AVIDA_VERSION);
+  settings.writeEntry("/avdUserMsgPrefs/saved_lines", savedLines());
+  avdUserMsgCtrlFunct funct(this, &avdUserMsgPrefsCtrl::savedLinesFunctor);
+  emit(userMsgPrefsChangedSig(funct));
+  Debug << "<avdUserMsgPrefsCtrl::spinBoxValueChangedSlot()> done.";
+}
+
+// arch-tag: implementation file for user debug-message display gui preferences controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.hh:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_ctrl.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,92 @@
+#ifndef AVD_USER_MSG_PREFS_CTRL_HH
+#define AVD_USER_MSG_PREFS_CTRL_HH
+
+#ifndef QFONT_H
+#include <qfont.h>
+#endif
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+#ifndef AVD_USER_MSG_CTRL_FUNCT_HH
+#include "avd_user_msg_ctrl_funct.hh"
+#endif
+
+
+
+class avdMessageType;
+class avdMsgModuleLVI : public QListViewItem, public cRetainable
+{
+public:
+  avdMsgModuleLVI(
+    QListView *parent,
+    QString label                 // e.g. 'UsrMsgSys'
+  );
+};
+class avdMsgTypeLVI : public QListViewItem, public cRetainable {
+public:
+  avdMsgTypeLVI(
+    avdMsgModuleLVI *parent,
+    const QString &parent_text,   // e.g. 'UsrMsgSys'
+    const QString &text,          // e.g. 'Debug'
+    avdMessageType &mt
+  );
+};
+class avdMsgCnfgCLI : public QCheckListItem, public cRetainable {
+protected:
+  bool &m_flag;
+  QString m_key;
+protected:
+  virtual void stateChange(bool state);
+public:
+  avdMsgCnfgCLI(
+    avdMsgTypeLVI *parent,
+    const QString &text,
+    const QString &key,
+    bool &flag
+  );
+};
+
+class avdPrefsItemView;
+class avdUserMsgCtrl;
+class avdUserMsgPrefsView;
+class avdUserMsgPrefsCtrl : public QObject, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<avdUserMsgPrefsView> m_view;
+  QFont m_console_font;
+  int m_saved_lines;
+public:
+  void setView(avdUserMsgPrefsView *);
+  void setConsoleFont(QFont console_font);
+  void setSavedLines(int saved_lines){ m_saved_lines = saved_lines; }
+
+  QWidget *getView();
+  avdUserMsgPrefsView *getUserMsgPrefsView();
+  QFont consoleFont() const { return m_console_font; }
+  int savedLines(){ return m_saved_lines; }
+public:
+  avdUserMsgPrefsCtrl(QObject *parent = 0, const char *name = 0);
+  ~avdUserMsgPrefsCtrl();
+  void setup();
+  void consoleFontFunctor(const avdUserMsgCtrl &user_msg_ctrl);
+  void savedLinesFunctor(const avdUserMsgCtrl &user_msg_ctrl);
+public slots:
+  void requestUserMsgPrefsSlot(const avdUserMsgCtrl &);
+  void fontBtnClickedSlot();
+  void spinBoxValueChangedSlot(int value);
+signals:
+  void userMsgPrefsChangedSig(avdUserMsgCtrlFunct &funct);
+};
+
+#endif
+
+// arch-tag: header file for user debug-message display gui preferences controller
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_gui.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_gui.cc:1.2
--- /dev/null	Mon Dec 29 14:55:21 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_gui.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,71 @@
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+#ifndef AVD_ABSTRACT_PREFS_GUI_HH
+#include "prefs_gui_factory/avd_abstract_prefs_gui.hh"
+#endif
+#ifndef AVD_CONNECTIONS_HH
+#include "mc/avd_connections.hh"
+#endif
+#ifndef AVD_MC_MEDIATOR_HH
+#include "mc/avd_mc_mediator.hh"
+#endif
+#ifndef AVD_PREFS_GUI_FACTORY_HH
+#include "prefs_gui_factory/avd_prefs_gui_factory.hh"
+#endif
+#ifndef AVD_SETTINGS_MEDIATOR_HH
+#include "mc/avd_settings_mediator.hh"
+#endif
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#include "avd_user_msg_gui_dbg.hh"
+#endif
+#ifndef AVD_USER_MSG_PREFS_CTRL_HH
+#include "avd_user_msg_prefs_ctrl.hh"
+#endif
+#ifndef TPREFSGUI_HH
+#include "prefs_gui_factory/tPrefsGUI.hh"
+#endif
+
+
+template <class avdUserMsgPrefsCtrl> class pUserMsgPrefsConnections {
+protected:
+  void setupConnections(avdMCMediator *med, avdUserMsgPrefsCtrl *ctrl){
+    Debug << "<pUserMsgPrefsConnections> entered.";
+    QObject::connect(
+      ctrl, SIGNAL(userMsgPrefsChangedSig(avdUserMsgCtrlFunct &)),
+      med->getSettingsMediator(),
+      SIGNAL(userMsgPrefsChangedSig(avdUserMsgCtrlFunct &)));
+    QObject::connect(
+      med->getSettingsMediator(),
+      SIGNAL(requestUserMsgPrefsSig(const avdUserMsgCtrl &)),
+      ctrl, SLOT(requestUserMsgPrefsSlot(const avdUserMsgCtrl &)));
+} };
+
+typedef tPrefsGUI<avdUserMsgPrefsCtrl, pUserMsgPrefsConnections> avdUserMsgPrefsGUI;
+
+namespace {
+  avdAbstractPrefsCtrl *createUserMsgPrefsGUI(){
+    Debug << "in createUserMsgPrefsGUI()...";
+    avdUserMsgPrefsGUI *g = new avdUserMsgPrefsGUI(0, "<avdUserMsgPrefsGUI>");
+    if(!g)
+    { Error << "can't create avdUserMsgPrefsGUI.";
+      return 0; }
+    Debug << "avdUserMsgPrefsGUI *g created ok.";
+    g->nameWatched("<avdUserMsgPrefsGUI>");
+    Debug << "named *g.";
+    if(!g->getCtrl())
+    { Error << "can't create avdUserMsgPrefsCtrl.";
+      g->release();
+      return 0; }
+    Debug << "avdUserMsgPrefsCtrl g->getCtrl() is ok.";
+    g->getCtrl()->nameWatched("<avdUserMsgPrefsCtrl>");
+    Debug << "named g->getCtrl().  finishing happy.";
+    return g;
+  }
+  QString s_key("avdUserMsgPrefsGUI");
+  const bool s_registered =
+    avdPrefsControllerFactory::Instance().Register(s_key, createUserMsgPrefsGUI);
+}
+
+// arch-tag: implementation file for user debug-message display preferences gui factory
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,70 @@
+#ifndef QLABEL_H
+#include <qlabel.h>
+#endif
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QLISTVIEW_H
+#include <qlistview.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QSPINBOX_H
+#include <qspinbox.h>
+#endif
+#ifndef QTABWIDGET_H
+#include <qtabwidget.h>
+#endif
+
+#ifndef AVD_USER_MSG_GUI_DBG_HH
+#include "avd_user_msg_gui_dbg.hh"
+#endif
+
+#ifndef AVD_USER_MSG_PREFS_VIEW_HH
+#include "avd_user_msg_prefs_view.hh"
+#endif
+
+avdUserMsgPrefsView::avdUserMsgPrefsView(
+  QWidget *parent, const char *name, WFlags f)
+:avdPrefsItemView(parent, name, f){
+  Debug << "<avdUserMsgPrefsView> ctor...";
+  QVBoxLayout *layout = new QVBoxLayout
+  ( this, 0, -1, "<avdUserMsgPrefsView(layout)>");
+    QTabWidget *tab_widget = new QTabWidget
+    ( this, "<avdUserMsgPrefsView(tab_widget)>");
+    layout->addWidget(tab_widget);
+      QWidget *console_cfg = new QWidget
+      ( tab_widget, "<avdUserMsgPrefsView(console_cfg)>");
+      QVBoxLayout *console_layout = new QVBoxLayout
+      ( console_cfg, 0, -1, "<avdUserMsgPrefsView(console_layout)>");
+      tab_widget->addTab(console_cfg, "Appearance");
+        QHBoxLayout *spinbox_layout = new QHBoxLayout
+        ( console_layout, -1, "<avdUserMsgPrefsView(spinbox_layout)>");
+          QLabel *spinbox_label = new QLabel
+          ( "saved lines (25-1000):", console_cfg, "<avdUserMsgPrefsView(spinbox_label)>");
+          spinbox_layout->addWidget(spinbox_label);
+          m_spin_box = new QSpinBox
+          ( 25, 1000, 5, console_cfg, "<avdUserMsgPrefsView(m_spin_box)>");
+          spinbox_layout->addWidget(m_spin_box);
+        QHBoxLayout *fontbtn_layout = new QHBoxLayout
+        ( console_layout, -1, "<avdUserMsgPrefsView(fontbtn_layout)>");
+          m_font_btn = new QPushButton
+          ( "Choose font...", console_cfg, "<avdUserMsgPrefsView(m_font_btn)>");
+          fontbtn_layout->addWidget(m_font_btn);
+          QLabel *fontbtn_label = new QLabel
+          ( console_cfg, "<avdUserMsgPrefsView(fontbtn_label)>");
+          fontbtn_layout->addWidget(fontbtn_label);
+      QWidget *dbg_cfg = new QWidget
+      ( tab_widget, "<avdUserMsgPrefsView(dbg_cfg)>");
+      QVBoxLayout *dbg_layout = new QVBoxLayout
+      ( dbg_cfg, 0, -1, "<avdUserMsgPrefsView(dbg_layout)>");
+      tab_widget->addTab(dbg_cfg, "Debugging");
+        m_list_view = new QListView
+        ( dbg_cfg, "<avdUserMsgPrefsView(m_list_view)>");
+        dbg_layout->addWidget(m_list_view);
+        m_list_view->addColumn("Software Module");
+  Debug << "<avdUserMsgPrefsView> ctor done.";
+}
+
+// arch-tag: implementation file for user debug-message display preferences view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_prefs_view.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,30 @@
+#ifndef AVD_USER_MSG_PREFS_VIEW_HH
+#define AVD_USER_MSG_PREFS_VIEW_HH
+
+#ifndef AVD_PREFS_ITEM_VIEW_HH
+#include "preferences/avd_prefs_item_view.hh"
+#endif
+
+class QListView;
+class QPushButton;
+class QSpinBox;
+class avdUserMsgPrefsView : public avdPrefsItemView {
+  Q_OBJECT
+protected:
+  QListView *m_list_view;
+  QPushButton *m_font_btn;
+  QSpinBox *m_spin_box;
+public:
+  explicit avdUserMsgPrefsView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = 0
+  );
+  QListView *listView(){ return m_list_view; }
+  QPushButton *fontBtn(){ return m_font_btn; }
+  QSpinBox *spinBox(){ return m_spin_box; }
+};
+
+#endif
+
+// arch-tag: header file for user debug-message display preferences view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,29 @@
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QLINEEDIT_H
+#include <qlineedit.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QTEXTEDIT_H
+#include <qtextedit.h>
+#endif
+
+#ifndef AVD_USER_MSG_VIEW_HH
+#include "avd_user_msg_view.hh"
+#endif
+
+
+avdUserMsgView::avdUserMsgView(QWidget *parent, const char *name, WFlags f)
+:QMainWindow(parent, name, f){
+  QWidget *central = new QWidget(this, "<avdUserMsgView(central)>");
+  setCentralWidget(central);
+  QVBoxLayout *layout = new QVBoxLayout(central, 10, -1, "<avdUserMsgView(layout)>");
+  m_text_edit = new QTextEdit(central, "<avdUserMsgView::m_text_edit>");
+  m_text_edit->setReadOnly(true);
+  layout->addWidget(m_text_edit);
+}
+
+// arch-tag: implementation file for user debug-message display view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/avd_user_msg_view.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,32 @@
+#ifndef AVD_USER_MSG_VIEW_HH
+#define AVD_USER_MSG_VIEW_HH
+
+#ifndef QGUARDEDPTR_H
+#include <qguardedptr.h>
+#endif
+#ifndef QMAINWINDOW_H
+#include <qmainwindow.h>
+#endif
+#ifndef RETAINABLE_HH
+#include "memory_mgt/retainable.hh"
+#endif
+
+class QLineEdit;
+class QPushButton;
+class QTextEdit;
+class avdUserMsgView : public QMainWindow, public cRetainable {
+  Q_OBJECT
+protected:
+  QGuardedPtr<QTextEdit> m_text_edit;
+public:
+  avdUserMsgView(
+    QWidget *parent = 0,
+    const char *name = 0,
+    WFlags f = WType_TopLevel
+  );
+  QTextEdit *textEdit(){ return m_text_edit; }
+};
+
+#endif
+
+// arch-tag: header file for user debug-message display view
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/gui_message_display.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/gui_message_display.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/gui_message_display.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 1993 - 2001 California Institute of Technology
+//
+// Read the COPYING and README files, or contact 'avida at alife.org',
+// before continuing.  SOME RESTRICTIONS MAY APPLY TO USE OF THIS FILE.
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef STRING_HH
+#include "tools/string.hh"
+#endif
+#ifndef MESSAGE_DISPLAY_HH
+#include "tools/message_display.hh"
+#endif
+
+#include <qstring.h>
+
+
+using namespace std;
+
+
+cMessageClosure &
+cMessageClosure::operator<<(const QString &s){
+  prefix();
+  if(QString::null == s){
+    _msg += "(null)";
+  } else {
+    _msg += s.latin1();
+  }
+  return *this;
+}
+
+// arch-tag: implementation file for old debug-message display of QStrings
Index: avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/user_msg.pri
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/user_msg.pri:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup/user_msg/user_msg.pri	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,29 @@
+
+user_msg {
+  HEADERS += \
+    $$USER_MSG_HH/avd_message_display.hh \
+    $$USER_MSG_HH/avd_message_display_proto.hh \
+    $$USER_MSG_HH/avd_message_display_typetrack.hh \
+    $$USER_MSG_HH/avd_message_display_typetrack_proto.hh \
+    $$USER_MSG_HH/avd_user_msg_gui_dbg.hh \
+    $$USER_MSG_HH/avd_user_msg_gui_dbg_proto.hh \
+    $$USER_MSG_HH/avd_user_msg_ctrl_funct.hh \
+    $$USER_MSG_HH/avd_user_msg_ctrl_funct_proto.hh \
+    $$USER_MSG_HH/avd_user_msg_ctrl.hh \
+    $$USER_MSG_HH/avd_user_msg_view.hh \
+    $$USER_MSG_HH/avd_user_msg_prefs_ctrl.hh \
+    $$USER_MSG_HH/avd_user_msg_prefs_view.hh
+
+  SOURCES += \
+    $$USER_MSG_CC/avd_message_display.cc \
+    $$USER_MSG_CC/avd_qstr_message_display.cc \
+    $$USER_MSG_CC/avd_user_msg_gui.cc \
+    $$USER_MSG_CC/avd_user_msg_view.cc \
+    $$USER_MSG_CC/avd_user_msg_ctrl.cc \
+    $$USER_MSG_CC/gui_message_display.cc \
+    $$USER_MSG_CC/avd_user_msg_prefs_gui.cc \
+    $$USER_MSG_CC/avd_user_msg_prefs_view.cc \
+    $$USER_MSG_CC/avd_user_msg_prefs_ctrl.cc
+}
+
+# arch-tag: qmake include file for user message display module
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/CMakeLists.txt
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/CMakeLists.txt:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/CMakeLists.txt	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,337 @@
+INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FixFindQt.cmake)
+
+IF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+  INCLUDE_DIRECTORIES(
+    ${ALL_INC_DIRS}
+    ${THIRDPARTY_SRC_DIR}/Loki
+    ${THIRDPARTY_SRC_DIR}/trio
+    ${QT_INCLUDE_DIR}
+    ${QT_INCLUDE_PATH}
+    .
+  )
+  LINK_DIRECTORIES(
+    ${ALL_LIB_DIRS}
+    ${THIRDPARTY_BLD_DIR}/trio
+    .
+  )
+  
+  SET(libxqtviewer_a_SOURCES
+#    analyzer/avd_n_analyzer_ctrl.cc
+#    analyzer/avd_n_analyzer_data_entry_command_list_item.cc
+#    analyzer/avd_n_analyzer_genotype_sel_view.cc
+#    analyzer/avd_n_analyzer_gui.cc
+#    analyzer/avd_n_analyzer_listview.cc
+#    analyzer/avd_n_analyzer_mdl.cc
+#    analyzer/avd_n_analyzer_menubar_handler.cc
+#    analyzer/avd_n_analyzer_out_fmt_sel.cc
+#    analyzer/avd_n_analyzer_view.cc
+#    analyzer_o/avd_analyzer_controller.cc
+#    analyzer_o/avd_analyzer_controller_data.cc
+#    analyzer_o/avd_analyzer_creator.cc
+#    analyzer_o/avd_analyzer_data_entry_command_list_item.cc
+#    analyzer_o/avd_analyzer_dbg_msgs.cc
+#    analyzer_o/avd_analyzer_listview.cc
+#    analyzer_o/avd_analyzer_menubar_handler.cc
+#    analyzer_o/avd_analyzer_model.cc
+#    analyzer_o/avd_analyzer_output_fmt_selector.cc
+#    analyzer_o/avd_analyzer_view.cc
+#    dumb_gui/avd_dumb_ctrl.cc
+#    dumb_gui/avd_dumb_gui.cc
+#    dumb_gui/avd_dumb_view.cc
+#    exp_gui/avd_exp_ctrl.cc
+#    exp_gui/avd_exp_gui.cc
+#    exp_gui/avd_exp_view.cc
+#    exp_gui/test_thing.cc
+#    gui_factory/avd_gui_factory.cc
+#    map_gui/avd_map_canvas.cc
+#    map_gui/avd_map_canvas_rectangle.cc
+#    map_gui/avd_map_canvas_view.cc
+#    map_gui/avd_map_ctrl.cc
+#    map_gui/avd_map_gui.cc
+#    map_gui/avd_map_layer.cc
+#    map_gui/avd_map_view.cc
+#    mc/avd_connections.cc
+#    mc/avd_mc_dbg.cc
+#    mc/avd_mc_mediator.cc
+#    mc/avd_mission_control.cc
+#    mc/setup_avida.cc
+#    memory_mgt/retainable.cc
+#    memory_mgt/watch_retains.cc
+#    menubar/avd_menubar_handler.cc
+#    menubar/avd_menubar_hdlr_creator.cc
+#    preferences/avd_prefs_ctrl.cc
+#    preferences/avd_prefs_dbg.cc
+#    preferences/avd_prefs_gui.cc
+#    preferences/avd_prefs_item.cc
+#    preferences/avd_prefs_view.cc
+#    prefs_gui_factory/avd_prefs_gui_factory.cc
+#    threaded_driver/avd_avida_driver.cc
+#    threaded_driver/avd_driver_creator.cc
+#    threaded_driver/avd_orig_driver_controller.cc
+    avd_dbg_msgs.cc
+    avd_message_class.cc
+    avd_message_closure.cc
+    avd_message_display.cc
+    avd_message_set_tracker.cc
+    avd_message_type.cc
+    avd_verifiable.cc
+#    user_msg/avd_qstr_message_display.cc
+#    user_msg/avd_user_msg_ctrl.cc
+#    user_msg/avd_user_msg_gui.cc
+#    user_msg/avd_user_msg_prefs_ctrl.cc
+#    user_msg/avd_user_msg_prefs_gui.cc
+#    user_msg/avd_user_msg_prefs_view.cc
+#    user_msg/avd_user_msg_view.cc
+#    user_msg/gui_message_display.cc
+  )
+  
+  SET(libxqtviewer_moc_a_MOC_SOURCES
+#    analyzer/avd_n_analyzer_batchlist_item.hh
+#    analyzer/avd_n_analyzer_batchlist_item_proto.hh
+#    analyzer/avd_n_analyzer_ctrl.hh
+#    analyzer/avd_n_analyzer_data_entry.hh
+#    analyzer/avd_n_analyzer_data_entry_command_list_item.hh
+#    analyzer/avd_n_analyzer_data_entry_command_list_item_proto.hh
+#    analyzer/avd_n_analyzer_data_entry_proto.hh
+#    analyzer/avd_n_analyzer_dbg_msgs.hh
+#    analyzer/avd_n_analyzer_dbg_msgs_proto.hh
+#    analyzer/avd_n_analyzer_genotype_list_item.hh
+#    analyzer/avd_n_analyzer_genotype_list_item_proto.hh
+#    analyzer/avd_n_analyzer_genotype_sel_ctrl.hh
+#    analyzer/avd_n_analyzer_genotype_sel_view.hh
+#    analyzer/avd_n_analyzer_listview.hh
+#    analyzer/avd_n_analyzer_mdl.hh
+#    analyzer/avd_n_analyzer_mdl_proto.hh
+#    analyzer/avd_n_analyzer_menubar_handler.hh
+#    analyzer/avd_n_analyzer_out_fmt_sel.hh
+#    analyzer/avd_n_analyzer_view.hh
+#    analyzer_o/avd_analyzer_batchlist_item.hh
+#    analyzer_o/avd_analyzer_batchlist_item_proto.hh
+#    analyzer_o/avd_analyzer_controller.hh
+#    analyzer_o/avd_analyzer_controller_data.hh
+#    analyzer_o/avd_analyzer_creator.hh
+#    analyzer_o/avd_analyzer_data_entry.hh
+#    analyzer_o/avd_analyzer_data_entry_command_list_item.hh
+#    analyzer_o/avd_analyzer_data_entry_command_list_item_proto.hh
+#    analyzer_o/avd_analyzer_data_entry_proto.hh
+#    analyzer_o/avd_analyzer_dbg_msgs.hh
+#    analyzer_o/avd_analyzer_dbg_msgs_proto.hh
+#    analyzer_o/avd_analyzer_genotype_list_item.hh
+#    analyzer_o/avd_analyzer_genotype_list_item_proto.hh
+#    analyzer_o/avd_analyzer_listview.hh
+#    analyzer_o/avd_analyzer_listview_proto.hh
+#    analyzer_o/avd_analyzer_menubar_handler.hh
+#    analyzer_o/avd_analyzer_model.hh
+#    analyzer_o/avd_analyzer_model_proto.hh
+#    analyzer_o/avd_analyzer_output_fmt_selector.hh
+#    analyzer_o/avd_analyzer_utils.hh
+#    analyzer_o/avd_analyzer_view.hh
+#    containers/tRetainable_list.hh
+#    containers/tRetainable_list_proto.hh
+#    containers/tRList.hh
+#    containers/tRList_proto.hh
+#    dumb_gui/avd_dumb_ctrl.hh
+#    dumb_gui/avd_dumb_gui_dbg.hh
+#    dumb_gui/avd_dumb_gui_dbg_proto.hh
+#    dumb_gui/avd_dumb_view.hh
+#    exp_gui/avd_exp_ctrl.hh
+#    exp_gui/avd_exp_gui_dbg.hh
+#    exp_gui/avd_exp_gui_dbg_proto.hh
+#    exp_gui/avd_exp_view.hh
+#    exp_gui/test_thing.hh
+#    exp_gui/test_thing_proto.hh
+#    exp_gui/testing_interface.hh
+#    gui_factory/avd_abstract_gui.hh
+#    gui_factory/avd_abstract_gui_proto.hh
+#    gui_factory/avd_gui_factory.hh
+#    gui_factory/avd_gui_factory_error_policy.hh
+#    gui_factory/avd_gui_factory_proto.hh
+#    gui_factory/tGUI.hh
+#    gui_factory/tGUI_proto.hh
+#    map_gui/avd_map_canvas.hh
+#    map_gui/avd_map_canvas_rectangle.hh
+#    map_gui/avd_map_canvas_rectangle_proto.hh
+#    map_gui/avd_map_canvas_view.hh
+#    map_gui/avd_map_ctrl.hh
+#    map_gui/avd_map_gui_dbg.hh
+#    map_gui/avd_map_gui_dbg_proto.hh
+#    map_gui/avd_map_layer.hh
+#    map_gui/avd_map_layer_proto.hh
+#    map_gui/avd_map_view.hh
+#    mc/attributes/requests_argv.hh
+#    mc/avd_avida_state_mediator.hh
+#    mc/avd_connections.hh
+#    mc/avd_gui_factory_mediator.hh
+#    mc/avd_mc_dbg.hh
+#    mc/avd_mc_dbg_proto.hh
+#    mc/avd_mc_mediator.hh
+#    mc/avd_menubar_mediator.hh
+#    mc/avd_mission_control.hh
+#    mc/avd_settings_mediator.hh
+#    mc/avd_windows_mediator.hh
+#    mc/setup_avida.hh
+#    memory_mgt/activate_watcher.hh
+#    memory_mgt/activate_watcher_proto.hh
+#    memory_mgt/retainable.hh
+#    memory_mgt/retainable_dbg.hh
+#    memory_mgt/retainable_dbg_proto.hh
+#    memory_mgt/retainable_proto.hh
+#    memory_mgt/watch_retains.hh
+#    memory_mgt/watch_retains_proto.hh
+#    menubar/avd_menubar_handler.hh
+#    preferences/avd_prefs_ctrl.hh
+#    preferences/avd_prefs_dbg.hh
+#    preferences/avd_prefs_dbg_proto.hh
+#    preferences/avd_prefs_item.hh
+#    preferences/avd_prefs_item_proto.hh
+#    preferences/avd_prefs_item_view.hh
+#    preferences/avd_prefs_item_view_proto.hh
+#    preferences/avd_prefs_view.hh
+#    prefs_gui_factory/avd_abstract_prefs_gui.hh
+#    prefs_gui_factory/avd_abstract_prefs_gui_proto.hh
+#    prefs_gui_factory/avd_prefs_gui_factory.hh
+#    prefs_gui_factory/avd_prefs_gui_factory_error_policy.hh
+#    prefs_gui_factory/avd_prefs_gui_factory_proto.hh
+#    prefs_gui_factory/tPrefsGUI.hh
+#    prefs_gui_factory/tPrefsGUI_proto.hh
+#    threaded_driver/avd_avida_driver.hh
+#    threaded_driver/avd_avida_thread_drvr_dbg.hh
+#    threaded_driver/avd_avida_thread_drvr_dbg_proto.hh
+#    threaded_driver/avd_gui_msg_event.hh
+#    threaded_driver/avd_orig_driver_controller.hh
+    avd_message_display.hh
+#    avd_message_display_proto.hh
+#    user_msg/avd_message_display_typetrack.hh
+#    user_msg/avd_message_display_typetrack_proto.hh
+#    user_msg/avd_user_msg_ctrl.hh
+#    user_msg/avd_user_msg_ctrl_funct.hh
+#    user_msg/avd_user_msg_ctrl_funct_proto.hh
+#    user_msg/avd_user_msg_gui_dbg.hh
+#    user_msg/avd_user_msg_gui_dbg_proto.hh
+#    user_msg/avd_user_msg_prefs_ctrl.hh
+#    user_msg/avd_user_msg_prefs_view.hh
+#    user_msg/avd_user_msg_view.hh
+  )
+  
+#  SET(libxqtviewer_ui_a_UI_SOURCES
+#  )
+  
+  QT_WRAP_CPP(xqtviewer_moc
+    libxqtviewer_moc_a_SOURCES
+    libxqtviewer_moc_a_MOC_SOURCES
+  )
+#  QT_WRAP_UI(xqtviewer_ui
+#    libxqtviewer_ui_a_HEADERS
+#    libxqtviewer_ui_a_SOURCES
+#    libxqtviewer_ui_a_UI_SOURCES
+#  )
+  ADD_LIBRARY(xqtviewer_moc ${libxqtviewer_moc_a_SOURCES})
+#  ADD_LIBRARY(xqtviewer_ui ${libxqtviewer_ui_a_SOURCES})
+  ADD_LIBRARY(xqtviewer ${libxqtviewer_a_SOURCES})
+  
+  SET(Avida_SOURCES main.cc)
+  SET(Avida_LIBRARIES
+    xqtviewer
+    main
+    cpu
+    event
+    main
+    tools
+    trio
+    xqtviewer_moc
+#    xqtviewer_ui
+    ${QT_LIBRARIES}
+  )
+#  CREATE_QT_EXECUTABLE(Avida Avida_SOURCES Avida_LIBRARIES /)
+ENDIF(_QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+
+SET(EXECUTABLE_OUTPUT_PATH "")
+
+IF(_UNIT_TEST_QT_EXP_GUI AND _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+  INCLUDE_DIRECTORIES(
+    ${ALL_INC_DIRS}
+    ${GUI_SRC_DIR}
+    ${THIRDPARTY_SRC_DIR}
+    ${THIRDPARTY_SRC_DIR}/Loki
+    ${THIRDPARTY_SRC_DIR}/trio
+    ${THIRDPARTY_SRC_DIR}/yaktest
+    ${QT_INCLUDE_DIR}
+    ${QT_INCLUDE_PATH}
+    .
+  )
+  LINK_DIRECTORIES(
+    ${ALL_LIB_DIRS}
+    ${THIRDPARTY_BLD_DIR}/mockpp
+    ${THIRDPARTY_BLD_DIR}/trio
+    ${THIRDPARTY_BLD_DIR}/yaktest
+    .
+  )
+
+  SET(QT_TESTSUITES
+  	template_t
+#  	template2_t
+  ) 
+  STRING(REGEX REPLACE _t _t.hh\; TESTSUITE_MOCSRCS ${QT_TESTSUITES})
+  SET(libxqtunittest_a_SOURCES
+#    avd_message_closure_m.cc
+#    avd_message_display_m.cc
+    xqt_test_case.cc
+  )
+  SET(libxqtunittest_moc_a_MOC_SOURCES
+    xqt_test_case.hh
+    ${TESTSUITE_MOCSRCS}
+  )
+  QT_WRAP_CPP(xqtunittest_moc
+    libxqtunittest_moc_a_SOURCES
+    libxqtunittest_moc_a_MOC_SOURCES
+  )
+  ADD_LIBRARY(xqtunittest_moc ${libxqtunittest_moc_a_SOURCES})
+  ADD_LIBRARY(xqtunittest ${libxqtunittest_a_SOURCES})
+
+  FOREACH(TESTSUITE ${QT_TESTSUITES})
+    ADD_EXECUTABLE(${TESTSUITE} ${TESTSUITE}.cc)
+    TARGET_LINK_LIBRARIES(${TESTSUITE}
+      xqtviewer
+      main
+      cpu
+      event
+      main
+      tools
+      trio
+      mockpp
+      yaktest
+      xqtviewer_moc
+#      xqtviewer_ui
+      xqtunittest
+      xqtunittest_moc
+      ${QT_LIBRARIES}
+    )
+    ADD_TEST(${TESTSUITE} ${TESTSUITE})
+  ENDFOREACH(TESTSUITE)
+
+  SET(TESTSUITES
+    demo_base_t
+#    avd_message_display_t
+#    avd_message_class_t
+#    avd_message_type_t
+#    avd_message_closure_t
+#    avd_dbg_msgs_t
+    avd_verifiable_t
+  ) 
+  FOREACH(TESTSUITE ${TESTSUITES})
+    ADD_EXECUTABLE(${TESTSUITE} ${TESTSUITE}.cc)
+    TARGET_LINK_LIBRARIES(${TESTSUITE}
+      xqtviewer
+      main
+      cpu
+      event
+      main
+      tools
+      trio
+      mockpp
+      yaktest
+    )
+    ADD_TEST(${TESTSUITE} ${TESTSUITE})
+  ENDFOREACH(TESTSUITE)
+ENDIF(_UNIT_TEST_QT_EXP_GUI AND _QT_EXPERIMENTAL_GRAPHIC_INTERFACE)
+
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_dbg_msgs.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_dbg_msgs.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_dbg_msgs.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,23 @@
+#ifndef AVD_DBG_MSGS_HH
+#define AVD_DBG_MSGS_HH
+
+#ifndef AVD_MESSAGE_CLOSURE_HH
+#include "avd_message_closure.hh"
+#endif
+#ifndef AVD_MESSAGE_TYPE_BASE_HH
+#include "avd_message_type_base.hh"
+#endif
+
+extern const avdMessageTypeBase             &Info_GEN_avdMsg;
+extern const avdMessageTypeBase            &Debug_GEN_avdMsg;
+extern const avdMessageTypeBase            &Error_GEN_avdMsg;
+extern const avdMessageTypeBase            &Fatal_GEN_avdMsg;
+#define avdInfo   AVD_INFO_MSG(avdMessageClosure, GEN)
+#define avdDebug AVD_DEBUG_MSG(avdMessageClosure, GEN)
+#define avdError AVD_ERROR_MSG(avdMessageClosure, GEN)
+#define avdFatal AVD_FATAL_MSG(avdMessageClosure, GEN)
+
+extern const avdMessageTypeBase &Plain_avdMsg;
+#define Message AVD_PLAIN_MSG(avdMessageClosure, Plain)
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,212 @@
+#ifndef AVD_MESSAGE_CLOSURE_HH
+#include "avd_message_closure.hh"
+#endif
+
+#ifndef AVD_MESSAGE_CLASS_BASE_HH
+#include "avd_message_class_base.hh"
+#endif 
+#ifndef AVD_MESSAGE_CLOSURE_BASE_HH
+#include "avd_message_closure_base.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_BASE_HH
+#include "avd_message_display_base.hh"
+#endif
+#ifndef AVD_MESSAGE_TYPE_BASE_HH
+#include "avd_message_type_base.hh"
+#endif
+
+#ifndef TRIO_TRIO_H
+#include "trio.h"
+#endif
+
+#ifndef _CPP_IOSTREAM
+#include <iostream>
+#endif
+
+using namespace std;
+
+// stub.
+avdMessageClosureBase &avdMessageClosure::operator<<(const QString &s)
+{ prefix(); return *this; }
+
+avdMessageClosure::avdMessageClosure(
+  const avdMessageTypeBase &type,
+  const char *function_name,
+  const char *file_name,
+  int line_number
+):m_type(type)
+, m_function(function_name)
+, m_file(file_name)
+, m_line(line_number)
+, m_error(INT_MAX)
+, m_op_count(0)
+{}
+avdMessageClosure::~avdMessageClosure(void){
+  if(!m_type.messageDisplay()){
+    cerr << "* Error in message display system *" << endl;
+    cerr << "* in class avdMessageClosure destructor *" << endl;
+    cerr << endl;
+    cerr << "Trying to display a message to the user, but my pointer to" << endl;
+    cerr << "my message-displayer doesn't point anywhere.  So I'm" << endl;
+    cerr << "going to send the message to the \"standard error\" device." << endl;
+    cerr << "Here's the message:" << endl;
+    cerr << endl;
+    cerr << m_msg << endl;
+    cerr << endl;
+    if(m_type.isFatal()) abort();
+  } else {
+    (*m_type.messageDisplay())->out(m_msg);
+    if(m_type.isFatal()) (*m_type.messageDisplay())->abort();
+  }
+}
+void avdMessageClosure::prefix(void){
+  if(m_op_count++ == 0 && !m_type.noPrefix()){
+    if(m_type.isPrefix()){
+      m_msg += m_type.typeName();
+      m_msg += '-';
+    }
+    m_msg += m_type.className();
+    if(!m_type.isPrefix()
+      ||m_type.showFunction()
+      ||m_type.showWhere()
+    ){
+      bool colon = false;
+      if(!m_type.isPrefix()){
+        m_msg += m_type.typeName();
+        m_msg += ": ";
+      }
+      if(m_type.showFunction() || m_type.showWhere()){
+        m_msg += "<";
+      }
+      if(m_type.showFunction()){
+        if(!m_function){
+          cerr << "* Error in message display system in *" << endl;
+          cerr << "* void avdMessageClosure::prefix() *" << endl;
+          cerr << endl;
+          cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+          cerr << "supposed to print the name of the function" << endl;
+          cerr << "from which the message originates, but I" << endl; 
+          cerr << "wasn't given the function name." << endl;
+          cerr << "But I'll try to print the rest of the message." << endl;
+        } else { m_msg += m_function; }
+        colon = true;
+      }
+      if(m_type.showWhere()){
+        if(colon){m_msg += ':';}
+        if(!m_file){
+          cerr << "* Error in message display system in *" << endl;
+          cerr << "* void avdMessageClosure::prefix() *" << endl;
+          cerr << endl;
+          cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+          cerr << "supposed to print the name of the file" << endl;
+          cerr << "from which the message originates, but I" << endl; 
+          cerr << "wasn't given the file name." << endl;
+          cerr << "But I'll try to print the rest of the message." << endl;
+        } else { m_msg += m_file; }
+        m_msg += ':';
+        // FIXME:  consider move this varargs gunk to cString.  -- kgn.
+        {
+          int size = trio_snprintf((char *) 0, 0, "%i", m_line);
+          char *buf = new char[size + 1];
+          //assert(buf != 0);
+          if(!buf){
+            cerr << "* Error in message display system in *" << endl;
+            cerr << "* void avdMessageClosure::prefix() *" << endl;
+            cerr << endl;
+            cerr << "I'm trying to prepare a message for you, and I'm" << endl;
+            cerr << "supposed to print the line number of the source-code" << endl;
+            cerr << "file from which the message originates, but I can't" << endl; 
+            cerr << "allocate enough space to print the line number." << endl;
+            cerr << "But I'll try to print the rest of the message." << endl;
+          } else {
+            trio_snprintf(buf, size+1, "%i", m_line);
+            m_msg += buf;
+            delete[] buf;
+          }
+        }
+      }
+      if(m_type.showFunction() || m_type.showWhere()){
+        m_msg += ">";
+      }
+      m_msg += ' ';
+    } else {
+      m_msg += ':';
+    }
+  }
+}
+avdMessageClosureBase &avdMessageClosure::operator<<(char c)
+{ prefix(); m_msg += c; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(unsigned char c)
+{ prefix(); m_msg += c; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(const char *s)
+{ prefix(); m_msg += s; return *this; }
+
+//avdMessageClosureBase &avdMessageClosure::operator<<(int i)
+//{ return va("%d", i); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(unsigned int i)
+//{ return va("%u", i); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(long i)
+//{ return va("%ld", i); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(unsigned long i)
+//{ return va("%lu", i); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(float f)
+//{ return va("%g", f); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(double f)
+//{ return va("%g", f); }
+//avdMessageClosureBase &avdMessageClosure::operator<<(const void *p)
+//{ return va("%p", p); }
+
+avdMessageClosureBase &avdMessageClosure::operator<<(int i)
+{ char buf[32]; trio_snprintf(buf, 32, "%d", i); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(unsigned int i)
+{ char buf[32]; trio_snprintf(buf, 32, "%u", i); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(long i)
+{ char buf[32]; trio_snprintf(buf, 32, "%ld", i); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(unsigned long i)
+{ char buf[32]; trio_snprintf(buf, 32, "%lu", i); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(float f)
+{ char buf[32]; trio_snprintf(buf, 32, "%g", f); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(double f)
+{ char buf[32]; trio_snprintf(buf, 32, "%g", f); m_msg += buf; return *this; }
+avdMessageClosureBase &avdMessageClosure::operator<<(const void *p)
+{ char buf[32]; trio_snprintf(buf, 32, "%p", p); m_msg += buf; return *this; }
+
+avdMessageClosureBase &avdMessageClosure::va(const char *fmt, ...)
+{
+  if(!fmt){
+    cerr << "* Error in message display system in *" << endl;
+    cerr << "* avdMessageClosure &avdMessageClosure::va(const char *, ...) *" << endl;
+    cerr << endl;
+    cerr << "I'm trying to prepare part of a message for you, but I" << endl; 
+    cerr << "nonsensical directions for printing this part of the message." << endl;
+    cerr << "But I'll try to print the rest of the message." << endl;
+
+    return *this;
+  }
+  va_list ap;
+
+  va_start(ap, fmt);
+  int size = trio_vsnprintf((char *) 0, 0, fmt, ap);
+  va_end(ap);
+
+  char *buf = new char[size + 1];
+  //assert(buf != 0);
+
+  if(!buf){
+    cerr << "* Error in message display system in *" << endl;
+    cerr << "* avdMessageClosure &avdMessageClosure::va(const char *, ...) *" << endl;
+    cerr << endl;
+    cerr << "I'm trying to prepare part of a message for you, but I can't" << endl; 
+    cerr << "allocate enough space to print this part of the message." << endl;
+    cerr << "But I'll try to print the rest of the message." << endl;
+  } else {
+    va_start(ap, fmt);
+    trio_vsnprintf(buf, size+1, fmt, ap);
+    va_end(ap);
+
+    prefix();
+    m_msg += buf;
+    delete[] buf;
+  }
+  return *this;
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure.hh	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,48 @@
+#ifndef AVD_MESSAGE_CLOSURE_HH
+#define AVD_MESSAGE_CLOSURE_HH
+
+#ifndef AVD_MESSAGE_CLOSURE_BASE_HH
+#include "avd_message_closure_base.hh"
+#endif
+
+#ifndef STRING_HH
+#include "string.hh"
+#endif
+
+class QString;
+class avdMessageTypeBase;
+class avdMessageClosure : public avdMessageClosureBase{
+protected:
+  const avdMessageTypeBase &m_type;
+  const char *m_function;
+  const char *m_file;
+  int m_line;
+  int m_error;
+  int m_op_count;
+  cString m_msg;
+public:
+  avdMessageClosure(
+    const avdMessageTypeBase &type,
+    const char *function_name,
+    const char *file_name,
+    int line_number
+  );
+  ~avdMessageClosure(void);
+public:
+  virtual avdMessageClosureBase &operator<<(char c);
+  virtual avdMessageClosureBase &operator<<(unsigned char c);
+  virtual avdMessageClosureBase &operator<<(const char *s);
+  virtual avdMessageClosureBase &operator<<(int i);
+  virtual avdMessageClosureBase &operator<<(unsigned int i);
+  virtual avdMessageClosureBase &operator<<(long i);
+  virtual avdMessageClosureBase &operator<<(unsigned long i);
+  virtual avdMessageClosureBase &operator<<(float f);
+  virtual avdMessageClosureBase &operator<<(double f);
+  virtual avdMessageClosureBase &operator<<(const void *p);
+  virtual avdMessageClosureBase &operator<<(const QString &s);
+
+  virtual avdMessageClosureBase &va(const char *fmt, ...);
+  virtual void prefix(void);
+};
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_closure_t.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,56 @@
+#ifndef AVD_MESSAGE_CLOSURE_HH
+#include "avd_message_closure.hh"
+#endif
+#ifndef AVD_MESSAGE_CLOSURE_M_HH
+#include "avd_message_closure_m.hh"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#include <iostream>
+
+using namespace std;
+
+class cMessageClassTest : public test_case {
+public: virtual void test() {
+  test_is_true(true);
+} };
+
+class cMessageTypeTest : public test_case {
+public: virtual void test() {
+  test_is_true(true);
+} };
+
+class cMessageClosureTest : public test_case {
+public: virtual void test() {
+  test_is_true(true);
+} };
+
+class cTestSuite : public test_case {
+public: cTestSuite() : test_case() {
+  adopt_test_case(new cMessageClassTest); 
+  adopt_test_case(new cMessageTypeTest); 
+  adopt_test_case(new cMessageClosureTest); 
+} };
+
+int main(int argc, char *argv[]){
+  cout << endl 
+  << "----------------------------------------" << endl
+  << "Testing avdMessageClass, avdMessageType, and avdMessageClosure." << endl;
+  cTestSuite t;
+  t.run_test();
+  cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.cc	Mon Dec 29 14:55:14 2003
@@ -0,0 +1,50 @@
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_BASE_HH
+#include "avd_message_display_base.hh"
+#endif
+
+#ifndef STRING_HH
+#include "string.hh"
+#endif
+
+#ifndef _CPP_IOSTREAM
+#include <iostream>
+#endif
+
+using namespace std;
+
+avdMessageDisplayBase *s_avd_info_display(&s_avd_info_msg_out);
+avdMessageDisplayBase *s_avd_debug_display(&s_avd_debug_msg_out);
+avdMessageDisplayBase *s_avd_error_display(&s_avd_error_msg_out);
+avdMessageDisplayBase *s_avd_fatal_display(&s_avd_fatal_msg_out);
+avdMessageDisplayBase *s_avd_plain_display(&s_avd_plain_msg_out);
+void setAvdInfoDisplay(avdMessageDisplayBase &md) { s_avd_info_display = &md; }
+void setAvdDebugDisplay(avdMessageDisplayBase &md) { s_avd_debug_display = &md; }
+void setAvdErrorDisplay(avdMessageDisplayBase &md) { s_avd_error_display = &md; }
+void setAvdFatalDisplay(avdMessageDisplayBase &md) { s_avd_fatal_display = &md; }
+void setAvdPlainDisplay(avdMessageDisplayBase &md) { s_avd_plain_display = &md; }
+
+void avdMessageDisplay::out(const cString &final_msg) const {
+  if(m_out){
+    *m_out << final_msg ; m_out->flush();
+  } else {
+    cerr << "* Error in message display system in method *" << endl;
+    cerr << "* \"void avdMessageDisplay::out(const cString &)\" *" << endl;
+    cerr << endl;
+    cerr << "Trying to display a message to the user, but my pointer to" << endl;
+    cerr << "the default output device doesn't point anywhere.  So I'm" << endl;
+    cerr << "going to send the message to the \"standard error\" device." << endl;
+    cerr << "Here's the message:" << endl;
+    cerr << endl;
+    cerr << final_msg << endl;
+    cerr << endl;
+  }
+}
+avdMessageDisplay s_avd_info_msg_out(&cout);
+avdMessageDisplay s_avd_debug_msg_out(&cout);
+avdMessageDisplay s_avd_error_msg_out(&cerr);
+avdMessageDisplay s_avd_fatal_msg_out(&cerr);
+avdMessageDisplay s_avd_plain_msg_out(&cout);
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,26 @@
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#define AVD_MESSAGE_DISPLAY_HH
+
+#ifndef _CPP_IOSTREAM
+#include <iostream>
+#endif
+
+#ifndef AVD_MESSAGE_DISPLAY_BASE_HH
+#include "avd_message_display_base.hh"
+#endif
+
+class cString;
+class avdMessageDisplay : public avdMessageDisplayBase {
+protected:
+  std::ostream *m_out;
+public:
+  avdMessageDisplay(std::ostream *stream):m_out(stream){}
+  void out(const cString &final_msg) const;
+};
+extern avdMessageDisplay s_avd_info_msg_out;
+extern avdMessageDisplay s_avd_debug_msg_out;
+extern avdMessageDisplay s_avd_error_msg_out;
+extern avdMessageDisplay s_avd_fatal_msg_out;
+extern avdMessageDisplay s_avd_plain_msg_out;
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_display_t.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,89 @@
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "avd_message_display.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_M_HH
+#include "avd_message_display_m.hh"
+#endif
+
+#ifndef STRING_HH
+#include "string.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#include <sys/types.h>
+#include <iostream>
+#include <regex.h>
+#include <string>
+#include <fstream>
+#include <set>
+
+using namespace std;
+
+char outbuf[5120];
+char errbuf[5120];
+
+class cMockCoutTest : public test_case {
+public: virtual void test() {
+  mockMessageDisplay md;
+  md.out("test\n");
+  md.out("fubar\n");
+  md.abort();
+} };
+
+class cCoutTest : public test_case {
+public: virtual void test() {
+  avdMessageDisplay md(&cout);
+  cout.flush();
+  md.out("test\n");
+  test_is_true(strncmp(outbuf, "test\n", 5) == 0);
+  cout.flush();
+  md.out("fubar\n");
+  test_is_true(strncmp(outbuf, "fubar\n", 6) == 0);
+} };
+
+class cCerrTest : public test_case {
+public: virtual void test() {
+  avdMessageDisplay md(&cerr);
+  cerr.flush();
+  md.out("test\n");
+  test_is_true(strncmp(errbuf, "test\n", 5) == 0);
+  md.out("fubar\n");
+  cerr.flush();
+  test_is_true(strncmp(errbuf, "fubar\n", 6) == 0);
+} };
+
+class cTestSuite : public test_case {
+public: cTestSuite() : test_case() {
+  adopt_test_case(new cMockCoutTest); 
+  adopt_test_case(new cCoutTest); 
+  adopt_test_case(new cCerrTest); 
+} };
+
+int
+main (int argc, char *argv[]) {
+// snippet adapted from dejagnu sources.
+#ifdef __STDC_HOSTED__
+  cout.rdbuf()->pubsetbuf(outbuf, 5120);
+  cerr.rdbuf()->pubsetbuf(errbuf, 5120);
+#else
+  cout.rdbuf()->setbuf(outbuf, 5120);
+  cerr.rdbuf()->setbuf(errbuf, 5120);
+#endif
+  
+  cout << endl 
+  << "----------------------------------------" << endl
+  << "Testing avdMessageDisplay and avdMessageDisplay." << endl;
+  cTestSuite t;
+  t.run_test();
+  cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,54 @@
+#ifndef AVD_MESSAGE_SET_TRACKER_HH
+#include "avd_message_set_tracker.hh"
+#endif
+
+#ifndef AVD_DBG_MSGS_HH
+#include "avd_dbg_msgs.hh"
+#endif
+#ifndef AVD_MESSAGE_TYPE_BASE_HH
+#include "avd_message_type_base.hh"
+#endif
+
+#include <iostream>
+
+using namespace std;
+
+/*
+A private namespace containing load-time initializations; these register
+the default error types with the avdMessageSetTracker singleton.  (The
+avdMessageSetTracker singleton is used in the GUI by the log window to
+keep track of how messages of a given type should be displayed).
+*/
+namespace {
+  class DebugMsgTypeSetRegistration {
+  protected: avdMessageTypeSet *m_msg_types;
+  public:
+    DebugMsgTypeSetRegistration():m_msg_types(0){
+      if((m_msg_types = new avdMessageTypeSet)){
+        m_msg_types->Register("Plain",   &Plain_avdMsg);
+        m_msg_types->Register("Info",   &Info_GEN_avdMsg);
+        m_msg_types->Register("Debug", &Debug_GEN_avdMsg);
+        m_msg_types->Register("Error", &Error_GEN_avdMsg);
+        m_msg_types->Register("Fatal", &Fatal_GEN_avdMsg);
+        avdMessageSetTracker::Instance().Register("General", m_msg_types);
+      } else {
+        cerr << "* Error in message display system *" << endl;
+        cerr << "* in class DebugMsgTypeSetRegistration constructor *" << endl;
+        cerr << endl;
+        cerr << "Couldn't allocate \"avdMessageTypeSet\" object for use in" << endl;
+        cerr << "registering general message types \"Plain\", \"Info\"," << endl;
+        cerr << "\"Debug\", \"Error\", and \"Fatal\" with the message-type" << endl;
+        cerr << "tracking system." << endl;
+        cerr << "Normally the message-type tracking system is used by a log" << endl;
+        cerr << "window, available in the graphic user interface, to" << endl;
+        cerr << "determine how messages of a given type should be" << endl;
+        cerr << "displayed to the user." << endl;
+        cerr << endl;
+      }
+    }
+    ~DebugMsgTypeSetRegistration(){
+      avdMessageSetTracker::Instance().Unregister("General");
+      if(m_msg_types) delete m_msg_types;
+  } };
+  const DebugMsgTypeSetRegistration s_registration;
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_set_tracker.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,50 @@
+#ifndef AVD_MESSAGE_SET_TRACKER_HH
+#define AVD_MESSAGE_SET_TRACKER_HH
+
+#include <string>
+
+/* XXX disables the Loki small-object allocator; it crashes under OSX10. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+#ifndef ASSOCVECTOR_INC_
+#include "third-party/Loki/AssocVector.h"
+#endif
+#ifndef SINGLETON_INC_
+#include "third-party/Loki/Singleton.h"
+#endif
+
+#ifndef AVD_MESSAGE_TYPE_SET_HH
+#include "avd_message_type_set.hh"
+#endif
+
+class avdMessageTypeBase;
+class _avdMessageSetTracker{
+public:
+  bool Register(const std::string &id, avdMessageTypeSet *ts)
+  { return m_associations.insert(IdToTSMap::value_type(id, ts)).second; }
+  bool Unregister(const std::string &id)
+  { return m_associations.erase(id) == 1; }
+  avdMessageTypeSet *GetTypeTracker(const std::string &id){
+    IdToTSMap::iterator i = m_associations.find(id);
+    if (i != m_associations.end()) return i->second;
+    return 0;
+  }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  begin(){ return m_associations.begin(); }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  end(){ return m_associations.end(); }
+  Loki::AssocVector<std::string, avdMessageTypeSet *>::size_type
+  size(){ return m_associations.size(); }
+protected:
+  typedef Loki::AssocVector<std::string, avdMessageTypeSet *> IdToTSMap;
+  typedef Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator Iterator;
+  IdToTSMap m_associations;
+};
+typedef Loki::AssocVector<std::string, avdMessageTypeBase *>::iterator
+  avdMessageTypeIterator;
+typedef Loki::SingletonHolder<_avdMessageSetTracker> avdMessageSetTracker;
+typedef Loki::AssocVector<std::string, avdMessageTypeSet *>::iterator
+  avdMessageSetTrackerIterator;
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_type_set.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_type_set.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/avd_message_type_set.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,44 @@
+#ifndef AVD_MESSAGE_TYPE_SET_HH
+#define AVD_MESSAGE_TYPE_SET_HH
+
+#include <string>
+
+/* XXX disables the Loki small-object allocator; it crashes under OSX10. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+#ifndef ASSOCVECTOR_INC_
+#include "third-party/Loki/AssocVector.h"
+#endif
+#ifndef SINGLETON_INC_
+#include "third-party/Loki/Singleton.h"
+#endif
+
+#ifndef AVD_MESSAGE_TYPE_BASE_HH
+#include "avd_message_type_base.hh"
+#endif
+
+class avdMessageTypeSet{
+public:
+  bool Register(const std::string &id, const avdMessageTypeBase *mt)
+  { return m_associations.insert(IdToMTMap::value_type(id, mt)).second; }
+  bool Unregister(const std::string &id)
+  { return m_associations.erase(id) == 1; }
+  const avdMessageTypeBase *GetTypeTracker(const std::string &id){
+    IdToMTMap::iterator i = m_associations.find(id);
+    if (i != m_associations.end()) return i->second;
+    return 0;
+  }
+  Loki::AssocVector<std::string, const avdMessageTypeBase *>::iterator begin()
+  { return m_associations.begin(); }
+  Loki::AssocVector<std::string, const avdMessageTypeBase *>::iterator end()
+  { return m_associations.end(); }
+  Loki::AssocVector<std::string, const avdMessageTypeBase *>::size_type size()
+  { return m_associations.size(); }
+protected:
+  typedef Loki::AssocVector<std::string, const avdMessageTypeBase *> IdToMTMap;
+  typedef Loki::AssocVector<std::string, const avdMessageTypeBase *>::iterator Iterator;
+  IdToMTMap m_associations;
+};
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/demo_base_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/demo_base_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/demo_base_t.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,35 @@
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#include <iostream>
+
+using namespace std;
+
+namespace demo_base_t {
+  class cTemplateTest : public test_case {
+  public: virtual void test() {
+    test_is_true(true);
+  } };
+  
+  class cTestSuite : public test_case {
+  public: cTestSuite() : test_case() {
+    adopt_test_case(new cTemplateTest); 
+  } };
+}
+
+int main(int argc, char *argv[]){
+  cout << endl 
+  << "----------------------------------------" << endl
+  << "Demonstration of basic testing." << endl;
+  demo_base_t::cTestSuite t;
+  t.run_test();
+  cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/main.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/main.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/main.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,49 @@
+#include <iostream>
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef AVD_MISSION_CONTROL_HH
+#include "mc/avd_mission_control.hh"
+#endif
+#ifndef WATCH_RETAINS_HH
+#include "memory_mgt/watch_retains.hh"
+#endif
+#ifndef AVD_MESSAGE_DISPLAY_HH
+#include "user_msg/avd_message_display.hh"
+#endif
+
+class cRetainableTest : public cRetainable {};
+
+int main( int argc, char **argv ){
+  avdDebug("in.");
+  cWatchRetains retain_watch;
+  cRetainableTest *retainable_test = new cRetainableTest;
+  if(retainable_test){
+    retainable_test->nameWatched("(cRetainableTest) this memory leak is on purpose.");
+  } else {
+    avdError
+    << "Couldn't allocate \"cRetainableTest\" object.\n"
+    << "Normally this object, once created, is never destroyed; it\n"
+    << "creates a small memory leak which, hopefully,\n"
+    << "the memory management system will detect.\n";
+  }
+  retain_watch.nameWatched("<main(retain_watch)>");
+  QApplication app( argc, argv );
+  avdMissionControl *mc = new avdMissionControl(argc, argv, 0, "<main(mc)>");
+  if(!mc)
+    avdFatal
+    << "Couldn't allocate \"avdMissionControl\" object.\n"
+    << "Normally that object manages the construction of the remainder\n"
+    << "of this program, including the graphic user interface and\n"
+    << "the processing part of Avida.  Since the object couldn't be\n"
+    << "created, this program has to abort.";
+  mc->nameWatched("<main(mc)>");
+  app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
+  int result = app.exec();
+  mc->release();
+  avdDebug("out.");
+  return result;
+}
+
+// arch-tag: implementation file for main function
+/* vim: set ts=2 ai et: */
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,13 @@
+#ifndef TEMPLATE2_T_HH
+#include "template2_t.hh"
+#endif
+
+int main(int argc, char *argv[]){
+  std::cout << std::endl 
+  << "----------------------------------------" << std::endl
+  << "Testing Template2." << std::endl;
+  nDemoTestsuite2::cTestSuite t(argc, argv);
+  t.run_test();
+  std::cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/template2_t.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,85 @@
+#ifndef TEMPLATE2_T_HH
+#define TEMPLATE2_T_HH
+
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#include <iostream>
+
+class myWidget2 : public QWidget {
+Q_OBJECT
+public:
+  QPushButton *m_pb;
+  explicit myWidget2(QWidget *parent = 0, const char *name = 0, WFlags f = 0)
+  : QWidget(parent, name, f), m_pb(0)
+  {
+    QVBoxLayout *layout = new QVBoxLayout(this, 10, -1, "<myWidget(layout)>");
+    m_pb = new QPushButton("foo", this, "<myWidget::m_pb>");
+    layout->addWidget(m_pb);
+    connect(m_pb, SIGNAL(clicked()), this, SIGNAL(clicked()));
+  }
+signals:
+  void clicked();
+};
+
+class cTemplate2Test : public cXQtTestCase {
+Q_OBJECT
+protected:
+  myWidget2 *m_w;
+public:
+  cTemplate2Test(int argc, char **argv) : cXQtTestCase(argc, argv) { }
+public slots:
+  void buttonClicked(){
+    resetDeadMan();
+    std::cout << "buttonClicked..." << std::endl;
+    test_is_true(true);
+    restartTimer();
+  }
+public:
+  virtual void test() {
+    m_w = new myWidget2(0, "<cTemplateTest::(myWidget *)m_w>", 0);
+    m_w->show(); m_w->raise();
+    connect(m_w, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+
+    tFunctor twiddle_functor(this, &cXQtTestCase::twiddle);
+    tFunctor click_functor(m_w->m_pb, &QPushButton::animateClick);
+
+    pushFunctor(twiddle_functor);
+    pushFunctor(twiddle_functor);
+    pushFunctor(click_functor);
+
+    execApp();
+
+    if(m_w){ delete m_w; m_w = 0; }
+  }
+};
+
+namespace nDemoTestsuite2 {
+  class cTestSuite : public test_case {
+  public: cTestSuite(int argc, char **argv) : test_case() {
+    adopt_test_case(new cTemplate2Test(argc, argv)); 
+  } };
+}
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,13 @@
+#ifndef TEMPLATE_T_HH
+#include "template_t.hh"
+#endif
+
+int main(int argc, char *argv[]){
+  std::cout << std::endl 
+  << "----------------------------------------" << std::endl
+  << "Testing Template." << std::endl;
+  nDemoTestsuite::cTestSuite t(argc, argv);
+  t.run_test();
+  std::cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/template_t.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,85 @@
+#ifndef TEMPLATE_T_HH
+#define TEMPLATE_T_HH
+
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#include <iostream>
+
+class myWidget : public QWidget {
+Q_OBJECT
+public:
+  QPushButton *m_pb;
+  explicit myWidget(QWidget *parent = 0, const char *name = 0, WFlags f = 0)
+  : QWidget(parent, name, f), m_pb(0)
+  {
+    QVBoxLayout *layout = new QVBoxLayout(this, 10, -1, "<myWidget(layout)>");
+    m_pb = new QPushButton("foo", this, "<myWidget::m_pb>");
+    layout->addWidget(m_pb);
+    connect(m_pb, SIGNAL(clicked()), this, SIGNAL(clicked()));
+  }
+signals:
+  void clicked();
+};
+
+class cTemplateTest : public cXQtTestCase {
+Q_OBJECT
+protected:
+  myWidget *m_w;
+public:
+  cTemplateTest(int argc, char **argv) : cXQtTestCase(argc, argv) { }
+public slots:
+  void buttonClicked(){
+    resetDeadMan();
+    std::cout << "buttonClicked..." << std::endl;
+    test_is_true(true);
+    restartTimer();
+  }
+public:
+  virtual void test() {
+    m_w = new myWidget(0, "<cTemplateTest::(myWidget *)m_w>", 0);
+    m_w->show(); m_w->raise();
+    connect(m_w, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+
+    tFunctor twiddle_functor(this, &cXQtTestCase::twiddle);
+    tFunctor click_functor(m_w->m_pb, &QPushButton::animateClick);
+
+    pushFunctor(twiddle_functor);
+    pushFunctor(twiddle_functor);
+    pushFunctor(click_functor);
+
+    execApp();
+
+    if(m_w){ delete m_w; m_w = 0; }
+  }
+};
+
+namespace nDemoTestsuite {
+  class cTestSuite : public test_case {
+  public: cTestSuite(int argc, char **argv) : test_case() {
+    adopt_test_case(new cTemplateTest(argc, argv)); 
+  } };
+}
+
+#endif
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.cc
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,64 @@
+#ifndef XQT_TEST_CASE_HH
+#include "xqt_test_case.hh"
+#endif
+
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QTIMER_H
+#include <qtimer.h>
+#endif
+
+cXQtTestCase::cXQtTestCase(int argc, char **argv)
+: QObject(0, "<cXQtTestCase>")
+, m_a(0)
+, m_t(0)
+, m_deadman(0)
+, m_argc(argc)
+, m_argv(argv)
+{
+  m_a = new QApplication(m_argc, m_argv);
+  m_t = new QTimer(this);
+  connect(m_t, SIGNAL(timeout()), this, SLOT(testDriver()));
+  m_deadman = new QTimer(this);
+  connect(m_deadman, SIGNAL(timeout()), this, SLOT(timeOut()));
+}
+cXQtTestCase::~cXQtTestCase(){
+  if(m_deadman){ delete m_deadman; m_deadman = 0; }
+  if(m_t){ delete m_t; m_t = 0; }
+  if(m_a){ delete m_a; m_a = 0; }
+}
+void cXQtTestCase::restartTimer(int milliseconds, bool one_shot){
+  if(m_t) m_t->start(milliseconds, one_shot);
+}
+void cXQtTestCase::resetDeadMan(int milliseconds){
+  if(m_deadman) m_deadman->changeInterval(milliseconds);
+}
+int cXQtTestCase::execApp(){
+  restartTimer();
+  resetDeadMan();
+  return (m_a != 0)?(m_a->exec()):(1);
+}
+void cXQtTestCase::exitApp(int retval){
+  if (m_a != 0) m_a->exit(retval);
+}
+void cXQtTestCase::pushFunctor(tFunctor &functor){
+  m_functor_list.PushRear(&functor);
+}
+cXQtTestCase::tFunctor *cXQtTestCase::popFunctor(){
+  return m_functor_list.Pop();
+}
+void cXQtTestCase::twiddle(){
+  restartTimer();
+  qDebug("twiddling my thumbs...");
+  resetDeadMan();
+}
+void cXQtTestCase::timeOut(){
+  qWarning("ERROR: timed out while waiting for event to be triggered...");
+  test_non_error(false);
+  twiddle();
+}
+void cXQtTestCase::testDriver(){
+  if(tFunctor *functor = popFunctor()){ (*functor)(); }
+  else exitApp();
+}
Index: avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.hh
diff -u /dev/null avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/qt-viewer/exp/exp_cleanup2/xqt_test_case.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,55 @@
+#ifndef XQT_TEST_CASE_HH
+#define XQT_TEST_CASE_HH
+
+#ifndef TLIST_HH
+#include "tList.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+/* XXX disables the Loki small-object allocator; it crashes under OSX10. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+#ifndef FUNCTOR_INC
+#include "third-party/Loki/Functor.h"
+#endif
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class QApplication;
+class QTimer;
+class cXQtTestCase : public QObject, public test_case {
+Q_OBJECT
+protected: // variables
+  typedef Loki::Functor<void> tFunctor;
+  tList<tFunctor> m_functor_list;
+  QApplication *m_a;
+  QTimer *m_t;
+  QTimer *m_deadman;
+  int m_argc;
+  char **m_argv;
+protected: // constructors/destructors
+  cXQtTestCase(int argc, char **argv);
+  ~cXQtTestCase();
+protected: // manipulators
+  void restartTimer(int milliseconds = 0, bool one_shot = true);
+  void resetDeadMan(int milliseconds = 5000);
+  int execApp();
+  void exitApp(int retval = 0);
+  void pushFunctor(tFunctor &functor);
+  tFunctor *popFunctor();
+protected slots:
+  virtual void twiddle();
+  virtual void timeOut();
+  virtual void testDriver();
+};
+
+#endif
Index: avida/current/source/support/CMakeLists.txt
diff -u avida/current/source/support/CMakeLists.txt:1.1 avida/current/source/support/CMakeLists.txt:1.2
--- avida/current/source/support/CMakeLists.txt:1.1	Sat Dec  6 10:01:01 2003
+++ avida/current/source/support/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -1,4 +1,3 @@
-
 SUBDIRS(preset_organisms)
 
 INSTALL_FILES(/ FILES
Index: avida/current/source/support/preset_organisms/CMakeLists.txt
diff -u avida/current/source/support/preset_organisms/CMakeLists.txt:1.1 avida/current/source/support/preset_organisms/CMakeLists.txt:1.2
--- avida/current/source/support/preset_organisms/CMakeLists.txt:1.1	Sat Dec  6 10:01:02 2003
+++ avida/current/source/support/preset_organisms/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -1,4 +1,3 @@
-
 INSTALL_FILES(/preset_organisms FILES
   dummy
   organism.4stack
Index: avida/current/source/testsuites/CMakeLists.txt
diff -u avida/current/source/testsuites/CMakeLists.txt:1.1 avida/current/source/testsuites/CMakeLists.txt:1.2
--- avida/current/source/testsuites/CMakeLists.txt:1.1	Sat Dec  6 10:01:02 2003
+++ avida/current/source/testsuites/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -1,4 +1 @@
-
-SET(EXECUTABLE_OUTPUT_PATH "")
-
-SUBDIRS(unit_testsuites)
+SUBDIRS(unit_testsuites qt_viewer_unit_testsuites)
Index: avida/current/source/testsuites/qt_viewer_unit_testsuites/CMakeLists.txt
diff -u /dev/null avida/current/source/testsuites/qt_viewer_unit_testsuites/CMakeLists.txt:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/testsuites/qt_viewer_unit_testsuites/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,59 @@
+INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FixFindQt.cmake)
+
+SET(EXECUTABLE_OUTPUT_PATH "")
+
+ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
+IF(_UNIT_TEST_QT_GUI AND _QT_GRAPHIC_INTERFACE)
+  INCLUDE_DIRECTORIES(
+    ${ALL_INC_DIRS}
+    ${GUI_SRC_DIR}
+    ${THIRDPARTY_SRC_DIR}/yaktest
+    ${QT_INCLUDE_DIR}
+    ${QT_INCLUDE_PATH}
+    .
+  )
+  LINK_DIRECTORIES(
+    ${ALL_LIB_DIRS}
+    ${GUI_BLD_DIR}
+    ${THIRDPARTY_BLD_DIR}/yaktest
+    .
+  )
+
+  SET(TESTSUITES
+  	template.t
+  ) 
+  STRING(REGEX REPLACE [.]t .t.hh\; TESTSUITE_MOCSRCS ${TESTSUITES})
+  SET(libqtunittest_a_SOURCES
+    qt_test_case.cc
+  )
+  SET(libqtunittest_moc_a_MOC_SOURCES
+    qt_test_case.hh
+    ${TESTSUITE_MOCSRCS}
+  )
+  QT_WRAP_CPP(qtunittest_moc
+    libqtunittest_moc_a_SOURCES
+    libqtunittest_moc_a_MOC_SOURCES
+  )
+  ADD_LIBRARY(qtunittest_moc ${libqtunittest_moc_a_SOURCES})
+  ADD_LIBRARY(qtunittest ${libqtunittest_a_SOURCES})
+
+  FOREACH(TESTSUITE ${TESTSUITES})
+    ADD_EXECUTABLE(${TESTSUITE} ${TESTSUITE}.cc)
+    TARGET_LINK_LIBRARIES(${TESTSUITE}
+      qtviewer
+      main
+      cpu
+      event
+      main
+      tools
+      yaktest
+      qtviewer_moc
+      qtviewer_ui
+      qtunittest
+      qtunittest_moc
+      ${QT_LIBRARIES}
+    )
+    ADD_TEST(${TESTSUITE} ${TESTSUITE})
+  ENDFOREACH(TESTSUITE)
+ENDIF(_UNIT_TEST_QT_GUI AND _QT_GRAPHIC_INTERFACE)
+
Index: avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.cc
diff -u /dev/null avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,64 @@
+#ifndef QT_TEST_CASE_HH
+#include "qt_test_case.hh"
+#endif
+
+#ifndef QAPPLICATION_H
+#include <qapplication.h>
+#endif
+#ifndef QTIMER_H
+#include <qtimer.h>
+#endif
+
+cQtTestCase::cQtTestCase(int argc, char **argv)
+: QObject(0, "<cQtTestCase>")
+, m_a(0)
+, m_t(0)
+, m_deadman(0)
+, m_argc(argc)
+, m_argv(argv)
+{
+  m_a = new QApplication(m_argc, m_argv);
+  m_t = new QTimer(this);
+  connect(m_t, SIGNAL(timeout()), this, SLOT(testDriver()));
+  m_deadman = new QTimer(this);
+  connect(m_deadman, SIGNAL(timeout()), this, SLOT(timeOut()));
+}
+cQtTestCase::~cQtTestCase(){
+  if(m_deadman){ delete m_deadman; m_deadman = 0; }
+  if(m_t){ delete m_t; m_t = 0; }
+  if(m_a){ delete m_a; m_a = 0; }
+}
+void cQtTestCase::restartTimer(int milliseconds, bool one_shot){
+  if(m_t) m_t->start(milliseconds, one_shot);
+}
+void cQtTestCase::resetDeadMan(int milliseconds){
+  if(m_deadman) m_deadman->changeInterval(milliseconds);
+}
+int cQtTestCase::execApp(){
+  restartTimer();
+  resetDeadMan();
+  return (m_a != 0)?(m_a->exec()):(1);
+}
+void cQtTestCase::exitApp(int retval){
+  if (m_a != 0) m_a->exit(retval);
+}
+void cQtTestCase::pushFunctor(tFunctor &functor){
+  m_functor_list.PushRear(&functor);
+}
+cQtTestCase::tFunctor *cQtTestCase::popFunctor(){
+  return m_functor_list.Pop();
+}
+void cQtTestCase::twiddle(){
+  restartTimer();
+  qDebug("twiddling my thumbs...");
+  resetDeadMan();
+}
+void cQtTestCase::timeOut(){
+  qWarning("ERROR: timed out while waiting for event to be triggered...");
+  test_non_error(false);
+  twiddle();
+}
+void cQtTestCase::testDriver(){
+  if(tFunctor *functor = popFunctor()){ (*functor)(); }
+  else exitApp();
+}
Index: avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.hh
diff -u /dev/null avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/testsuites/qt_viewer_unit_testsuites/qt_test_case.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,55 @@
+#ifndef QT_TEST_CASE_HH
+#define QT_TEST_CASE_HH
+
+#ifndef TLIST_HH
+#include "tList.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+/* XXX disables the Loki small-object allocator; it crashes under OSX10. */
+#ifndef MAX_SMALL_OBJECT_SIZE
+#define MAX_SMALL_OBJECT_SIZE 0
+#endif
+#ifndef FUNCTOR_INC
+#include "third-party/Loki/Functor.h"
+#endif
+
+#ifndef QOBJECT_H
+#include <qobject.h>
+#endif
+
+class QApplication;
+class QTimer;
+class cQtTestCase : public QObject, public test_case {
+Q_OBJECT
+protected: // variables
+  typedef Loki::Functor<void> tFunctor;
+  tList<tFunctor> m_functor_list;
+  QApplication *m_a;
+  QTimer *m_t;
+  QTimer *m_deadman;
+  int m_argc;
+  char **m_argv;
+protected: // constructors/destructors
+  cQtTestCase(int argc, char **argv);
+  ~cQtTestCase();
+protected: // manipulators
+  void restartTimer(int milliseconds = 0, bool one_shot = true);
+  void resetDeadMan(int milliseconds = 5000);
+  int execApp();
+  void exitApp(int retval = 0);
+  void pushFunctor(tFunctor &functor);
+  tFunctor *popFunctor();
+protected slots:
+  virtual void twiddle();
+  virtual void timeOut();
+  virtual void testDriver();
+};
+
+#endif
Index: avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.cc
diff -u /dev/null avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.cc:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.cc	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,13 @@
+#ifndef TEMPLATE_T_HH
+#include "template.t.hh"
+#endif
+
+int main(int argc, char *argv[]){
+  std::cout << std::endl 
+  << "----------------------------------------" << std::endl
+  << "Testing Template." << std::endl;
+  nDemoTestsuite::cTestSuite t(argc, argv);
+  t.run_test();
+  std::cout << text_test_interpreter().interpretation(t.last_result());
+  return(t.last_result().success_count() != t.last_result().total_test_count());
+}
Index: avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.hh
diff -u /dev/null avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.hh:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/testsuites/qt_viewer_unit_testsuites/template.t.hh	Mon Dec 29 14:55:15 2003
@@ -0,0 +1,85 @@
+#ifndef TEMPLATE_T_HH
+#define TEMPLATE_T_HH
+
+#ifndef QT_TEST_CASE_HH
+#include "qt_test_case.hh"
+#endif
+
+#ifndef TEST_CASE_H
+#include "third-party/yaktest/test_case.h"
+#endif
+#ifndef TEXT_TEST_INTERPRETER_H
+#include "third-party/yaktest/text_test_interpreter.h"
+#endif
+#ifndef TEST_RESULT_H
+#include "third-party/yaktest/test_result.h"
+#endif
+
+#ifndef QLAYOUT_H
+#include <qlayout.h>
+#endif
+#ifndef QPUSHBUTTON_H
+#include <qpushbutton.h>
+#endif
+#ifndef QWIDGET_H
+#include <qwidget.h>
+#endif
+
+#include <iostream>
+
+class myWidget : public QWidget {
+Q_OBJECT
+public:
+  QPushButton *m_pb;
+  explicit myWidget(QWidget *parent = 0, const char *name = 0, WFlags f = 0)
+  : QWidget(parent, name, f), m_pb(0)
+  {
+    QVBoxLayout *layout = new QVBoxLayout(this, 10, -1, "<myWidget(layout)>");
+    m_pb = new QPushButton("foo", this, "<myWidget::m_pb>");
+    layout->addWidget(m_pb);
+    connect(m_pb, SIGNAL(clicked()), this, SIGNAL(clicked()));
+  }
+signals:
+  void clicked();
+};
+
+class cTemplateTest : public cQtTestCase {
+Q_OBJECT
+protected:
+  myWidget *m_w;
+public:
+  cTemplateTest(int argc, char **argv) : cQtTestCase(argc, argv) { }
+public slots:
+  void buttonClicked(){
+    resetDeadMan();
+    std::cout << "buttonClicked..." << std::endl;
+    test_is_true(true);
+    restartTimer();
+  }
+public:
+  virtual void test() {
+    m_w = new myWidget(0, "<cTemplateTest::(myWidget *)m_w>", 0);
+    m_w->show(); m_w->raise();
+    connect(m_w, SIGNAL(clicked()), this, SLOT(buttonClicked()));
+
+    tFunctor twiddle_functor(this, &cQtTestCase::twiddle);
+    tFunctor click_functor(m_w->m_pb, &QPushButton::animateClick);
+
+    pushFunctor(twiddle_functor);
+    pushFunctor(twiddle_functor);
+    pushFunctor(click_functor);
+
+    execApp();
+
+    if(m_w){ delete m_w; m_w = 0; }
+  }
+};
+
+namespace nDemoTestsuite {
+  class cTestSuite : public test_case {
+  public: cTestSuite(int argc, char **argv) : test_case() {
+    adopt_test_case(new cTemplateTest(argc, argv)); 
+  } };
+}
+
+#endif
Index: avida/current/source/testsuites/unit_testsuites/CMakeLists.txt
diff -u avida/current/source/testsuites/unit_testsuites/CMakeLists.txt:1.1 avida/current/source/testsuites/unit_testsuites/CMakeLists.txt:1.2
--- avida/current/source/testsuites/unit_testsuites/CMakeLists.txt:1.1	Sat Dec  6 10:01:03 2003
+++ avida/current/source/testsuites/unit_testsuites/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -1,6 +1,8 @@
+SET(EXECUTABLE_OUTPUT_PATH "")
+
 SUBDIRS(level_0 level_1)
 
-IF(_UNIT_TESTS)
+IF(_UNIT_TEST_PRIMITIVE)
   INCLUDE_DIRECTORIES(
     ${ALL_INC_DIRS}
     ${THIRDPARTY_SRC_DIR}/yaktest
@@ -160,4 +162,4 @@
     )
     ADD_TEST(${TESTSUITE} ${TESTSUITE})
   ENDFOREACH(TESTSUITE)
-ENDIF(_UNIT_TESTS)
+ENDIF(_UNIT_TEST_PRIMITIVE)
Index: avida/current/source/testsuites/unit_testsuites/level_0/CMakeLists.txt
diff -u avida/current/source/testsuites/unit_testsuites/level_0/CMakeLists.txt:1.1 avida/current/source/testsuites/unit_testsuites/level_0/CMakeLists.txt:1.2
--- avida/current/source/testsuites/unit_testsuites/level_0/CMakeLists.txt:1.1	Sat Dec  6 10:01:03 2003
+++ avida/current/source/testsuites/unit_testsuites/level_0/CMakeLists.txt	Mon Dec 29 14:55:15 2003
@@ -1,5 +1,4 @@
-
-IF(_UNIT_TESTS)
+IF(_UNIT_TEST_PRIMITIVE)
   INCLUDE_DIRECTORIES(
     ${ALL_INC_DIRS}
     ${THIRDPARTY_SRC_DIR}/yaktest
@@ -32,4 +31,4 @@
     )
     ADD_TEST(${TESTSUITE} ${TESTSUITE})
   ENDFOREACH(TESTSUITE)
-ENDIF(_UNIT_TESTS)
+ENDIF(_UNIT_TEST_PRIMITIVE)
Index: avida/current/source/testsuites/unit_testsuites/level_1/CMakeLists.txt
diff -u avida/current/source/testsuites/unit_testsuites/level_1/CMakeLists.txt:1.1 avida/current/source/testsuites/unit_testsuites/level_1/CMakeLists.txt:1.2
--- avida/current/source/testsuites/unit_testsuites/level_1/CMakeLists.txt:1.1	Sat Dec  6 10:01:04 2003
+++ avida/current/source/testsuites/unit_testsuites/level_1/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,5 +1,4 @@
-
-IF(_UNIT_TESTS)
+IF(_UNIT_TEST_PRIMITIVE)
   INCLUDE_DIRECTORIES(
     ${ALL_INC_DIRS}
     ${THIRDPARTY_SRC_DIR}/yaktest
@@ -24,4 +23,4 @@
     )
     ADD_TEST(${TESTSUITE} ${TESTSUITE})
   ENDFOREACH(TESTSUITE)
-ENDIF(_UNIT_TESTS)
+ENDIF(_UNIT_TEST_PRIMITIVE)
Index: avida/current/source/third-party/CMakeLists.txt
diff -u avida/current/source/third-party/CMakeLists.txt:1.1 avida/current/source/third-party/CMakeLists.txt:1.2
--- avida/current/source/third-party/CMakeLists.txt:1.1	Sat Dec  6 10:01:05 2003
+++ avida/current/source/third-party/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,2 +1,2 @@
-SUBDIRS(trio yaktest)
+SUBDIRS(trio yaktest mockpp)
 
Index: avida/current/source/third-party/mockpp/CMakeLists.txt
diff -u /dev/null avida/current/source/third-party/mockpp/CMakeLists.txt:1.2
--- /dev/null	Mon Dec 29 14:55:22 2003
+++ avida/current/source/third-party/mockpp/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -0,0 +1,61 @@
+IF(UNIT_TESTS)
+  INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+  CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+  CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
+  CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
+  CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
+  CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
+  CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
+  CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
+  CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
+  CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
+  CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
+  CHECK_INCLUDE_FILE("limits" HAVE_LIMITS)
+  CHECK_INCLUDE_FILE("machine/limits.h" HAVE_MACHINE_LIMITS_H)
+  CHECK_INCLUDE_FILE("values.h" HAVE_VALUES_H)
+  FOREACH(define
+    HAVE_DLFCN_H
+    HAVE_SYS_TYPES_H
+    HAVE_SYS_STAT_H
+    HAVE_STDLIB_H
+    HAVE_STRING_H
+    HAVE_MEMORY_H
+    HAVE_STRINGS_H
+    HAVE_INTTYPES_H
+    HAVE_STDINT_H
+    HAVE_UNISTD_H
+    HAVE_LIMITS
+    HAVE_MACHINE_LIMITS_H
+    HAVE_VALUES_H
+  )
+    IF(${define})
+      ADD_DEFINITIONS(-D${define}=1)
+    ENDIF(${define})
+  ENDFOREACH(define)
+  INCLUDE_DIRECTORIES(
+    ${THIRDPARTY_SRC_DIR}
+  )
+  ADD_DEFINITIONS(-DVERSION=\\"bogus\\")
+  SET(libmockpp_a_SOURCES
+    compat/Exception.cpp
+    compat/Assert.cpp
+    compat/Formatter.cpp
+    compat/AssertionFailedError.cpp
+    util/AssertMo.cpp
+    util/NotImplementedException.cpp
+    ExpectationCounter.cpp
+    mockpp.cpp
+    Throwable.cpp
+    ThrowableList.cpp
+    MockObject.cpp
+    VisitableMockObject.cpp
+    VerifiableList.cpp
+    Verifiable.cpp
+  )
+  ADD_LIBRARY(mockpp ${libmockpp_a_SOURCES})
+
+  SET(EXECUTABLE_OUTPUT_PATH "")
+  ADD_EXECUTABLE(mock_greeter examples/mock_greeter.cpp)
+  TARGET_LINK_LIBRARIES(mock_greeter mockpp)
+ENDIF(UNIT_TESTS)
+
Index: avida/current/source/third-party/trio/CMakeLists.txt
diff -u avida/current/source/third-party/trio/CMakeLists.txt:1.1 avida/current/source/third-party/trio/CMakeLists.txt:1.2
--- avida/current/source/third-party/trio/CMakeLists.txt:1.1	Sat Dec  6 10:01:06 2003
+++ avida/current/source/third-party/trio/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,4 +1,3 @@
-
 SET(libtrio_a_SOURCES
   trio.c
   triostr.c
Index: avida/current/source/third-party/yaktest/CMakeLists.txt
diff -u avida/current/source/third-party/yaktest/CMakeLists.txt:1.1 avida/current/source/third-party/yaktest/CMakeLists.txt:1.2
--- avida/current/source/third-party/yaktest/CMakeLists.txt:1.1	Sat Dec  6 10:01:06 2003
+++ avida/current/source/third-party/yaktest/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,5 +1,4 @@
-
-IF(_UNIT_TESTS)
+IF(UNIT_TESTS)
   SET(libyaktest_a_SOURCES
     test_problem.cpp
     test_result.cpp
@@ -7,4 +6,4 @@
     text_test_interpreter.cpp
   )
   ADD_LIBRARY(yaktest ${libyaktest_a_SOURCES})
-ENDIF(_UNIT_TESTS)
+ENDIF(UNIT_TESTS)
Index: avida/current/source/third-party/yaktest/test_case.cpp
diff -u avida/current/source/third-party/yaktest/test_case.cpp:1.1 avida/current/source/third-party/yaktest/test_case.cpp:1.2
--- avida/current/source/third-party/yaktest/test_case.cpp:1.1	Tue Nov 25 10:50:08 2003
+++ avida/current/source/third-party/yaktest/test_case.cpp	Mon Dec 29 14:55:16 2003
@@ -56,6 +56,7 @@
 test_case::test_non_error_stub( bool condition,
 			        const std::string& condition_name,
 			        const std::string& filename,
+			        const std::string& functionname,
 			        long line_number )
 {
   if ( !condition )
@@ -64,6 +65,7 @@
       message.append( condition_name );
       message.append( std::string( "\" evaluated to false." ) );
       m_last_result.add_error( test_problem( filename,
+					       functionname,
 					       line_number,
 					       message ));
     }
@@ -76,6 +78,7 @@
 test_case::test_is_true_stub( bool condition,
 			      const std::string& condition_name,
 			      const std::string& filename,
+			      const std::string& functionname,
 			      long line_number )
 {
   if ( condition )
@@ -88,6 +91,7 @@
       message.append( condition_name );
       message.append( std::string( "\" evaluated to false." ) );
       m_last_result.add_failure( test_problem( filename,
+					       functionname,
 					       line_number,
 					       message ));
     }
@@ -99,13 +103,14 @@
 test_case::create_equality_problem_report( const std::string& actual_message,
 					   const std::string& expected_message,
 					   const std::string& filename,
+					   const std::string& functionname,
 					   long line_number )
 {
   std::string message = "Equality failed.  Got ";
   message.append( actual_message );
   message.append( ", expected " );
   message.append( expected_message );
-  return test_problem( filename, line_number, message );
+  return test_problem( filename, functionname, line_number, message );
 }
 
 
@@ -115,6 +120,7 @@
 test_case::test_int_is_equal_stub( long actual,
 			       long expected,
 			       const std::string& filename,
+			       const std::string& functionname,
 			       long line_number )
 {
   if ( actual == expected ) 
@@ -131,6 +137,7 @@
       m_last_result.add_failure( create_equality_problem_report( actual_message,
 								 expected_message,
 								 filename,
+								 functionname,
 								 line_number ) );
     }
 }
@@ -139,6 +146,7 @@
 test_case::test_double_is_equal_stub( double actual,
 				      double expected,
 				      const std::string& filename,
+				      const std::string& functionname,
 				      long line_number,
 // msvc didn't like the redeclaration of default parameter RS 2/14/2001
 //				      double tolerance = 0.005 )
@@ -158,6 +166,7 @@
       m_last_result.add_failure( create_equality_problem_report( actual_message,
 								 expected_message,
 								 filename,
+								 functionname,
 								 line_number ));
     }
 }
@@ -168,6 +177,7 @@
 test_case::test_string_is_equal_stub( const std::string& actual,
 			   const std::string& expected,
 			   const std::string& filename,
+			   const std::string& functionname,
 			   long line_number )
 {
   if ( actual == expected ) 
@@ -185,6 +195,7 @@
       m_last_result.add_failure( create_equality_problem_report( actual_message,
 								 expected_message,
 								 filename,
+								 functionname,
 								 line_number ));
     }
 }
Index: avida/current/source/third-party/yaktest/test_case.h
diff -u avida/current/source/third-party/yaktest/test_case.h:1.1 avida/current/source/third-party/yaktest/test_case.h:1.2
--- avida/current/source/third-party/yaktest/test_case.h:1.1	Tue Nov 25 10:50:08 2003
+++ avida/current/source/third-party/yaktest/test_case.h	Mon Dec 29 14:55:16 2003
@@ -14,7 +14,7 @@
 using std::ostringstream;
 #endif //WIN32
 
-// $Id: test_case.h,v 1.1 2003/11/25 18:50:08 kaben Exp $
+// $Id: test_case.h,v 1.2 2003/12/29 22:55:16 kaben Exp $
 /*! A composite test case 
  * its atomic test can be redefined by overriding
  * test(); it can also serve as a suite of tests by adding test_cases
@@ -53,38 +53,45 @@
   void test_non_error_stub( bool condition, 
 			    const std::string& condition_name,
 			    const std::string& filename,
+			    const std::string& functionname,
 			    long line_number );
   //! tests to see if the supplied condition is true; called by the test_is_true macro
   void test_is_true_stub( bool condition, 
 			  const std::string& condition_name,
 			  const std::string& filename,
+			  const std::string& functionname,
 			  long line_number );
   //! tests to see if two longs are equal
   void test_int_is_equal_stub( long actual,
 			   long expected,
 			   const std::string& filename,
+			   const std::string& functionname,
 			   long line_number );
   //! tests to see if two doubles are within limits
   void test_double_is_equal_stub( double actual,
 				  double expected,
 				  const std::string& filename,
+			          const std::string& functionname,
 				  long line_number,
 				  double tolerance = 0.005 );
   //! tests to see if two strings are equal
   void test_string_is_equal_stub( const std::string& actual,
 				  const std::string& expected,
 				  const std::string& filename,
+			          const std::string& functionname,
 				  long line_number );
   //! creates an "equality test failed" problem report
   test_problem create_equality_problem_report( const std::string& actual_message,
 					       const std::string& expected_message,
 					       const std::string& filename,
+			                       const std::string& functionname,
 					       long line_number );
   
 				 
   template< class T >void test_is_equal_stub( const T& actual,
 					      const T& expected,
 					      const std::string& filename,
+			                      const std::string& functionname,
 					      long line_number )
     {
       if ( actual == expected ) 
@@ -105,7 +112,8 @@
 	    ( expected_ptr == NULL ) ? "" : expected_ptr->to_string();
 	  m_last_result.add_failure( create_equality_problem_report( actual_message,
 								     expected_message,
-							     filename,
+							             filename,
+							             functionname,
 								     line_number ) );
 #endif // LINUX
         //will use strstreams to get generic i/o working
@@ -118,7 +126,8 @@
     expected_message << expected;
 	  m_last_result.add_failure( create_equality_problem_report( actual_message.str(),
 								     expected_message.str(),
-							     filename,
+							             filename,
+							             functionname,
 								     line_number ) );
 
 #endif // WIN32
@@ -142,13 +151,23 @@
 
 //these macros are used instead of the code stubs in test_case
 //in order to use preprocessor features to get filename/line number
-#define test_non_error( condition ) (this->test_non_error_stub( (condition), (#condition), __FILE__, __LINE__ ))
-#define test_is_true( condition ) (this->test_is_true_stub( (condition), (#condition), __FILE__, __LINE__ ))
-#define test_int_is_equal( actual_value, expected_value ) (this->test_int_is_equal_stub( actual_value, expected_value, __FILE__, __LINE__ ))
-#define test_double_is_equal( actual_value, expected_value ) (this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, __LINE__ ))
-#define double_is_within_tolerance( actual_value, expected_value, tolerance ) ( this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, __LINE__, tolerance ))
-#define test_string_is_equal( actual_value, expected_value ) (this->test_string_is_equal_stub( actual_value, expected_value, __FILE__, __LINE__ ))
-#define test_is_equal( actual_value, expected_value ) (this->test_is_equal_stub( actual_value, expected_value, __FILE__, __LINE__ ))
+#ifdef WIN32
+  #define test_non_error( condition ) (this->test_non_error_stub( (condition), (#condition), __FILE__, (""), __LINE__ ))
+  #define test_is_true( condition ) (this->test_is_true_stub( (condition), (#condition), __FILE__, (""), __LINE__ ))
+  #define test_int_is_equal( actual_value, expected_value ) (this->test_int_is_equal_stub( actual_value, expected_value, __FILE__, (""), __LINE__ ))
+  #define test_double_is_equal( actual_value, expected_value ) (this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, (""), __LINE__ ))
+  #define double_is_within_tolerance( actual_value, expected_value, tolerance ) ( this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, (""), __LINE__, tolerance ))
+  #define test_string_is_equal( actual_value, expected_value ) (this->test_string_is_equal_stub( actual_value, expected_value, __FILE__, (""), __LINE__ ))
+  #define test_is_equal( actual_value, expected_value ) (this->test_is_equal_stub( actual_value, expected_value, __FILE__, (""), __LINE__ ))
+#else // WIN32
+  #define test_non_error( condition ) (this->test_non_error_stub( (condition), (#condition), __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+  #define test_is_true( condition ) (this->test_is_true_stub( (condition), (#condition), __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+  #define test_int_is_equal( actual_value, expected_value ) (this->test_int_is_equal_stub( actual_value, expected_value, __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+  #define test_double_is_equal( actual_value, expected_value ) (this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+  #define double_is_within_tolerance( actual_value, expected_value, tolerance ) ( this->test_double_is_equal_stub( actual_value, expected_value, __FILE__, __PRETTY_FUNCTION__, __LINE__, tolerance ))
+  #define test_string_is_equal( actual_value, expected_value ) (this->test_string_is_equal_stub( actual_value, expected_value, __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+  #define test_is_equal( actual_value, expected_value ) (this->test_is_equal_stub( actual_value, expected_value, __FILE__, __PRETTY_FUNCTION__, __LINE__ ))
+#endif // WIN32
 
 #endif
 
Index: avida/current/source/third-party/yaktest/test_problem.cpp
diff -u avida/current/source/third-party/yaktest/test_problem.cpp:1.1 avida/current/source/third-party/yaktest/test_problem.cpp:1.2
--- avida/current/source/third-party/yaktest/test_problem.cpp:1.1	Tue Nov 25 10:50:08 2003
+++ avida/current/source/third-party/yaktest/test_problem.cpp	Mon Dec 29 14:55:16 2003
@@ -2,9 +2,22 @@
 
 //constructor (dumb initializer) for test_problem
 test_problem::test_problem(  const std::string& filename, 
+			     const std::string& functionname,
 			     long line_number, 
 			     const std::string& message ) :
 m_line_number( line_number ),
+m_functionname( functionname ),
+m_filename( filename ),
+m_message( message )
+{
+}
+
+//constructor (dumb initializer) for test_problem, sans functionname
+test_problem::test_problem(  const std::string& filename, 
+			     long line_number, 
+			     const std::string& message ) :
+m_line_number( line_number ),
+m_functionname( "" ),
 m_filename( filename ),
 m_message( message )
 {
@@ -13,6 +26,7 @@
 //copy constructor
 test_problem::test_problem( const test_problem& rhs ) :
 m_line_number( rhs.m_line_number ),
+m_functionname( rhs.m_functionname ),
 m_filename( rhs.m_filename ),
 m_message( rhs.m_message )
 {
@@ -23,6 +37,7 @@
 test_problem::operator=( const test_problem& rhs )
 {
   m_line_number = rhs.m_line_number;
+  m_functionname = rhs.m_functionname;
   m_filename = rhs.m_filename;
   m_message = rhs.m_message;
   return *this;
@@ -35,6 +50,13 @@
   return m_line_number;
 }
 
+
+//data access
+const std::string&
+test_problem::functionname( void ) const
+{
+  return m_functionname;
+}
 
 //data access
 const std::string&
Index: avida/current/source/third-party/yaktest/test_problem.h
diff -u avida/current/source/third-party/yaktest/test_problem.h:1.1 avida/current/source/third-party/yaktest/test_problem.h:1.2
--- avida/current/source/third-party/yaktest/test_problem.h:1.1	Tue Nov 25 10:50:08 2003
+++ avida/current/source/third-party/yaktest/test_problem.h	Mon Dec 29 14:55:16 2003
@@ -11,6 +11,8 @@
   //protected data members
   //line number of the error, if appropriate
   long m_line_number;
+  //functionname of the error, if appropriate
+  std::string m_functionname;
   //filename of the error, if appropriate
   std::string m_filename;
   //additional message as appropriate
@@ -18,11 +20,13 @@
 
  public:
   //construction
+  test_problem( const std::string& filename, const std::string& functionname, long line_number, const std::string& message );
   test_problem( const std::string& filename, long line_number, const std::string& message );
   test_problem( const test_problem& rhs );
   test_problem& operator= (const test_problem& rhs);
   //data access
   long line_number( void ) const;
+  const std::string& functionname( void ) const;
   const std::string& filename( void ) const;
   const std::string& message( void ) const;
 
Index: avida/current/source/third-party/yaktest/text_test_interpreter.cpp
diff -u avida/current/source/third-party/yaktest/text_test_interpreter.cpp:1.1 avida/current/source/third-party/yaktest/text_test_interpreter.cpp:1.2
--- avida/current/source/third-party/yaktest/text_test_interpreter.cpp:1.1	Tue Nov 25 10:50:08 2003
+++ avida/current/source/third-party/yaktest/text_test_interpreter.cpp	Mon Dec 29 14:55:16 2003
@@ -79,7 +79,9 @@
   Result.append( problem.filename() );
   Result.append( ":" );
   Result.append( _yak_itoa( problem.line_number() ) );
-  Result.append( ":" );
+  Result.append( ":<" );
+  Result.append( problem.functionname() );
+  Result.append( "> " );
   Result.append( problem.message() );
   Result.append( "\n" );
   return Result;
Index: avida/current/source/tools/CMakeLists.txt
diff -u avida/current/source/tools/CMakeLists.txt:1.1 avida/current/source/tools/CMakeLists.txt:1.2
--- avida/current/source/tools/CMakeLists.txt:1.1	Sat Dec  6 10:01:07 2003
+++ avida/current/source/tools/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,4 +1,3 @@
-
 SET(libtools_a_SOURCES
   block_struct.cc
   const_schedule.cc
Index: avida/current/source/tools/tDataEntry.hh
diff -u avida/current/source/tools/tDataEntry.hh:1.1 avida/current/source/tools/tDataEntry.hh:1.2
--- avida/current/source/tools/tDataEntry.hh:1.1	Tue Nov 25 09:38:01 2003
+++ avida/current/source/tools/tDataEntry.hh	Mon Dec 29 14:55:16 2003
@@ -21,7 +21,7 @@
 #endif
 
 class cString;
-class cStringUtil; // access
+struct cStringUtil; // access
 
 template <class T, class OUT> class tDataEntry : public tDataEntryBase<T> {
 protected:
Index: avida/current/source/tools/tDictionary.hh
diff -u avida/current/source/tools/tDictionary.hh:1.6 avida/current/source/tools/tDictionary.hh:1.7
--- avida/current/source/tools/tDictionary.hh:1.6	Tue Nov 25 09:38:01 2003
+++ avida/current/source/tools/tDictionary.hh	Mon Dec 29 14:55:16 2003
@@ -23,7 +23,7 @@
 #define DICTIONARY_HASH_LARGE   2311
 
 class cString; // aggregate
-class cStringUtil; // access
+struct cStringUtil; // access
 template <class T> class tList; // access
 template <class T> class tListIterator; // aggregate
 
Index: avida/current/source/viewers/CMakeLists.txt
diff -u avida/current/source/viewers/CMakeLists.txt:1.1 avida/current/source/viewers/CMakeLists.txt:1.2
--- avida/current/source/viewers/CMakeLists.txt:1.1	Sat Dec  6 10:01:07 2003
+++ avida/current/source/viewers/CMakeLists.txt	Mon Dec 29 14:55:16 2003
@@ -1,15 +1,4 @@
-
-INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/TargetDistclean.cmake)
 INCLUDE(${PROJECT_SOURCE_DIR}/CMakeModules/FindNcurses.cmake)
-
-OPTION(_NCURSES_CONSOLE_INTERFACE
-  "Enable building Avida console interface."
-  ON
-)
-# )
-#VARIABLE_REQUIRES(_NCURSES_CONSOLE_INTERFACE NCURSES_REQUISITES
-#  NCURSES_INCLUDE_PATH
-#)
 
 IF(_NCURSES_CONSOLE_INTERFACE)
   INCLUDE_DIRECTORIES(


More information about the Avida-cvs mailing list