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 #if defined(DEVEL_RALF)
67 # define TRACE_GROUP_SELECTION
68 #endif
69 
70 #define AWAR_EXPORT_NDS "tmp/export_nds"
71 #define AWAR_EXPORT_NDS_SEPARATOR AWAR_EXPORT_NDS "/separator"
72 #define AWAR_MARKED_SPECIES_COUNTER "tmp/disp_marked_species"
73 #define AWAR_NTREE_TITLE_MODE "tmp/title_mode"
74 
76 
80 
82 
83 static void nt_changesecurity(AW_root *aw_root) {
84  int level = aw_root->awar(AWAR_SECURITY_LEVEL)->read_int();
86  GB_change_my_security(GLOBAL.gb_main, level); // changes user security
88 }
89 
90 static void export_nds_cb(AW_window *aww, bool do_print) {
91  AW_root *aw_root = aww->get_root();
92  char *name = aw_root->awar(AWAR_EXPORT_NDS"/file_name")->read_string();
93  FILE *out = fopen(name, "w");
94 
95  if (!out) {
96  aw_message("Error: Cannot open and write to file");
97  }
98  else {
100 
102  NDS_Type nds_type = (NDS_Type)aw_root->awar(AWAR_EXPORT_NDS_SEPARATOR)->read_int();
103  char *tree_name = aw_root->awar(AWAR_TREE)->read_string();
104 
105  for (GBDATA *gb_species = GBT_first_marked_species(GLOBAL.gb_main);
106  gb_species;
107  gb_species = GBT_next_marked_species(gb_species))
108  {
109  const char *buf = make_node_text_nds(GLOBAL.gb_main, gb_species, nds_type, NULp, tree_name);
110  fprintf(out, "%s\n", buf);
111  }
113  fclose(out);
114  if (do_print) {
115  GB_ERROR error = GB_textprint(name);
116  if (error) aw_message(error);
117  }
118  free(tree_name);
119  }
120  free(name);
121 }
122 
124  AW_window_simple *aws = new AW_window_simple;
125  aws->init(root, "EXPORT_NDS_OF_MARKED", "EXPORT NDS OF MARKED SPECIES");
126  aws->load_xfig("sel_box_nds.fig");
127 
128  aws->callback(AW_POPDOWN);
129  aws->at("close");
130  aws->create_button("CLOSE", "CLOSE", "C");
131 
132  aws->callback(makeHelpCallback("arb_export_nds.hlp"));
133  aws->at("help");
134  aws->create_button("HELP", "HELP", "H");
135 
136  aws->at("save");
137  aws->callback(makeWindowCallback(export_nds_cb, false));
138  aws->create_button("SAVE", "SAVE", "S");
139 
140  aws->at("print");
141  aws->callback(makeWindowCallback(export_nds_cb, true));
142  aws->create_button("PRINT", "PRINT", "P");
143 
144  aws->at("toggle1");
145  aws->label("Column output");
146  aws->create_option_menu(AWAR_EXPORT_NDS_SEPARATOR, true);
147  aws->insert_default_option("Space padded", "S", NDS_OUTPUT_SPACE_PADDED);
148  aws->insert_option ("TAB separated", "T", NDS_OUTPUT_TAB_SEPARATED);
149  aws->insert_option ("Comma separated", "C", NDS_OUTPUT_COMMA_SEPARATED);
150  aws->update_option_menu();
151 
153 
154  return aws;
155 }
156 
158  AW_create_fileselection_awars(awr, AWAR_EXPORT_NDS, "", ".nds", "export.nds");
160 }
161 
163  const char *value = awr->awar(AWAR_SPECIES_NAME)->read_char_pntr();
164  awr->awar(AWAR_INFO_BUTTON_TEXT)->write_string(value[0] ? value : "Species Info");
165  if (value[0]) {
166  awr->awar(AWAR_GROUP)->write_pointer(NULp); // deselect group when species gets selected
167 #if defined(TRACE_GROUP_SELECTION)
168  fputs("clear AWAR_GROUP (because species selected)\n", stderr);
169 #endif
170  }
171 }
172 
173 static void expert_mode_changed_cb(AW_root *aw_root) {
174  aw_root->awar(AWAR_AWM_MASK)->write_int(aw_root->awar(AWAR_EXPERT)->read_int() ? AWM_ALL : AWM_BASIC); // publish expert-mode globally
175 }
176 
179 
180 static void nt_create_all_awars(AW_root *awr) {
181  // creates awars for all modules reachable from ARB_NT main window
182 
184  if (GB_read_clients(GLOBAL.gb_main)>=0) {
185  awr->awar_string(AWAR_TREE, "", GLOBAL.gb_main);
186  }
187  else {
189  }
190 
195  awr->awar_string(AWAR_INFO_BUTTON_TEXT, "Species Info", GLOBAL.gb_main);
198 
199  awr->awar_string(AWAR_SAI_COLOR_STR, "", GLOBAL.gb_main); // sai visualization in probe match
200 
203 #if defined(DEBUG)
204  AWT_create_db_browser_awars(awr, AW_ROOT_DEFAULT);
205 #endif // DEBUG
206 
208 
211 #if defined(DEBUG) && 0
212  awr->awar(AWAR_SECURITY_LEVEL)->write_int(6); // no security for debugging..
213 #endif // DEBUG
214 
221  {
223  if (gde_err) GBK_terminatef("Fatal: %s", gde_err);
224  }
229 
236 
238  awr->awar_string(AWAR_DB_COMMENT, "<no description>", GLOBAL.gb_main);
239 
245 
247 
249  if (!error) {
250  AW_awar *awar_expert = awr->awar(AWAR_EXPERT);
251  awar_expert->add_callback(expert_mode_changed_cb);
252  awar_expert->touch();
253 
255  }
256 
257  if (error) aw_message(error);
258 }
259 
260 // --------------------------------------------------------------------------------
261 
262 static bool nt_disconnect_from_db(AW_root *aw_root, GBDATA*& gb_main_ref) {
263  // ask user if DB was not saved
264  // returns true if user allows to quit
265 
266  // @@@ code here could as well be applied to both merge DBs
267  // - question about saving only with target DB!
268 
269  if (gb_main_ref) {
270  if (GB_read_clients(gb_main_ref)>=0) {
271  if (GB_read_clock(gb_main_ref) > GB_last_saved_clock(gb_main_ref)) {
272  long secs;
273  secs = GB_last_saved_time(gb_main_ref);
274 
275 #if defined(DEBUG)
276  secs = GB_time_of_day(); // simulate "just saved"
277 #endif // DEBUG
278 
279  const char *quit_buttons = "Quit ARB,Do NOT quit";
280  if (secs) {
281  secs = GB_time_of_day() - secs;
282  if (secs>10) {
283  char *question = GBS_global_string_copy("You last saved your data %li:%li minutes ago\nSure to quit ?", secs/60, secs%60);
284  int dontQuit = aw_question("quit_arb", question, quit_buttons);
285  free(question);
286  if (dontQuit) {
287  return false;
288  }
289  }
290  }
291  else {
292  if (aw_question("quit_arb", "You never saved any data\nSure to quit ???", quit_buttons)) {
293  return false;
294  }
295  }
296  }
297  }
298 
299  GBCMS_shutdown(gb_main_ref);
300 
301  GBDATA *gb_main = gb_main_ref;
302  gb_main_ref = NULp; // avoid further usage
303 
304  nt_assert(aw_root);
305 #if defined(WARN_TODO)
306 #warning instead of directly calling the following functions, try to add them as GB_atclose_callback
307 #endif
308  aw_root->unlink_awars_from_DB(gb_main);
310 #if defined(DEBUG)
311  AWT_browser_forget_db(gb_main);
312 #endif // DEBUG
313 
314  GB_close(gb_main);
315  }
316  return true;
317 }
318 
319 static void nt_run(const char *command) {
320  GB_ERROR error = GBK_system(command);
321  if (error) {
322  fprintf(stderr, "nt_run: Failed to run '%s' (Reason: %s)\n", command, error);
323 #if defined(DEBUG)
324  GBK_dump_backtrace(stderr, "nt_run-error");
325 #endif
326  }
327 }
328 
329 void NT_start(const char *arb_ntree_args, bool restart_with_new_ARB_PID) {
330  char *command = GBS_global_string_copy("arb_launcher --async %s %s", restart_with_new_ARB_PID ? "arb" : "arb_ntree", arb_ntree_args);
331  nt_run(command);
332  free(command);
333 }
334 
335 __ATTR__NORETURN static void really_exit(int exitcode, bool kill_my_clients) {
336  if (kill_my_clients) {
337  nt_run("(arb_clean session; echo ARB done) &"); // kills all clients
338  }
339  exit(exitcode);
340 }
341 
342 void NT_exit(AW_window *aws, int exitcode) {
343  AW_root *aw_root = aws->get_root();
345  shutdown_macro_recording(aw_root);
346  bool is_server_and_has_clients = GLOBAL.gb_main && GB_read_clients(GLOBAL.gb_main)>0;
347  if (nt_disconnect_from_db(aw_root, GLOBAL.gb_main)) {
348  really_exit(exitcode, is_server_and_has_clients);
349  }
350 }
351 void NT_restart(AW_root *aw_root, const char *arb_ntree_args) {
352  // restarts arb_ntree (with new ARB_PID)
353  bool is_server_and_has_clients = GLOBAL.gb_main && GB_read_clients(GLOBAL.gb_main)>0;
354  if (nt_disconnect_from_db(aw_root, GLOBAL.gb_main)) {
355  NT_start(arb_ntree_args, true);
356  really_exit(EXIT_SUCCESS, is_server_and_has_clients);
357  }
358 }
359 
360 static void nt_start_2nd_arb(AW_window *aww, bool quit) {
361  // start 2nd arb with intro window
362  AW_root *aw_root = aww->get_root();
363  char *dir4intro;
364  GB_split_full_path(aw_root->awar(AWAR_DB_PATH)->read_char_pntr(), &dir4intro, NULp, NULp, NULp);
365  if (!dir4intro) {
366  dir4intro = ARB_strdup(".");
367  }
368 
369  if (quit) {
370  NT_restart(aw_root, dir4intro);
371  }
372  else {
373  NT_start(dir4intro, true);
374  }
375  free(dir4intro);
376 }
377 
378 // --------------------------------------------------------------------------------
379 
380 static void NT_save_quick_cb(AW_window *aww) {
381  AW_root *awr = aww->get_root();
382  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
383 
385 
387  free( filename);
388  if (error) aw_message(error);
390 }
391 
392 
393 static void NT_save_quick_as_cb(AW_window *aww) {
394  AW_root *awr = aww->get_root();
395  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
397  if (!error) AW_refresh_fileselection(awr, AWAR_DBBASE);
398  aww->hide_or_notify(error);
399 
400  free(filename);
401 }
402 
403 #define AWAR_DB_TYPE AWAR_DBBASE "/type" // created by AWT_insert_DBsaveType_selector
404 #define AWAR_DB_COMPRESSION AWAR_DBBASE "/compression" // created by AWT_insert_DBcompression_selector
405 #define AWAR_DB_OPTI_TREENAME AWAR_DBBASE "/optimize_tree_name"
406 
407 static void NT_save_as_cb(AW_window *aww) {
408  AW_root *awr = aww->get_root();
409  char *filename = awr->awar(AWAR_DB_PATH)->read_string();
410  const char *atype = awr->awar(AWAR_DB_TYPE)->read_char_pntr();
411  const char *ctype = awr->awar(AWAR_DB_COMPRESSION)->read_char_pntr();
412  char *savetype = GBS_global_string_copy("%s%s", atype, ctype);
413 
415  GB_ERROR error = GB_save(GLOBAL.gb_main, filename, savetype);
416  if (!error) AW_refresh_fileselection(awr, AWAR_DBBASE);
417  aww->hide_or_notify(error);
418 
419  free(savetype);
420  free(filename);
421 }
422 
423 static AW_window *NT_create_save_quick_as_window(AW_root *aw_root, const char *base_name) {
424  static AW_window_simple *aws = NULp;
425  if (!aws) {
426  aws = new AW_window_simple;
427  aws->init(aw_root, "SAVE_CHANGES_TO", "Quicksave changes as");
428  aws->load_xfig("save_as.fig");
429 
430  aws->at("close");
431  aws->callback(AW_POPDOWN);
432  aws->create_button("CLOSE", "CLOSE", "C");
433 
434  aws->callback(makeHelpCallback("save.hlp"));
435  aws->at("help");
436  aws->create_button("HELP", "HELP", "H");
437 
438  AW_create_standard_fileselection(aws, base_name);
439 
440  aws->at("comment");
441  aws->create_text_field(AWAR_DB_COMMENT);
442 
443  aws->at("save");
444  aws->callback(NT_save_quick_as_cb);
445  aws->create_button("SAVE", "SAVE", "S");
446  }
447  return aws;
448 }
449 
451  arb_progress progress("Optimizing database compression", 2L);
453 
455  if (!error) {
456  ConstStrArray ali_names;
458 
459  arb_progress ali_progress("Optimizing sequence data", ali_names.size());
460  ali_progress.allow_title_reuse();
461 
462  error = GBT_check_data(GLOBAL.gb_main, NULp);
463  error = GB_end_transaction(GLOBAL.gb_main, error);
464 
465  if (!error) {
466  char *tree_name = aww->get_root()->awar(AWAR_DB_OPTI_TREENAME)->read_string();
467  for (int i = 0; ali_names[i]; ++i) {
468  error = GBT_compress_sequence_tree2(GLOBAL.gb_main, tree_name, ali_names[i]);
469  ali_progress.inc_and_check_user_abort(error);
470  }
471  free(tree_name);
472  }
473  }
474  progress.inc_and_check_user_abort(error);
475 
476  if (!error) {
477  error = GB_optimize(GLOBAL.gb_main);
478  progress.inc_and_check_user_abort(error);
479  }
480  aww->hide_or_notify(error);
481 }
482 
484  static AW_window_simple *aws = NULp;
485  if (aws) return aws;
487 
488  const char *largest_tree = GBT_name_of_largest_tree(GLOBAL.gb_main);
489  aw_root->awar_string(AWAR_DB_OPTI_TREENAME, largest_tree);
490 
491  aws = new AW_window_simple;
492  aws->init(aw_root, "OPTIMIZE_DATABASE", "Optimize database compression");
493  aws->load_xfig("optimize.fig");
494 
495  aws->at("trees");
497 
498  aws->at("close");
499  aws->callback(AW_POPDOWN);
500  aws->create_button("CLOSE", "CLOSE", "C");
501 
502  aws->callback(makeHelpCallback("optimize.hlp"));
503  aws->at("help");
504  aws->create_button("HELP", "HELP", "H");
505 
506  aws->at("go");
507  aws->callback(NT_database_optimization);
508  aws->create_button("GO", "GO");
509  return aws;
510 }
511 
512 static AW_window *NT_create_save_as(AW_root *aw_root, const char *base_name) {
513  static AW_window_simple *aws = NULp;
514  if (aws) return aws;
515 
516  aws = new AW_window_simple;
517  aws->init(aw_root, "SAVE_DB", "SAVE ARB DB");
518  aws->load_xfig("save_as.fig");
519 
520  aws->at("close");
521  aws->callback(AW_POPDOWN);
522  aws->create_button("CLOSE", "CLOSE", "C");
523 
524  aws->at("help");
525  aws->callback(makeHelpCallback("save.hlp"));
526  aws->create_button("HELP", "HELP", "H");
527 
528  AW_create_standard_fileselection(aws, base_name);
529 
530  aws->at("type");
532 
533  aws->at("compression");
535 
536  aws->at("optimize");
538  aws->help_text("optimize.hlp");
539  aws->create_autosize_button("OPTIMIZE", "Optimize database compression");
540 
541  aws->at("save");
542  aws->callback(NT_save_as_cb);
543  aws->create_button("SAVE", "SAVE", "S");
544 
545  aws->at("comment");
546  aws->create_text_field(AWAR_DB_COMMENT);
547 
548  return aws;
549 }
550 
551 static void NT_undo_cb(AW_window*, GB_UNDO_TYPE undo_type, TREE_canvas *ntw) {
552  GB_ERROR error = GB_undo(GLOBAL.gb_main, undo_type);
553  if (error) aw_message(error);
554  else {
556  AWT_auto_refresh allowed_on(ntw);
557  ntw->request_refresh();
558  }
559 }
560 
562 static char *stream2str(streamSource source, const char *commandOrFile) {
563  char *output = NULp;
564  FILE *in = NULp;
565 
566  switch (source) {
567  case FROM_PIPE: in = popen(commandOrFile, "r"); break;
568  case FROM_FILE: in = fopen(commandOrFile, "rt"); break;
569  }
570 
571  if (in) {
572  GBS_strstruct *out = GBS_stropen(2000);
573  int c;
574 
575  while (EOF != (c = fgetc(in))) GBS_chrcat(out, c);
576 
577  switch (source) {
578  case FROM_PIPE: pclose(in); break;
579  case FROM_FILE: fclose(in); break;
580  }
581 
582  // skip trailing linefeeds
583  long offset = GBS_memoffset(out);
584  while (offset>0 && GBS_mempntr(out)[offset-1] == '\n') {
585  GBS_str_cut_tail(out, 1);
586  offset--;
587  }
588 
589  output = GBS_strclose(out);
590  }
591  return output;
592 }
593 
594 inline void removeTrailingNewlines(char *str) {
595  char *eos = strchr(str, 0)-1;
596  while (eos >= str && eos[0] == '\n') *eos-- = 0;
597 }
598 
599 inline void append_named_value(GBS_strstruct *out, const char *prefix, const char *value) {
600  GBS_strcat(out, GBS_global_string("%-*s: %s\n", 12, prefix, value));
601 }
602 inline void append_command_output(GBS_strstruct *out, const char *prefix, const char *command) {
603  char *output = stream2str(FROM_PIPE, command);
604  if (output) {
605  removeTrailingNewlines(output);
606  if (strcmp(output, "unknown") != 0) append_named_value(out, prefix, output);
607  free(output);
608  }
609 }
610 
611 static void NT_infomode_cb(UNFIXED, TREE_canvas *canvas, AWT_COMMAND_MODE mode) {
612  DBUI::popup_species_info_window(canvas->awr, canvas->gb_main);
613  nt_mode_event(NULp, canvas, mode);
614 }
615 
617  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
618  if (tree_root) {
619  AWT_auto_refresh allowed_on(ntw);
620  GB_transaction ta(ntw->gb_main);
621 
622  NT_mark_all_cb(NULp, ntw, 0); // unmark all
623  tree_root->mark_duplicates();
625  }
626 }
627 
629  GB_transaction ta(ntw->gb_main);
630  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
631 
632  if (tree_root) {
633  AWT_auto_refresh allowed_on(ntw);
634  tree_root->justify_branch_lenghs(ntw->gb_main);
636  }
637 }
638 
639 #if defined(DEBUG)
640 static void NT_fix_database(AW_window *) {
641  GB_ERROR err = NULp;
643  if (err) aw_message(err);
644 }
645 #endif
646 
647 static void relink_pseudo_species_to_organisms(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash) {
648  if (ref_gb_node) {
649  if (GEN_is_pseudo_gene_species(ref_gb_node)) {
650  GBDATA *gb_organism = GEN_find_origin_organism(ref_gb_node, organism_hash);
651 
652  if (gb_organism) {
653  char *name = GBT_read_string(gb_organism, "name");
654 
655  if (name) {
656  freeset(ref_name, name);
657  ref_gb_node = gb_organism;
658  }
659  }
660  }
661  }
662 }
663 
665  GB_transaction ta(ntw->gb_main);
666  AP_tree *tree_root = AWT_TREE(ntw)->get_root_node();
667 
668  if (tree_root) {
669  AWT_auto_refresh allowed_on(ntw);
670 
671  GB_HASH *organism_hash = GBT_create_organism_hash(ntw->gb_main);
672  tree_root->relink_tree(ntw->gb_main, relink_pseudo_species_to_organisms, organism_hash);
673  GBS_free_hash(organism_hash);
674  ntw->request_save();
675  }
676 }
677 
678 
679 // #########################################
680 // #########################################
681 // ### ###
682 // ## user mask section ##
683 // ### ###
684 // #########################################
685 // #########################################
686 
687 struct nt_item_type_species_selector FINAL_TYPE : public awt_item_type_selector {
690 
691  const char *get_self_awar() const OVERRIDE {
692  return AWAR_SPECIES_NAME;
693  }
695  return 12; // should be enough for "nnaammee.999"
696  }
697  GBDATA *current(AW_root *root, GBDATA *gb_main) const OVERRIDE { // give the current item
698  char *species_name = root->awar(get_self_awar())->read_string();
699  GBDATA *gb_species = NULp;
700 
701  if (species_name[0]) {
703  gb_species = GBT_find_species(gb_main, species_name);
704  }
705 
706  free(species_name);
707  return gb_species;
708  }
709  const char *getKeyPath() const OVERRIDE { // give the keypath for items
710  return CHANGE_KEY_PATH;
711  }
712 };
713 
714 static nt_item_type_species_selector item_type_species;
715 
716 static void NT_open_mask_window(AW_window *aww, int id, GBDATA *gb_main) {
717  const awt_input_mask_descriptor *descriptor = AWT_look_input_mask(id);
718  nt_assert(descriptor);
719  if (descriptor) AWT_initialize_input_mask(aww->get_root(), gb_main, &item_type_species, descriptor->get_internal_maskname(), descriptor->is_local_mask());
720 }
721 
724 }
727 }
728 
734  const char *buffer = count ? GBS_global_string("%li marked", count) : "";
736  char *oldval = counter->read_string();
737  if (strcmp(oldval, buffer)) {
738  counter->write_string(buffer);
739  aww->get_root()->awar(AWAR_TREE_REFRESH)->touch();
740  }
741  free(oldval);
742 }
743 
744 // --------------------------------------------------------------------------------------------------
745 
747  GB_ERROR error = NULp;
748  GB_transaction ta(gb_main);
749 
750  ConstStrArray tree_names;
751  GBT_get_tree_names(tree_names, gb_main, false);
752 
753  if (!tree_names.empty()) {
754  long treeCount = tree_names.size();
755 
756  const char *whats_removed = NULp;
757  switch (mode) {
758  case GBT_REMOVE_ZOMBIES: whats_removed = "zombies"; break;
759  case GBT_REMOVE_MARKED: whats_removed = "marked"; break;
760  default: nt_assert(0); break;
761  }
762 
763  const char *task = GBS_global_string("Deleting %s from %li trees", whats_removed, treeCount);
764 
765  arb_progress progress(task, treeCount);
766  GB_HASH *species_hash = GBT_create_species_hash(gb_main);
767 
768  int modified = 0;
769 
770  for (int t = 0; t<treeCount && !error; t++) {
771  progress.subtitle(tree_names[t]);
772  TreeNode *tree = GBT_read_tree(gb_main, tree_names[t], new SimpleRoot);
773  if (!tree) {
774  aw_message(GBS_global_string("Can't load tree '%s' - skipped", tree_names[t]));
775  }
776  else {
777  int removed = 0;
778  int groups_removed = 0;
779 
780  tree = GBT_remove_leafs(tree, mode, species_hash, &removed, &groups_removed);
781 
782  nt_assert(removed >= groups_removed);
783 
784  if (!tree) {
785  aw_message(GBS_global_string("'%s' would disappear. Please delete tree manually.", tree_names[t]));
786  }
787  else {
788  if (removed>0) {
789  error = GBT_write_tree(gb_main, tree_names[t], tree);
790  if (error) {
791  aw_message(GBS_global_string("Failed to write '%s' (Reason: %s)", tree_names[t], error));
792  }
793  else {
794  if (groups_removed>0) {
795  aw_message(GBS_global_string("Removed %i species and %i groups from '%s'", removed, groups_removed, tree_names[t]));
796  }
797  else {
798  aw_message(GBS_global_string("Removed %i species from '%s'", removed, tree_names[t]));
799  }
800  modified++;
801  }
802  }
803  UNCOVERED();
804  destroy(tree);
805  }
806  }
807  progress.inc_and_check_user_abort(error);
808  }
809 
810  if (modified) {
811  aw_message(GBS_global_string("Changed %i of %li trees.", modified, treeCount));
812  }
813  else {
814  aw_message("No tree modified");
815  }
816 
817  GBS_free_hash(species_hash);
818  }
819 
820  aw_message_if(ta.close(error));
821 }
822 
825  if (tree) {
826  AP_tree *root = tree->get_root_node();
827  if (root) return root;
828  }
829  return NULp;
830 }
831 
832 // --------------------------------------------------------------------------------------------------
833 
835  GB_transaction ta(gb_main);
836  GBT_mark_all(gb_main, 0);
837 
838  DBItemSetIter end = referred.end();
839  for (DBItemSetIter s = referred.begin(); s != end; ++s) {
840  GB_write_flag(*s, 1);
841  }
842  return ARB_ERROR();
843 }
844 
846  static AW_window *aws = NULp;
847  if (!aws) {
849  aws = RefEntries::create_refentries_window(awr, &reh, "markbyref", "Mark by reference", "markbyref.hlp", NULp, "Mark referenced", mark_referred_species);
850  }
851  return aws;
852 }
853 
854 // --------------------------------------------------------------------------------------------------
855 
856 static void merge_from_to(AW_root *awr, const char *db_awar_name, bool merge_to) {
857  const char *db_name = awr->awar(db_awar_name)->read_char_pntr();
858  char *quotedDB = GBK_singlequote(db_name);
859 
862  merge_to
863  ? "arb_ntree : %s &"
864  : "arb_ntree %s : &",
865  quotedDB)
866  );
867 
868  free(quotedDB);
869 }
870 
871 static void merge_from_cb(AW_window *aww, AW_CL cl_awarNamePtr) { merge_from_to(aww->get_root(), *(const char**)cl_awarNamePtr, false); }
872 static void merge_into_cb(AW_window *aww, AW_CL cl_awarNamePtr) { merge_from_to(aww->get_root(), *(const char**)cl_awarNamePtr, true); }
873 
875  static char *awar_name = NULp; // do not free, bound to callback
876  AW_window *aw_from =
877  awt_create_load_box(awr, "Merge data from", "other ARB database",
878  ".", ".arb", &awar_name,
879  makeWindowCallback(merge_from_cb, AW_CL(&awar_name)));
880  return aw_from;
881 }
883  static char *awar_name = NULp; // do not free, bound to callback
884  AW_window *aw_to =
885  awt_create_load_box(awr, "Merge data to", "other ARB database",
886  ".", ".arb", &awar_name,
887  makeWindowCallback(merge_into_cb, AW_CL(&awar_name)),
888  makeWindowCallback(AW_POPDOWN), NULp);
889  return aw_to;
890 }
891 
892 // --------------------------------------------------------------------------------------------------
893 
894 static void update_main_window_title(AW_root* awr, AW_window_menu_modes* aww, int clone) {
895  const char* filename = awr->awar(AWAR_DB_NAME)->read_char_pntr();
896  if (clone) {
897  aww->set_window_title(GBS_global_string("%s - ARB (%i)", filename, clone));
898  }
899  else {
900  aww->set_window_title(GBS_global_string("%s - ARB", filename));
901  }
902 }
903 
904 static void canvas_tree_awar_changed_cb(AW_awar *, bool, TREE_canvas *ntw) {
906  AW_root::SINGLETON->awar(AWAR_NTREE_MAIN_WINDOW_COUNT)->touch(); // refresh canvas selection lists
908 }
909 
911  int count;
912  TREE_canvas *canvas[MAX_NT_WINDOWS];
913 
914  static TREE_canvas_registry *SINGLETON;
915 
916  TREE_canvas_registry() : count(0) {
918  }
919 
920 public:
922  if (!SINGLETON) SINGLETON = new TREE_canvas_registry;
923  return *SINGLETON;
924  }
925 
927  nt_assert(count<MAX_NT_WINDOWS);
928  nt_assert(count == ntw->get_index()); // you have to register TREE_canvas'es in order of creation!
929  canvas[count++] = ntw;
930  ntw->awr->awar(AWAR_NTREE_MAIN_WINDOW_COUNT)->write_int(count); // trigger callbacks
931  }
932 
933  int get_count() const { return count; }
934 
935  TREE_canvas *get_canvas(int idx) const {
936  if (idx<0 || idx>=count) return NULp;
937  return canvas[idx];
938  }
939 };
940 
941 TREE_canvas_registry *TREE_canvas_registry::SINGLETON = NULp;
942 
945  nt_assert(idx>=0 && idx<MAX_NT_WINDOWS);
947 }
948 
949 #if defined(TRACE_GROUP_SELECTION)
950 static TREE_canvas *find_canvas_showing(AWT_graphic_tree *agt) {
951  // look for (registered) canvas showing given AWT_graphic_tree
952  // returns NULp if none found
954 
955  int maxIdx = reg.get_count();
956  for (int32_t i = 0; i<maxIdx; ++i) {
957  TREE_canvas *ntw = reg.get_canvas(i);
958  if (ntw->gfx == agt) return ntw;
959  }
960  return NULp;
961 }
962 #endif
963 
968 
969  int maxIdx = reg.get_count();
970  for (int32_t i = 0; i<maxIdx; ++i) {
971  TREE_canvas *ntw = reg.get_canvas(i);
972  if (ntw && ntw != to_skip) {
973  nt_assert(ntw->get_awar_tree());
974  const char *treename = ntw->get_awar_tree()->read_char_pntr();
975  const char *description = i
976  ? GBS_global_string("ARB (%i): %s", i, treename)
977  : GBS_global_string("ARB main: %s", treename);
978  sellst->insert(description, i);
979  }
980  }
981 }
982 
983 // ----------------------------------
984 // group-selection handlers
985 
988 }
989 
991 
993  const Group& group = gfx->get_selected_group();
994 
995 #if defined(TRACE_GROUP_SELECTION)
996  fprintf(stderr, "[%s] ", track_group_selection_by_canvas ? "track" : "dont track");
997  TREE_canvas *ntw = find_canvas_showing(gfx);
998  if (group.is_valid()) {
999  fprintf(stderr, "canvas %i selects group '%s'\n", ntw->get_index(), group.get_name());
1000  }
1001  else {
1002  fprintf(stderr, "canvas %i de-selects group\n", ntw->get_index());
1003  }
1004 #endif
1005 
1006  if (track_group_selection_by_canvas) {
1007  // set group-awar:
1008  gfx->get_root()->awar(AWAR_GROUP)->write_pointer(group.get_group_data()); // writes NULp if !group.is_valid()
1009  }
1010 }
1011 
1012 static void group_awar_changed_cb(AW_root *awr) {
1013  AW_awar *awar_group = awr->awar(AWAR_GROUP);
1014  GBDATA *gb_wanted_group = awar_group->read_pointer();
1015 
1016  GBDATA *gb_wanted_tree = NULp;
1017  {
1018  if (gb_wanted_group) {
1019  GB_transaction ta(gb_wanted_group);
1020  gb_wanted_tree = GB_get_father(gb_wanted_group);
1021  awr->awar(AWAR_SPECIES_NAME)->write_string(""); // deselect species when group gets selected
1022 #if defined(TRACE_GROUP_SELECTION)
1023  fputs("clear AWAR_SPECIES_NAME (because group selected)\n", stderr);
1024 #endif
1025  }
1026 #if defined(TRACE_GROUP_SELECTION)
1027  const char *group_name = NULp;
1028  if (gb_wanted_group) {
1029  GB_transaction ta(gb_wanted_group);
1030  GBDATA *gb_name = GB_entry(gb_wanted_group, "group_name");
1031  if (gb_name) group_name = GB_read_char_pntr(gb_name);
1032  }
1033  fprintf(stderr, "group awar changed to %p", gb_wanted_group);
1034  if (group_name) fprintf(stderr, " (='%s')", group_name);
1035  fputc('\n', stderr);
1036 #endif
1037  }
1038 
1039  LocallyModify<bool> ignore_group_selection_by_canvas(track_group_selection_by_canvas, false);
1040 
1041  {
1043 
1044  int maxIdx = reg.get_count();
1045  for (int32_t i = 0; i<maxIdx; ++i) {
1046  TREE_canvas *ntw = reg.get_canvas(i);
1047  AWT_graphic_tree *agt = AWT_TREE(ntw);
1048  const Group& curr_group = agt->get_selected_group();
1049 
1050  GBDATA *gb_curr_tree = agt->get_tree_root()->get_gb_tree();
1051  if (gb_curr_tree == gb_wanted_tree) {
1052  AWT_auto_refresh allowed_on(ntw);
1053  if (!curr_group.is_valid() || // no group selected
1054  curr_group.get_group_data() != gb_wanted_group) // wrong group selected
1055  {
1056  agt->select_group(gb_wanted_group);
1057  ntw->request_refresh();
1058  }
1059  // perform auto-jump (also if group was already selected, otherwise group-traversal keys will not follow the selected group)
1061  }
1062  else {
1063  if (curr_group.is_valid()) {
1064  AWT_auto_refresh allowed_on(ntw);
1065  agt->deselect_group();
1066  ntw->request_refresh();
1067  }
1068  }
1069  }
1070  }
1071 }
1072 
1073 // ----------------------------
1074 // create main window
1075 
1076 static AW_window *popup_new_main_window(AW_root *awr, int clone, TREE_canvas **result_ntw) {
1083 
1084  char window_title[256];
1085  const char *awar_tree = NULp;
1086 
1087  if (clone) {
1088  awar_tree = ARB_keep_string(GBS_global_string_copy(AWAR_TREE "_%i", clone));
1089  sprintf(window_title, "ARB_NT_%i", clone);
1090  }
1091  else {
1092  awar_tree = AWAR_TREE;
1093  sprintf(window_title, "ARB_NT");
1094  }
1096  awm->init(awr, window_title, window_title, 0, 0);
1097 
1098  awr->awar(AWAR_DB_NAME)
1099  ->add_callback(makeRootCallback(update_main_window_title, awm, clone))
1100  ->update();
1101 
1102  awm->button_length(5);
1103 
1104  if (!clone) AW_init_color_group_defaults("arb_ntree");
1105 
1107 
1108  if (!clone) { // while creating initial window
1111  }
1112 
1113  TREE_canvas *ntw;
1114  {
1115  AW_awar *tree_awar = awr->awar_string(awar_tree);
1116  {
1117  AP_tree_display_style prev_style = tree->get_tree_style();
1118  tree->set_tree_style(AP_LIST_SIMPLE, NULp); // avoid NDS warnings during startup
1119 
1120  ntw = new TREE_canvas(GLOBAL.gb_main, awm, "ARB_NT", tree, tree_awar);
1121  tree->set_tree_style(prev_style, ntw);
1122  ntw->set_mode(AWT_MODE_SELECT);
1123  }
1124 
1125  if (result_ntw) *result_ntw = ntw;
1126 
1127  {
1128  const char *tree_name = tree_awar->read_char_pntr();
1129  const char *existing_tree_name = GBT_existing_tree(GLOBAL.gb_main, tree_name);
1130 
1131  if (existing_tree_name) {
1132  tree_awar->write_string(existing_tree_name);
1133  NT_reload_tree_event(awr, ntw, true); // load first tree
1134  }
1135  else {
1136  AW_advice("Your database contains no tree.", AW_ADVICE_TOGGLE_AND_HELP, NULp, "no_tree.hlp");
1137  tree->set_tree_style(AP_LIST_NDS, ntw); // no tree -> show NDS list
1138  }
1139 
1141  AWT_registerTreeAwarCallback(tree_awar, makeTreeAwarCallback(canvas_tree_awar_changed_cb, ntw), false);
1142  }
1143  }
1144 
1146 
1147  bool is_genome_db = GEN_is_genome_db(GLOBAL.gb_main, 0); // is this a genome database ? (default = 0 = not a genom db)
1148 
1150 
1151  // --------------
1152  // File
1153 
1154 #if defined(DEBUG)
1155  AWT_create_debug_menu(awm);
1156 #endif // DEBUG
1157 
1158  bool allow_new_window = (ntw->get_index()+1) < MAX_NT_WINDOWS;
1159 
1160  if (clone) {
1161  awm->create_menu("File", "F", AWM_ALL);
1162  if (allow_new_window) {
1163  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));
1164  }
1165  awm->insert_menu_topic("close", "Close", "C", NULp, AWM_ALL, AW_POPDOWN);
1166  }
1167  else {
1168 #if defined(DEBUG)
1169  // add more to debug-menu
1170  awm->sep______________();
1171  awm->insert_menu_topic("fix_db", "Fix database", "F", NULp, AWM_ALL, NT_fix_database);
1172  awm->insert_menu_topic("debug_arbdb", "Print debug information", "d", NULp, AWM_ALL, makeWindowCallback(GB_print_debug_information, GLOBAL.gb_main));
1173  awm->insert_menu_topic("test_compr", "Test compression", "T", NULp, AWM_ALL, makeWindowCallback(GBT_compression_test, GLOBAL.gb_main));
1174 #endif // DEBUG
1175 
1176  awm->create_menu("File", "F", AWM_ALL);
1177  {
1178  // keep the following entries in sync with ../EDIT4/ED4_root.cxx@common_save_menu_entries
1179  awm->insert_menu_topic("save_changes", "Quicksave changes", "s", "save.hlp", AWM_ALL, NT_save_quick_cb);
1180  awm->insert_menu_topic("save_all_as", "Save whole database as ...", "w", "save.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_save_as, AWAR_DBBASE));
1181  if (allow_new_window) {
1182  awm->sep______________();
1183  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));
1184  }
1185  awm->sep______________();
1186  awm->insert_menu_topic("optimize_db", "Optimize database compression", "O", "optimize.hlp", AWM_ALL, NT_create_database_optimization_window);
1187  awm->sep______________();
1188 
1189  awm->insert_sub_menu("Import", "I");
1190  {
1191  awm->insert_menu_topic("merge_from", "Merge from other ARB database", "d", "arb_merge_into.hlp", AWM_ALL, NT_create_merge_from_window);
1192  awm->insert_menu_topic("import_seq", "Import from external format", "I", "arb_import.hlp", AWM_ALL, makeWindowCallback(NT_import_sequences, ntw));
1193  GDE_load_menu(awm, AWM_EXP, "Import");
1194  }
1195  awm->close_sub_menu();
1196 
1197  awm->insert_sub_menu("Export", "E");
1198  {
1199  awm->insert_menu_topic("export_to_ARB", "Merge to (new) ARB database", "A", "arb_merge_outof.hlp", AWM_ALL, NT_create_merge_to_window);
1200  awm->insert_menu_topic("export_seqs", "Export to external format", "f", "arb_export.hlp", AWM_ALL, makeCreateWindowCallback(create_AWTC_export_window, GLOBAL.gb_main));
1201  GDE_load_menu(awm, AWM_ALL, "Export");
1202  awm->insert_menu_topic("export_nds", "Export fields (to calc-sheet using NDS)", "N", "arb_export_nds.hlp", AWM_ALL, create_nds_export_window);
1203  }
1204  awm->close_sub_menu();
1205  awm->sep______________();
1206 
1207  insert_macro_menu_entry(awm, false);
1208 
1209  awm->insert_sub_menu("VersionInfo/Bugreport/MailingList", "V");
1210  {
1211  awm->insert_menu_topic("version_info", "Version info (" ARB_VERSION_DETAILED ")", "V", "version.hlp", AWM_ALL, makeHelpCallback ("version.hlp"));
1212  awm->insert_menu_topic("bug_report", "Report bug", "b", NULp, AWM_ALL, makeWindowCallback(AWT_openURL, "http://bugs.arb-home.de/wiki/BugReport"));
1213  awm->insert_menu_topic("mailing_list", "Mailing list", "M", NULp, AWM_ALL, makeWindowCallback(AWT_openURL, "http://bugs.arb-home.de/wiki/ArbMailingList"));
1214  }
1215  awm->close_sub_menu();
1216  awm->sep______________();
1217 
1218  awm->insert_menu_topic("new_arb", "Start second database", "d", "quit.hlp", AWM_ALL, makeWindowCallback(nt_start_2nd_arb, false));
1219  awm->insert_menu_topic("restart_arb", "Quit + load other database", "l", "quit.hlp", AWM_ALL, makeWindowCallback(nt_start_2nd_arb, true));
1220  awm->insert_menu_topic("quit", "Quit", "Q", "quit.hlp", AWM_ALL, makeWindowCallback(NT_exit, EXIT_SUCCESS));
1221  }
1222 
1223  // -----------------
1224  // Species
1225 
1226  awm->create_menu("Species", "c", AWM_ALL);
1227  {
1228  awm->insert_menu_topic("species_search", "Search and query", "q", "sp_search.hlp", AWM_ALL, makeCreateWindowCallback(DBUI::create_species_query_window, GLOBAL.gb_main));
1229  awm->insert_menu_topic("species_info", "Species information", "i", "sp_info.hlp", AWM_ALL, popupinfo_wcb);
1230 
1231  awm->sep______________();
1232 
1233  NT_insert_mark_submenus(awm, ntw, 1);
1234  awm->insert_menu_topic("mark_by_ref", "Mark by reference..", "r", "markbyref.hlp", AWM_EXP, makeCreateWindowCallback(create_mark_by_refentries_window, GLOBAL.gb_main));
1235  awm->insert_menu_topic("species_colors", "Colors ...", "l", "colorize.hlp", AWM_ALL, create_colorize_species_window);
1236  awm->insert_menu_topic("selection_admin", "Selections ...", "o", "species_configs.hlp", AWM_ALL, makeWindowCallback(NT_popup_configuration_admin, ntw));
1237 
1238  awm->sep______________();
1239 
1240  awm->insert_sub_menu("Database fields admin", "f");
1242  awm->close_sub_menu();
1244 
1245  awm->sep______________();
1246 
1247  awm->insert_menu_topic("del_marked", "Delete Marked Species", "D", "sp_del_mrkd.hlp", AWM_ALL, makeWindowCallback(NT_delete_mark_all_cb, ntw));
1248 
1249  awm->insert_sub_menu("Sort Species", "s");
1250  {
1251  awm->insert_menu_topic("$sort_by_field", "According to Database Entries", "D", "sp_sort_fld.hlp", AWM_ALL, NT_create_resort_window);
1252  awm->insert_menu_topic("$sort_by_tree", "According to Phylogeny", "P", "sp_sort_phyl.hlp", AWM_ALL, makeWindowCallback(NT_resort_data_by_phylogeny, ntw));
1253  }
1254  awm->close_sub_menu();
1255 
1256  awm->insert_sub_menu("Merge Species", "g", AWM_EXP);
1257  {
1258  awm->insert_menu_topic("merge_species", "Create merged species from similar species", "m", "merge_species.hlp", AWM_EXP, NT_createMergeSimilarSpeciesWindow);
1259  awm->insert_menu_topic("join_marked", "Join Marked Species", "J", "species_join.hlp", AWM_EXP, NT_create_species_join_window);
1260  }
1261  awm->close_sub_menu();
1262 
1263  awm->sep______________();
1264 
1265  awm->insert_menu_topic("species_submission", "Submit Species", "b", "submission.hlp", AWM_EXP, makeCreateWindowCallback(AWTC_create_submission_window, GLOBAL.gb_main));
1266 
1267  awm->sep______________();
1268 
1269  awm->insert_menu_topic("new_names", "Synchronize IDs", "e", "rename.hlp", AWM_ALL, makeCreateWindowCallback(AWTC_create_rename_window, GLOBAL.gb_main));
1270 
1271  awm->insert_sub_menu("Valid Names ...", "V", AWM_EXP);
1272  {
1273  awm->insert_menu_topic("imp_names", "Import names from file", "I", "vn_import.hlp", AWM_EXP, NT_importValidNames);
1274  awm->insert_menu_topic("del_names", "Delete names from DB", "D", "vn_delete.hlp", AWM_EXP, NT_deleteValidNames);
1275  awm->insert_menu_topic("sug_names", "Suggest valid names", "v", "vn_suggest.hlp", AWM_EXP, NT_suggestValidNames);
1276  awm->insert_menu_topic("search_names", "Search manually", "m", "vn_search.hlp", AWM_EXP, NT_create_searchManuallyNames_window);
1277  }
1278  awm->close_sub_menu();
1279  }
1280 
1281  // ----------------------------
1282  // Genes + Experiment
1283 
1284  if (is_genome_db) GEN_create_genes_submenu(awm, GLOBAL.gb_main, true);
1285 
1286  // ------------------
1287  // Sequence
1288 
1289  awm->create_menu("Sequence", "S", AWM_ALL);
1290  {
1291  awm->insert_menu_topic("seq_admin", "Sequence/Alignment Admin", "A", "ad_align.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_alignment_admin_window, (AW_window*)NULp));
1292  awm->insert_sub_menu("Insert/delete", "I");
1293  {
1294  awm->insert_menu_topic("ins_del_col", ".. column", "c", "insdel.hlp", AWM_ALL, create_insertDeleteColumn_window);
1295  awm->insert_menu_topic("ins_del_sai", ".. using SAI", "S", "insdel_sai.hlp", AWM_ALL, makeCreateWindowCallback(create_insertDeleteBySAI_window, GLOBAL.gb_main));
1296  }
1297  awm->close_sub_menu();
1298  awm->sep______________();
1299 
1300  awm->insert_sub_menu("Edit Sequences", "E");
1301  {
1302  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));
1303  awm->insert_menu_topic("new2_arb_edit4", "... plus relatives", "r", "arb_edit4.hlp", AWM_ALL, makeWindowCallback(NT_start_editor_on_tree, -1, ntw));
1304  awm->insert_menu_topic("old_arb_edit4", "Using earlier configuration", "c", "arb_edit4.hlp", AWM_ALL, NT_create_startEditorOnOldConfiguration_window);
1305  }
1306  awm->close_sub_menu();
1307 
1308  awm->sep______________();
1309 
1310  awm->insert_sub_menu("Align Sequences", "S");
1311  {
1312  awm->insert_menu_topic("realign_dna", "Realign DNA according to aligned protein", "R", "realign_dna.hlp", AWM_ALL, NT_create_realign_dna_window);
1313  GDE_load_menu(awm, AWM_ALL, "Align");
1314  }
1315  awm->close_sub_menu();
1316  awm->insert_menu_topic("seq_concat", "Concatenate Sequences/Alignments", "C", "concatenate.hlp", AWM_ALL, NT_createConcatenationWindow);
1317  awm->insert_menu_topic("track_changes", "Track alignment changes", "k", "track_ali_changes.hlp", AWM_EXP, NT_create_trackAliChanges_window);
1318  awm->sep______________();
1319 
1320  awm->insert_menu_topic("dna_2_pro", "Perform translation", "t", "translate_dna_2_pro.hlp", AWM_ALL, NT_create_dna_2_pro_window);
1321  awm->insert_menu_topic("arb_dist", "Distance Matrix + ARB NJ", "D", "dist.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_dist &"));
1322  awm->sep______________();
1323 
1324  awm->insert_menu_topic("seq_quality", "Check Sequence Quality", "Q", "seq_quality.hlp", AWM_EXP, makeCreateWindowCallback(SQ_create_seq_quality_window, GLOBAL.gb_main));
1325  awm->insert_menu_topic("chimera_check", "Chimera Check", "m", "chimera_check.hlp", AWM_EXP, makeCreateWindowCallback(STAT_create_chimera_check_window, GLOBAL.gb_main));
1326 
1327  awm->sep______________();
1328 
1329  GDE_load_menu(awm, AWM_ALL, "Print");
1330  }
1331 
1332  // -------------
1333  // SAI
1334 
1335  awm->create_menu("SAI", "A", AWM_ALL);
1336  {
1337  awm->insert_menu_topic("sai_admin", "Manage SAIs", "S", "ad_extended.hlp", AWM_ALL, NT_create_extendeds_window);
1338  awm->insert_menu_topic("sai_calc", "Combine SAIs", "b", "saicalc.hlp", AWM_ALL, makeWindowCallback(SAI_popup_calculator_window, GLOBAL.gb_main));
1339  awm->insert_sub_menu("Create SAI using ...", "C");
1340  {
1341  awm->insert_menu_topic("sai_max_freq", "Max. Frequency", "M", "max_freq.hlp", AWM_EXP, AP_create_max_freq_window);
1342  awm->insert_menu_topic("sai_consensus", "Consensus", "C", "consensus.hlp", AWM_ALL, AP_create_con_expert_window);
1343  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);
1344  awm->insert_menu_topic("arb_phyl", "Filter by base frequency", "F", "phylo.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_phylo &"));
1345  awm->insert_menu_topic("sai_pfold", "Protein secondary structure (field \"sec_struct\")", "P", "pfold.hlp", AWM_EXP, NT_create_sai_from_pfold);
1346 
1347  GDE_load_menu(awm, AWM_EXP, "SAI");
1348  }
1349  awm->close_sub_menu();
1350 
1351  awm->insert_sub_menu("Other functions", "O");
1352  {
1353  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));
1354  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));
1355  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);
1356  }
1357  awm->close_sub_menu();
1358  }
1359 
1360  // ----------------
1361  // Probes
1362 
1363  awm->create_menu("Probes", "P", AWM_ALL);
1364  {
1365  awm->insert_menu_topic("probe_design", "Design Probes", "D", "probedesign.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_design_window, GLOBAL.gb_main));
1366  awm->insert_menu_topic("probe_multi", "Calculate Multi-Probes", "u", "multiprobe.hlp", AWM_ALL, makeCreateWindowCallback(create_multiprobe_window, ntw));
1367  awm->insert_menu_topic("probe_match", "Match Probes", "M", "probematch.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_match_window, GLOBAL.gb_main));
1368  awm->sep______________();
1369  awm->insert_menu_topic("probe_match_sp", "Match Probes with Specificity", "f", "probespec.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_match_with_specificity_window, ntw));
1370  awm->sep______________();
1371  awm->insert_menu_topic("primer_design_new", "Design Primers", "P", "primer_new.hlp", AWM_EXP, makeCreateWindowCallback(create_primer_design_window, GLOBAL.gb_main));
1372  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));
1373  awm->sep______________();
1374  awm->insert_menu_topic("pt_server_admin", "PT_SERVER Admin", "A", "probeadmin.hlp", AWM_ALL, makeCreateWindowCallback(create_probe_admin_window, GLOBAL.gb_main));
1375  }
1376 
1377  }
1378 
1379  // --------------
1380  // Tree
1381 
1382  awm->create_menu("Tree", "T", AWM_ALL);
1383  {
1384  if (!clone) {
1385  awm->insert_sub_menu("Add Species to Existing Tree", "A");
1386  {
1387  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 &"));
1388  awm->insert_menu_topic("arb_pars", "ARB Parsimony interactive", "i", "pars.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_pars &"));
1389  GDE_load_menu(awm, AWM_EXP, "Incremental phylogeny");
1390  }
1391  awm->close_sub_menu();
1392  }
1393 
1394  awm->insert_sub_menu("Remove Species from Tree", "R");
1395  {
1396  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));
1397  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));
1398  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));
1399  awm->sep______________();
1400  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));
1401  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));
1402  }
1403  awm->close_sub_menu();
1404 
1405  if (!clone) {
1406  awm->insert_sub_menu("Build tree from sequence data", "B");
1407  {
1408  awm->insert_sub_menu("Distance matrix methods", "D");
1409  awm->insert_menu_topic("arb_dist", "Distance Matrix + ARB NJ", "J", "dist.hlp", AWM_ALL, makeWindowCallback(AWT_system_cb, "arb_dist &"));
1410  GDE_load_menu(awm, AWM_ALL, "Phylogeny Distance Matrix");
1411  awm->close_sub_menu();
1412 
1413  awm->insert_sub_menu("Maximum Parsimony methods", "P");
1414  GDE_load_menu(awm, AWM_ALL, "Phylogeny max. parsimony");
1415  awm->close_sub_menu();
1416 
1417  awm->insert_sub_menu("Maximum Likelihood methods", "L");
1418  GDE_load_menu(awm, AWM_EXP, "Phylogeny max. Likelihood EXP");
1419  GDE_load_menu(awm, AWM_ALL, "Phylogeny max. Likelihood");
1420  awm->close_sub_menu();
1421 
1422  awm->insert_sub_menu("Other methods", "O", AWM_EXP);
1423  GDE_load_menu(awm, AWM_EXP, "Phylogeny (Other)");
1424  awm->close_sub_menu();
1425  }
1426  awm->close_sub_menu();
1427  }
1428 
1429  awm->insert_menu_topic(awm->local_id("consense_tree"), "Build consensus tree", "c", "consense_tree.hlp", AWM_ALL, NT_create_consense_window);
1430 
1431  awm->sep______________();
1432 
1433  awm->insert_sub_menu("Reset zoom", "z");
1434  {
1435  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));
1436  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));
1437  }
1438  awm->close_sub_menu();
1439 
1440  awm->sep______________();
1441 
1442  // taxonomic groups
1443  NT_insert_collapse_submenu(awm, ntw);
1444  if (!clone) {
1445  awm->insert_menu_topic("group_search", "Search groups...", "g", "group_search.hlp", AWM_ALL, makeWindowCallback (popup_group_search_window, GLOBAL.gb_main));
1446  awm->insert_menu_topic("compare_taxonomy", "Compare taxonomy...", "x", "compare_taxonomy.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_compare_taxonomy_window, ntw));
1447  awm->insert_menu_topic("move_groups", "Move groups...", "n", "move_groups.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_moveGroupInfo_window));
1448  }
1449 
1450  awm->sep______________();
1451 
1452  if (!clone) {
1453  awm->insert_menu_topic("compare_topology", "Compare topology...", "p", "compare_topo.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_compareTopologies_window));
1454  }
1455 
1456  awm->insert_sub_menu("Modify branches", "M");
1457  {
1458  awm->insert_menu_topic(awm->local_id("tree_remove_remark"), "Remove bootstraps", "b", "trm_boot.hlp", AWM_ALL, makeWindowCallback(NT_remove_bootstrap, ntw));
1459  awm->sep______________();
1460  awm->insert_menu_topic(awm->local_id("tree_reset_lengths"), "Reset branchlengths", "R", "tbl_reset.hlp", AWM_ALL, makeWindowCallback(NT_reset_branchlengths, ntw));
1461  awm->insert_menu_topic(awm->local_id("justify_branch_lengths"), "Justify branchlengths", "J", "tbl_justify.hlp", AWM_ALL, makeWindowCallback(NT_justify_branch_lenghs, ntw));
1462  awm->insert_menu_topic(awm->local_id("tree_scale_lengths"), "Scale Branchlengths", "S", "tbl_scale.hlp", AWM_ALL, makeWindowCallback(NT_scale_tree, ntw));
1463  awm->sep______________();
1464  awm->insert_menu_topic(awm->local_id("tree_multifurcate"), "Multifurcate...", "M", "multifurcate.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_multifurcate_tree_window, ntw));
1465  awm->sep______________();
1466  awm->insert_menu_topic(awm->local_id("tree_boot2len"), "Bootstraps -> Branchlengths", "l", "tbl_boot2len.hlp", AWM_ALL, makeWindowCallback(NT_move_boot_branch, ntw, 0));
1467  awm->insert_menu_topic(awm->local_id("tree_len2boot"), "Bootstraps <- Branchlengths", "o", "tbl_boot2len.hlp", AWM_ALL, makeWindowCallback(NT_move_boot_branch, ntw, 1));
1468 
1469  }
1470  awm->close_sub_menu();
1471  awm->insert_sub_menu("Beautify tree", "e");
1472  {
1473  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));
1474  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));
1475  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));
1476  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));
1477  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));
1478  awm->sep______________();
1479  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));
1480  }
1481  awm->close_sub_menu();
1482 
1483  awm->insert_menu_topic(awm->local_id("branch_analysis"), "Branch analysis", "h", "branch_analysis.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_branch_analysis_window, ntw));
1484  awm->insert_menu_topic(awm->local_id("mark_duplicates"), "Mark duplicates", "u", "mark_duplicates.hlp", AWM_ALL, makeWindowCallback(NT_mark_duplicates, ntw));
1485 
1486  awm->sep______________();
1487 
1488  awm->insert_menu_topic(awm->local_id("shade"), "Tree shading...", "s", "tree_shading.hlp", AWM_ALL, makeWindowCallback (NT_configure_treeShader));
1489  awm->insert_menu_topic(awm->local_id("syncscroll"), "Sync tree scrolling..", "o", "syncscroll.hlp", AWM_ALL, makeCreateWindowCallback(NT_create_syncScroll_window, ntw));
1490 
1491  awm->sep______________();
1492 
1493  awm->insert_menu_topic(awm->local_id("tree_select"), "Select Tree", "T", NULp, AWM_ALL, makeCreateWindowCallback(NT_create_select_tree_window, awar_tree));
1494  awm->insert_menu_topic(awm->local_id("tree_select_latest"), "Select Last Tree", "L", NULp, AWM_ALL, makeWindowCallback(NT_select_bottom_tree, awar_tree));
1495 
1496  if (!clone) {
1497  awm->sep______________();
1498  awm->insert_menu_topic("tree_admin", "Tree admin", "i", "treeadm.hlp", AWM_ALL, popup_tree_admin_window);
1499  awm->insert_menu_topic("nds", "NDS (Node display setup)", "N", "props_nds.hlp", AWM_ALL, makeCreateWindowCallback(AWT_create_nds_window, GLOBAL.gb_main));
1500  }
1501 
1502  awm->sep______________();
1503  awm->insert_menu_topic("transversion", "Transversion analysis", "y", "trans_anal.hlp", AWM_EXP, makeHelpCallback("trans_anal.hlp"));
1504 
1505  if (!clone) {
1506  awm->sep______________();
1507  awm->insert_menu_topic("print_tree", "Print tree", "P", "tree2prt.hlp", AWM_ALL, makeWindowCallback(AWT_popup_print_window, static_cast<AWT_canvas*>(ntw)));
1508  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)));
1509  }
1510 
1511  if (is_genome_db) {
1512  awm->sep______________();
1513  awm->insert_sub_menu("Other..", "O", AWM_EXP);
1514  {
1515  awm->insert_menu_topic(awm->local_id("tree_pseudo_species_to_organism"), "Relink tree to organisms", "o", "tree_pseudo.hlp", AWM_EXP, makeWindowCallback(NT_pseudo_species_to_organism, ntw));
1516  }
1517  awm->close_sub_menu();
1518  }
1519  }
1520 
1521  if (!clone) {
1522  // ---------------
1523  // Tools
1524 
1525  awm->create_menu("Tools", "o", AWM_ALL);
1526  {
1527  awm->insert_menu_topic("names_admin", "Name server admin (IDs)", "s", "namesadmin.hlp", AWM_ALL, makeCreateWindowCallback(AW_create_namesadmin_window, GLOBAL.gb_main));
1528  awm->insert_sub_menu("DB admin", "D", AWM_EXP);
1529  {
1530  awm->insert_menu_topic("db_admin", "Re-repair DB", "R", "rerepair.hlp", AWM_EXP, makeWindowCallback(NT_rerepair_DB, GLOBAL.gb_main));
1531  }
1532  awm->close_sub_menu();
1533  awm->insert_sub_menu("Network", "N", AWM_EXP);
1534  {
1535  GDE_load_menu(awm, AWM_EXP, "Network");
1536  }
1537  awm->close_sub_menu();
1538  awm->sep______________();
1539 
1540  awm->insert_sub_menu("GDE specials", "G", AWM_EXP);
1541  {
1542  GDE_load_menu(awm, AWM_EXP, NULp);
1543  }
1544  awm->close_sub_menu();
1545 
1546  awm->sep______________();
1547  awm->insert_menu_topic("xterm", "Start XTERM", "X", "xterm.hlp", AWM_ALL, AWT_console);
1548  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
1549  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));
1550  awm->sep______________();
1551  GDE_load_menu(awm, AWM_EXP, "User");
1552  }
1553  // --------------------
1554  // Properties
1555 
1556  awm->create_menu("Properties", "r", AWM_ALL);
1557  {
1558  awm->insert_menu_topic("props_menu", "Frame settings ...", "F", "props_frame.hlp", AWM_ALL, AW_preset_window);
1559  awm->insert_menu_topic(awm->local_id("props_tree2"), "Tree options", "o", "nt_tree_settings.hlp", AWM_ALL, TREE_create_settings_window);
1560  awm->insert_menu_topic("props_tree", "Tree colors & fonts", "c", "color_props.hlp", AWM_ALL, makeCreateWindowCallback(AW_create_gc_window, ntw->gc_manager));
1561  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));
1562  awm->sep______________();
1563  awm->insert_menu_topic("!toggle_expert", "Toggle expert mode", "x", NULp, AWM_ALL, NT_toggle_expert_mode);
1564  awm->insert_menu_topic("!toggle_focus", "Toggle focus follows mouse", "m", NULp, AWM_ALL, NT_toggle_focus_policy);
1565  awm->sep______________();
1567  awm->sep______________();
1568  awm->insert_menu_topic("save_props", "Save properties (ntree.arb)", "S", "savedef.hlp", AWM_ALL, AW_save_properties);
1569  }
1570  }
1571 
1572  awm->insert_help_topic("ARB_NT help", "N", "arb_ntree.hlp", AWM_ALL, makeHelpCallback("arb_ntree.hlp"));
1573 
1574  // ----------------------
1575  // mode buttons
1576  //
1577  // keep them synchronized as far as possible with those in ARB_PARSIMONY
1578  // see ../PARSIMONY/PARS_main.cxx@keepModesSynchronized
1579 
1580  awm->create_mode("mode_select.xpm", "mode_select.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SELECT));
1581  awm->create_mode("mode_mark.xpm", "mode_mark.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MARK));
1582  awm->create_mode("mode_group.xpm", "mode_group.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_GROUP));
1583  awm->create_mode("mode_zoom.xpm", "mode_pzoom.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_ZOOM));
1584  awm->create_mode("mode_lzoom.xpm", "mode_lzoom.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LZOOM));
1585 
1586  awm->create_mode("mode_info.xpm", "mode_info.hlp", AWM_ALL, makeWindowCallback(NT_infomode_cb, ntw, AWT_MODE_INFO));
1587  awm->create_mode("mode_www.xpm", "mode_www.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_WWW));
1588 
1589  // topology-modification-modes
1590  awm->create_mode("mode_setroot.xpm", "mode_setroot.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SETROOT));
1591  awm->create_mode("mode_swap.xpm", "mode_swap.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SWAP));
1592  awm->create_mode("mode_move.xpm", "mode_move.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MOVE));
1593  awm->create_mode("mode_length.xpm", "mode_length.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LENGTH));
1594  awm->create_mode("mode_multifurc.xpm", "mode_length.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_MULTIFURC));
1595 
1596  // layout-modes
1597  awm->create_mode("mode_line.xpm", "mode_width.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_LINE));
1598  awm->create_mode("mode_rotate.xpm", "mode_rotate.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_ROTATE));
1599  awm->create_mode("mode_spread.xpm", "mode_spread.hlp", AWM_ALL, makeWindowCallback(nt_mode_event, ntw, AWT_MODE_SPREAD));
1600 
1601  awm->set_info_area_height(250);
1602  awm->at(5, 2);
1603  awm->auto_space(-2, -2);
1604  awm->shadow_width(1);
1605 
1606  // -------------------------
1607  // create top area
1608 
1609  int first_liney;
1610  int leftx;
1611  awm->get_at_position(&leftx, &first_liney);
1612 
1613  // ---------------------
1614  // quit + help
1615 
1616  awm->button_length(0);
1617 
1618  if (clone) {
1619  awm->callback(AW_POPDOWN);
1620  awm->create_button("CLOSE", "#close.xpm");
1621  }
1622  else {
1623  awm->callback(makeWindowCallback(NT_exit, EXIT_SUCCESS));
1624  awm->help_text("quit.hlp");
1625  awm->create_button("QUIT", "#quit.xpm");
1626  }
1627 
1628  int db_pathx = awm->get_at_xposition();
1629 
1630  // now fetch the yposition for the 2nd button line
1631  awm->at_newline();
1632  int second_liney = awm->get_at_yposition();
1633 
1635  awm->help_text("arb_ntree.hlp");
1636  awm->create_button("?", "#help.xpm");
1637 
1638  // --------------------------
1639  // save + undo/redo
1640 
1641  awm->callback(NT_save_quick_cb);
1642  awm->help_text("save.hlp");
1643  awm->create_button("SAVE", "#save.xpm");
1644 
1645  awm->callback(makeCreateWindowCallback(NT_create_save_as, AWAR_DBBASE));
1646  awm->help_text("save.hlp");
1647  awm->create_button("SAVE_AS", "#saveAs.xpm");
1648 
1649  // undo/redo:
1650  awm->callback(makeWindowCallback(NT_undo_cb, GB_UNDO_UNDO, ntw));
1651  awm->help_text("undo.hlp");
1652  awm->create_button("UNDO", "#undo.xpm");
1653 
1654  awm->callback(makeWindowCallback(NT_undo_cb, GB_UNDO_REDO, ntw));
1655  awm->help_text("undo.hlp");
1656  awm->create_button("REDO", "#redo.xpm");
1657 
1658  int db_pathx2 = awm->get_at_xposition();
1659 
1660  // fetch position for mode help-line:
1661  awm->at_newline();
1662  int third_liney = awm->get_at_yposition();
1663 
1664  awm->at(db_pathx, first_liney);
1665  // size of DB-name button is determined by buttons below:
1666  awm->at_attach_to(false, false, db_pathx2-db_pathx-1, second_liney-first_liney+1);
1667  awm->callback(makeCreateWindowCallback(NT_create_save_quick_as_window, AWAR_DBBASE));
1668  awm->help_text("save.hlp");
1669  awm->create_button("QUICK_SAVE_AS", AWAR_DB_NAME);
1670 
1671  // -----------------------------
1672  // tree + tree display
1673 
1674 #define TREE_BUTTON_OVERSIZE 6
1675 
1676  int db_treex = awm->get_at_xposition();
1677  int second_uppery = second_liney-TREE_BUTTON_OVERSIZE;
1678 
1679  awm->at(db_treex, second_uppery);
1680  awm->button_length(0);
1681 
1682  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_RADIAL));
1683  awm->help_text("tr_type_radial.hlp");
1684  awm->create_button("RADIAL_TREE_TYPE", "#radial.xpm");
1685 
1686  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_NORMAL));
1687  awm->help_text("tr_type_list.hlp");
1688  awm->create_button("LIST_TREE_TYPE", "#dendro.xpm");
1689 
1690  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_TREE_IRS));
1691  awm->help_text("tr_type_irs.hlp");
1692  awm->create_button("FOLDED_LIST_TREE_TYPE", "#dendroIrs.xpm");
1693 
1694  awm->callback(makeWindowCallback(NT_set_tree_style, ntw, AP_LIST_NDS));
1695  awm->help_text("tr_type_nds.hlp");
1696  awm->create_button("NO_TREE_TYPE", "#listdisp.xpm");
1697 
1698  int db_treex2 = awm->get_at_xposition();
1699 
1700  awm->at(db_treex, first_liney);
1701  // size of tree-name button is determined by buttons below:
1702  awm->at_attach_to(false, false, db_treex2-db_treex-1, second_uppery-first_liney+1);
1703  awm->callback(makeCreateWindowCallback(NT_create_select_tree_window, awar_tree));
1704  awm->help_text("nt_tree_select.hlp");
1705  awm->create_button("SELECT_A_TREE", awar_tree);
1706 
1707  // ---------------------------------------------------------------
1708  // protection, alignment + editor (and maybe Genome Map)
1709 
1710  int db_alignx = awm->get_at_xposition();
1711 
1712  // editor and genemap buttons have to be 44x24 sized
1713 #define EDIT_XSIZE 50
1714 #define EDIT_YSIZE 30 // same as 'save as' buttons
1715 
1716  // first draw protection:
1717  int protectx = db_alignx + 2*EDIT_XSIZE;
1718 
1719  awm->at(protectx+2, first_liney+1);
1720  awm->button_length(0);
1721  awm->create_button(NULp, "#protect.xpm");
1722 
1723  awm->at(protectx, second_liney+2);
1725  awm->insert_option ("0", NULp, 0);
1726  awm->insert_option ("1", NULp, 1);
1727  awm->insert_option ("2", NULp, 2);
1728  awm->insert_option ("3", NULp, 3);
1729  awm->insert_option ("4", NULp, 4);
1730  awm->insert_option ("5", NULp, 5);
1731  awm->insert_default_option("6", NULp, 6);
1732  awm->update_option_menu();
1733 
1734  int db_searchx = awm->get_at_xposition() - 7;
1735 
1736  // draw ali/editor buttons AFTER protect menu (to get rid of it's label)
1737  awm->at(db_alignx, second_liney);
1738 
1739  awm->at_attach_to(false, false, ((2-is_genome_db)*EDIT_XSIZE), EDIT_YSIZE);
1740  awm->callback(makeWindowCallback(NT_start_editor_on_tree, 0, ntw));
1741  awm->help_text("arb_edit4.hlp");
1742  if (is_genome_db) awm->create_button("EDIT_SEQUENCES", "#editor_small.xpm");
1743  else awm->create_button("EDIT_SEQUENCES", "#editor.xpm");
1744 
1745  if (is_genome_db) {
1746  awm->at_attach_to(false, false, EDIT_XSIZE, EDIT_YSIZE);
1747  awm->callback(makeCreateWindowCallback(GEN_create_first_map, GLOBAL.gb_main)); // initial gene map
1748  awm->help_text("gene_map.hlp");
1749  awm->create_button("OPEN_GENE_MAP", "#gen_map.xpm");
1750  }
1751 
1752  int db_alignx2 = awm->get_at_xposition();
1753 
1754  awm->at(db_alignx, first_liney);
1755  awm->at_attach_to(false, false, db_alignx2-db_alignx-1, second_liney-first_liney+1);
1757  awm->help_text("nt_align_select.hlp");
1758  awm->create_button("SELECT_AN_ALIGNMENT", AWAR_DEFAULT_ALIGNMENT);
1759 
1760  // -------------------------------
1761  // create mode-help line
1762 
1763  awm->at(leftx, third_liney);
1766 
1767  awm->at_newline();
1768  int bottomy = awm->get_at_yposition();
1769 
1770  // ---------------------------------------
1771  // Info / marked / Search / Jump
1772 
1773  awm->button_length(7);
1774 
1775  awm->at(db_searchx, first_liney);
1776  awm->callback(makeCreateWindowCallback(DBUI::create_species_query_window, GLOBAL.gb_main));
1777  awm->help_text("sp_search.hlp");
1778  awm->create_button("SEARCH", "Search");
1779 
1780  awm->at(db_searchx, second_uppery);
1781  awm->callback(makeWindowCallback(NT_jump_cb, ntw, AP_JUMP_BY_BUTTON));
1782  awm->help_text("tr_jump.hlp");
1783  awm->create_button("JUMP", "Jump");
1784 
1785  int db_infox = awm->get_at_xposition();
1786 
1787  awm->at(db_infox, first_liney);
1788  awm->button_length(13);
1789  awm->callback(popupinfo_wcb);
1790  awm->help_text("sp_search.hlp");
1791  awm->create_button("INFO", AWAR_INFO_BUTTON_TEXT);
1792 
1793  awm->at(db_infox, second_uppery);
1794  awm->button_length(13);
1795  awm->help_text("species_configs.hlp");
1796  awm->callback(makeWindowCallback(NT_popup_configuration_admin, ntw));
1797  awm->create_button("selection_admin2", AWAR_MARKED_SPECIES_COUNTER);
1798  {
1800  GB_add_callback(gb_species_data, GB_CB_CHANGED, makeDatabaseCallback(NT_update_marked_counter, static_cast<AW_window*>(awm)));
1802  }
1803 
1804  // set height of top area:
1805  awm->set_info_area_height(bottomy+2);
1806  awm->set_bottom_area_height(0);
1807 
1809 
1810  // ------------------------------------
1811  // Autostarts for development
1812 
1813 #if defined(DEVEL_RALF)
1814  // if (is_genome_db) GEN_map_first(awr)->show();
1815 #endif // DEVEL_RALF
1816 
1818 
1819 #if defined(DEBUG)
1820  AWT_check_action_ids(awr, is_genome_db ? "_genome" : "");
1821 #endif
1822 
1823  return awm;
1824 }
1825 
1828  if (error) aw_message(error);
1829 
1830  nt_create_all_awars(aw_root);
1831 
1832  TREE_canvas *ntw = NULp;
1833  AW_window *aww = popup_new_main_window(aw_root, 0, &ntw);
1835  aww->show();
1836 
1838  if (error) aw_message(error);
1839 
1840  return ntw;
1841 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2516
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:1233
void register_canvas(TREE_canvas *ntw)
Definition: NT_extern.cxx:926
static void group_selected_by_canvas_cb(AWT_graphic_tree *gfx)
Definition: NT_extern.cxx:992
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:519
#define AWT_TREE(ntw)
Definition: TreeDisplay.hxx:77
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:483
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:291
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:450
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:894
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:237
void button_length(int length)
Definition: AW_at.cxx:283
AW_window * AWTC_create_rename_window(AW_root *root, GBDATA *gb_main)
Definition: AW_rename.cxx:562
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:1251
void NT_remove_leafs(UNFIXED, TREE_canvas *ntw, AWT_RemoveType mode)
int get_at_xposition() const
Definition: AW_at.cxx:296
static void NT_save_quick_as_cb(AW_window *aww)
Definition: NT_extern.cxx:393
AW_window * NT_create_moveGroupInfo_window(AW_root *root)
Definition: ad_trees.cxx:683
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:194
void nt_mode_event(UNFIXED, TREE_canvas *ntw, AWT_COMMAND_MODE mode)
void append_command_output(GBS_strstruct *out, const char *prefix, const char *command)
Definition: NT_extern.cxx:602
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:697
static void expert_mode_changed_cb(AW_root *aw_root)
Definition: NT_extern.cxx:173
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:592
void AWTC_create_submission_variables(AW_root *root, AW_default db1)
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:717
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:405
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
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)
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:63
void append_named_value(GBS_strstruct *out, const char *prefix, const char *value)
Definition: NT_extern.cxx:599
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:33
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:2549
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:261
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:1057
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:316
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:722
TreeNode * GBT_read_tree(GBDATA *gb_main, const char *tree_name, TreeRoot *troot)
Definition: adtree.cxx:791
long read_int() const
Definition: AW_awar.cxx:187
#define AWAR_SAI_COLOR_STR
AW_window * NT_create_multifurcate_tree_window(AW_root *aw_root, TREE_canvas *ntw)
Definition: ad_trees.cxx:1116
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:1274
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
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
void make_node_text_init(GBDATA *gb_main)
Definition: nds.cxx:850
static void export_nds_cb(AW_window *aww, bool do_print)
Definition: NT_extern.cxx:90
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:178
void GBK_terminatef(const char *templat,...)
Definition: arb_msg.cxx:477
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:904
const char * GBT_existing_tree(GBDATA *gb_main, const char *tree_name)
Definition: adtree.cxx:1010
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:541
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:407
#define EXIT_SUCCESS
Definition: arb_a2ps.c:154
TREE_canvas * NT_get_canvas_by_index(int idx)
Definition: NT_extern.cxx:943
static bool track_group_selection_by_canvas
Definition: NT_extern.cxx:990
#define AWAR_FOOTER_MAX_LEN
void set_window_title(const char *title)
Definition: AW_window.cxx:1066
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:512
const char * getKeyPath() const OVERRIDE
Definition: NT_extern.cxx:709
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:889
#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:1720
void update_option_menu()
static void NT_update_marked_counter(GBDATA *, AW_window *aww)
Definition: NT_extern.cxx:729
GB_ERROR GB_push_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2482
GB_ERROR toggle_toggle()
Definition: AW_awar.cxx:575
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:1078
AW_window * NT_createMergeSimilarSpeciesWindow(AW_root *aw_root)
void SAI_popup_calculator_window(AW_window *awp, GBDATA *gb_main)
Definition: saicalc.cxx:1138
#define AWAR_MARKED_SPECIES_COUNTER
Definition: NT_extern.cxx:72
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
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:845
static void NT_mark_duplicates(UNFIXED, TREE_canvas *ntw)
Definition: NT_extern.cxx:616
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:486
static bool nt_disconnect_from_db(AW_root *aw_root, GBDATA *&gb_main_ref)
Definition: NT_extern.cxx:262
void GB_change_my_security(GBDATA *gbd, int level)
Definition: arbdb.cxx:1625
const char * read_char_pntr() const
Definition: AW_awar.cxx:171
static char * stream2str(streamSource source, const char *commandOrFile)
Definition: NT_extern.cxx:562
static void merge_from_cb(AW_window *aww, AW_CL cl_awarNamePtr)
Definition: NT_extern.cxx:871
GBS_strstruct * GBS_stropen(long init_size)
Definition: arb_strbuf.cxx:39
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:2958
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:1658
TreeNode * NT_get_tree_root_of_canvas(TREE_canvas *ntw)
Definition: NT_extern.cxx:823
void GDE_load_menu(AW_window *awm, AW_active, const char *menulabel)
Definition: GDE.cxx:433
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:83
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)
const char * make_node_text_nds(GBDATA *gb_main, GBDATA *gbd, NDS_Type mode, TreeNode *species, const char *tree_name)
Definition: nds.cxx:854
void popup_tree_admin_window(AW_window *awp)
Definition: ad_trees.cxx:787
#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:1477
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:694
static nt_item_type_species_selector item_type_species
Definition: NT_extern.cxx:714
AW_window * NT_create_consense_window(AW_root *aw_root)
Definition: ad_trees.cxx:940
#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:116
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:628
GBDATA * gb_species_data
Definition: adname.cxx:34
#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:123
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:393
#define MAX_NT_WINDOWS
Definition: NT_local.h:31
void NT_restart(AW_root *aw_root, const char *arb_ntree_args)
Definition: NT_extern.cxx:351
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:157
GB_ERROR GBT_write_tree(GBDATA *gb_main, const char *tree_name, TreeNode *tree)
Definition: adtree.cxx:477
long GBS_memoffset(GBS_strstruct *strstr)
Definition: arb_strbuf.cxx:91
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:469
static ARB_ERROR mark_referred_species(GBDATA *gb_main, const DBItemSet &referred)
Definition: NT_extern.cxx:834
#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:113
void touch()
Definition: AW_awar.cxx:210
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
void GBS_strcat(GBS_strstruct *strstr, const char *ptr)
Definition: arb_strbuf.cxx:108
static void error(const char *msg)
Definition: mkptypes.cxx:96
TREE_canvas * get_canvas(int idx) const
Definition: NT_extern.cxx:935
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2374
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:24
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:566
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:1076
#define AWAR_DB_COMPRESSION
Definition: NT_extern.cxx:404
void AWT_destroy_input_masks()
void GBS_str_cut_tail(GBS_strstruct *strstr, size_t byte_count)
Definition: arb_strbuf.cxx:96
#define AWAR_INFO_BUTTON_TEXT
static void nt_create_all_awars(AW_root *awr)
Definition: NT_extern.cxx:180
AP_tree_display_style get_tree_style() const
#define AWAR_SECURITY_LEVEL
char * read_string() const
Definition: AW_awar.cxx:201
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:2512
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:642
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:611
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)
AW_option_menu_struct * create_option_menu(const char *awar_name, bool fallback2default)
void AW_refresh_fileselection(AW_root *awr, const char *awar_prefix)
Definition: AW_file.cxx:944
void create_nds_vars(AW_root *aw_root, AW_default awdef, GBDATA *gb_main, bool force_reinit)
Definition: nds.cxx:205
static AW_window_menu_modes_opengl * awm
void GB_print_debug_information(struct Unfixed_cb_parameter *, GBDATA *gb_main)
Definition: arbdb.cxx:2802
static void selectedSpeciesChanged_cb(AW_root *awr)
Definition: NT_extern.cxx:162
#define AWAR_EXPORT_NDS_SEPARATOR
Definition: NT_extern.cxx:71
long GBT_count_marked_species(GBDATA *gb_main)
Definition: aditem.cxx:353
long GB_last_saved_clock(GBDATA *gb_main)
nt_item_type_species_selector()
Definition: NT_extern.cxx:688
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
void NT_create_multifurcate_tree_awars(AW_root *aw_root, AW_default props)
Definition: ad_trees.cxx:1097
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:196
static AW_window * NT_create_merge_from_window(AW_root *awr)
Definition: NT_extern.cxx:874
static void merge_into_cb(AW_window *aww, AW_CL cl_awarNamePtr)
Definition: NT_extern.cxx:872
GB_ERROR GB_undo(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT
Definition: adindex.cxx:752
void removeTrailingNewlines(char *str)
Definition: NT_extern.cxx:594
AW_window * NT_create_species_join_window(AW_root *root)
Definition: NT_join.cxx:143
void GBS_chrcat(GBS_strstruct *strstr, char ch)
Definition: arb_strbuf.cxx:119
static void group_awar_changed_cb(AW_root *awr)
Definition: NT_extern.cxx:1012
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:793
AWT_graphic * gfx
Definition: awt_canvas.hxx:339
AW_window * AWT_create_nds_window(AW_root *aw_root, GBDATA *gb_main)
Definition: nds.cxx:500
AW_window * NT_create_colstat_2_gnuplot_window(AW_root *root)
AW_DB_selection * awt_create_TREE_selection_list(GBDATA *gb_main, AW_window *aws, const char *varname, bool fallback2default)
fputs(TRACE_PREFIX, stderr)
#define AWAR_AW_FOCUS_FOLLOWS_MOUSE
TREE_canvas * NT_create_main_window(AW_root *aw_root)
Definition: NT_extern.cxx:1826
AW_window * create_colorize_items_window(AW_root *aw_root, GBDATA *gb_main, ItemSelector &sel)
Definition: db_query.cxx:1959
#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:798
static void NT_undo_cb(AW_window *, GB_UNDO_TYPE undo_type, TREE_canvas *ntw)
Definition: NT_extern.cxx:551
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
AW_window * AW_create_namesadmin_window(AW_root *root, GBDATA *gb_main)
xml element
void NT_activate_configMarkers_display(TREE_canvas *ntw)
Definition: NT_edconf.cxx:255
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:32
void AW_help_entry_pressed(AW_window *aww)
Definition: AW_root.cxx:37
char * GBK_singlequote(const char *arg)
Definition: arb_msg.cxx:547
void GB_write_flag(GBDATA *gbd, long flag)
Definition: arbdb.cxx:2761
static void NT_justify_branch_lenghs(UNFIXED, TREE_canvas *ntw)
Definition: NT_extern.cxx:628
#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:653
const char * get_self_awar() const OVERRIDE
Definition: NT_extern.cxx:691
char * GBS_mempntr(GBS_strstruct *strstr)
Definition: arb_strbuf.cxx:86
static void NT_open_mask_window(AW_window *aww, int id, GBDATA *gb_main)
Definition: NT_extern.cxx:716
void request_structure_update()
Definition: awt_canvas.hxx:365
#define OVERRIDE
Definition: cxxforward.h:93
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:1579
AP_tree_display_style
Definition: TreeDisplay.hxx:79
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:263
#define CHANGE_KEY_PATH
Definition: arbdbt.h:86
void AWT_popup_print_window(AW_window *parent_win, AWT_canvas *scr)
Definition: AWT_canio.cxx:865
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:428
static AW_window * NT_create_merge_to_window(AW_root *awr)
Definition: NT_extern.cxx:882
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:746
char * GBS_strclose(GBS_strstruct *strstr)
Definition: arb_strbuf.cxx:69
int get_count() const
Definition: NT_extern.cxx:933
void close_sub_menu()
Definition: AW_window.cxx:483
void GBT_get_tree_names(ConstStrArray &names, GBDATA *gb_main, bool sorted)
Definition: adtree.cxx:1136
static void NT_save_quick_cb(AW_window *aww)
Definition: NT_extern.cxx:380
static AW_window * create_colorize_species_window(AW_root *aw_root)
Definition: NT_extern.cxx:725
#define AWAR_EXPORT_NDS
Definition: NT_extern.cxx:70
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:335
void aw_message(const char *msg)
Definition: AW_status.cxx:932
void NT_start(const char *arb_ntree_args, bool restart_with_new_ARB_PID)
Definition: NT_extern.cxx:329
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
Definition: macro_gui.cxx:171
AW_root * get_root()
Definition: aw_window.hxx:348
long GB_read_clock(GBDATA *gbd)
Definition: arbdb.cxx:1712
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:360
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
Definition: adsocket.cxx:1213
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:97
GBDATA * gb_main
Definition: NT_local.h:36
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
streamSource
Definition: NT_extern.cxx:561
#define AWAR_NTREE_TITLE_MODE
Definition: NT_extern.cxx:73
#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:423
#define offset(field)
Definition: GLwDrawA.c:73
void sep______________()
Definition: AW_window.cxx:750
static TREE_canvas_registry & instance()
Definition: NT_extern.cxx:921
void NT_scale_tree(UNFIXED, TREE_canvas *ntw)
const char * local_id(const char *id) const
Definition: AW_window.cxx:744
void GBT_mark_all(GBDATA *gb_main, int flag)
Definition: aditem.cxx:295
GB_ERROR GB_request_undo_type(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT_TODO
Definition: adindex.cxx:718
void NT_fill_canvas_selection_list(class AW_selection_list *sellst, TREE_canvas *to_skip)
Definition: NT_extern.cxx:964
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:130
void destroy(TreeNode *that)
Definition: TreeNode.h:559
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
Definition: arbdb.cxx:898
#define AWAR_DB_TYPE
Definition: NT_extern.cxx:403
#define AWAR_EXPERT
int get_at_yposition() const
Definition: AW_at.cxx:300
AW_window * NT_create_compare_taxonomy_window(AW_root *aw_root, TREE_canvas *ntw)
GBDATA * gb_main
Definition: adname.cxx:33
static void nt_run(const char *command)
Definition: NT_extern.cxx:319
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:217
void NT_exit(AW_window *aws, int exitcode)
Definition: NT_extern.cxx:342
void hide_or_notify(const char *error)
Definition: AW_window.cxx:1817
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:986
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:1075
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:568
static void relink_pseudo_species_to_organisms(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash)
Definition: NT_extern.cxx:647
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:856
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:689
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:177
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:274
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
Definition: output.h:28
AW_window * create_tree_window(AW_root *aw_root, AWT_graphic *awd)
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:195
void GB_close(GBDATA *gbd)
Definition: arbdb.cxx:649
NT_global GLOBAL
Definition: NT_main.cxx:44
GBDATA * gb_main
Definition: awt_canvas.hxx:336
static void NT_pseudo_species_to_organism(AW_window *, TREE_canvas *ntw)
Definition: NT_extern.cxx:664
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:446
#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:156