[project @ 13]
[mussa.git] / mussa_gui_load_window.hh
1 //  This file is part of the Mussa source distribution.
2 //  http://mussa.caltech.edu/
3 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
4
5 // This program and all associated source code files are Copyright (C) 2005
6 // the California Institute of Technology, Pasadena, CA, 91125 USA.  It is
7 // under the GNU Public License; please see the included LICENSE.txt
8 // file for more information, or contact Tristan directly.
9
10
11 #include "mussa_gui_annot_window.hh"
12 #include <FL/Fl_File_Chooser.H>
13 #include <FL/Fl_Scroll.H>
14
15 class SetupWindow : public Fl_Window
16
17   public:
18     SetupWindow(int w, int h, const char* title, Mussa *an_analysis);
19     ~SetupWindow();
20
21     bool done();
22
23   //did I put these in public for a reason?
24     Fl_Button* test;
25     Fl_Input *name_input;
26     Fl_Input *win_input;
27     Fl_Input *thres_input;
28     Fl_Input *seq_num_input;
29     Fl_Scroll *seq_scroll;
30     // need to keep track of these so a browsed file search can set the input
31     // fields to teh selected file
32     vector<Fl_Input*> seq_inputs, annot_inputs;
33
34
35     // callback receiver functions
36
37     void real_do_analysis();
38
39     void real_set_ana_name_cb(Fl_Input* o);
40     void real_set_win_size_cb(Fl_Input* o);
41     void real_set_threshold_cb(Fl_Input* o);
42     void real_set_seq_num_cb(Fl_Input* o);
43
44     void real_seq_file_in_cb(Fl_Input* o, int i);
45     void real_choose_seq_file_cb(int i);
46     void real_annot_file_in_cb(Fl_Input* o, int i);
47     void real_choose_annot_file_cb(int i);
48
49     void real_fa_index_in_cb(Fl_Input* o, int i);
50     void real_sub_start_in_cb(Fl_Input* o, int i);
51     void real_sub_end_in_cb(Fl_Input* o, int i);
52
53   private:
54     Mussa *an_analysis;
55     string ana_name;
56     int window, threshold, seq_num;
57     vector<string> seq_files, annot_files;
58     vector<int> fasta_indices, sub_seq_starts, sub_seq_ends;
59     bool win_append, thres_append;
60
61     bool all_done;
62     static void print_cb(Fl_Button*, void*);
63     inline void print_cb_real(Fl_Button*, void*);
64
65     void add_seq_input(int index);
66 };
67
68 // crazy whacked shite Titus taught me to do to get an index value associated
69 // with each instance of an input associated with the callback... 
70
71 struct seq_data_instance
72 {
73   SetupWindow * sw_ptr;
74   int index;
75 };