ARB
PH_main.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : PH_main.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #include "phylo.hxx"
12 #include "phwin.hxx"
13 #include "PH_display.hxx"
14 
15 #include <awt_sel_boxes.hxx>
16 #include <aw_preset.hxx>
17 #include <aw_awar.hxx>
18 #include <aw_msg.hxx>
19 #include <awt.hxx>
20 #include <aw_root.hxx>
21 #include <arbdbt.h>
22 #include <arb_strarray.h>
23 
24 #include <macros.hxx>
25 #include <aw_question.hxx>
26 
28 
29 const char *filter_text[FILTER_MODES] = {
30  "don't count (ignore) ", // DONT_COUNT
31  "if occurs most often => forget whole column", // SKIP_COLUMN_IF_MAX
32  "if occurs => forget whole column ", // SKIP_COLUMN_IF_OCCUR
33  "count, but do NOT use as maximum ", // COUNT_DONT_USE_MAX
34  "treat as uppercase character ", // TREAT_AS_UPPERCASE
35  "treat as regular character ", // TREAT_AS_REGULAR
36 };
37 
39  GB_transaction ta(gb_main);
40  const char *aliname = aw_root->awar(AWAR_PHYLO_ALIGNMENT)->read_char_pntr();
41  if (GBT_get_alignment_len(gb_main, aliname)<1) {
43  return false;
44  }
45  return true;
46 }
47 
48 static void startup_sequence_cb(AW_window *alisel_window, AW_window *main_window, PH_root *ph_root) {
49  AW_root *aw_root = main_window->get_root();
50  GBDATA *gb_main = ph_root->get_gb_main();
51  if (valid_alignment_selected(aw_root, gb_main)) {
52  if (alisel_window) alisel_window->hide();
53 
54  char *use = aw_root->awar(AWAR_PHYLO_ALIGNMENT)->read_string();
55  PHDATA *phd = new PHDATA(aw_root, ph_root);
56 
58  phd->load(use);
59  phd->ROOT = phd;
60 
61  long len = PHDATA::ROOT->get_seq_len(); // @@@ off by one?
63  aw_root->awar(AWAR_PHYLO_FILTER_STARTCOL)->set_minmax(0, len);
64  aw_root->awar(AWAR_PHYLO_FILTER_STOPCOL)->set_minmax(0, len);
65 
66  main_window->activate();
68  }
69  else {
70  if (alisel_window) {
71  aw_message("Please select a valid alignment");
72  }
73  else {
74  GBK_terminate("Expected to have a valid alignment");
75  }
76  }
77 }
78 
79 __ATTR__NORETURN static void ph_exit(AW_window *aw_window, PH_root *ph_root) {
80  AW_root *aw_root = aw_window->get_root();
81  shutdown_macro_recording(aw_root);
82 
83  GBDATA *gb_main = ph_root->get_gb_main();
84  if (gb_main) {
85  aw_root->unlink_awars_from_DB(gb_main);
86 #if defined(DEBUG)
87  AWT_browser_forget_db(gb_main);
88 #endif // DEBUG
89  GB_close(gb_main);
90  }
91 
92  exit(EXIT_SUCCESS);
93 }
94 
95 
96 void expose_cb() {
100  }
101 }
102 
103 static void resize_cb() {
107  }
108 }
109 
110 static void gc_changed_cb(GcChange whatChanged) {
111  switch (whatChanged) {
113  ph_assert(0); // not used atm
114  FALLTHROUGH; // in NDEBUG
115  case GC_COLOR_CHANGED:
116  expose_cb();
117  break;
118  case GC_FONT_CHANGED:
119  resize_cb();
120  break;
121  }
122 }
123 
124 static GB_ERROR PH_create_ml_multiline_SAI(GB_CSTR sai_name, int nr, GBDATA **gb_sai_ptr, PH_root *ph_root) {
125  GBDATA *gb_sai = GBT_find_or_create_SAI(ph_root->get_gb_main(), sai_name);
126  GBDATA *gbd, *gb2;
128 
129  if (!error) {
130  for (gbd = GB_child(gb_sai); gbd; gbd = gb2) {
131  gb2 = GB_nextChild(gbd);
132 
133  const char *key = GB_read_key_pntr(gbd);
134  if (!strcmp(key, "name")) continue;
135  if (!strncmp(key, "ali_", 4)) continue;
136 
137  error = GB_delete(gbd);
138  if (error) break;
139  }
140  }
141 
142  if (!error) {
143  GBDATA *gb_ali = GB_search(gb_sai, PHDATA::ROOT->use, GB_FIND);
144  if (gb_ali) {
145  for (gbd = GB_child(gb_ali); gbd; gbd = gb2) {
146  gb2 = GB_nextChild(gbd);
147 
148  const char *key = GB_read_key_pntr(gbd);
149  if (!strcmp(key, "data")) continue;
150  if (!strcmp(key, "_TYPE")) continue;
151 
152  error = GB_delete(gbd);
153  if (error) break;
154  }
155  }
156  }
157 
158  GBDATA *gb_data = NULp, *gb_TYPE = NULp;
159 
160  if (!error) {
161  gb_data = GBT_add_data(gb_sai, PHDATA::ROOT->use, "data", GB_STRING);
162  if (!gb_data) error = GB_await_error();
163  }
164 
165  if (!error) {
166  gb_TYPE = GBT_add_data(gb_sai, PHDATA::ROOT->use, "_TYPE", GB_STRING);
167  if (!gb_TYPE) error = GB_await_error();
168  }
169 
170  if (!error && !PHDATA::ROOT->markerline) {
171  error = "Nothing calculated yet";
172  }
173 
174  if (!error) {
175  char *full_save_name = NULp;
176  FILE *saveResults = NULp;
177  if (nr == 2) {
178  char *save_name = GB_unique_filename("conservationProfile", "gnu");
179  saveResults = GB_fopen_tempfile(save_name, "w+", &full_save_name);
180  GB_remove_on_exit(full_save_name);
181  free(save_name);
182 
183  if (!saveResults) error = GB_await_error();
184  }
185 
186  if (!error) {
188  long minhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MINHOM)->read_int();
189  long maxhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MAXHOM)->read_int();
190  long startcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STARTCOL)->read_int();
191  long stopcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STOPCOL)->read_int();
192  float *markerline = PHDATA::ROOT->markerline;
193  long len = PHDATA::ROOT->get_seq_len();
194 
195  char *data = ARB_calloc<char>(len+1);
196  int cnt = 0;
197 
198 
199  for (int x=0; x<len; x++) {
200  char c;
201 
202  if (x<startcol || x>stopcol) {
203  c = '.';
204  }
205  else {
206  float ml = markerline[x];
207  if (nr==2 && ml>0.0) {
208  ph_assert(saveResults);
209  fprintf(saveResults, "%i\t%.2f\n", cnt, ml);
210  cnt++;
211  }
212 
213  if (ml>=0.0 && ml>=minhom && ml<=maxhom) {
214  int digit = -1;
215  switch (nr) {
216  case 0: // hundred
217  if (ml>=100.0) digit = 1;
218  break;
219  case 1: // ten
220  if (ml>=10.0) digit = int(ml/10);
221  break;
222  case 2: // one
223  digit = int(ml);
224  break;
225  default:
226  ph_assert(0);
227  break;
228  }
229 
230  if (digit<0) c = '-';
231  else c = '0' + digit%10;
232  }
233  else {
234  c = '-';
235  }
236  }
237 
238  data[x] = c;
239  }
240  data[len] = 0;
241 
242  if (saveResults) {
243  fclose(saveResults);
244  fprintf(stderr, "Note: Frequencies as well saved to '%s'\n", full_save_name);
245  }
246 
247  error = GB_write_string(gb_data, data);
248  if (!error) {
249  const char *buffer = GBS_global_string("FMX: Filter by Maximum Frequency: "
250  "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
251  startcol, stopcol, minhom, maxhom);
252  error = GB_write_string(gb_TYPE, buffer);
253  }
254  free(data);
255  }
256  free(full_save_name);
257  }
258 
259  if (!error) *gb_sai_ptr = gb_sai;
260  return error;
261 }
262 
263 static void PH_save_ml_multiline_cb(AW_window *aww, PH_root *ph_root) {
264  GB_transaction ta(ph_root->get_gb_main());
265 
266  GB_ERROR error = NULp;
267  char *fname = aww->get_root()->awar(AWAR_PHYLO_MARKERLINENAME)->read_string();
268  int fname_len = strlen(fname);
269  {
270  char *digit_appended = ARB_alloc<char>(fname_len+2);
271  memcpy(digit_appended, fname, fname_len);
272  strcpy(digit_appended+fname_len, "0");
273 
274  freeset(fname, digit_appended);
275  }
276  GBDATA *gb_sai[3];
277  int i;
278  for (i=0; !error && i<3; i++) {
279  fname[fname_len] = '0'+i;
280  error = PH_create_ml_multiline_SAI(fname, i, &gb_sai[i], ph_root);
281  }
282 
283  delete fname;
284 
285  aw_message_if(ta.close(error));
286 }
287 
288 static void PH_save_ml_cb(AW_window *aww, PH_root *ph_root) {
289  GBDATA *gb_main = ph_root->get_gb_main();
290  GB_transaction ta(gb_main);
291 
292  char *fname = aww->get_root()->awar(AWAR_PHYLO_MARKERLINENAME)->read_string();
293  GBDATA *gb_sai = GBT_find_or_create_SAI(gb_main, fname);
294 
296 
297  if (!error) {
298  for (GBDATA *gbd = GB_child(gb_sai), *gbnext; gbd; gbd = gbnext) {
299  gbnext = GB_nextChild(gbd);
300 
301  const char *key = GB_read_key_pntr(gbd);
302  if (!strcmp(key, "name")) continue;
303  if (!strncmp(key, "ali_", 4)) continue;
304 
305  error = GB_delete(gbd);
306  if (error) break;
307  }
308  }
309 
310  if (!error) {
311  GBDATA *gb_ali = GB_search(gb_sai, PHDATA::ROOT->use, GB_FIND);
312  if (gb_ali) {
313  for (GBDATA *gbd = GB_child(gb_ali), *gbnext; gbd; gbd = gbnext) {
314  gbnext = GB_nextChild(gbd);
315 
316  const char *key = GB_read_key_pntr(gbd);
317  if (!strcmp(key, "bits")) continue;
318  if (!strcmp(key, "_TYPE")) continue;
319 
320  error = GB_delete(gbd);
321  if (error) break;
322  }
323  }
324  }
325 
326  GBDATA *gb_bits = NULp, *gb_TYPE = NULp;
327 
328  if (!error) {
329  gb_bits = GBT_add_data(gb_sai, PHDATA::ROOT->use, "bits", GB_BITS);
330  if (!gb_bits) error = GB_await_error();
331  }
332 
333  if (!error) {
334  gb_TYPE = GBT_add_data(gb_sai, PHDATA::ROOT->use, "_TYPE", GB_STRING);
335  if (!gb_TYPE) error = GB_await_error();
336  }
337 
338  if (!error && !PHDATA::ROOT->markerline) {
339  error = "Nothing calculated yet";
340  }
341 
342  if (!error) {
344  long minhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MINHOM)->read_int();
345  long maxhom = main_win->get_root()->awar(AWAR_PHYLO_FILTER_MAXHOM)->read_int();
346  long startcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STARTCOL)->read_int();
347  long stopcol = main_win->get_root()->awar(AWAR_PHYLO_FILTER_STOPCOL)->read_int();
348  long len = PHDATA::ROOT->get_seq_len();
349  char *bits = ARB_calloc<char>(len+1);
350  int x;
351  float *markerline = PHDATA::ROOT->markerline;
352 
353  for (x=0; x<len; x++) {
354  int bit;
355 
356  if (x < startcol || x>stopcol) {
357  bit = 0;
358  }
359  else {
360  float ml = markerline[x];
361 
362  if (ml>=0.0 && ml>=minhom && ml<=maxhom) bit = 1;
363  else bit = 0;
364 
365  }
366  bits[x] = '0'+bit;
367  }
368 
369  error = GB_write_bits(gb_bits, bits, len, "0");
370 
371  if (!error) {
372  char buffer[1024];
373  sprintf(buffer, "FMX: Filter by Maximum Frequency: "
374  "Start %li; Stop %li; Minhom %li%%; Maxhom %li%%",
375  startcol, stopcol, minhom, maxhom);
376 
377  error = GB_write_string(gb_TYPE, buffer);
378  }
379  free(bits);
380  }
381  free(fname);
382  aw_message_if(ta.close(error));
383 }
384 
385 
386 static AW_window *PH_save_markerline(AW_root *root, PH_root *ph_root, int multi_line) {
387  // multi_line ==1 -> save three SAI's usable as column percentage
388 
390 
391  AW_window_simple *aws = new AW_window_simple;
392 
393  if (multi_line) {
394  aws->init(root, "EXPORT_FREQUENCY_LINES", "Export Frequency Lines");
395  }
396  else {
397  aws->init(root, "EXPORT_MARKER_LINE", "Export Marker Line");
398  }
399 
400  aws->load_xfig("phylo/save_markerline.fig");
401 
402  aws->callback(AW_POPDOWN);
403  aws->at("close");
404  aws->create_button("CLOSE", "CLOSE", "C");
405 
406  aws->callback(makeHelpCallback("ph_export_markerline.hlp"));
407  aws->at("help");
408  aws->create_button("HELP", "HELP", "H");
409 
410  aws->at("name");
411  aws->create_input_field(AWAR_PHYLO_MARKERLINENAME);
412 
413  aws->at("box");
415 
416  aws->at("save");
417  if (multi_line) aws->callback(makeWindowCallback(PH_save_ml_multiline_cb, ph_root));
418  else aws->callback(makeWindowCallback(PH_save_ml_cb, ph_root));
419  aws->create_button("EXPORT", "EXPORT", "E");
420 
421  return aws;
422 }
423 
424 static AW_window *create_phyl_main_window(AW_root *aw_root, PH_root *ph_root) {
426  awm->init(aw_root, "ARB_PHYLO", "ARB_PHYLO", 830, 630);
427 
428  // create menus and menu inserts with callbacks
429 
430  const GcChangedCallback gcChangedCb = makeGcChangedCallback(gc_changed_cb);
431 
432  AW_gc_manager *gcmiddle =
433  AW_manage_GC(awm,
434  awm->get_window_id(),
437  gcChangedCb,
438  "#C4B6D0",
439  "#SEQUENCE$#000000",
440  "#MARKER$#E0F570",
441  "NOT_MARKER$#A270C0",
442  NULp);
443 
444  AW_manage_GC(awm,
445  "ARB_PHYLO_BOTTOM",
448  gcChangedCb,
449  "lightgrey",
450  "#FOOTER",
451  NULp);
452 
453 
454 #if defined(DEBUG)
455  AWT_create_debug_menu(awm);
456 #endif // DEBUG
457 
458  // File menu
459  awm->create_menu("File", "F");
460  awm->insert_menu_topic("export_filter", "Export Filter", "E", "ph_export_markerline.hlp", AWM_ALL, makeCreateWindowCallback(PH_save_markerline, ph_root, 0));
461  awm->insert_menu_topic("export_freq", "Export Frequencies", "F", "ph_export_markerline.hlp", AWM_ALL, makeCreateWindowCallback(PH_save_markerline, ph_root, 1));
462  insert_macro_menu_entry(awm, false);
463 
464  awm->insert_menu_topic("quit", "Quit", "Q", "quit.hlp", AWM_ALL, makeWindowCallback(ph_exit, ph_root));
465 
466  // Calculate menu
467  awm->create_menu("Calculate", "C");
468  awm->insert_menu_topic("calc_column_filter", "Column Filter", "F", "no help", AWM_ALL, makeWindowCallback(ph_calc_filter_cb));
469 
470  // Config menu
471  awm->create_menu("Config", "o");
472  awm->insert_menu_topic("config_column_filter", "Column Filter", "F", "no help", AWM_ALL, PH_create_filter_window);
473 
474  // Properties menu
475  awm->create_menu("Properties", "P");
476  awm->insert_menu_topic("props_menu", "Frame settings ...", "F", "props_frame.hlp", AWM_ALL, AW_preset_window);
477  awm->insert_menu_topic("props_data", "Colors and Fonts ...", "C", "color_props.hlp", AWM_ALL, makeCreateWindowCallback(AW_create_gc_window, gcmiddle));
478  awm->sep______________();
480  awm->sep______________();
481  awm->insert_menu_topic("save_props", "Save Properties (phylo.arb)", "S", "savedef.hlp", AWM_ALL, AW_save_properties);
482 
483 
484  // set window areas
485  awm->set_info_area_height(30);
486  awm->at(5, 2);
487  awm->auto_space(5, -2);
488 
489  awm->callback(makeWindowCallback(ph_exit, ph_root));
490  awm->button_length(0);
491  awm->help_text("quit.hlp");
492  awm->create_button("QUIT", "QUIT");
493 
494  awm->callback(makeHelpCallback("phylo.hlp"));
495  awm->button_length(0);
496  awm->create_button("HELP", "HELP", "H");
497 
498 
499  awm->set_bottom_area_height(120);
500 
501  awm->set_expose_callback(AW_MIDDLE_AREA, makeWindowCallback(expose_cb));
502  awm->set_resize_callback(AW_MIDDLE_AREA, makeWindowCallback(resize_cb));
503  awm->set_expose_callback(AW_BOTTOM_AREA, makeWindowCallback(display_status_cb));
504  awm->set_resize_callback(AW_BOTTOM_AREA, makeWindowCallback(display_status_cb));
505 
506  return awm;
507 }
508 
509 
510 static AW_window *create_select_alignment_window(AW_root *aw_root, AW_window *main_window, PH_root *ph_root) {
511  AW_window_simple *aws = new AW_window_simple;
512 
513  aws->init(aw_root, "SELECT_ALIGNMENT", "ARB_PHYLO: Select alignment");
514  aws->load_xfig("phylo/select_ali.fig");
515  aws->button_length(10);
516 
517  aws->at("which_alignment");
519 
520  aws->auto_space(10, 10);
521 
522  aws->at("ok");
523  aws->callback(makeWindowCallback(startup_sequence_cb, main_window, ph_root));
524  aws->create_button("OK", "Ok", "D");
525 
526  aws->callback(makeWindowCallback(ph_exit, ph_root));
527  aws->create_button("ABORT", "Abort", "D");
528 
529  return aws;
530 }
531 
532 
533 
535  memset((char *) this, 0, sizeof(PH_used_windows));
536 }
537 
538 // initialize 'globals'
542 
543 static void create_variables(AW_root *aw_root, AW_default def, GBDATA *gb_main) {
544  aw_root->awar_string(AWAR_PHYLO_ALIGNMENT, "", def);
545  aw_root->awar_string(AWAR_PHYLO_FILTER_FILTER, "", def);
546  PH_create_filter_variables(aw_root, def, gb_main);
547 }
548 
549 int ARB_main(int argc, char *argv[]) {
550  aw_initstatus();
551 
552  GB_shell shell;
553  AW_root *aw_root = AWT_create_root("phylo.arb", "ARB_PHYLO", need_macro_ability());
554 
555  int exitcode = EXIT_SUCCESS;
556  if (argc > 2 || (argc == 2 && strcmp(argv[1], "--help") == 0)) {
557  fprintf(stderr, "Usage: arb_phylo [database]\n");
558  exitcode = EXIT_FAILURE;
559  }
560  else {
561  const char *db_server = (argc == 2 ? argv[1] : ":");
562 
563  PH_used_windows *puw = new PH_used_windows;
564  PH_display *phd = new PH_display;
565 
566  PH_root *ph_root = new PH_root;
567  GB_ERROR error = ph_root->open(db_server);
568 
569  if (!error) error = configure_macro_recording(aw_root, "ARB_PHYLO", ph_root->get_gb_main());
570  if (!error) {
571  GBDATA *gb_main = ph_root->get_gb_main();
572 
573  // create arb_phylo awars :
574  create_variables(aw_root, AW_ROOT_DEFAULT, gb_main);
575  ARB_init_global_awars(aw_root, AW_ROOT_DEFAULT, gb_main);
576 #if defined(DEBUG)
577  AWT_create_db_browser_awars(aw_root, AW_ROOT_DEFAULT);
578 #endif // DEBUG
579 
580 #if defined(DEBUG)
581  AWT_announce_db_to_browser(gb_main, GBS_global_string("ARB-database (%s)", db_server));
582 #endif // DEBUG
583 
584  // create main window :
585 
586  puw->phylo_main_window = create_phyl_main_window(aw_root, ph_root);
587  puw->windowList = puw;
588 
589  phd->ph_display = phd;
590 
591  // loading database
592  GB_push_transaction(gb_main);
593 
594  ConstStrArray alignment_names;
595  GBT_get_alignment_names(alignment_names, gb_main);
596 
597  int num_alignments;
598  for (num_alignments = 0; alignment_names[num_alignments]; num_alignments++) {}
599 
600  if (num_alignments > 1) {
601  char *defaultAli = GBT_get_default_alignment(gb_main);
602  aw_root->awar(AWAR_PHYLO_ALIGNMENT)->write_string(defaultAli);
603  create_select_alignment_window(aw_root, puw->phylo_main_window, ph_root)->show();
604  free(defaultAli);
605  }
606  else {
607  aw_root->awar(AWAR_PHYLO_ALIGNMENT)->write_string(alignment_names[0]);
609  }
610  GB_pop_transaction(gb_main);
611 
613  aw_root->main_loop();
614  }
615 
616  if (error) {
617  aw_popup_exit(error);
618  exitcode = EXIT_FAILURE;
619  }
620  }
621 
622  delete aw_root;
623  return exitcode;
624 }
625 
#define AWAR_PHYLO_FILTER_STARTCOL
Definition: phylo.hxx:29
void display_status_cb()
Definition: PH_display.cxx:331
const char * GB_ERROR
Definition: arb_core.h:25
static PH_display * ph_display
Definition: PH_display.hxx:44
AW_HEADER_MAIN const char * filter_text[FILTER_MODES]
Definition: PH_main.cxx:29
GB_ERROR GB_write_bits(GBDATA *gbd, const char *bits, long size, const char *c_0)
Definition: arbdb.cxx:1416
void set_resize_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:813
void GB_remove_on_exit(const char *filename)
Definition: adsocket.cxx:1224
void button_length(int length)
Definition: AW_at.cxx:283
static void resize_cb()
Definition: PH_main.cxx:103
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:534
GBDATA * GB_child(GBDATA *father)
Definition: adquery.cxx:322
__ATTR__USERESULT_TODO GB_ERROR ARB_init_global_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
Definition: aw_root.hxx:198
Definition: arbdb.h:69
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:592
GB_ERROR GB_write_string(GBDATA *gbd, const char *s)
Definition: arbdb.cxx:1385
AW_window * phylo_main_window
Definition: phwin.hxx:21
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:717
static AW_window * PH_save_markerline(AW_root *root, PH_root *ph_root, int multi_line)
Definition: PH_main.cxx:386
const char * get_window_id() const
Definition: aw_window.hxx:364
int ARB_main(int argc, char *argv[])
Definition: PH_main.cxx:549
void at(int x, int y)
Definition: AW_at.cxx:93
void aw_initstatus()
Definition: AW_status.cxx:766
void expose_cb()
Definition: PH_main.cxx:96
void GBT_get_alignment_names(ConstStrArray &names, GBDATA *gbd)
Definition: adali.cxx:316
long read_int() const
Definition: AW_awar.cxx:187
AW_window * PH_create_filter_window(AW_root *aw_root)
Definition: PH_filt.cxx:408
AW_awar * set_minmax(float min, float max)
Definition: AW_awar.cxx:532
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:718
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
Definition: AW_preset.cxx:1445
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
__ATTR__USERESULT GB_ERROR configure_macro_recording(AW_root *aw_root, const char *client_id, GBDATA *gb_main)
Definition: trackers.cxx:454
GB_ERROR open(const char *db_server)
Definition: PH_root.cxx:14
static bool valid_alignment_selected(AW_root *aw_root, GBDATA *gb_main)
Definition: PH_main.cxx:38
AW_gc_manager * AW_manage_GC(AW_window *aww, const char *gc_base_name, AW_device *device, int base_drag, AW_GCM_AREA area, const GcChangedCallback &changecb, const char *default_background_color,...)
Definition: AW_preset.cxx:969
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
GB_ERROR GB_push_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2482
void activate()
Definition: aw_window.hxx:354
GB_ERROR GB_delete(GBDATA *&source)
Definition: arbdb.cxx:1904
char * GB_set_cache_size(GBDATA *gbd, size_t size)
Definition: adcache.cxx:294
const char * read_char_pntr() const
Definition: AW_awar.cxx:171
GcChange
Definition: aw_base.hxx:94
NOT4PERL GBDATA * GBT_add_data(GBDATA *species, const char *ali_name, const char *key, GB_TYPES type) __ATTR__DEPRECATED_TODO("better use GBT_create_sequence_data()")
Definition: adali.cxx:571
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:353
void show()
Definition: AW_window.cxx:1658
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
GB_CSTR GB_read_key_pntr(GBDATA *gbd)
Definition: arbdb.cxx:1654
#define AWAR_PHYLO_FILTER_STOPCOL
Definition: phylo.hxx:30
void ph_calc_filter_cb()
Definition: PH_display.cxx:44
static void gc_changed_cb(GcChange whatChanged)
Definition: PH_main.cxx:110
void GBK_terminate(const char *error) __ATTR__NORETURN
Definition: arb_msg.cxx:463
void clear_window()
Definition: PH_display.hxx:50
static PH_used_windows * windowList
Definition: phwin.hxx:20
void AW_save_properties(AW_window *aw)
Definition: AW_preset.cxx:1452
float * markerline
Definition: phylo.hxx:153
void GB_clear_error()
Definition: arb_msg.cxx:365
void set_expose_callback(AW_area area, const WindowCallback &wcb)
Definition: AW_window.cxx:762
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:469
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
Definition: AW_preset.cxx:1373
void help_text(const char *id)
Definition: AW_window.cxx:113
static void error(const char *msg)
Definition: mkptypes.cxx:96
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2374
FILE * GB_fopen_tempfile(const char *filename, const char *fmode, char **res_fullname)
Definition: adsocket.cxx:1142
AW_window * AW_preset_window(AW_root *root)
Definition: AW_preset.cxx:1920
#define ph_assert(cond)
Definition: phylo.hxx:24
void PH_create_filter_variables(AW_root *aw_root, AW_default default_file, GBDATA *gb_main)
Definition: PH_filt.cxx:370
void ph_view_species_cb()
Definition: PH_display.cxx:27
UserActionTracker * need_macro_ability()
Definition: trackers.cxx:450
char * read_string() const
Definition: AW_awar.cxx:201
#define AWAR_PHYLO_FILTER_MAXHOM
Definition: phylo.hxx:32
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GB_ERROR GB_pop_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2512
#define AWAR_PHYLO_FILTER_MINHOM
Definition: phylo.hxx:31
Definition: arbdb.h:86
#define EXIT_FAILURE
Definition: arb_a2ps.c:157
static AW_window_menu_modes_opengl * awm
void unlink_awars_from_DB(GBDATA *gb_main)
Definition: AW_root.cxx:635
static void PH_save_ml_cb(AW_window *aww, PH_root *ph_root)
Definition: PH_main.cxx:288
#define AW_HEADER_MAIN
Definition: aw_window.hxx:36
AW_DB_selection * awt_create_ALI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, const char *ali_type_match)
char * GB_unique_filename(const char *name_prefix, const char *suffix)
Definition: adsocket.cxx:1199
void main_loop()
Definition: AW_root.cxx:625
AW_root * AWT_create_root(const char *properties, const char *program, UserActionTracker *user_tracker)
void set_info_area_height(int height)
Definition: AW_window.cxx:793
void display()
Definition: PH_display.cxx:150
void set_bottom_area_height(int height)
Definition: AW_window.cxx:798
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:32
const int FILTER_MODES
Definition: phylo.hxx:52
#define PH_DB_CACHE_SIZE
Definition: phylo.hxx:55
void resized()
Definition: PH_display.cxx:98
static AW_window * create_phyl_main_window(AW_root *aw_root, PH_root *ph_root)
Definition: PH_main.cxx:424
GBDATA * get_gb_main() const
Definition: phylo.hxx:103
static AW_window * create_select_alignment_window(AW_root *aw_root, AW_window *main_window, PH_root *ph_root)
Definition: PH_main.cxx:510
void aw_message(const char *msg)
Definition: AW_status.cxx:932
void hide()
Definition: AW_window.cxx:1807
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
Definition: macro_gui.cxx:171
AW_root * get_root()
Definition: aw_window.hxx:348
__ATTR__NORETURN void aw_popup_exit(const char *msg)
void shutdown_macro_recording(AW_root *aw_root)
Definition: trackers.cxx:470
#define NULp
Definition: cxxforward.h:97
#define __ATTR__NORETURN
Definition: attributes.h:56
static void startup_sequence_cb(AW_window *alisel_window, AW_window *main_window, PH_root *ph_root)
Definition: PH_main.cxx:48
GB_ERROR write_string(const char *aw_string)
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:687
void sep______________()
Definition: AW_window.cxx:750
AW_DB_selection * awt_create_SAI_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, bool fallback2default, const SaiSelectionlistFilterCallback &fcb)
static PHDATA * ROOT
Definition: phylo.hxx:151
void AWT_install_cb_guards()
GBDATA * GB_nextChild(GBDATA *child)
Definition: adquery.cxx:326
#define FALLTHROUGH
Definition: cxxforward.h:110
GBDATA * GBT_find_or_create_SAI(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:65
char * load(char *&use)
Definition: PH_data.cxx:28
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:130
long get_seq_len()
Definition: phylo.hxx:172
GBDATA * gb_main
Definition: adname.cxx:33
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
static void PH_save_ml_multiline_cb(AW_window *aww, PH_root *ph_root)
Definition: PH_main.cxx:263
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
static GB_ERROR PH_create_ml_multiline_SAI(GB_CSTR sai_name, int nr, GBDATA **gb_sai_ptr, PH_root *ph_root)
Definition: PH_main.cxx:124
const char * GB_CSTR
Definition: arbdb_base.h:25
#define AWAR_PHYLO_FILTER_FILTER
Definition: phylo.hxx:27
#define AWAR_PHYLO_MARKERLINENAME
Definition: phylo.hxx:39
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
GB_ERROR ph_check_initialized()
Definition: PH_display.cxx:39
static void create_variables(AW_root *aw_root, AW_default def, GBDATA *gb_main)
Definition: PH_main.cxx:543
static __ATTR__NORETURN void ph_exit(AW_window *aw_window, PH_root *ph_root)
Definition: PH_main.cxx:79
GB_ERROR write_int(long aw_int)
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
void GB_close(GBDATA *gbd)
Definition: arbdb.cxx:649
#define AWAR_PHYLO_ALIGNMENT
Definition: phylo.hxx:26
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:446
bool digit(int ch)