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