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