248e06b310007df5a332e127e05a257b7b8824d6
[mussa.git] / mussa_gui_motif_window.hh
1 #include "mussa_class.hh"
2
3 #include <FL/Fl.H>
4 #include <FL/Fl_Window.H>
5 #include <FL/Fl_Button.H>
6
7 #include <FL/Fl_Input.H>
8 #include <FL/Fl_Output.H>
9 #include <FL/Fl_Pack.H>
10 #include <FL/fl_show_colormap.H>
11
12 struct motif
13 {
14   string name, seq;
15   Fl_Color color;
16   vector<vector<int> > locations;
17   bool dirty;
18 };
19
20 //typedef motif_ptr *motif;
21  
22
23 class MotifWindow : public Fl_Window
24
25   public:
26     MotifWindow(int w, int h, const char* title, vector<motif> * some_motifs);
27     ~MotifWindow();
28     Fl_Pack * motif_input_pack;
29     list<Fl_Input*> motif_ins;
30     vector<Fl_Button*> motif_color_buttons;
31     list<Fl_Input*> name_ins;
32     Fl_Button* test;
33     Fl_Button* add_motif;
34
35     void cb_motif_in_i(Fl_Input*, int i);
36     void cb_motif_color_i(Fl_Button* o, int i);
37
38   private:
39     vector<motif> * the_motifs;
40     int motif_count;
41
42     void add_motif_input(int index);
43
44     static void add_motif_cb(Fl_Button*, void*);
45     inline void add_motif_cb_real(Fl_Button*, void*);
46
47     static void print_cb(Fl_Button*, void*);
48     inline void print_cb_real(Fl_Button*, void*);
49 };
50
51 // crazy whacked shite Titus taught me to do to get an index value associated
52 // with each instance of an input associated with the callback... 
53 struct motif_instance
54 {
55   MotifWindow * mw_ptr;
56   int index;
57 };
58
59 motif new_blank_motif();