d859c6a857c34e0797ed7f503e6010d56f64c370
[mussa.git] / mussa_gui_subana.hh
1 #include "mussa_gui_seq_text.hh"
2 #include <FL/Fl_File_Chooser.H>
3 #include <FL/Fl_Scroll.H>
4
5 class SubanaWindow : public Fl_Window
6
7   public:
8     SubanaWindow(int w, int h, const char* title, Mussa *an_analysis,
9                  vector<Sequence> some_Seqs);
10     ~SubanaWindow();
11     bool done();
12
13
14     Fl_Button* test;
15
16     Fl_Input *name_input;
17     Fl_Input *win_input;
18     Fl_Input *thres_input;
19     Fl_Input *seq_num_input;
20     Fl_Scroll *seq_scroll;
21     // need to keep track of these so a browsed file search can set the input
22     // fields to the selected file
23     vector<Fl_Input*> seq_inputs, annot_inputs;
24
25
26     // callback receiver functions
27
28     void real_do_subana();
29
30     void real_set_ana_name_cb(Fl_Input* o);
31     void real_set_win_size_cb(Fl_Input* o);
32     void real_set_threshold_cb(Fl_Input* o);
33
34     void real_sub_start_in_cb(Fl_Input* o, int i);
35     void real_sub_end_in_cb(Fl_Input* o, int i);
36
37   private:
38     // sequence data
39     vector<Sequence> the_Seqs;
40     Mussa *an_analysis;
41     string ana_name;
42     int window, threshold, seq_num;
43     vector<int> sub_seq_starts, sub_seq_ends;
44     bool win_append, thres_append;
45     bool all_done;
46
47     static void print_cb(Fl_Button*, void*);
48     inline void print_cb_real(Fl_Button*, void*);
49
50     void add_seq_input(int index, string a_name);
51 };
52
53 // crazy whacked shite Titus taught me to do to get an index value associated
54 // with each instance of an input associated with the callback... 
55
56
57 struct sub_seq_data_instance
58 {
59   SubanaWindow * sw_ptr;
60   int index;
61 };
62