| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 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 |
|
|---|
| 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; |
|---|
| 63 |
|
|---|
| 64 |
while(1) { |
|---|
| 65 |
ch = getopt(argc, argv, ""); |
|---|
| 66 |
if (ch == -1) { |
|---|
| 67 |
break; |
|---|
| 68 |
} |
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 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 |
|
|---|
| 81 |
sister::init(); |
|---|
| 82 |
canal::init(); |
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 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 |
} |
|---|