[project @ 13]
[mussa.git] / mussa_gui_annot_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_gui_motif_window.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 annot_color
23 {
24   string type;
25   Fl_Color color;
26 };
27
28 //typedef annot_ptr *annot;
29  
30
31 class AnnotWindow : public Fl_Window
32
33   public:
34     AnnotWindow(int w, int h, const char* title, 
35                 vector<annot_color> * some_annots);
36     ~AnnotWindow();
37     Fl_Pack * annot_input_pack;
38     list<Fl_Output*> annot_ins;
39     vector<Fl_Button*> annot_color_buttons;
40     list<Fl_Input*> name_ins;
41     Fl_Button* test;
42     Fl_Button* add_annot;
43
44     void cb_annot_in_i(Fl_Input*, int i);
45     void cb_annot_color_i(Fl_Button* o, int i);
46
47   private:
48     vector<annot_color> * the_annots;
49     int annot_count;
50
51     void add_annot_input(int index);
52
53     static void add_annot_cb(Fl_Button*, void*);
54     inline void add_annot_cb_real(Fl_Button*, void*);
55
56     static void print_cb(Fl_Button*, void*);
57     inline void print_cb_real(Fl_Button*, void*);
58 };
59
60 // crazy whacked shite Titus taught me to do to get an index value associated
61 // with each instance of an input associated with the callback... 
62 struct annot_instance
63 {
64   AnnotWindow * mw_ptr;
65   int index;
66 };
67
68 annot_color new_blank_annot();