root/trunk/FRII/app/FRII.cc

Revision 144, 2.7 kB (checked in by t, 2 years ago)

include FL/ instead of Fl/

Line 
1 /*
2  * This file is part of the FamilyRelations II source distribution.
3  *
4  * FamilyRelations II is part of the FamilyJewels package for comparative
5  * sequence analysis: http://family.caltech.edu/.
6  *
7  * Contact author: C. Titus Brown, titus@caltech.edu.
8  *
9  * This program and all associated source code files are Copyright (C) 2003,
10  * 2004 the California Institute of Technology, Pasadena, CA, 91125 USA.  It
11  * is under the Lesser GNU Public License; please see the included
12  * LICENSE.txt file for more information, or contact Titus directly.
13  *
14  */
15
16 // The main application: create a window with a variety of options for
17 // loading data.
18
19 #include <stdlib.h>
20
21 #include <FL/Fl.H>
22 #include <FL/Fl_Double_Window.H>
23 #include <FL/Fl_Tabs.H>
24
25 #include "load_canal.hh"
26 #include "load_sister.hh"
27
28 #include "LoginWindow.hh"
29 #include "LoadFileWindow.hh"
30 #include "PreferencesWindow.hh"
31
32 CartwheelServerInfo servers[] = {
33   { "Woodward (Caltech public server)",
34     "woodward.caltech.edu", "/canal/services/canal_svc/", 80 },
35   { "UTSA server",
36     "ross.cbi.utsa.edu", "/canal/services/canal_svc/", 80 },
37   { "", "", "", 0 },
38 };
39
40 int load_xml_file(char * filename)
41 {
42   //
43   // OK, now go load everything.
44   //
45
46   sister::init();
47
48   iff::AnalysisGroup* g = sister::parse_file(filename);
49
50   if (g->n_sequences() == 1) {
51     load_single((iff::SingleAnalysisGroup*) g);
52   } else {
53     load_pair((iff::PairAnalysisGroup*) g);
54   }
55
56   return Fl::run();
57 }
58
59 int main(int argc, char * argv[])
60 {
61   int ch;
62   char * filename = NULL;       // sisterXML filename to load.
63
64   while(1) {
65     ch = getopt(argc, argv, "");
66     if (ch == -1) {             // end of options
67       break;
68     }
69   }
70
71   // allow exactly one extra argument: the filename
72   if (optind < argc && optind + 1 == argc) {
73     filename = argv[optind];
74   }
75
76   if (filename != NULL) {
77     load_xml_file(filename);
78   }
79   else {
80     // initialize necessary packages
81     sister::init();
82     canal::init();
83
84     // create & display login window.
85     Fl_Window* w = new Fl_Double_Window(550, 300);
86     w->label("FamilyRelationsII");
87     w->hotspot(w);
88
89     Fl_Tabs * tabs = new Fl_Tabs(0, 0, 550, 300);
90     w->add(tabs);
91
92     LoginWindow* login_window = new LoginWindow(0, 30, 550, 270,
93                                                 servers,
94                                                 "Cartwheel login");
95     login_window->selection_color(FL_LIGHT1);
96     tabs->add(login_window);
97
98     LoadFileWindow * load_file = new LoadFileWindow(0, 30, 550, 270);
99     load_file->selection_color(FL_LIGHT1);
100
101     tabs->add(load_file);
102
103     PreferencesWindow * preferences_window;
104     preferences_window = new PreferencesWindow(0, 30, 550, 270);
105     preferences_window->label("Preferences");
106     preferences_window->selection_color(FL_LIGHT1);
107
108     tabs->add(preferences_window);
109
110     w->show();
111     Fl::run();
112
113     delete w;
114   }
115
116   exit(0);
117 }
Note: See TracBrowser for help on using the browser.