ARB
NT_extern.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : NT_extern.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #include "map_viewer.h"
12 #include "NT_local.h"
13 #include "ad_trees.h"
14 #include "NT_group_search.h"
15 
16 #include <seq_quality.h>
17 #include <multi_probe.hxx>
18 #include <st_window.hxx>
19 #include <GEN.hxx>
20 #include <EXP.hxx>
21 
22 #include <TreeCallbacks.hxx>
23 #include <AW_rename.hxx>
24 #include <probe_gui.hxx>
25 #include <primer_design.hxx>
26 #include <gde.hxx>
27 #include <awtc_submission.hxx>
28 
29 #include <macros.hxx>
30 #include <nds.h>
31 #include <db_query.h>
32 #include <dbui.h>
33 #include <refentries.h>
34 #include <insdel.h>
35 
36 #include <awti_export.hxx>
37 #include <awti_import.hxx>
38 
39 #include <awt.hxx>
40 #include <awt_input_mask.hxx>
41 #include <awt_sel_boxes.hxx>
42 #include <awt_www.hxx>
43 #include <awt_TreeAwars.hxx>
44 #include <awt_misc.hxx>
45 
46 #include <aw_color_groups.hxx>
47 #include <aw_advice.hxx>
48 #include <aw_preset.hxx>
49 #include <aw_awars.hxx>
50 #include <aw_global_awars.hxx>
51 #include <aw_file.hxx>
52 #include <aw_msg.hxx>
53 #include <arb_progress.h>
54 #include <aw_root.hxx>
55 #include <aw_question.hxx>
56 #include <aw_select.hxx>
57 #include <rootAsWin.h>
58 
59 #include <ad_cb.h>
60 
61 #include <arb_strbuf.h>
62 #include <arb_file.h>
63 #include <arb_version.h>
64 
65 #include <saicalc.h>
66 
67 #if defined(DEVEL_RALF)
68 # define TRACE_GROUP_SELECTION
69 #endif
70 
71 #define AWAR_EXPORT_NDS "tmp/export_nds"
72 #define AWAR_EXPORT_NDS_SEPARATOR AWAR_EXPORT_NDS "/delimiter"
73 #define AWAR_MARKED_SPECIES_COUNTER "tmp/disp_marked_species"
74 #define AWAR_NTREE_TITLE_MODE "tmp/title_mode"
75 
77 
81 
83 
85  EXPORT_SPACE_PADDED_RIGHT_ALIGNED = 1, // format info (using spaces). slow - uses one extra pass for column width detection.
86  EXPORT_SPACE_PADDED_LEFT_ALIGNED = 4, // dito, but left aligned
87  EXPORT_TAB_SEPARATED = 2, // format info (using 1 tab per column - for easy import into star-calc, excel, etc. )
88  EXPORT_COMMA_SEPARATED = 3, // like EXPORT_TAB_SEPARATED, but using commas
89 };
90 
91 static void nt_changesecurity(AW_root *aw_root) {
92  int level = aw_root->awar(AWAR_SECURITY_LEVEL)->read_int();
94  GB_change_my_security(GLOBAL.gb_main, level); // changes user security
96 }
97 
98 static void export_nds_cb(AW_window *aww, bool do_print) {
99  AW_root *aw_root = aww->get_root();
100  char *name = aw_root->awar(AWAR_EXPORT_NDS"/file_name")->read_string();
101  FILE *out = fopen(name, "w");
102 
103  if (!out) {
104  aw_message("Error: Cannot open and write to file");
105  }
106  else {
108 
109  char *tree_name = aw_root->awar(AWAR_TREE)->read_string();
110  const Export_Type export_type = (Export_Type)aw_root->awar(AWAR_EXPORT_NDS_SEPARATOR)->read_int();
112  const bool spacePadded = export_type == EXPORT_SPACE_PADDED_LEFT_ALIGNED || export_type == EXPORT_SPACE_PADDED_RIGHT_ALIGNED;
113  const int passesNeeded = spacePadded ? 2 : 1;
114  NDS_Labeler labeler(nds_type);
115 
116  arb_progress progress("Exporting data using NDS", passesNeeded*GBT_count_marked_species(GLOBAL.gb_main));
117 
118  const size_t max_col = std::max(labeler.max_columns(GLOBAL.gb_main), 1L);
119  size_t col_max_len[max_col];
120 
121  const char *col_format = NULp;
122 
123  if (spacePadded) {
124  for (size_t i = 0; i<max_col; ++i) {
125  col_max_len[i] = 0;
126  }
127  if (export_type == EXPORT_SPACE_PADDED_RIGHT_ALIGNED) {
128  col_format = "%*s";
129  }
130  else {
131  col_format = "%-*s";
132  }
133  }
134 
135  for (int pass = 1; pass<=passesNeeded; ++pass) {
136  for (GBDATA *gb_species = GBT_first_marked_species(GLOBAL.gb_main);
137  gb_species;
138  gb_species = GBT_next_marked_species(gb_species))
139  {
140  const char *label = labeler.speciesLabel(GLOBAL.gb_main, gb_species, NULp, tree_name);
141 
142  if (spacePadded) {
143  ConstStrArray parts;
144  GBT_split_string(parts, label, "\t", false);
145 
146  size_t col_count = parts.size();
147  nt_assert(col_count<=max_col);
148 
149  if (pass == 1) { // track maximum used width for all columns
150  for (size_t i = 0; i<col_count; ++i) {
151  col_max_len[i] = std::max(col_max_len[i], strlen(parts[i]));
152  }
153  }
154  else { // format according to tracked widths
155  for (size_t i = 0; i<col_count; ++i) {
156  if (i) fputc(' ', out);
157 
158  arb_assert(col_max_len[i]>0); // otherwise empty, unused column (might be ok, but might need different handling)
159  arb_assert(col_max_len[i]<=INT_MAX); // (protect cast below)
160 
161  if (export_type == EXPORT_SPACE_PADDED_LEFT_ALIGNED && i == (col_count-1)) { // left aligned and last column
162  fputs(parts[i], out);
163  }
164  else {
165  fprintf(out, col_format, int(col_max_len[i]), parts[i]);
166  }
167  }
168  fputc('\n', out);
169  }
170  }
171  else {
172  fprintf(out, "%s\n", label);
173  }
174  ++progress;
175  }
176  }
177 
179  fclose(out);
180  if (do_print) {
181  GB_ERROR error = GB_textprint(name);
182  if (error) aw_message(error);
183  }
184  free(tree_name);
185  }
186  free(name);
187 }
188 
190  AW_window_simple *aws = new AW_window_simple;
191  aws->init(root, "EXPORT_NDS_OF_MARKED", "EXPORT NDS OF MARKED SPECIES");
192  aws->load_xfig("sel_box_nds.fig");
193 
194  aws->callback(AW_POPDOWN);
195  aws->at("close");
196  aws->create_button("CLOSE", "CLOSE", "C");
197 
198  aws->callback(makeHelpCallback("arb_export_nds.hlp"));
199  aws->at("help");
200  aws->create_button("HELP", "HELP", "H");
201 
202  aws->at("save");
203  aws->callback(makeWindowCallback(export_nds_cb, false));
204  aws->create_button("SAVE", "SAVE", "S");
205 
206  aws->at("print");
207  aws->callback(makeWindowCallback(export_nds_cb, true));
208  aws->create_button("PRINT", "PRINT", "P");
209 
210  aws->at("toggle1");
211  aws->label("Column output");
212  aws->create_option_menu(AWAR_EXPORT_NDS_SEPARATOR);
213  aws->insert_option ("Space padded (left aligned)", "S", EXPORT_SPACE_PADDED_LEFT_ALIGNED);
214  aws->insert_option ("Space padded (right aligned)", "r", EXPORT_SPACE_PADDED_RIGHT_ALIGNED);
215  aws->insert_default_option("TAB separated", "T", EXPORT_TAB_SEPARATED);
216  aws->insert_option ("Comma separated", "C", EXPORT_COMMA_SEPARATED);
217  aws->update_option_menu();
218 
220 
221  return aws;
222 }
223 
225  AW_create_fileselection_awars(awr, AWAR_EXPORT_NDS, "", ".nds", "export.nds");
227 }
228 
230  const char *value = awr->awar(AWAR_SPECIES_NAME)->read_char_pntr();
231  awr->awar(AWAR_INFO_BUTTON_TEXT)->write_string(value[0] ? value : "Species Info");
232  if (value[0]) {
233  awr->awar(AWAR_GROUP)->write_pointer(NULp); // deselect group when species gets selected
234 #if defined(TRACE_GROUP_SELECTION)
235  fputs("clear AWAR_GROUP (because species selected)\n", stderr);
236 #endif
237  }
238 }
239 
240 static void expert_mode_changed_cb(AW_root *aw_root) {
241  aw_root->awar(AWAR_AWM_MASK)->write_int(aw_root->awar(AWAR_EXPERT)->read_int() ? AWM_ALL : AWM_BASIC); // publish expert-mode globally
242 }
243 
246 
247 static void nt_create_all_awars(AW_root *awr) {
248  // creates awars for all modules reachable from ARB_NT main window
249 
251  if (GB_read_clients(GLOBAL.gb_main)>=0) {
252  awr->awar_string(AWAR_TREE, "", GLOBAL.gb_main);
253  }
254  else {
256  }
257 
258  awr->awar_string(AWAR_TOPAREA_SAIS, "ECOLI;HELIX;HELIX_NR", AW_ROOT_DEFAULT);
259 
264  awr->awar_string(AWAR_INFO_BUTTON_TEXT, "Species Info", GLOBAL.gb_main);
267 
268  awr->awar_string(AWAR_SAI_COLOR_STR, "", GLOBAL.gb_main); // sai visualization in probe match
269 
272 #if defined(DEBUG)
273  AWT_create_db_browser_awars(awr, AW_ROOT_DEFAULT);
274 #endif // DEBUG
275 
277 
280 #if defined(DEBUG) && 0
281  awr->awar(AWAR_SECURITY_LEVEL)->write_int(6); // no security for debugging..
282 #endif // DEBUG
283 
290  {
292  if (gde_err) GBK_terminatef("Fatal: %s", gde_err);
293  }
298 
305 
307  awr->awar_string(AWAR_DB_COMMENT, "<no description>", GLOBAL.gb_main);
308 
314 
316 
318  if (!error) {
319  AW_awar *awar_expert = awr->awar(AWAR_EXPERT);
320  awar_expert->add_callback(expert_mode_changed_cb);
321  awar_expert->touch();
322 
324  }
325 
326  if (error) aw_message(error);
327 }
328 
329 // --------------------------------------------------------------------------------
330 
331 static bool nt_disconnect_from_db(AW_root *aw_root, GBDATA*& gb_main_ref) {
332  // ask user if DB was not saved
333  // returns true if user allows to quit
334 
335  // @@@ code here could as well be applied to both merge DBs
336  // - question about saving only with target DB!
337 
338  if (gb_main_ref) {
339  if (GB_read_clients(gb_main_ref)>=0) {
340  if (GB_read_clock(gb_main_ref) > GB_last_saved_clock(gb_main_ref)) {
341  long secs;
342  secs = GB_last_saved_time(gb_main_ref);
343 
344 #if defined(DEBUG)
345  secs = GB_time_of_day(); // simulate "just saved"
346 #endif // DEBUG
347 
348  const char *quit_buttons = "Quit ARB,Do NOT quit";
349  if (secs) {
350  secs = GB_time_of_day() - secs;
351  if (secs>15) {
352  char *question = GBS_global_string_copy("You last saved your data %li:%02li minutes ago\nSure to quit?", secs/60, secs%60);
353  int dontQuit = aw_question("quit_arb", question, quit_buttons);
354  free(question);
355  if (dontQuit) {
356  return false;
357  }
358  }
359  }
360  else {
361  if (aw_question("quit_arb", "You never saved any data.\nSure to quit?", quit_buttons)) {
362  return false;
363  }
364  }
365  }
366  }
367 
368  GBCMS_shutdown(gb_main_ref);
369 
370  GBDATA *gb_main = gb_main_ref;
371  gb_main_ref = NULp; // avoid further usage
372 
373  nt_assert(aw_root);
374 
375  // @@@ instead of directly calling the following functions, try to add them as GB_atclose_callback
376  aw_root->unlink_awars_from_DB(gb_main);
378 #if defined(DEBUG)
379  AWT_browser_forget_db(gb_main);
380 #endif // DEBUG
381 
382  GB_close(gb_main);
383  }
384  return true;
385 }
386 
387 static void nt_run(const char *command) {
388  GB_ERROR error = GBK_system(command);
389  if (error) {
390  fprintf(stderr, "nt_run: Failed to run '%s' (Reason: %s)\n", command, error);
391 #if defined(DEBUG)
392  GBK_dump_backtrace(stderr, "nt_run-error");
393 #endif
394  }
395 }
396 
397 void NT_start(const char *arb_ntree_args, bool restart_with_new_ARB_PID) {
398  char *command = GBS_global_string_copy("arb_launcher --async %s %s", restart_with_new_ARB_PID ? "arb" : "arb_ntree", arb_ntree_args);
399  nt_run(command);
400  free(command);
401 }
402 
403 __ATTR__NORETURN static void really_exit(int exitcode, bool kill_my_clients) {
404  if (kill_my_clients) {
405  nt_run("(arb_clean session; echo ARB done) &"); // kills all clients
406  }
407  exit(exitcode);
408 }
409 
410 void NT_exit(AW_window *aws, int exitcode) {
411  AW_root *aw_root = aws->get_root();
413  shutdown_macro_recording(aw_root);
414  bool is_server_and_has_clients = GLOBAL.gb_main && GB_read_clients(GLOBAL.gb_main)>0;
415  if (nt_disconnect_from_db(aw_root, GLOBAL.gb_main)) {
416  really_exit(exitcode, is_server_and_has_clients);
417  }
418 }
419 void NT_restart(AW_root *aw_root, const char *arb_ntree_args) {
420  // restarts arb_ntree (with new ARB_PID)
421  bool is_server_and_has_clients = GLOBAL.gb_main && GB_read_clients(GLOBAL.gb_main)>0;
422  if (nt_disconnect_from_db(aw_root, GLOBAL.gb_main)) {
423  NT_start(arb_ntree_args, true);
424  really_exit(EXIT_SUCCESS, is_server_and_has_clients);
425  }
426 }
427 
428 static void nt_start_2nd_arb(AW_window *aww, bool quit) {
429  // start 2nd arb with intro window
430  AW_root *aw_root = aww->get_root();
431  char *dir4intro;
433  if (!dir4intro) {
434  dir4intro = ARB_strdup(".");
435  }
436 
437  if (quit) {
438  NT_restart(aw_root, dir4intro);
439  }
440  else {
441  NT_start(dir4intro, true);
442  }
443  free(dir4intro);
444 }
445 
446 // --------------------------------------------------------------------------------
447 
448 static void NT_save_quick_cb(AW_window *aww) {
449  AW_root *awr = aww->get_root();
450  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
451 
453 
455  if (error) aw_message(error);
456  else {
457  awr->awar(AWAR_SAVED_DB_PATH)->write_string(filename);
459  }
460 
461  free(filename);
462 }
463 
464 
465 static void NT_save_quick_as_cb(AW_window *aww) {
466  AW_root *awr = aww->get_root();
467  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
468 
469  // @@@ also use dont_save_awars_with_default_value here?
470 
472  if (!error) {
473  awr->awar(AWAR_SAVED_DB_PATH)->write_string(filename);
475  }
476  aww->hide_or_notify(error);
477 
478  free(filename);
479 }
480 
481 #define AWAR_DB_TYPE AWAR_DBBASE "/type" // created by AWT_insert_DBsaveType_selector
482 #define AWAR_DB_COMPRESSION AWAR_DBBASE "/compression" // created by AWT_insert_DBcompression_selector
483 #define AWAR_DB_OPTI_TREENAME AWAR_DBBASE "/optimize_tree_name"
484 
485 static void NT_save_as_cb(AW_window *aww) {
486  AW_root *awr = aww->get_root();
487  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
488  const char *atype = awr->awar(AWAR_DB_TYPE)->read_char_pntr();
489  const char *ctype = awr->awar(AWAR_DB_COMPRESSION)->read_char_pntr();
490  char *savetype = GBS_global_string_copy("%s%s", atype, ctype);
491 
493 
494  GB_ERROR error = GB_save(GLOBAL.gb_main, filename, savetype);
495  if (!error) {
496  awr->awar(AWAR_SAVED_DB_PATH)->write_string(filename);
498  }
499  aww->hide_or_notify(error);
500 
501  free(savetype);
502  free(filename);
503 }
504 
505 static AW_window *NT_create_save_quick_as_window(AW_root *aw_root, const char *base_name) {
506  static AW_window_simple *aws = NULp;
507  if (!aws) {
508  aws = new AW_window_simple;
509  aws->init(aw_root, "SAVE_CHANGES_TO", "Quicksave changes as");
510  aws->load_xfig("save_as.fig");
511 
512  aws->at("close");
513  aws->callback(AW_POPDOWN);
514  aws->create_button("CLOSE", "CLOSE", "C");
515 
516  aws->callback(makeHelpCallback("save.hlp"));
517  aws->at("help");
518  aws->create_button("HELP", "HELP", "H");
519 
520  AW_create_standard_fileselection(aws, base_name);
521 
522  aws->at("comment");
523  aws->create_text_field(AWAR_DB_COMMENT);
524 
525  aws->at("save");
526  aws->callback(NT_save_quick_as_cb);
527  aws->create_button("SAVE", "SAVE", "S");
528  }
529  return aws;
530 }
531 
533  arb_progress progress(WEIGHTED, "Optimizing database compression", 0.38);
534  // 38% for seq-compression is just a rough guess made with silvaNR99138
535  // (a real guess would have to depend on ali-count, ali-length + field-count)
536 
538 
540  if (!error) {
541  ConstStrArray ali_names;
543 
544  arb_progress ali_progress("Optimizing sequence data", ali_names.size());
545  ali_progress.allow_title_reuse();
546 
547  error = GBT_check_data(GLOBAL.gb_main, NULp);
548  error = GB_end_transaction(GLOBAL.gb_main, error);
549 
550  if (!error) {
551  char *tree_name = aww->get_root()->awar(AWAR_DB_OPTI_TREENAME)->read_string();
552  for (int i = 0; ali_names[i]; ++i) {
553  error = GBT_compress_sequence_tree2(GLOBAL.gb_main, tree_name, ali_names[i]);
554  ali_progress.inc_and_check_user_abort(error);
555  }
556  free(tree_name);
557  }
558  }
559  progress.inc_and_check_user_abort(error);
560 
561  if (!error) {
562  error = GB_optimize(GLOBAL.gb_main);
563  progress.inc_and_check_user_abort(error);
564  }
565  aww->hide_or_notify(error);
566 }
567 
569  static AW_window_simple *aws = NULp;
570  if (aws) return aws;
572 
573  const char *largest_tree = GBT_name_of_largest_tree(GLOBAL.gb_main);
574  aw_root->awar_string(AWAR_DB_OPTI_TREENAME, largest_tree);
575 
576  aws = new AW_window_simple;
577  aws->init(aw_root, "OPTIMIZE_DATABASE", "Optimize database compression");
578  aws->load_xfig("optimize.fig");
579 
580  aws->at("trees");
582 
583  aws->at("close");
584  aws->callback(AW_POPDOWN);
585  aws->create_button("CLOSE", "CLOSE", "C");
586 
587  aws->callback(makeHelpCallback("optimize.hlp"));
588  aws->at("help");
589  aws->create_button("HELP", "HELP", "H");
590 
591  aws->at("go");
592  aws->callback(NT_database_optimization);
593  aws->create_button("GO", "GO");
594  return aws;
595 }
596 
597 static AW_window *NT_create_save_as(AW_root *aw_root, const char *base_name) {
598  static AW_window_simple *aws = NULp;
599  if (aws) return aws;
600 
601  aws = new AW_window_simple;
602  aws->init(aw_root, "SAVE_DB", "SAVE ARB DB");
603  aws->load_xfig("save_as.fig");
604 
605  aws->at("close");
606  aws->callback(AW_POPDOWN);
607  aws->create_button("CLOSE", "CLOSE", "C");
608 
609  aws->at("help");
610  aws->callback(makeHelpCallback("save.hlp"));
611  aws->create_button("HELP", "HELP", "H");
612 
613  AW_create_standard_fileselection(aws, base_name);
614 
615  aws->at("type");
617 
618  aws->at("compression");
620 
621  aws->at("optimize");
623  aws->help_text("optimize.hlp");
624  aws->create_autosize_button("OPTIMIZE", "Optimize database compression");
625 
626  aws->at("save");
627  aws->callback(NT_save_as_cb);
628  aws->create_button("SAVE", "SAVE", "S");
629 
630  aws->at("comment");
631  aws->create_text_field(AWAR_DB_COMMENT);
632 
633  return aws;
634 }
635 
636 static void NT_undo_cb(AW_window*, GB_UNDO_TYPE undo_type, TREE_canvas *ntw) {
637  GB_ERROR error = GB_undo(GLOBAL.gb_main, undo_type);
638  if (error) aw_message(error);
639  else {
641  AWT_auto_refresh allowed_on(ntw);
642  ntw->request_refresh();
643  }
644 }
645 
646 static void NT_infomode_cb(UNFIXED, TREE_canvas *canvas, AWT_COMMAND_MODE mode) {
647  DBUI::popup_species_info_window(canvas->awr, canvas->gb_main);
648  nt_mode_event(NULp, canvas, mode);
649 }
650 
652  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
653  if (tree_root) {
654  AWT_auto_refresh allowed_on(ntw);
655  GB_transaction ta(ntw->gb_main);
656 
657  NT_mark_all_cb(NULp, ntw, 0); // unmark all
658  tree_root->mark_duplicates();
660  }
661 }
662 
664  GB_transaction ta(ntw->gb_main);
665  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
666 
667  if (tree_root) {
668  AWT_auto_refresh allowed_on(ntw);
669  tree_root->justify_branch_lenghs(ntw->gb_main);
671  }
672 }
673 
674 #if defined(DEBUG)
675 static void NT_fix_database(AW_window *) {
676  GB_ERROR err = NULp;
678  if (err) aw_message(err);
679 }
680 #endif
681 
682 static void relink_pseudo_species_to_organisms(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash) {
683  if (ref_gb_node) {
684  if (GEN_is_pseudo_gene_species(ref_gb_node)) {
685  GBDATA *gb_organism = GEN_find_origin_organism(ref_gb_node, organism_hash);
686 
687  if (gb_organism) {
688  char *name = GBT_read_string(gb_organism, "name");
689 
690  if (name) {
691  freeset(ref_name, name);
692  ref_gb_node = gb_organism;
693  }
694  }
695  }
696  }
697 }
698 
700  GB_transaction ta(ntw->gb_main);
701  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
702 
703  if (tree_root) {
704  AWT_auto_refresh allowed_on(ntw);
705 
706  GB_HASH *organism_hash = GBT_create_organism_hash(ntw->gb_main);
707  tree_root->relink_tree(ntw->gb_main, relink_pseudo_species_to_organisms, organism_hash);
708  GBS_free_hash(organism_hash);
709  ntw->request_save();
710  }
711 }
712 
713 
714 // #########################################
715 // #########################################
716 // ### ###
717 // ## user mask section ##
718 // ### ###
719 // #########################################
720 // #########################################
721 
722 struct nt_item_type_species_selector FINAL_TYPE : public awt_item_type_selector {
725 
726  const char *get_self_awar() const OVERRIDE {
727  return AWAR_SPECIES_NAME;
728  }
730  return 12; // should be enough for "nnaammee.999"
731  }
732  GBDATA *current(AW_root *root, GBDATA *gb_main) const OVERRIDE { // give the current item
733  char *species_name = root->awar(get_self_awar())->read_string();
734  GBDATA *gb_species = NULp;
735 
736  if (species_name[0]) {
738  gb_species = GBT_find_species(gb_main, species_name);
739  }
740 
741  free(species_name);
742  return gb_species;
743  }
744  const char *getKeyPath() const OVERRIDE { // give the keypath for items
745  return CHANGE_KEY_PATH;
746  }
747 };
748 
749 static nt_item_type_species_selector item_type_species;
750 
751 static void NT_open_mask_window(AW_window *aww, int id, GBDATA *gb_main) {
752  const awt_input_mask_descriptor *descriptor = AWT_look_input_mask(id);
753  nt_assert(descriptor);
754  if (descriptor) AWT_initialize_input_mask(aww->get_root(), gb_main, &item_type_species, descriptor->get_internal_maskname(), descriptor->is_local_mask());
755 }
756 
759 }
762 }
763 
769  const char *buffer = count ? GBS_global_string("%li marked", count) : "";
771  char *oldval = counter->read_string();
772  if (strcmp(oldval, buffer)) {
773  counter->write_string(buffer);
774  aww->get_root()->awar(AWAR_TREE_REFRESH)->touch();
775  }
776  free(oldval);
777 }
778 
779 // --------------------------------------------------------------------------------------------------
780 
782  GB_ERROR error = NULp;
783  GB_transaction ta(gb_main);
784 
785  ConstStrArray tree_names;
786  GBT_get_tree_names(tree_names, gb_main, false);
787 
788  if (!tree_names.empty()) {
789  long treeCount = tree_names.size();
790 
791  const char *whats_removed = NULp;
792  switch (mode) {
793  case GBT_REMOVE_ZOMBIES: whats_removed = "zombies"; break;
794  case GBT_REMOVE_MARKED: whats_removed = "marked"; break;
795  default: nt_assert(0); break;
796  }
797 
798  const char *task = GBS_global_string("Deleting %s from %li trees", whats_removed, treeCount);
799 
800  arb_progress progress(task, treeCount);
801  GB_HASH *species_hash = GBT_create_species_hash(gb_main);
802 
803  int modified = 0;
804 
805  for (int t = 0; t<treeCount && !error; t++) {
806  progress.subtitle(tree_names[t]);
807  TreeNode *tree = GBT_read_tree(gb_main, tree_names[t], new SimpleRoot);
808  if (!tree) {
809  aw_message(GBS_global_string("Can't load tree '%s' - skipped", tree_names[t]));
810  }
811  else {
812  int removed = 0;
813  int groups_removed = 0;
814 
815  tree = GBT_remove_leafs(tree, mode, species_hash, &removed, &groups_removed);
816 
817  nt_assert(removed >= groups_removed);
818 
819  if (!tree) {
820  aw_message(GBS_global_string("'%s' would disappear. Please delete tree manually.", tree_names[t]));
821  }
822  else {
823  if (removed>0) {
824  error = GBT_write_tree(gb_main, tree_names[t], tree);
825  if (error) {
826  aw_message(GBS_global_string("Failed to write '%s' (Reason: %s)", tree_names[t], error));
827  }
828  else {
829  if (groups_removed>0) {
830  aw_message(GBS_global_string("Removed %i species and %i groups from '%s'", removed, groups_removed, tree_names[t]));
831  }
832  else {
833  aw_message(GBS_global_string("Removed %i species from '%s'", removed, tree_names[t]));
834  }
835  modified++;
836  }
837  }
838  UNCOVERED();
839  destroy(tree);
840  }
841  }
842  progress.inc_and_check_user_abort(error);
843  }
844 
845  if (modified) {
846  aw_message(GBS_global_string("Changed %i of %li trees.", modified, treeCount));
847  }
848  else {
849  aw_message("No tree modified");
850  }
851 
852  GBS_free_hash(species_hash);
853  }
854 
855  aw_message_if(ta.close(error));
856 }
857 
860  if (tree) {
861  AP_tree *root = tree->get_root_node();
862  if (root) return root;
863  }
864  return NULp;
865 }
866 
867 // --------------------------------------------------------------------------------------------------
868 
870  GB_transaction ta(gb_main);
871  GBT_mark_all(gb_main, 0);
872 
873  DBItemSetIter end = referred.end();
874  for (DBItemSetIter s = referred.begin(); s != end; ++s) {
875  GB_write_flag(*s, 1);
876  }
877  return ARB_ERROR();
878 }
879 
881  static AW_window *aws = NULp;
882  if (!aws) {
884  aws = RefEntries::create_refentries_window(awr, &reh, "markbyref", "Mark by reference", "markbyref.hlp", NULp, "Mark referenced", mark_referred_species);
885  }
886  return aws;
887 }
888 
889 // --------------------------------------------------------------------------------------------------
890 
891 static void merge_from_to(AW_root *awr, const char *db_awar_name, bool merge_to) {
892  const char *db_name = awr->awar(db_awar_name)->read_char_pntr();
893  char *quotedDB = GBK_singlequote(db_name);
894 
897  merge_to
898  ? "arb_ntree : %s &"
899  : "arb_ntree %s : &",
900  quotedDB)
901  );
902 
903  free(quotedDB);
904 }
905 
906 static void merge_from_cb(AW_window *aww, AW_CL cl_awarNamePtr) { merge_from_to(aww->get_root(), *(const char**)cl_awarNamePtr, false); }
907 static void merge_into_cb(AW_window *aww, AW_CL cl_awarNamePtr) { merge_from_to(aww->get_root(), *(const char**)cl_awarNamePtr, true); }
908 
910  static char *awar_name = NULp; // do not free, bound to callback
911  AW_window *aw_from =
912  awt_create_load_box(awr, "Merge data from", "other ARB database",
913  ".", ".arb", &awar_name,
914  makeWindowCallback(merge_from_cb, AW_CL(&awar_name)));
915  return aw_from;
916 }
918  static char *awar_name = NULp; // do not free, bound to callback
919  AW_window *aw_to =
920  awt_create_load_box(awr, "Merge data to", "other ARB database",
921  ".", ".arb", &awar_name,
922  makeWindowCallback(merge_into_cb, AW_CL(&awar_name)),
923  makeWindowCallback(AW_POPDOWN), NULp);
924  return aw_to;
925 }
926 
927 // --------------------------------------------------------------------------------------------------
928 
929 static void update_main_window_title(AW_root* awr, AW_window_menu_modes* aww, int clone) {
930  const char* filename = awr->awar(AWAR_DB_NAME)->read_char_pntr();
931  if (clone) {
932  aww->set_window_title(GBS_global_string("%s - ARB (%i)", filename, clone));
933  }
934  else {
935  aww->set_window_title(GBS_global_string("%s - ARB", filename));
936  }
937 }
938 
939 static void canvas_tree_awar_changed_cb(AW_awar *, bool, TREE_canvas *ntw) {
941  AW_root::SINGLETON->awar(AWAR_NTREE_MAIN_WINDOW_COUNT)->touch(); // refresh canvas selection lists
943 }
944 
946  int count;
947  TREE_canvas *canvas[MAX_NT_WINDOWS];
948 
949  static TREE_canvas_registry *SINGLETON;
950 
951  TREE_canvas_registry() : count(0) {
953  }
954 
955 public:
957  if (!SINGLETON) SINGLETON = new TREE_canvas_registry;
958  return *SINGLETON;
959  }
960 
962  nt_assert(count<MAX_NT_WINDOWS);
963  nt_assert(count == ntw->get_index()); // you have to register TREE_canvas'es in order of creation!
964  canvas[count++] = ntw;
965  ntw->awr->awar(AWAR_NTREE_MAIN_WINDOW_COUNT)->write_int(count); // trigger callbacks
966  }
967 
968  int get_count() const { return count; }
969 
970  TREE_canvas *get_canvas(int idx) const {
971  if (idx<0 || idx>=count) return NULp;
972  return canvas[idx];
973  }
974 };
975 
976 TREE_canvas_registry *TREE_canvas_registry::SINGLETON = NULp;
977 
980  nt_assert(idx>=0 && idx<MAX_NT_WINDOWS);
982 }
983 
984 #if defined(TRACE_GROUP_SELECTION)
985 static TREE_canvas *find_canvas_showing(AWT_graphic_tree *agt) {
986  // look for (registered) canvas showing given AWT_graphic_tree
987  // returns NULp if none found
989 
990  int maxIdx = reg.get_count();
991  for (int32_t i = 0; i<maxIdx; ++i) {
992  TREE_canvas *ntw = reg.get_canvas(i);
993  if (ntw->gfx == agt) return ntw;
994  }
995  return NULp;
996 }
997 #endif
998 
1003 
1004  int maxIdx = reg.get_count();
1005  for (int32_t i = 0; i<maxIdx; ++i) {
1006  TREE_canvas *ntw = reg.get_canvas(i);
1007  if (ntw && ntw != to_skip) {
1008  nt_assert(ntw->get_awar_tree());
1009  const char *treename = ntw->get_awar_tree()->read_char_pntr();
1010  const char *description = i
1011  ? GBS_global_string("ARB (%i): %s", i, treename)
1012  : GBS_global_string("ARB main: %s", treename);
1013  sellst->insert(description, i);
1014  }
1015  }
1016 }
1017 
1018 // ----------------------------------
1019 // group-selection handlers
1020 
1023 }
1024 
1026 
1028  const Group& group = gfx->get_selected_group();
1029 
1030 #if defined(TRACE_GROUP_SELECTION)
1031  fprintf(stderr, "[%s] ", track_group_selection_by_canvas ? "track" : "dont track");
1032  TREE_canvas *ntw = find_canvas_showing(gfx);
1033  if (group.is_valid()) {
1034  fprintf(stderr, "canvas %i selects group '%s'\n", ntw->get_index(), group.get_name());
1035  }
1036  else {
1037  fprintf(stderr, "canvas %i de-selects group\n", ntw->get_index());
1038  }
1039 #endif
1040 
1041  if (track_group_selection_by_canvas) {
1042  // set group-awar:
1043  gfx->get_root()->awar(AWAR_GROUP)->write_pointer(group.get_group_data()); // writes NULp if !group.is_valid()
1044  }
1045 }
1046 
1047 static void group_awar_changed_cb(AW_root *awr) {
1048  AW_awar *awar_group = awr->awar(AWAR_GROUP);
1049  GBDATA *gb_wanted_group = awar_group->read_pointer();
1050 
1051  GBDATA *gb_wanted_tree = NULp;
1052  {
1053  if (gb_wanted_group) {
1054  GB_transaction ta(gb_wanted_group);
1055  gb_wanted_tree = GB_get_father(gb_wanted_group);
1056  awr->awar(AWAR_SPECIES_NAME)->write_string(""); // deselect species when group gets selected
1057 #if defined(TRACE_GROUP_SELECTION)
1058  fputs("clear AWAR_SPECIES_NAME (because group selected)\n", stderr);
1059 #endif
1060  }
1061 #if defined(TRACE_GROUP_SELECTION)
1062  const char *group_name = NULp;
1063  if (gb_wanted_group) {
1064  GB_transaction ta(gb_wanted_group);
1065  GBDATA *gb_name = GB_entry(gb_wanted_group, "group_name");
1066  if (gb_name) group_name = GB_read_char_pntr(gb_name);
1067  }
1068  fprintf(stderr, "group awar changed to %p", gb_wanted_group);
1069  if (group_name) fprintf(stderr, " (='%s')", group_name);
1070  fputc('\n', stderr);
1071 #endif
1072  }
1073 
1074  LocallyModify<bool> ignore_group_selection_by_canvas(track_group_selection_by_canvas, false);
1075 
1076  {
1078 
1079  int maxIdx = reg.get_count();
1080  for (int32_t i = 0; i<maxIdx; ++i) {
1081  TREE_canvas *ntw = reg.get_canvas(i);
1082  AWT_graphic_tree *agt = AWT_TREE(ntw);
1083  const Group& curr_group = agt->get_selected_group();
1084 
1085  GBDATA *gb_curr_tree = agt->get_tree_root()->get_gb_tree();
1086  if (gb_curr_tree == gb_wanted_tree) {
1087  AWT_auto_refresh allowed_on(ntw);
1088  if (!curr_group.is_valid() || // no group selected
1089  curr_group.get_group_data() != gb_wanted_group) // wrong group selected
1090  {
1091  agt->select_group(gb_wanted_group);
1092  ntw->request_refresh();
1093  }
1094  // perform auto-jump (also if group was already selected, otherwise group-traversal keys will not follow the selected group)
1096  }
1097  else {
1098  if (curr_group.is_valid()) {
1099  AWT_auto_refresh allowed_on(ntw);
1100  agt->deselect_group();
1101  ntw->request_refresh();
1102  }
1103  }
1104  }
1105  }
1106 }
1107 
1108 // ----------------------------
1109 // create main window
1110 
1111 static AW_window *popup_new_main_window(AW_root *awr, int clone, TREE_canvas **result_ntw) {
1118 
1119  char window_title[256];
1120  const char *awar_tree = NULp;
1121 
1122  if (clone) {
1123  awar_tree = ARB_keep_string(GBS_global_string_copy(AWAR_TREE "_%i", clone));
1124  sprintf(window_title, "ARB_NT_%i", clone);
1125  }
1126  else {
1127  awar_tree = AWAR_TREE;
1128  sprintf(window_title, "ARB_NT");
1129  }
1131  awm->init(awr, window_title, window_title, 0, 0);
1132 
1133  awr->awar(AWAR_DB_NAME)
1134  ->add_callback(makeRootCallback(update_main_window_title, awm, clone))
1135  ->update();
1136 
1137  awm->button_length(5);
1138 
1139  if (!clone) AW_init_color_group_defaults("arb_ntree");
1140 
1142 
1143  if (!clone) { // while creating initial window
1146  }
1147 
1148  TREE_canvas *ntw;
1149  {
1150  AW_awar *tree_awar = awr->awar_string(awar_tree);
1151  {
1152  AP_tree_display_style prev_style = tree->get_tree_style();
1153  tree->set_tree_style(AP_LIST_SIMPLE, NULp); // avoid NDS warnings during startup
1154 
1155  ntw = new TREE_canvas(GLOBAL.gb_main, awm, "ARB_NT", tree, tree_awar);
1156  tree->set_tree_style(prev_style, ntw);
1157  ntw->set_mode(AWT_MODE_SELECT);
1158  }
1159 
1160  if (result_ntw) *result_ntw = ntw;
1161 
1162  {
1163  const char *tree_name = tree_awar->read_char_pntr();
1164  const char *existing_tree_name = GBT_existing_tree(GLOBAL.gb_main, tree_name);
1165 
1166  if (existing_tree_name) {
1167  tree_awar->write_string(existing_tree_name);
1168  NT_reload_tree_event(awr, ntw, true); // load first tree
1169  }
1170  else {
1171  AW_advice("Your database contains no tree.", AW_ADVICE_TOGGLE_AND_HELP, NULp, "no_tree.hlp");
1172  tree->set_tree_style(AP_LIST_NDS, ntw); // no tree -> show NDS list
1173  }
1174 
1176  AWT_registerTreeAwarCallback(tree_awar, makeTreeAwarCallback(canvas_tree_awar_changed_cb, ntw), false);
1177  }
1178  }
1179 
1181 
1182  bool is_genome_db = GEN_is_genome_db(GLOBAL.gb_main, 0); // is this a genome database ? (default = 0 = not a genom db)
1183 
1185 
1186  // --------------
1187  // File
1188 
1189 #if defined(DEBUG)
1190  AWT_create_debug_menu(awm);
1191 #endif // DEBUG
1192 
1193  bool allow_new_window = (ntw->get_index()+1) < MAX_NT_WINDOWS;
1194 
1195  if (clone) {
1196  awm->create_menu("File", "F", AWM_ALL);
1197  if (allow_new_window) {
1198  awm->insert_menu_topic(awm->local_id("new_window"), "New window (same database)", "N", "newwindow.hlp", AWM_ALL, makeCreateWindowCallback(popup_new_main_window, clone+1, (TREE_canvas**)NULp));
1199  }
1200  awm->insert_menu_topic("close", "Close", "C", NULp, AWM_ALL, AW_POPDOWN);
1201  }
1202  else {
1203 #if defined(DEBUG)
1204  // add more to debug-menu
1205  awm->sep______________();
1206  awm->insert_menu_topic("fix_db", "Fix database", "F", NULp, AWM_ALL, NT_fix_database);
1207  awm->insert_menu_topic("debug_arbdb", "Print debug information", "d", NULp, AWM_ALL, makeWindowCallback(GB_print_debug_information, GLOBAL.gb_main));
1208  awm->insert_menu_topic("test_compr", "Test compression", "T", NULp, AWM_ALL, makeWindowCallback(GBT_compression_test, GLOBAL.gb_main));
1209 #endif // DEBUG
1210 
1211  awm->create_menu("File", "F", AWM_ALL);
1212  {
1213  // keep the following entries in sync with ../EDIT4/ED4_root.cxx@common_save_menu_entries
1214  awm->insert_menu_topic("save_changes", "Quicksave changes", "s", "save.hlp", AWM_ALL, NT_save_quick_cb);
1215  awm->insert_menu_topic("save_all_as", "Save whole database as ...", "w", "save.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_save_as, AWAR_DBBASE));
1216  if (allow_new_window) {
1217  awm->sep______________();
1218  awm->insert_menu_topic("new_window", "New window (same database)", "N", "newwindow.hlp", AWM_ALL, makeCreateWindowCallback(popup_new_main_window, clone+1, (TREE_canvas**)NULp));
1219  }
1220  awm->sep______________();
1221  awm->insert_menu_topic("optimize_db", "Optimize database compression", "O", "optimize.hlp", AWM_ALL, NT_create_database_optimization_window);
1222  awm->sep______________();
1223 
1224  awm->insert_sub_menu("Import", "I");
1225  {
1226  awm->insert_menu_topic("merge_from", "Merge from other ARB database", "d", "arb_merge_into.hlp", AWM_ALL, NT_create_merge_from_window);
1227  awm->insert_menu_topic("import_seq", "Import from external format", "I", "arb_import.hlp", AWM_ALL, makeWindowCallback(NT_import_sequences, ntw));
1228  GDE_load_menu(awm, AWM_EXP, "Import");
1229  }
1230  awm->close_sub_menu();
1231 
1232  awm->insert_sub_menu("Export", "E");
1233  {
1234  awm->insert_menu_topic("export_to_ARB", "Merge to (new) ARB database", "A", "arb_merge_outof.hlp", AWM_ALL, NT_create_merge_to_window);
1235  awm->insert_menu_topic("export_seqs", "Export to external format", "f", "arb_export.hlp", AWM_ALL, makeCreateWindowCallback(create_AWTC_export_window, GLOBAL.gb_main));
1236  GDE_load_menu(awm, AWM_ALL, "Export");
1237  awm->insert_menu_topic("export_nds", "Export fields (to calc-sheet using NDS)", "N", "arb_export_nds.hlp", AWM_ALL, create_nds_export_window);
1238  }
1239  awm->close_sub_menu();
1240  awm->sep______________();
1241 
1242  insert_macro_menu_entry(awm, false);
1243 
1244  awm->insert_sub_menu("VersionInfo/Bugreport/MailingList", "V");
1245  {
1246  awm->insert_menu_topic("version_info", "Version info (" ARB_VERSION_DETAILED ")", "V", "version.hlp", AWM_ALL, makeHelpCallback ("version.hlp"));
1247  awm->insert_menu_topic("bug_report", "Report bug", "b", NULp, AWM_ALL, makeWindowCallback(AWT_openURL, "http://bugs.arb-home.de/wiki/BugReport"));
1248  awm->insert_menu_topic("mailing_list", "Mailing list", "M", NULp, AWM_ALL, makeWindowCallback(AWT_openURL, "http://bugs.arb-home.de/wiki/ArbMailingList"));
1249  }
1250  awm->close_sub_menu();
1251  awm->sep______________();
1252 
1253  awm->insert_menu_topic("new_arb", "Start second database", "d", "quit.hlp", AWM_ALL, makeWindowCallback(nt_start_2nd_arb, false));
1254  awm->insert_menu_topic("restart_arb", "Quit + load other database", "l", "quit.hlp", AWM_ALL, makeWindowCallback(nt_start_2nd_arb, true));
1255  awm->insert_menu_topic("quit", "Quit", "Q", "quit.hlp", AWM_ALL, makeWindowCallback(NT_exit, EXIT_SUCCESS));
1256  }
1257 
1258  // -----------------
1259  // Species
1260 
1261  awm->create_menu("Species", "c", AWM_ALL);
1262  {
1263  awm->insert_menu_topic("species_search", "Search and query", "q", "sp_search.hlp", AWM_ALL, makeCreateWindowCallback(DBUI::create_species_query_window, GLOBAL.gb_main));
1264  awm->insert_menu_topic("species_info", "Species information", "i", "sp_info.hlp", AWM_ALL, popupinfo_wcb);
1265 
1266  awm->sep______________();
1267 
1268  NT_insert_mark_submenus(awm, ntw, 1);
1269  awm->insert_menu_topic("mark_by_ref", "Mark by reference..", "r", "markbyref.hlp", AWM_EXP, makeCreateWindowCallback(create_mark_by_refentries_window, GLOBAL.gb_main));
1270  awm->insert_menu_topic("species_colors", "Colors ...", "l", "colorize.hlp", AWM_ALL, create_colorize_species_window);
1271  awm->insert_menu_topic("selection_admin", "Selections ...", "o", "species_configs.hlp", AWM_ALL, makeWindowCallback(NT_popup_configuration_admin, ntw));
1272 
1273  awm->sep______________();
1274 
1275  awm->insert_sub_menu("Database fields admin", "f");
1277  awm->close_sub_menu();
1279 
1280  awm->sep______________();
1281 
1282  awm->insert_menu_topic("del_marked", "Delete Marked Species", "D", "sp_del_mrkd.hlp", AWM_ALL, makeWindowCallback(NT_delete_mark_all_cb, ntw));
1283 
1284  awm->insert_sub_menu("Sort Species", "s");
1285  {
1286  awm->insert_menu_topic("$sort_by_field", "According to Database Entries", "D", "sp_sort_fld.hlp", AWM_ALL, NT_create_resort_window);
1287  awm->insert_menu_topic("$sort_by_tree", "According to Phylogeny", "P", "sp_sort_phyl.hlp", AWM_ALL, makeWindowCallback(NT_resort_data_by_phylogeny, ntw));
1288  }
1289  awm->close_sub_menu();
1290 
1291  awm->insert_sub_menu("Merge Species", "g", AWM_EXP);
1292  {
1293  awm->insert_menu_topic("merge_species", "Create merged species from similar species", "m", "merge_species.hlp", AWM_EXP, NT_createMergeSimilarSpeciesWindow);
1294  awm->insert_menu_topic("join_marked", "Join Marked Species", "J", "species_join.hlp", AWM_EXP, NT_create_species_join_window);
1295  }
1296  awm->close_sub_menu();
1297 
1298  awm->sep______________();
1299 
1300  awm->insert_menu_topic("species_submission", "Submit Species", "b", "submission.hlp", AWM_EXP, makeCreateWindowCallback(AWTC_create_submission_window, GLOBAL.gb_main));
1301 
1302  awm->sep______________();
1303 
1304  awm->insert_menu_topic("new_names", "Synchronize IDs", "e", "rename.hlp", AWM_ALL, makeCreateWindowCallback(AWTC_create_rename_window, GLOBAL.gb_main));
1305 
1306  awm->insert_sub_menu("Valid Names ...", "V", AWM_EXP);
1307  {
1308  awm->insert_menu_topic("imp_names", "Import names from file", "I", "vn_import.hlp", AWM_EXP, NT_importValidNames);
1309  awm->insert_menu_topic("del_names", "Delete names from DB", "D", "vn_delete.hlp", AWM_EXP, NT_deleteValidNames);
1310  awm->insert_menu_topic("sug_names", "Suggest valid names", "v", "vn_suggest.hlp", AWM_EXP, NT_suggestValidNames);
1311  awm->insert_menu_topic("search_names", "Search manually", "m", "vn_search.hlp", AWM_EXP, NT_create_searchManuallyNames_window);
1312  }
1313  awm->close_sub_menu();
1314  }
1315 
1316  // ----------------------------
1317  // Genes + Experiment
1318 
1319  if (is_genome_db) GEN_create_genes_submenu(awm, GLOBAL.gb_main, true);
1320 
1321  // ------------------
1322  // Sequence
1323 
1324  awm->create_menu("Sequence", "S", AWM_ALL);
1325  {
1326  awm->insert_menu_topic("seq_admin", "Sequence/Alignment Admin", "A", "ad_align.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_alignment_admin_window, (AW_window*)NULp));
1327  awm->insert_sub_menu("Insert/delete", "I");
1328  {
1329  awm->insert_menu_topic("ins_del_col", ".. column", "c", "insdel.hlp", AWM_ALL, create_insertDeleteColumn_window);
1330  awm->insert_menu_topic("ins_del_sai", ".. using SAI", "S", "insdel_sai.hlp", AWM_ALL, makeCreateWindowCallback(create_insertDeleteBySAI_window, GLOBAL.gb_main));
1331  }
1332  awm->close_sub_menu();
1333  awm->sep______________();
1334 
1335  awm->insert_sub_menu("Edit Sequences", "E");
1336  {
1337  awm->insert_menu_topic("new_arb_edit4", "Using marked species and tree", "m", "arb_edit4.hlp", AWM_ALL, makeWindowCallback(NT_start_editor_on_tree, 0, ntw));
1338  awm->insert_menu_topic("new2_arb_edit4", "... plus relatives", "r", "arb_edit4.hlp", AWM_ALL, makeWindowCallback(NT_start_editor_on_tree, -1, ntw));
1339  awm->insert_menu_topic("old_arb_edit4", "Using earlier configuration", "c", "arb_edit4.hlp", AWM_ALL, NT_create_startEditorOnOldConfiguration_window);
1340  }
1341  awm->close_sub_menu();
1342 
1343  awm->sep______________();
1344 
1345  awm->insert_sub_menu("Align sequences", "l");
1346  {
1347  awm->insert_menu_topic("realign_dna", "Realign DNA according to aligned protein", "R", "realign_dna.hlp", AWM_ALL, NT_create_realign_dna_window);
1348  GDE_load_menu(awm, AWM_ALL, "Align");
1349  }
1350  awm->close_sub_menu();
1351  awm->insert_menu_topic("seq_concat", "Concatenate sequences", "C", "concatenate.hlp", AWM_ALL, NT_createConcatenationWindow);
1352  awm->insert_menu_topic("seq_split", "Split sequences", "S", "split.hlp", AWM_ALL, NT_create_splitAlignment_window);
1353  awm->insert_menu_topic("track_changes", "Track alignment changes", "k", "track_ali_changes.hlp", AWM_EXP, NT_create_trackAliChanges_window);
1354  awm->sep______________();
1355 
1356  awm->insert_menu_topic("dna_2_pro", "Perform translation", "t", "translate_dna_2_pro.hlp", AWM_ALL, NT_create_dna_2_pro_window);
1357  awm->insert_menu_topic("arb_dist", "Distance Matrix + ARB NJ", "D", "dist.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_dist &"));
1358  awm->sep______________();
1359 
1360  awm->insert_menu_topic("seq_quality", "Check Sequence Quality", "Q", "seq_quality.hlp", AWM_EXP, makeCreateWindowCallback(SQ_create_seq_quality_window, GLOBAL.gb_main));
1361  awm->insert_menu_topic("chimera_check", "Chimera Check", "m", "chimera_check.hlp", AWM_EXP, makeCreateWindowCallback(STAT_create_chimera_check_window, GLOBAL.gb_main));
1362 
1363  awm->sep______________();
1364 
1365  GDE_load_menu(awm, AWM_ALL, "Print");
1366  }
1367 
1368  // -------------
1369  // SAI
1370 
1371  awm->create_menu("SAI", "A", AWM_ALL);
1372  {
1373  awm->insert_menu_topic("sai_admin", "Manage SAIs", "S", "ad_extended.hlp", AWM_ALL, NT_create_extendeds_window);
1374  awm->insert_menu_topic("sai_calc", "Combine SAIs", "b", "saicalc.hlp", AWM_ALL, makeWindowCallback(SAI_popup_calculator_window, GLOBAL.gb_main));
1375  awm->insert_sub_menu("Create SAI using ...", "C");
1376  {
1377  awm->insert_menu_topic("sai_max_freq", "Max. Frequency", "M", "max_freq.hlp", AWM_EXP, AP_create_max_freq_window);
1378  awm->insert_menu_topic("sai_consensus", "Consensus", "C", "consensus.hlp", AWM_ALL, AP_create_con_expert_window);
1379  awm->insert_menu_topic("pos_var_pars", "Positional variability + Column statistic (parsimony method)", "a", "pos_var_pars.hlp", AWM_ALL, AP_create_pos_var_pars_window);
1380  awm->insert_menu_topic("arb_phyl", "Filter by base frequency", "F", "phylo.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_phylo &"));
1381  awm->insert_menu_topic("sai_pfold", "Protein secondary structure (field \"sec_struct\")", "P", "pfold.hlp", AWM_EXP, NT_create_sai_from_pfold);
1382 
1383  GDE_load_menu(awm, AWM_EXP, "SAI");
1384  }
1385  awm->close_sub_menu();
1386 
1387  awm->insert_sub_menu("Other functions", "O");
1388  {
1389  awm->insert_menu_topic("count_different_chars", "Count different chars/column", "C", "count_chars.hlp", AWM_EXP, makeWindowCallback(NT_count_different_chars, GLOBAL.gb_main));
1390  awm->insert_menu_topic("corr_mutat_analysis", "Compute clusters of correlated positions", "m", "", AWM_ALL, makeWindowCallback(AWT_system_in_console_cb, "arb_rnacma", XCMD_ASYNC_WAIT_ON_ERROR));
1391  awm->insert_menu_topic("export_pos_var", "Export Column Statistic (GNUPLOT format)", "E", "csp_2_gnuplot.hlp", AWM_ALL, NT_create_colstat_2_gnuplot_window);
1392  }
1393  awm->close_sub_menu();
1394  }
1395 
1396  // ----------------
1397  // Probes
1398 
1399  awm->create_menu("Probes", "P", AWM_ALL);
1400  {
1401  awm->insert_menu_topic("probe_design", "Design Probes", "D", "probedesign.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_design_window, GLOBAL.gb_main));
1402  awm->insert_menu_topic("probe_multi", "Calculate Multi-Probes", "u", "multiprobe.hlp", AWM_ALL, makeCreateWindowCallback(create_multiprobe_window, ntw));
1403  awm->insert_menu_topic("probe_match", "Match Probes", "M", "probematch.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_match_window, GLOBAL.gb_main));
1404  awm->sep______________();
1405  awm->insert_menu_topic("probe_match_sp", "Match Probes with Specificity", "f", "probespec.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_match_with_specificity_window, ntw));
1406  awm->sep______________();
1407  awm->insert_menu_topic("primer_design_new", "Design Primers", "P", "primer_new.hlp", AWM_EXP, makeCreateWindowCallback(create_primer_design_window, GLOBAL.gb_main));
1408  awm->insert_menu_topic("primer_design", "Design Sequencing Primers", "S", "primer.hlp", AWM_EXP, makeWindowCallback(AWT_system_in_console_cb, "arb_primer", XCMD_ASYNC_WAITKEY));
1409  awm->sep______________();
1410  awm->insert_menu_topic("pt_server_admin", "PT_SERVER Admin", "A", "probeadmin.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_admin_window, GLOBAL.gb_main));
1411  }
1412 
1413  }
1414 
1415  // --------------
1416  // Tree
1417 
1418  awm->create_menu("Tree", "T", AWM_ALL);
1419  {
1420  if (!clone) {
1421  awm->insert_sub_menu("Add Species to Existing Tree", "A");
1422  {
1423  awm->insert_menu_topic("arb_pars_quick", "ARB Parsimony (Quick add marked)", "Q", "pars.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_pars -add_marked -quit &"));
1424  awm->insert_menu_topic("arb_pars", "ARB Parsimony interactive", "i", "pars.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_pars &"));
1425  GDE_load_menu(awm, AWM_EXP, "Incremental phylogeny");
1426  }
1427  awm->close_sub_menu();
1428  }
1429 
1430  awm->insert_sub_menu("Remove Species from Tree", "R");
1431  {
1432  awm->insert_menu_topic(awm->local_id("tree_remove_deleted"), "Remove zombies", "z", "trm_del.hlp", AWM_ALL, makeWindowCallback(NT_remove_leafs, ntw, AWT_REMOVE_ZOMBIES));
1433  awm->insert_menu_topic(awm->local_id("tree_remove_marked"), "Remove marked", "m", "trm_mrkd.hlp", AWM_ALL, makeWindowCallback(NT_remove_leafs, ntw, AWT_REMOVE_MARKED));
1434  awm->insert_menu_topic(awm->local_id("tree_keep_marked"), "Keep marked", "K", "tkeep_mrkd.hlp", AWM_ALL, makeWindowCallback(NT_remove_leafs, ntw, AWT_KEEP_MARKED));
1435  awm->sep______________();
1436  awm->insert_menu_topic("all_tree_remove_deleted", "Remove zombies from ALL trees", "A", "trm_del.hlp", AWM_ALL, makeWindowCallback(NT_alltree_remove_leafs, GBT_REMOVE_ZOMBIES, GLOBAL.gb_main));
1437  awm->insert_menu_topic("all_tree_remove_marked", "Remove marked from ALL trees", "L", "trm_mrkd.hlp", AWM_ALL, makeWindowCallback(NT_alltree_remove_leafs, GBT_REMOVE_MARKED, GLOBAL.gb_main));
1438  }
1439  awm->close_sub_menu();
1440 
1441  if (!clone) {
1442  awm->insert_sub_menu("Build tree from sequence data", "B");
1443  {
1444  awm->insert_sub_menu("Distance matrix methods", "D");
1445  awm->insert_menu_topic("arb_dist", "Distance Matrix + ARB NJ", "J", "dist.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_dist &"));
1446  GDE_load_menu(awm, AWM_ALL, "Phylogeny Distance Matrix");
1447  awm->close_sub_menu();
1448 
1449  awm->insert_sub_menu("Maximum Parsimony methods", "P");
1450  GDE_load_menu(awm, AWM_ALL, "Phylogeny max. parsimony");
1451  awm->close_sub_menu();
1452 
1453  awm->insert_sub_menu("Maximum Likelihood methods", "L");
1454  GDE_load_menu(awm, AWM_EXP, "Phylogeny max. Likelihood EXP");
1455  GDE_load_menu(awm, AWM_ALL, "Phylogeny max. Likelihood");
1456  awm->close_sub_menu();
1457 
1458  awm->insert_sub_menu("Other methods", "O", AWM_EXP);
1459  GDE_load_menu(awm, AWM_EXP, "Phylogeny (Other)");
1460  awm->close_sub_menu();
1461  }
1462  awm->close_sub_menu();
1463  }
1464 
1465  awm->insert_menu_topic(awm->local_id("consense_tree"), "Build consensus tree", "c", "consense_tree.hlp", AWM_ALL, NT_create_consense_window);
1466 
1467  awm->sep______________();
1468 
1469  awm->insert_sub_menu("Reset zoom", "z");
1470  {
1471  awm->insert_menu_topic(awm->local_id("reset_logical_zoom"), "Logical zoom", "L", "rst_log_zoom.hlp", AWM_ALL, makeWindowCallback(NT_reset_lzoom_cb, ntw));
1472  awm->insert_menu_topic(awm->local_id("reset_physical_zoom"), "Physical zoom", "P", "rst_phys_zoom.hlp", AWM_ALL, makeWindowCallback(NT_reset_pzoom_cb, ntw));
1473  }
1474  awm->close_sub_menu();
1475 
1476  awm->sep______________();
1477 
1478  // taxonomic groups
1479  NT_insert_collapse_submenu(awm, ntw);
1480  if (!clone) {
1481  awm->insert_menu_topic("group_search", "Search groups...", "g", "group_search.hlp", AWM_ALL, makeWindowCallback (popup_group_search_window, GLOBAL.gb_main));
1482  awm->insert_menu_topic("compare_taxonomy", "Compare taxonomy...", "x", "compare_taxonomy.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_compare_taxonomy_window, ntw));
1483  awm->insert_menu_topic("move_groups", "Move groups...", "v", "move_groups.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_moveGroupInfo_window));
1484  }
1485 
1486  awm->sep______________();
1487 
1488  if (!clone) {
1489  awm->insert_menu_topic("compare_topology", "Compare topology...", "o", "compare_topo.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_compareTopologies_window));
1490  }
1491 
1492  awm->insert_sub_menu("Modify branches", "M");
1493  {
1494  awm->insert_menu_topic(awm->local_id("tree_remove_remark"), "Remove bootstraps", "b", "trm_boot.hlp", AWM_ALL, makeWindowCallback(NT_remove_bootstrap, ntw));
1495  awm->insert_menu_topic(awm->local_id("tree_edit_remark"), "Edit bootstraps", "E", "ted_boot.hlp", AWM_ALL, makeWindowCallback(NT_edit_bootstrap, ntw));
1496  awm->sep______________();
1497  awm->insert_menu_topic(awm->local_id("tree_reset_lengths"), "Reset branchlengths", "R", "tbl_reset.hlp", AWM_ALL, makeWindowCallback(NT_reset_branchlengths, ntw));
1498  awm->insert_menu_topic(awm->local_id("justify_branch_lengths"), "Justify branchlengths", "J", "tbl_justify.hlp", AWM_ALL, makeWindowCallback(NT_justify_branch_lenghs, ntw));
1499  awm->insert_menu_topic(awm->local_id("tree_scale_lengths"), "Scale Branchlengths", "S", "tbl_scale.hlp", AWM_ALL, makeWindowCallback(NT_scale_tree, ntw));
1500  awm->sep______________();
1501  awm->insert_menu_topic(awm->local_id("tree_multifurcate"), "Multifurcate...", "M", "multifurcate.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_multifurcate_tree_window, ntw));
1502  awm->sep______________();
1503  awm->insert_menu_topic(awm->local_id("tree_boot2len"), "Bootstraps -> Branchlengths", "l", "tbl_boot2len.hlp", AWM_ALL, makeWindowCallback(NT_move_boot_branch, ntw, 0));
1504  awm->insert_menu_topic(awm->local_id("tree_len2boot"), "Bootstraps <- Branchlengths", "o", "tbl_boot2len.hlp", AWM_ALL, makeWindowCallback(NT_move_boot_branch, ntw, 1));
1505 
1506  }
1507  awm->close_sub_menu();
1508  awm->insert_sub_menu("Beautify tree", "u");
1509  {
1510  awm->insert_menu_topic(awm->local_id("beautifyt_tree"), "#beautifyt.xpm", "", "resorttree.hlp", AWM_ALL, makeWindowCallback(NT_resort_tree_cb, ntw, BIG_BRANCHES_TO_TOP));
1511  awm->insert_menu_topic(awm->local_id("beautifyc_tree"), "#beautifyc.xpm", "", "resorttree.hlp", AWM_ALL, makeWindowCallback(NT_resort_tree_cb, ntw, BIG_BRANCHES_TO_EDGE));
1512  awm->insert_menu_topic(awm->local_id("beautifyb_tree"), "#beautifyb.xpm", "", "resorttree.hlp", AWM_ALL, makeWindowCallback(NT_resort_tree_cb, ntw, BIG_BRANCHES_TO_BOTTOM));
1513  awm->insert_menu_topic(awm->local_id("beautifyr_tree"), "Radial tree (1)", "1", "resorttree.hlp", AWM_ALL, makeWindowCallback(NT_resort_tree_cb, ntw, BIG_BRANCHES_TO_CENTER));
1514  awm->insert_menu_topic(awm->local_id("beautifyr2_tree"), "Radial tree (2)", "2", "resorttree.hlp", AWM_ALL, makeWindowCallback(NT_resort_tree_cb, ntw, BIG_BRANCHES_ALTERNATING));
1515  awm->sep______________();
1516  awm->insert_menu_topic(awm->local_id("sort_by_other"), "By other tree", "o", "resortbyother.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_sort_tree_by_other_tree_window, ntw));
1517  }
1518  awm->close_sub_menu();
1519 
1520  awm->insert_menu_topic(awm->local_id("branch_analysis"), "Branch analysis", "h", "branch_analysis.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_branch_analysis_window, ntw));
1521  awm->insert_menu_topic(awm->local_id("syncroots"), "Adjust roots...", "j", "syncroots.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_syncroot_window, GLOBAL.gb_main));
1522  awm->insert_menu_topic(awm->local_id("mark_duplicates"), "Mark duplicates", "k", "mark_duplicates.hlp", AWM_ALL, makeWindowCallback (NT_mark_duplicates, ntw));
1523 
1524  awm->sep______________();
1525 
1526  awm->insert_menu_topic(awm->local_id("shade"), "Tree shading...", "s", "tree_shading.hlp", AWM_ALL, makeWindowCallback (NT_configure_treeShader));
1527  awm->insert_menu_topic(awm->local_id("syncscroll"), "Sync tree scrolling..", "e", "syncscroll.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_syncScroll_window, ntw));
1528 
1529  awm->sep______________();
1530 
1531  awm->insert_menu_topic(awm->local_id("tree_select_latest"), "Select Last Tree", "L", NULp, AWM_ALL, makeWindowCallback(NT_select_bottom_tree, awar_tree));
1532 
1533  if (!clone) {
1534  awm->sep______________();
1535  awm->insert_menu_topic("tree_admin", "Tree admin", "T", "treeadm.hlp", AWM_ALL, popup_tree_admin_window);
1536  awm->insert_menu_topic("nds", "NDS (Node display setup)", "N", "props_nds.hlp", AWM_ALL, makeCreateWindowCallback(NDS_create_window, GLOBAL.gb_main));
1537  }
1538 
1539  awm->sep______________();
1540  awm->insert_menu_topic("transversion", "Transversion analysis", "y", "trans_anal.hlp", AWM_EXP, makeHelpCallback("trans_anal.hlp"));
1541 
1542  if (is_genome_db) {
1543  awm->sep______________();
1544  awm->insert_menu_topic(awm->local_id("tree_pseudo_species_to_organism"), "Relink tree to organisms", "i", "tree_pseudo.hlp", AWM_EXP, makeWindowCallback(NT_pseudo_species_to_organism, ntw));
1545  }
1546 
1547  if (!clone) {
1548  awm->sep______________();
1549  awm->insert_menu_topic("print_tree", "Print tree", "P", "tree2prt.hlp", AWM_ALL, makeWindowCallback(AWT_popup_print_window, static_cast<AWT_canvas*>(ntw)));
1550  awm->insert_menu_topic("tree_2_xfig", "Export tree to XFIG", "F", "tree2file.hlp", AWM_ALL, makeWindowCallback(AWT_popup_tree_export_window, static_cast<AWT_canvas*>(ntw)));
1551  }
1552 
1553  }
1554 
1555  if (!clone) {
1556  // ---------------
1557  // Tools
1558 
1559  awm->create_menu("Tools", "o", AWM_ALL);
1560  {
1561  awm->insert_menu_topic("names_admin", "Nameserver admin (IDs)", "s", "namesadmin.hlp", AWM_ALL, makeWindowCallback(AW_popup_namesadmin_window, GLOBAL.gb_main));
1562  awm->insert_sub_menu("DB admin", "D", AWM_EXP);
1563  {
1564  awm->insert_menu_topic("db_admin", "Re-repair DB", "R", "rerepair.hlp", AWM_EXP, makeWindowCallback(NT_rerepair_DB, GLOBAL.gb_main));
1565  }
1566  awm->close_sub_menu();
1567  awm->sep______________();
1568 
1569  awm->insert_sub_menu("GDE specials", "G", AWM_EXP);
1570  {
1571  GDE_load_menu(awm, AWM_EXP, NULp);
1572  }
1573  awm->close_sub_menu();
1574 
1575  awm->sep______________();
1576  awm->insert_menu_topic("xterm", "Start XTERM", "X", "xterm.hlp", AWM_ALL, AWT_console);
1577  awm->insert_menu_topic("viewlog", "View ARB log", "l", "console.hlp", AWM_ALL, makeWindowCallback(AWT_system_in_console_cb, "arb_show_log.pl run", XCMD_ASYNC_WAIT_ON_ERROR)); // ../SH/arb_show_log.pl
1578  awm->insert_menu_topic("viewserv", "View server log", "V", "console.hlp", AWM_ALL, makeWindowCallback(AWT_system_in_console_cb, "arb_show_log.pl server", XCMD_ASYNC_WAIT_ON_ERROR));
1579  awm->insert_menu_topic("viewsys", "View sysinfo", "i", "console.hlp", AWM_ALL, makeWindowCallback(AWT_system_in_console_cb, "arb_show_log.pl sysinf", XCMD_ASYNC_WAIT_ON_ERROR));
1580  awm->sep______________();
1581  GDE_load_menu(awm, AWM_EXP, "User");
1582  }
1583  // --------------------
1584  // Properties
1585 
1586  awm->create_menu("Properties", "r", AWM_ALL);
1587  {
1588  awm->insert_menu_topic("props_menu", "Frame settings ...", "F", "props_frame.hlp", AWM_ALL, AW_preset_window);
1589  awm->insert_menu_topic(awm->local_id("props_tree2"), "Tree options", "o", "nt_tree_settings.hlp", AWM_ALL, TREE_create_settings_window);
1590  awm->insert_menu_topic("props_tree", "Tree colors & fonts", "c", "color_props.hlp", AWM_ALL, makeCreateWindowCallback(AW_create_gc_window, ntw->gc_manager));
1591  awm->insert_menu_topic("props_www", "Search world wide web (WWW)", "b", "props_www.hlp", AWM_ALL, makeCreateWindowCallback(AWT_create_www_window, GLOBAL.gb_main));
1592  awm->sep______________();
1593  awm->insert_menu_topic("!toggle_expert", "Toggle expert mode", "x", NULp, AWM_ALL, NT_toggle_expert_mode);
1594  awm->insert_menu_topic("!toggle_focus", "Toggle focus follows mouse", "m", NULp, AWM_ALL, NT_toggle_focus_policy);
1595  awm->sep______________();
1597  awm->sep______________();
1598  awm->insert_menu_topic("save_props", "Save properties (ntree.arb)", "S", "savedef.hlp", AWM_ALL, AW_save_properties);
1599  }
1600  }
1601 
1602  awm->insert_help_topic("ARB_NT help", "N", "arb_ntree.hlp", AWM_ALL, makeHelpCallback("arb_ntree.hlp"));
1603 
1604  // ----------------------
1605  // mode buttons
1606  //
1607  // keep them synchronized as far as possible with those in ARB_PARSIMONY
1608  // see ../PARSIMONY/PARS_main.cxx@keepModesSynchronized
1609 
1610  awm->create_mode("mode_select.xpm", "mode_select.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SELECT));
1611  awm->create_mode("mode_mark.xpm", "mode_mark.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MARK));
1612  awm->create_mode("mode_group.xpm", "mode_group.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_GROUP));
1613  awm->create_mode("mode_zoom.xpm", "mode_pzoom.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_ZOOM));
1614  awm->create_mode("mode_lzoom.xpm", "mode_lzoom.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LZOOM));
1615 
1616  awm->create_mode("mode_info.xpm", "mode_info.hlp", AWM_ALL, makeWindowCallback(NT_infomode_cb, ntw, AWT_MODE_INFO));
1617  awm->create_mode("mode_www.xpm", "mode_www.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_WWW));
1618 
1619  // topology-modification-modes
1620  awm->create_mode("mode_setroot.xpm", "mode_setroot.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SETROOT));
1621  awm->create_mode("mode_swap.xpm", "mode_swap.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SWAP));
1622  awm->create_mode("mode_move.xpm", "mode_move.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MOVE));
1623  awm->create_mode("mode_length.xpm", "mode_length.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LENGTH));
1624  awm->create_mode("mode_multifurc.xpm", "mode_length.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MULTIFURC));
1625 
1626  // layout-modes
1627  awm->create_mode("mode_line.xpm", "mode_width.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LINE));
1628  awm->create_mode("mode_rotate.xpm", "mode_rotate.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_ROTATE));
1629  awm->create_mode("mode_spread.xpm", "mode_spread.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SPREAD));
1630 
1631  awm->set_info_area_height(250);
1632  awm->at(5, 2);
1633  awm->auto_space(-2, -2);
1634  awm->shadow_width(1);
1635 
1636  // -------------------------
1637  // create top area
1638 
1639  int first_liney;
1640  int leftx;
1641  awm->get_at_position(&leftx, &first_liney);
1642 
1643  // ---------------------
1644  // quit + help
1645 
1646  awm->button_length(0);
1647 
1648  if (clone) {
1649  awm->callback(AW_POPDOWN);
1650  awm->create_button("CLOSE", "#close.xpm");
1651  }
1652  else {
1653  awm->callback(makeWindowCallback(NT_exit, EXIT_SUCCESS));
1654  awm->help_text("quit.hlp");
1655  awm->create_button("QUIT", "#quit.xpm");
1656  }
1657 
1658  int db_pathx = awm->get_at_xposition();
1659 
1660  // now fetch the yposition for the 2nd button line
1661  awm->at_newline();
1662  int second_liney = awm->get_at_yposition();
1663 
1665  awm->help_text("arb_ntree.hlp");
1666  awm->create_button("?", "#help.xpm");
1667 
1668  // --------------------------
1669  // save + undo/redo
1670 
1671  awm->callback(NT_save_quick_cb);
1672  awm->help_text("save.hlp");
1673  awm->create_button("SAVE", "#save.xpm");
1674 
1675  awm->callback(makeCreateWindowCallback(NT_create_save_as, AWAR_DBBASE));
1676  awm->help_text("save.hlp");
1677  awm->create_button("SAVE_AS", "#saveAs.xpm");
1678 
1679  // undo/redo:
1680  awm->callback(makeWindowCallback(NT_undo_cb, GB_UNDO_UNDO, ntw));
1681  awm->help_text("undo.hlp");
1682  awm->create_button("UNDO", "#undo.xpm");
1683 
1684  awm->callback(makeWindowCallback(NT_undo_cb, GB_UNDO_REDO, ntw));
1685  awm->help_text("undo.hlp");
1686  awm->create_button("REDO", "#redo.xpm");
1687 
1688  int db_pathx2 = awm->get_at_xposition();
1689 
1690  // fetch position for mode help-line:
1691  awm->at_newline();
1692  int third_liney = awm->get_at_yposition();
1693 
1694  awm->at(db_pathx, first_liney);
1695  // size of DB-name button is determined by buttons below:
1696  awm->at_attach_to(false, false, db_pathx2-db_pathx-1, second_liney-first_liney+1);
1697  awm->callback(makeCreateWindowCallback(NT_create_save_quick_as_window, AWAR_DBBASE));
1698  awm->help_text("save.hlp");
1699  awm->create_button("QUICK_SAVE_AS", AWAR_DB_NAME);
1700 
1701  // -----------------------------
1702  // tree + tree display
1703 
1704 #define TREE_BUTTON_OVERSIZE 6
1705 
1706  int db_treex = awm->get_at_xposition();
1707  int second_uppery = second_liney-TREE_BUTTON_OVERSIZE;
1708 
1709  awm->at(db_treex, second_uppery);
1710  awm->button_length(0);
1711 
1712  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_RADIAL));
1713  awm->help_text("tr_type_radial.hlp");
1714  awm->create_button("RADIAL_TREE_TYPE", "#radial.xpm");
1715 
1716  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_NORMAL));
1717  awm->help_text("tr_type_list.hlp");
1718  awm->create_button("LIST_TREE_TYPE", "#dendro.xpm");
1719 
1720  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_IRS));
1721  awm->help_text("tr_type_irs.hlp");
1722  awm->create_button("FOLDED_LIST_TREE_TYPE", "#dendroIrs.xpm");
1723 
1724  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_LIST_NDS));
1725  awm->help_text("tr_type_nds.hlp");
1726  awm->create_button("NO_TREE_TYPE", "#listdisp.xpm");
1727 
1728  int db_treex2 = awm->get_at_xposition();
1729 
1730  awm->at(db_treex, first_liney);
1731  // size of tree-name button is determined by buttons below:
1732  awm->at_attach_to(false, false, db_treex2-db_treex-1, second_uppery-first_liney+1);
1733  awm->callback(makeCreateWindowCallback(NT_create_select_tree_window, awar_tree));
1734  awm->help_text("nt_tree_select.hlp");
1735  awm->create_button("SELECT_A_TREE", awar_tree);
1736 
1737  // ---------------------------------------------------------------
1738  // protection, alignment + editor (and maybe Genome Map)
1739 
1740  int db_alignx = awm->get_at_xposition();
1741 
1742  // editor and genemap buttons have to be 44x24 sized
1743 #define EDIT_XSIZE 50
1744 #define EDIT_YSIZE 30 // same as 'save as' buttons
1745 
1746  // first draw protection:
1747  int protectx = db_alignx + 2*EDIT_XSIZE;
1748 
1749  awm->at(protectx+2, first_liney+1);
1750  awm->button_length(0);
1751  awm->create_button(NULp, "#protect.xpm");
1752 
1753  awm->at(protectx, second_liney+2);
1755  awm->insert_option ("0", NULp, 0);
1756  awm->insert_option ("1", NULp, 1);
1757  awm->insert_option ("2", NULp, 2);
1758  awm->insert_option ("3", NULp, 3);
1759  awm->insert_option ("4", NULp, 4);
1760  awm->insert_option ("5", NULp, 5);
1761  awm->insert_default_option("6", NULp, 6);
1762  awm->update_option_menu();
1763 
1764  int db_searchx = awm->get_at_xposition() - 7;
1765 
1766  // draw ali/editor buttons AFTER protect menu (to get rid of it's label)
1767  awm->at(db_alignx, second_liney);
1768 
1769  awm->at_attach_to(false, false, ((2-is_genome_db)*EDIT_XSIZE), EDIT_YSIZE);
1770  awm->callback(makeWindowCallback(NT_start_editor_on_tree, 0, ntw));
1771  awm->help_text("arb_edit4.hlp");
1772  if (is_genome_db) awm->create_button("EDIT_SEQUENCES", "#editor_small.xpm");
1773  else awm->create_button("EDIT_SEQUENCES", "#editor.xpm");
1774 
1775  if (is_genome_db) {
1776  awm->at_attach_to(false, false, EDIT_XSIZE, EDIT_YSIZE);
1777  awm->callback(makeCreateWindowCallback(GEN_create_first_map, GLOBAL.gb_main)); // initial gene map
1778  awm->help_text("gene_map.hlp");
1779  awm->create_button("OPEN_GENE_MAP", "#gen_map.xpm");
1780  }
1781 
1782  int db_alignx2 = awm->get_at_xposition();
1783 
1784  awm->at(db_alignx, first_liney);
1785  awm->at_attach_to(false, false, db_alignx2-db_alignx-1, second_liney-first_liney+1);
1787  awm->help_text("nt_align_select.hlp");
1788  awm->create_button("SELECT_AN_ALIGNMENT", AWAR_DEFAULT_ALIGNMENT);
1789 
1790  // -------------------------------
1791  // create mode-help line
1792 
1793  awm->at(leftx, third_liney);
1796 
1797  awm->at_newline();
1798  int bottomy = awm->get_at_yposition();
1799 
1800  // ---------------------------------------
1801  // Info / marked / Search / Jump
1802 
1803  awm->button_length(7);
1804 
1805  awm->at(db_searchx, first_liney);
1806  awm->callback(makeCreateWindowCallback(DBUI::create_species_query_window, GLOBAL.gb_main));
1807  awm->help_text("sp_search.hlp");
1808  awm->create_button("SEARCH", "Search");
1809 
1810  awm->at(db_searchx, second_uppery);
1811  awm->callback(makeWindowCallback(NT_jump_cb, ntw, AP_JUMP_BY_BUTTON));
1812  awm->help_text("tr_jump.hlp");
1813  awm->create_button("JUMP", "Jump");
1814 
1815  int db_infox = awm->get_at_xposition();
1816 
1817  awm->at(db_infox, first_liney);
1818  awm->button_length(13);
1819  awm->callback(popupinfo_wcb);
1820  awm->help_text("sp_search.hlp");
1821  awm->create_button("INFO", AWAR_INFO_BUTTON_TEXT);
1822 
1823  awm->at(db_infox, second_uppery);
1824  awm->button_length(13);
1825  awm->help_text("species_configs.hlp");
1826  awm->callback(makeWindowCallback(NT_popup_configuration_admin, ntw));
1827  awm->create_button("selection_admin2", AWAR_MARKED_SPECIES_COUNTER);
1828  {
1830  GB_add_callback(gb_species_data, GB_CB_CHANGED, makeDatabaseCallback(NT_update_marked_counter, static_cast<AW_window*>(awm)));
1832  }
1833 
1834  // set height of top area:
1835  awm->set_info_area_height(bottomy+2);
1836  awm->set_bottom_area_height(0);
1837 
1839 
1840  // ------------------------------------
1841  // Autostarts for development
1842 
1843 #if defined(DEVEL_RALF)
1844  // if (is_genome_db) GEN_map_first(awr)->show();
1845 #endif // DEVEL_RALF
1846 
1848 
1849 #if defined(DEBUG)
1850  AWT_check_action_ids(awr, is_genome_db ? "_genome" : "");
1851 #endif
1852 
1853  return awm;
1854 }
1855 
1858  if (error) aw_message(error);
1859 
1860  nt_create_all_awars(aw_root);
1861 
1862  TREE_canvas *ntw = NULp;
1863  AW_window *aww = popup_new_main_window(aw_root, 0, &ntw);
1865  aww->show();
1866 
1868  if (error) aw_message(error);
1869 
1870  return ntw;
1871 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2528
AW_window * AP_create_max_freq_window(AW_root *aw_root)
void NT_popup_configuration_admin(AW_window *aw_main, TREE_canvas *ntw)
Definition: NT_edconf.cxx:1253
void register_canvas(TREE_canvas *ntw)
Definition: NT_extern.cxx:961
static void group_selected_by_canvas_cb(AWT_graphic_tree *gfx)
Definition: NT_extern.cxx:1027
void insert_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
GB_ERROR GBK_system(const char *system_command)
Definition: arb_msg.cxx:571
#define arb_assert(cond)
Definition: arb_assert.h:245
#define AWT_TREE(ntw)
Definition: TreeDisplay.hxx:85
AW_window * create_species_query_window(AW_root *aw_root, GBDATA *gb_main)
const char * GB_ERROR
Definition: arb_core.h:25
static AW_window * NT_create_database_optimization_window(AW_root *aw_root)
Definition: NT_extern.cxx:568
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:296
GBDATA * get_group_data() const
Definition: Group.hxx:55
virtual const char * get_self_awar() const =0
#define AWAR_DB_NAME
Definition: aw_awar_defs.hxx:6
void NT_install_treeShader(TREE_canvas *ntw, GBDATA *gb_main)
static void NT_database_optimization(AW_window *aww)
Definition: NT_extern.cxx:532
AP_tree_root * get_tree_root()
GBT_TreeRemoveType
Definition: arbdbt.h:31
void AWT_popup_tree_export_window(AW_window *parent_win, AWT_canvas *scr)
Definition: AWT_canio.cxx:765
static void update_main_window_title(AW_root *awr, AW_window_menu_modes *aww, int clone)
Definition: NT_extern.cxx:929
#define AWAR_SAVED_DB_PATH
void GBT_compression_test(struct Unfixed_cb_parameter *, GBDATA *gb_main)
const awt_input_mask_descriptor * AWT_look_input_mask(int id)
AW_window * create_probe_design_window(AW_root *root, GBDATA *gb_main)
void launch_MapViewer_cb(GBDATA *gbd, AD_MAP_VIEWER_TYPE type)
Definition: ad_spec.cxx:254
void button_length(int length)
Definition: AW_at.cxx:288
AW_window * AWTC_create_rename_window(AW_root *root, GBDATA *gb_main)
Definition: AW_rename.cxx:573
GBDATA * GBT_first_marked_species(GBDATA *gb_main)
Definition: aditem.cxx:113
size_t size() const
Definition: arb_strarray.h:85
AWT_COMMAND_MODE
Definition: awt_canvas.hxx:25
AW_window * NT_create_startEditorOnOldConfiguration_window(AW_root *awr)
Definition: NT_edconf.cxx:1271
void NT_remove_leafs(UNFIXED, TREE_canvas *ntw, AWT_RemoveType mode)
int get_at_xposition() const
Definition: AW_at.cxx:301
static void NT_save_quick_as_cb(AW_window *aww)
Definition: NT_extern.cxx:465
AW_window * NT_create_moveGroupInfo_window(AW_root *root)
Definition: ad_trees.cxx:691
void NT_edit_bootstrap(UNFIXED, TREE_canvas *ntw)
void EXP_create_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
Definition: EXP_main.cxx:37
GBDATA * read_pointer() const
Definition: AW_awar.cxx:191
void nt_mode_event(UNFIXED, TREE_canvas *ntw, AWT_COMMAND_MODE mode)
GB_ERROR GB_save(GBDATA *gb, const char *path, const char *savetype)
void NT_createConcatenationAwars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
GBDATA * current(AW_root *root, GBDATA *gb_main) const OVERRIDE
Definition: NT_extern.cxx:732
static void expert_mode_changed_cb(AW_root *aw_root)
Definition: NT_extern.cxx:240
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:595
void AWTC_create_submission_variables(AW_root *root, AW_default db1)
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
void SQ_create_awars(AW_root *awr, AW_default aw_def)
Definition: SQ_main.cxx:48
void create_dbui_awars(AW_root *aw_root)
Definition: ui_species.cxx:85
#define AWAR_DB_OPTI_TREENAME
Definition: NT_extern.cxx:483
AW_window * create_AWTC_export_window(AW_root *awr, GBDATA *gb_main)
GB_ERROR GB_add_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
Definition: ad_cb.cxx:356
Export_Type
Definition: NT_extern.cxx:84
void GEN_create_awars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
void NT_create_transpro_variables(AW_root *root, AW_default props)
long GBT_mark_all(GBDATA *gb_main, int flag)
Definition: aditem.cxx:295
void NT_create_compare_taxonomy_awars(AW_root *aw_root, AW_default props)
void popup_species_info_window(AW_root *aw_root, GBDATA *gb_main)
GB_ERROR write_pointer(GBDATA *aw_pointer)
const char * ARB_keep_string(char *str)
Definition: arb_string.cxx:72
void NT_mark_all_cb(UNFIXED, TREE_canvas *ntw, int mark_mode)
void request_refresh()
Definition: awt_canvas.hxx:362
AW_window * awt_create_load_box(AW_root *aw_root, const char *action, const char *what, const char *default_directory, const char *file_extension, char **set_file_name_awar, const WindowCallback &ok_cb, const WindowCallback &close_cb, const char *close_button_text)
AW_window * NT_create_extendeds_window(AW_root *aw_root)
Definition: ad_ext.cxx:318
#define TREE_BUTTON_OVERSIZE
AW_window * AWTC_create_submission_window(AW_root *root, GBDATA *gb_main)
void NT_remove_bootstrap(UNFIXED, TREE_canvas *ntw)
TreeNode * GBT_remove_leafs(TreeNode *tree, GBT_TreeRemoveType mode, const GB_HASH *species_hash, int *removed, int *groups_removed)
Definition: adtree.cxx:34
void NT_create_extendeds_vars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
Definition: ad_ext.cxx:286
GB_ERROR GB_end_transaction(GBDATA *gbd, GB_ERROR error)
Definition: arbdb.cxx:2561
void at(int x, int y)
Definition: AW_at.cxx:93
void NT_move_boot_branch(UNFIXED, TREE_canvas *ntw, int direction)
void allow_title_reuse()
Definition: arb_progress.h:319
void NT_reset_pzoom_cb(UNFIXED, TREE_canvas *ntw)
void dont_save_awars_with_default_value(GBDATA *gb_db)
Definition: AW_root.cxx:605
void AW_create_standard_fileselection(AW_window *aws, const char *awar_prefix)
Definition: aw_file.hxx:30
const char * GBT_name_of_largest_tree(GBDATA *gb_main)
Definition: adtree.cxx:1103
void request_save()
Definition: awt_canvas.hxx:366
GB_ERROR ARB_bind_global_awars(GBDATA *gb_main)
#define ARB_VERSION_DETAILED
Definition: arb_build.h:2
void GBT_get_alignment_names(ConstStrArray &names, GBDATA *gbd)
Definition: adali.cxx:317
void create_primer_design_variables(AW_root *aw_root, AW_default aw_def, AW_default global)
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
#define AWAR_DEFAULT_ALIGNMENT
Definition: aw_awar_defs.hxx:8
AW_window * create_probe_match_with_specificity_window(AW_root *root, TREE_canvas *ntw)
AW_window * STAT_create_chimera_check_window(AW_root *root, GBDATA *gb_main)
Definition: ST_window.cxx:270
static void NT_create_mask_submenu(AW_window_menu_modes *awm)
Definition: NT_extern.cxx:757
TreeNode * GBT_read_tree(GBDATA *gb_main, const char *tree_name, TreeRoot *troot)
Definition: adtree.cxx:837
long read_int() const
Definition: AW_awar.cxx:184
#define AWAR_SAI_COLOR_STR
AW_window * NT_create_multifurcate_tree_window(AW_root *aw_root, TREE_canvas *ntw)
Definition: ad_trees.cxx:1125
AW_window * create_insertDeleteBySAI_window(AW_root *root, GBDATA *gb_main)
Definition: NT_ins_col.cxx:268
void NT_start_editor_on_tree(AW_window *aww, int use_species_aside, TREE_canvas *ntw)
Definition: NT_edconf.cxx:1294
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
AW_window * NT_create_syncScroll_window(AW_root *awr, TREE_canvas *ntw)
AW_root * awr
Definition: awt_canvas.hxx:338
void AWTI_cleanup_importer()
void AW_advice(const char *message, AW_Advice_Type type, const char *title, const char *corresponding_help)
Show a message box with an advice for the user.
Definition: AW_advice.cxx:160
static void export_nds_cb(AW_window *aww, bool do_print)
Definition: NT_extern.cxx:98
void AWT_create_mask_submenu(AW_window_menu_modes *awm, awt_item_type wanted_item_type, AWT_OpenMaskWindowCallback open_mask_window_cb, GBDATA *gb_main)
static void NT_toggle_focus_policy(AW_window *aww)
Definition: NT_extern.cxx:245
AW_DB_selection * awt_create_TREE_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname)
void GBK_terminatef(const char *templat,...)
Definition: arb_msg.cxx:523
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void TREE_auto_jump_cb(UNFIXED, TREE_canvas *ntw, AP_tree_jump_reason cause)
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
Definition: AW_preset.cxx:1445
static void canvas_tree_awar_changed_cb(AW_awar *, bool, TREE_canvas *ntw)
Definition: NT_extern.cxx:939
const char * GBT_existing_tree(GBDATA *gb_main, const char *tree_name)
Definition: adtree.cxx:1056
void NT_create_alignment_vars(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main)
Definition: NT_cb.cxx:98
void GBS_free_hash(GB_HASH *hs)
Definition: adhash.cxx:538
void AWT_registerTreeAwarCallback(AW_awar *awar, const TreeAwarCallback &tacb, bool triggerIfTreeDataChanges)
GB_HASH * GBT_create_species_hash(GBDATA *gb_main)
Definition: adhashtools.cxx:36
static void NT_save_as_cb(AW_window *aww)
Definition: NT_extern.cxx:485
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
TREE_canvas * NT_get_canvas_by_index(int idx)
Definition: NT_extern.cxx:978
static bool track_group_selection_by_canvas
Definition: NT_extern.cxx:1025
#define AWAR_FOOTER_MAX_LEN
void set_window_title(const char *title)
Definition: AW_window.cxx:1069
bool is_valid() const
Definition: Group.hxx:48
AW_window * create_multiprobe_window(AW_root *root, TREE_canvas *canvas)
Definition: MP_main.cxx:101
AW_window * create_primer_design_window(AW_root *root, GBDATA *gb_main)
static AW_window * NT_create_save_as(AW_root *aw_root, const char *base_name)
Definition: NT_extern.cxx:597
const char * getKeyPath() const OVERRIDE
Definition: NT_extern.cxx:744
void GBCMS_shutdown(GBDATA *gbd)
Definition: adcomm.cxx:247
GB_ERROR GB_fix_database(GBDATA *gb_main)
Definition: adTest.cxx:236
void insert_field_admin_menuitems(AW_window *aws, GBDATA *gb_main)
Definition: ui_species.cxx:888
#define AWAR_GROUP
Definition: ad_trees.h:19
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
GBDATA * GB_get_father(GBDATA *gbd)
Definition: arbdb.cxx:1722
void update_option_menu()
static void NT_update_marked_counter(GBDATA *, AW_window *aww)
Definition: NT_extern.cxx:764
GB_ERROR GB_push_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2494
GB_ERROR toggle_toggle()
Definition: AW_awar.cxx:573
void NT_delete_mark_all_cb(AW_window *, TREE_canvas *ntw)
Definition: NT_cb.cxx:31
void AWT_insert_DBcompression_selector(AW_window *aww, const char *awar_name)
Definition: AWT_misc.cxx:62
void AW_init_color_group_defaults(const char *for_program)
Definition: AW_preset.cxx:1113
#define EDIT_YSIZE
bool empty() const
Definition: arb_strarray.h:86
AW_window * NT_create_sort_tree_by_other_tree_window(AW_root *aw_root, TREE_canvas *ntw)
Definition: ad_trees.cxx:1087
AW_window * NT_createMergeSimilarSpeciesWindow(AW_root *aw_root)
void GBT_split_string(ConstStrArray &dest, const char *namelist, const char *separator, bool dropEmptyTokens)
Definition: arb_strarray.h:232
void SAI_popup_calculator_window(AW_window *awp, GBDATA *gb_main)
Definition: saicalc.cxx:1138
#define AWAR_MARKED_SPECIES_COUNTER
Definition: NT_extern.cxx:73
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:231
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
void insert(const char *displayed, const AW_scalar &value)
Definition: AW_select.cxx:380
void AW_create_namesadmin_awars(AW_root *awr, GBDATA *gb_main)
static AW_window * create_mark_by_refentries_window(AW_root *awr, GBDATA *gbmain)
Definition: NT_extern.cxx:880
static void NT_mark_duplicates(UNFIXED, TREE_canvas *ntw)
Definition: NT_extern.cxx:651
void set_tree_style(AP_tree_display_style style, AWT_canvas *ntw)
GB_UNDO_TYPE
Definition: arbdb.h:107
GB_ERROR GDE_init(AW_root *aw_root, AW_default aw_def, GBDATA *gb_main, GDE_get_sequences_cb get_sequences, GDE_format_alignment_cb format_ali, gde_window_type window_type)
Definition: GDE.cxx:489
static bool nt_disconnect_from_db(AW_root *aw_root, GBDATA *&gb_main_ref)
Definition: NT_extern.cxx:331
void GB_change_my_security(GBDATA *gbd, int level)
Definition: arbdb.cxx:1627
AW_window * NT_create_syncroot_window(AW_root *awr, GBDATA *gb_main)
const char * read_char_pntr() const
Definition: AW_awar.cxx:168
static void merge_from_cb(AW_window *aww, AW_CL cl_awarNamePtr)
Definition: NT_extern.cxx:906
static void install_group_changed_callback(const GraphicTreeCallback &gccb)
int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:2986
GB_ERROR GB_optimize(GBDATA *gb_main)
AWT_graphic_tree * NT_generate_tree(AW_root *root, GBDATA *gb_main, AD_map_viewer_cb map_viewer_cb)
AW_window * NT_create_resort_window(AW_root *awr)
Definition: NT_sort.cxx:209
AW_window * NT_create_select_alignment_window(AW_root *awr)
Definition: NT_cb.cxx:119
static AW_root * SINGLETON
Definition: aw_root.hxx:102
void show()
Definition: AW_window.cxx:1683
TreeNode * NT_get_tree_root_of_canvas(TREE_canvas *ntw)
Definition: NT_extern.cxx:858
void GDE_load_menu(AW_window *awm, AW_active, const char *menulabel)
Definition: GDE.cxx:436
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
GB_ERROR ARB_format_alignment(GBDATA *Main, const char *alignment_name)
Definition: insdel.cxx:1439
static void nt_changesecurity(AW_root *aw_root)
Definition: NT_extern.cxx:91
char * GBT_read_string(GBDATA *gb_container, const char *fieldpath)
Definition: adtools.cxx:267
void popup_group_search_window(AW_window *aw_parent, GBDATA *gb_main)
void popup_tree_admin_window(AW_window *awp)
Definition: ad_trees.cxx:795
#define AWAR_FOOTER
void NT_insert_collapse_submenu(AW_window_menu_modes *awm, TREE_canvas *ntw)
void GEN_create_genes_submenu(AW_window_menu_modes *awm, GBDATA *gb_main, bool for_ARB_NTREE)
Definition: GEN_map.cxx:1483
void create_insertDeleteColumn_variables(AW_root *root, AW_default db1)
Definition: NT_ins_col.cxx:135
AW_window * AWT_create_www_window(AW_root *aw_root, GBDATA *gb_main)
Definition: AWT_www.cxx:194
GBDATA * get_gb_tree() const
Definition: ARB_Tree.hxx:82
size_t get_self_awar_content_length() const OVERRIDE
Definition: NT_extern.cxx:729
static nt_item_type_species_selector item_type_species
Definition: NT_extern.cxx:749
AW_window * NT_create_consense_window(AW_root *aw_root)
Definition: ad_trees.cxx:948
#define AWAR_SAI_GLOBAL
std::set< GBDATA * > DBItemSet
Definition: dbitem_set.h:22
void NT_create_sai_from_pfold(AW_window *aww)
Definition: ad_spec.cxx:127
AW_window * create_refentries_window(AW_root *aw_root, ReferringEntriesHandler *reh, const char *window_id, const char *title, const char *help, client_area_builder build_client_area, const char *action, referred_item_handler action_cb)
Definition: refentries.cxx:253
AW_window * NT_create_select_tree_window(AW_root *awr, const char *awar_tree)
Definition: NT_cb.cxx:60
AW_root * get_root() const
AW_window * NT_create_compareTopologies_window(AW_root *root)
Definition: ad_trees.cxx:636
GBDATA * gb_species_data
Definition: adname.cxx:33
#define AWAR_DB_PATH
Definition: aw_awar_defs.hxx:5
void create_probe_design_variables(AW_root *aw_root, AW_default def, AW_default global)
static AW_window * create_nds_export_window(AW_root *root)
Definition: NT_extern.cxx:189
void awt_create_aww_vars(AW_root *aw_root, AW_default aw_def)
Definition: AWT_www.cxx:54
static int group[MAXN+1]
Definition: ClustalV.cxx:65
void AW_save_properties(AW_window *aw)
Definition: AW_preset.cxx:1452
void update()
Definition: AW_awar.cxx:390
#define MAX_NT_WINDOWS
Definition: NT_local.h:32
void NT_restart(AW_root *aw_root, const char *arb_ntree_args)
Definition: NT_extern.cxx:419
AW_window * NT_create_dna_2_pro_window(AW_root *root)
Definition: ad_transpro.cxx:72
static void create_export_nds_awars(AW_root *awr, AW_default def)
Definition: NT_extern.cxx:224
GB_ERROR GBT_write_tree(GBDATA *gb_main, const char *tree_name, TreeNode *tree)
Definition: adtree.cxx:523
AW_window * create_insertDeleteColumn_window(AW_root *root)
Definition: NT_ins_col.cxx:201
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:472
static ARB_ERROR mark_referred_species(GBDATA *gb_main, const DBItemSet &referred)
Definition: NT_extern.cxx:869
#define AWAR_NTREE_MAIN_WINDOW_COUNT
Definition: NT_local.h:29
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:116
void touch()
Definition: AW_awar.cxx:207
void NT_rerepair_DB(AW_window *, GBDATA *gb_main)
void mark_duplicates()
Definition: AP_Tree.cxx:1530
void NT_jump_cb(UNFIXED, TREE_canvas *ntw, AP_tree_jump_type jumpType)
AW_window * NT_create_alignment_admin_window(AW_root *root, AW_window *aw_popmedown)
Definition: NT_cb.cxx:109
static void error(const char *msg)
Definition: mkptypes.cxx:96
TREE_canvas * get_canvas(int idx) const
Definition: NT_extern.cxx:970
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2402
void AP_create_consensus_var(AW_root *aw_root, AW_default aw_def)
const char * get_name() const
Definition: Group.hxx:56
#define AWAR_TREE_REFRESH
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
Definition: AW_file.cxx:72
NDS_Type
Definition: nds.h:35
AW_window * NT_create_searchManuallyNames_window(AW_root *aw_root)
fputc('\n', stderr)
AW_window * AW_preset_window(AW_root *root)
Definition: AW_preset.cxx:1920
GBDATA * GBT_next_marked_species(GBDATA *gb_species)
Definition: aditem.cxx:116
void relink_tree(GBDATA *gb_main, void(*relinker)(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash), GB_HASH *organism_hash)
Definition: AP_Tree.cxx:1575
#define AWAR_TREE
#define AWAR_DBBASE
Definition: aw_awar_defs.hxx:4
GB_ULONG GB_time_of_day(void)
Definition: adsocket.cxx:357
void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:569
AW_window * NT_create_realign_dna_window(AW_root *root)
void NT_count_different_chars(AW_window *, GBDATA *gb_main)
Definition: ad_spec.cxx:30
long GB_read_clients(GBDATA *gbd)
Definition: adcomm.cxx:1682
void NT_import_sequences(AW_window *aww, TREE_canvas *ntw)
Definition: NT_import.cxx:48
#define AWAR_SPECIES_NAME
DBItemSet::const_iterator DBItemSetIter
Definition: dbitem_set.h:23
#define AWAR_AWM_MASK
#define AWAR_SAI_NAME
static AW_window * popup_new_main_window(AW_root *awr, int clone, TREE_canvas **result_ntw)
Definition: NT_extern.cxx:1111
#define AWAR_DB_COMPRESSION
Definition: NT_extern.cxx:482
void AWT_destroy_input_masks()
#define AWAR_INFO_BUTTON_TEXT
static void nt_create_all_awars(AW_root *awr)
Definition: NT_extern.cxx:247
AP_tree_display_style get_tree_style() const
#define AWAR_SECURITY_LEVEL
char * read_string() const
Definition: AW_awar.cxx:198
static WindowCallback simple(void(*root_cb)(AW_root *, T), T t)
Definition: rootAsWin.h:47
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GB_ERROR GB_pop_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2524
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:645
void NT_create_trackAliChanges_Awars(AW_root *root, AW_default properties)
GB_ERROR GB_save_quick_as(GBDATA *gbd, const char *path)
void NT_resort_data_by_phylogeny(AW_window *, TREE_canvas *ntw)
Definition: NT_sort.cxx:167
static void NT_infomode_cb(UNFIXED, TREE_canvas *canvas, AWT_COMMAND_MODE mode)
Definition: NT_extern.cxx:646
void AWT_insert_DBsaveType_selector(AW_window *aww, const char *awar_name)
Definition: AWT_misc.cxx:39
void NT_set_tree_style(UNFIXED, TREE_canvas *ntw, AP_tree_display_style style)
void AW_refresh_fileselection(AW_root *awr, const char *awar_prefix)
Definition: AW_file.cxx:944
static AW_window_menu_modes_opengl * awm
void GB_print_debug_information(struct Unfixed_cb_parameter *, GBDATA *gb_main)
Definition: arbdb.cxx:2814
static void selectedSpeciesChanged_cb(AW_root *awr)
Definition: NT_extern.cxx:229
#define AWAR_EXPORT_NDS_SEPARATOR
Definition: NT_extern.cxx:72
long GBT_count_marked_species(GBDATA *gb_main)
Definition: aditem.cxx:372
long GB_last_saved_clock(GBDATA *gb_main)
nt_item_type_species_selector()
Definition: NT_extern.cxx:723
int get_index() const
void NT_insert_mark_submenus(AW_window_menu_modes *awm, TREE_canvas *ntw, int insert_as_submenu)
void unlink_awars_from_DB(GBDATA *gb_main)
Definition: AW_root.cxx:635
void insert_default_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
#define nt_assert(cond)
Definition: NT_local.h:27
AW_window * NT_create_splitAlignment_window(AW_root *awr)
void NT_create_multifurcate_tree_awars(AW_root *aw_root, AW_default props)
Definition: ad_trees.cxx:1106
AW_window * SQ_create_seq_quality_window(AW_root *aw_root, GBDATA *gb_main)
Definition: SQ_main.cxx:225
void create_trees_var(AW_root *aw_root, AW_default aw_def)
Definition: ad_trees.cxx:202
static AW_window * NT_create_merge_from_window(AW_root *awr)
Definition: NT_extern.cxx:909
static void merge_into_cb(AW_window *aww, AW_CL cl_awarNamePtr)
Definition: NT_extern.cxx:907
GB_ERROR GB_undo(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT
Definition: adindex.cxx:755
AW_window * NT_create_species_join_window(AW_root *root)
Definition: NT_join.cxx:143
static void group_awar_changed_cb(AW_root *awr)
Definition: NT_extern.cxx:1047
void NT_suggestValidNames(AW_window *)
int aw_question(const char *unique_id, const char *question, const char *buttons, bool sameSizeButtons, const char *helpfile)
Definition: AW_question.cxx:26
void set_info_area_height(int height)
Definition: AW_window.cxx:796
AWT_graphic * gfx
Definition: awt_canvas.hxx:339
AW_window * NT_create_colstat_2_gnuplot_window(AW_root *root)
fputs(TRACE_PREFIX, stderr)
#define AWAR_AW_FOCUS_FOLLOWS_MOUSE
#define AWAR_TOPAREA_SAIS
Definition: NT_local.h:30
TREE_canvas * NT_create_main_window(AW_root *aw_root)
Definition: NT_extern.cxx:1856
AW_window * create_colorize_items_window(AW_root *aw_root, GBDATA *gb_main, ItemSelector &sel)
Definition: db_query.cxx:1963
#define EDIT_XSIZE
const Group & get_selected_group() const
void set_mode(AWT_COMMAND_MODE mo)
Definition: awt_canvas.hxx:382
void set_bottom_area_height(int height)
Definition: AW_window.cxx:801
static void NT_undo_cb(AW_window *, GB_UNDO_TYPE undo_type, TREE_canvas *ntw)
Definition: NT_extern.cxx:636
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
GB_ULONG GB_last_saved_time(GBDATA *gb_main)
void NT_resort_tree_cb(UNFIXED, TREE_canvas *ntw, TreeOrder order)
void request_save_and_zoom_reset()
Definition: awt_canvas.hxx:368
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
xml element
void NT_activate_configMarkers_display(TREE_canvas *ntw)
Definition: NT_edconf.cxx:254
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:35
void AW_help_entry_pressed(AW_window *aww)
Definition: AW_root.cxx:37
char * GBK_singlequote(const char *arg)
Definition: arb_msg.cxx:599
void GB_write_flag(GBDATA *gbd, long flag)
Definition: arbdb.cxx:2773
AW_window * NDS_create_window(AW_root *aw_root, GBDATA *gb_main)
Definition: nds.cxx:586
static void NT_justify_branch_lenghs(UNFIXED, TREE_canvas *ntw)
Definition: NT_extern.cxx:663
#define AWAR_ERROR_MESSAGES
long AW_CL
Definition: cb.h:21
GBDATA * GEN_find_origin_organism(GBDATA *gb_pseudo, const GB_HASH *organism_hash)
Definition: adGene.cxx:643
const char * get_self_awar() const OVERRIDE
Definition: NT_extern.cxx:726
static void NT_open_mask_window(AW_window *aww, int id, GBDATA *gb_main)
Definition: NT_extern.cxx:751
void request_structure_update()
Definition: awt_canvas.hxx:365
#define OVERRIDE
Definition: cxxforward.h:110
AW_gc_manager * gc_manager
Definition: awt_canvas.hxx:341
void NT_deleteValidNames(AW_window *)
AW_window * AP_create_con_expert_window(AW_root *aw_root)
AW_window * GEN_create_first_map(AW_root *aw_root, GBDATA *gb_main)
Definition: GEN_map.cxx:1585
void AW_popup_namesadmin_window(AW_window *parent_win, GBDATA *gb_main)
AP_tree_display_style
Definition: TreeDisplay.hxx:87
void justify_branch_lenghs(GBDATA *gb_main)
Definition: AP_Tree.cxx:1559
#define AWAR_DB_COMMENT
AP_tree * get_root_node()
void NT_importValidNames(AW_window *)
void subtitle(const char *stitle)
Definition: arb_progress.h:321
#define CHANGE_KEY_PATH
Definition: arbdbt.h:86
void AWT_popup_print_window(AW_window *parent_win, AWT_canvas *scr)
Definition: AWT_canio.cxx:863
GB_ERROR GB_textprint(const char *path) __ATTR__USERESULT
Definition: adsocket.cxx:363
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:416
static AW_window * NT_create_merge_to_window(AW_root *awr)
Definition: NT_extern.cxx:917
ItemSelector & SPECIES_get_selector()
Definition: species.cxx:139
static void NT_alltree_remove_leafs(AW_window *, GBT_TreeRemoveType mode, GBDATA *gb_main)
Definition: NT_extern.cxx:781
int get_count() const
Definition: NT_extern.cxx:968
void close_sub_menu()
Definition: AW_window.cxx:486
void GBT_get_tree_names(ConstStrArray &names, GBDATA *gb_main, bool sorted)
Definition: adtree.cxx:1182
static void NT_save_quick_cb(AW_window *aww)
Definition: NT_extern.cxx:448
static AW_window * create_colorize_species_window(AW_root *aw_root)
Definition: NT_extern.cxx:760
#define AWAR_EXPORT_NDS
Definition: NT_extern.cxx:71
GB_ERROR GBT_compress_sequence_tree2(GBDATA *gbd, const char *tree_name, const char *ali_name) __ATTR__USERESULT
Definition: adseqcompr.cxx:889
AW_window * TREE_create_settings_window(AW_root *aw_root)
void NT_createValidNamesAwars(AW_root *aw_root, AW_default aw_def)
static __ATTR__NORETURN void really_exit(int exitcode, bool kill_my_clients)
Definition: NT_extern.cxx:403
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
AW_option_menu_struct * create_option_menu(const char *awar_name)
void NT_start(const char *arb_ntree_args, bool restart_with_new_ARB_PID)
Definition: NT_extern.cxx:397
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
Definition: macro_gui.cxx:171
AW_root * get_root()
Definition: aw_window.hxx:354
long GB_read_clock(GBDATA *gbd)
Definition: arbdb.cxx:1714
AW_window * AP_create_pos_var_pars_window(AW_root *root)
static void nt_start_2nd_arb(AW_window *aww, bool quit)
Definition: NT_extern.cxx:428
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
Definition: adsocket.cxx:1268
AW_window * NT_createConcatenationWindow(AW_root *aw_root)
void shutdown_macro_recording(AW_root *aw_root)
Definition: trackers.cxx:470
#define NULp
Definition: cxxforward.h:114
GBDATA * gb_main
Definition: NT_local.h:37
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:139
GB_HASH * GBT_create_organism_hash(GBDATA *gb_main)
Definition: adhashtools.cxx:48
void AWT_system_in_console_cb(AW_window *, const char *command, XCMD_TYPE exectype)
Definition: AWT_misc.cxx:90
void NT_select_bottom_tree(AW_window *aww, const char *awar_tree)
Definition: NT_cb.cxx:92
#define AWAR_NTREE_TITLE_MODE
Definition: NT_extern.cxx:74
#define __ATTR__NORETURN
Definition: attributes.h:56
void create_refentries_awars(AW_root *aw_root, AW_default aw_def)
Definition: refentries.cxx:223
GB_ERROR write_string(const char *aw_string)
static char * command
Definition: arb_a2ps.c:319
static AW_window * NT_create_save_quick_as_window(AW_root *aw_root, const char *base_name)
Definition: NT_extern.cxx:505
void sep______________()
Definition: AW_window.cxx:753
static TREE_canvas_registry & instance()
Definition: NT_extern.cxx:956
void NT_scale_tree(UNFIXED, TREE_canvas *ntw)
const char * local_id(const char *id) const
Definition: AW_window.cxx:747
GB_ERROR GB_request_undo_type(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT_TODO
Definition: adindex.cxx:721
void NT_fill_canvas_selection_list(class AW_selection_list *sellst, TREE_canvas *to_skip)
Definition: NT_extern.cxx:999
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:133
void destroy(TreeNode *that)
Definition: TreeNode.h:600
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
Definition: arbdb.cxx:904
#define AWAR_DB_TYPE
Definition: NT_extern.cxx:481
#define AWAR_EXPERT
int get_at_yposition() const
Definition: AW_at.cxx:305
AW_window * NT_create_compare_taxonomy_window(AW_root *aw_root, TREE_canvas *ntw)
GBDATA * gb_main
Definition: adname.cxx:32
static void nt_run(const char *command)
Definition: NT_extern.cxx:387
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
GB_ERROR GBT_check_data(GBDATA *Main, const char *alignment_name)
Definition: adali.cxx:218
void NT_exit(AW_window *aws, int exitcode)
Definition: NT_extern.cxx:410
void hide_or_notify(const char *error)
Definition: AW_window.cxx:1845
AW_window * NT_create_branch_analysis_window(AW_root *aw_root, TREE_canvas *ntw)
void NT_deselect_group(AW_root *awr)
Definition: NT_extern.cxx:1021
bool GEN_is_genome_db(GBDATA *gb_main, int default_value)
Definition: adGene.cxx:20
void shadow_width(int shadow_thickness)
Definition: AW_window.cxx:1078
AW_window * create_probe_match_window(AW_root *root, GBDATA *gb_main)
AW_window * NT_create_trackAliChanges_window(AW_root *root)
void AWT_openURL(AW_window *aww, const char *url)
Definition: AWT_www.cxx:268
void AWT_console(AW_window *)
Definition: AWT_misc.cxx:87
bool GEN_is_pseudo_gene_species(GBDATA *gb_species)
Definition: adGene.cxx:558
static void relink_pseudo_species_to_organisms(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash)
Definition: NT_extern.cxx:682
void NT_configure_treeShader(void)
void at_newline()
Definition: AW_at.cxx:119
static void merge_from_to(AW_root *awr, const char *db_awar_name, bool merge_to)
Definition: NT_extern.cxx:891
AW_awar * get_awar_tree() const
void TREE_create_awars(AW_root *aw_root, AW_default db)
~nt_item_type_species_selector() OVERRIDE
Definition: NT_extern.cxx:724
void NDS_create_vars(AW_root *aw_root, AW_default awdef, GBDATA *gb_main)
Definition: nds.cxx:366
void at_attach_to(bool attach_x, bool attach_y, int xoff, int yoff)
Definition: AW_at.cxx:187
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
void NT_reset_branchlengths(UNFIXED, TREE_canvas *ntw)
GB_ERROR write_int(long aw_int)
static void NT_toggle_expert_mode(AW_window *aww)
Definition: NT_extern.cxx:244
void NT_reset_lzoom_cb(UNFIXED, TREE_canvas *ntw)
GB_ERROR AWT_initialize_input_mask(AW_root *root, GBDATA *gb_main, const awt_item_type_selector *sel, const char *mask_name, bool localMask)
AW_window * create_probe_admin_window(AW_root *root, GBDATA *gb_main)
void create_group_search_awars(AW_root *aw_root, AW_default props)
GBDATA * GB_entry(GBDATA *father, const char *key)
Definition: adquery.cxx:334
void inc_and_check_user_abort(GB_ERROR &error)
Definition: arb_progress.h:332
void TREE_install_update_callbacks(TREE_canvas *ntw)
GB_ERROR GB_save_quick(GBDATA *gbd, const char *refpath)
Definition: Group.hxx:20
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
AW_window * create_tree_window(AW_root *aw_root, AWT_graphic *awd)
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:194
void GB_close(GBDATA *gbd)
Definition: arbdb.cxx:655
NT_global GLOBAL
Definition: NT_main.cxx:46
GBDATA * gb_main
Definition: awt_canvas.hxx:336
static void NT_pseudo_species_to_organism(AW_window *, TREE_canvas *ntw)
Definition: NT_extern.cxx:699
const char * label
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:448
#define UNCOVERED()
Definition: arb_assert.h:380
void NT_create_resort_awars(AW_root *awr, AW_default aw_def)
Definition: NT_sort.cxx:199
void AWT_system_cb(AW_window *, const char *command)
Definition: AWT_misc.cxx:84
void NT_reload_tree_event(AW_root *, TREE_canvas *ntw, bool unzoom_and_expose)
GBDATA * GBT_get_species_data(GBDATA *gb_main)
Definition: aditem.cxx:105
GB_write_int const char s
Definition: AW_awar.cxx:154
#define max(a, b)
Definition: f2c.h:154