Thicker bars, better letters
[mussa.git] / gui / MotifWindow.hh
1 #ifndef _MUSSA_GUI_MOTIF_WINDOW_H_
2 #define _MUSSA_GUI_MOTIF_WINDOW_H_
3 //  This file is part of the Mussa source distribution.
4 //  http://mussa.caltech.edu/
5 //  Contact author: Tristan  De Buysscher, tristan@caltech.edu
6
7 // This program and all associated source code files are Copyright (C) 2005
8 // the California Institute of Technology, Pasadena, CA, 91125 USA.  It is
9 // under the GNU Public License; please see the included LICENSE.txt
10 // file for more information, or contact Tristan directly.
11
12 #include <list>
13 #include <string>
14 #include <vector>
15
16 #include <FL/Fl_Window.H>
17 #include <FL/Fl_Button.H>
18
19 #include <FL/Fl_Input.H>
20 #include <FL/Fl_Pack.H>
21
22 #include "alg/mussa_class.hh"
23
24 struct motif
25 {
26   std::string name, seq;
27   Fl_Color color;
28   std::vector<std::vector<int> > locations;
29   bool dirty;
30 };
31
32 //typedef motif_ptr *motif;
33  
34
35 class MotifWindow : public Fl_Window
36
37   public:
38     MotifWindow(int w, int h, const char* title, std::vector<motif> * some_motifs);
39     ~MotifWindow();
40     Fl_Pack * motif_input_pack;
41     std::list<Fl_Input*> motif_ins;
42     std::vector<Fl_Button*> motif_color_buttons;
43     std::list<Fl_Input*> name_ins;
44     Fl_Button* test;
45     Fl_Button* add_motif;
46
47     void cb_motif_in_i(Fl_Input*, int i);
48     void cb_motif_color_i(Fl_Button* o, int i);
49
50   private:
51     std::vector<motif> * the_motifs;
52     int motif_count;
53
54     void add_motif_input(int index);
55
56     static void add_motif_cb(Fl_Button*, void*);
57     inline void add_motif_cb_real(Fl_Button*, void*);
58
59     static void print_cb(Fl_Button*, void*);
60     inline void print_cb_real(Fl_Button*, void*);
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 struct motif_instance
66 {
67   MotifWindow * mw_ptr;
68   int index;
69 };
70
71 motif new_blank_motif();
72 #endif