ARB
ED4_root.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : ED4_root.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 #include "ed4_class.hxx"
12 #include "ed4_awars.hxx"
13 #include "ed4_tools.hxx"
14 #include "ed4_block.hxx"
15 #include "ed4_dots.hxx"
16 #include "ed4_nds.hxx"
17 #include "ed4_list.hxx"
18 #include "ed4_plugins.hxx"
19 #include "ed4_visualizeSAI.hxx"
20 #include "ed4_naligner.hxx"
21 #include "ed4_ProteinViewer.hxx"
23 #include "graph_aligner_gui.hxx"
24 #include "ed4_colStat.hxx"
25 #include "ed4_seq_colors.hxx"
26 #include "ed4_flags.hxx"
27 
28 #include <ed4_extern.hxx>
29 #include <fast_aligner.hxx>
30 
31 #include <AW_helix.hxx>
32 #include <gde.hxx>
33 #include <awt.hxx>
34 #include <awt_map_key.hxx>
35 
36 #include <aw_awars.hxx>
37 #include <aw_preset.hxx>
38 #include <aw_msg.hxx>
39 #include <arb_progress.h>
40 #include <aw_root.hxx>
41 #include <aw_question.hxx>
42 #include <aw_advice.hxx>
43 #include <rootAsWin.h>
44 #include "../WINDOW/aw_status.hxx" // @@@ hack - obsolete when EDIT4 status works like elsewhere
45 
46 #include <arb_version.h>
47 #include <arb_file.h>
48 #include <arb_defs.h>
49 
50 #include <arbdbt.h>
51 #include <ad_cb.h>
52 #include <macros.hxx>
53 #include <st_window.hxx>
54 
55 #include <cctype>
56 #include <map>
57 
59 
61 #if defined(DEBUG)
62  if (dimension<0.0) {
63  // e4_assert(0); // crashes gdb when called from scrollbar callback - so instead only dump backtrace
64  const char *msg = GBS_global_string("illegal dimension %f\n", dimension);
65  GBK_dump_backtrace(stderr, msg);
66  }
67 #endif
68 }
69 
70 void ED4_WinContext::warn_missing_context() const {
71  e4_assert(0);
72  GBK_dump_backtrace(stderr, "Missing context");
73  aw_message("Missing context - please send information from console to devel@arb-home.de");
74 }
75 
77  if (lev == LEV_NONE || (base->spec.level&lev) != 0) {
78  if (base->is_terminal()) base->request_refresh();
79  }
80  return NULp;
81 }
82 
84  main_manager->route_down_hierarchy(makeED4_route_cb(request_terminal_refresh, LEV_NONE)).expect_no_error();
85 }
86 
88  main_manager->route_down_hierarchy(makeED4_route_cb(request_terminal_refresh, lev)).expect_no_error();
89 }
90 
91 
92 static ARB_ERROR request_sequence_refresh(ED4_base *base, bool consensi) {
94  if (base->spec.level & LEV_SPECIES) {
95  if (base->is_consensus_manager() == consensi) {
96  error = base->to_manager()->route_down_hierarchy(makeED4_route_cb(request_terminal_refresh, LEV_SEQUENCE_STRING));
97  }
98  }
99  return error;
100 }
101 
102 // if you want to refresh consensi AND sequences you may use request_refresh_for_specific_terminals(LEV_SEQUENCE_STRING)
104  main_manager->route_down_hierarchy(makeED4_route_cb(request_sequence_refresh, true)).expect_no_error();
105 }
107  if (main_manager) {
108  main_manager->route_down_hierarchy(makeED4_route_cb(request_sequence_refresh, false)).expect_no_error();
109  }
110 }
111 
112 void ED4_root::refresh_window_simple(bool redraw) {
113  // if 'redraw' -> update everything (ignoring refresh flag)
114  bool refresh_all = false;
115  if (redraw) {
116 #if defined(TRACE_REFRESH)
117  fprintf(stderr, "- clear display (refresh_window_simple(redraw=true) called)\n"); fflush(stderr);
118 #endif
119  main_manager->update_info.set_clear_at_refresh(1);
120  refresh_all = true;
121  }
122 
123  main_manager->Show(refresh_all, false);
124  if (redraw) main_manager->update_info.set_clear_at_refresh(0);
125 }
126 
127 void ED4_root::handle_update_requests(bool& redraw) {
128  if (main_manager->update_info.delete_requested) {
129 #if defined(TRACE_REFRESH)
130  fprintf(stderr, "- handling requested deletes\n"); fflush(stderr);
131 #endif
132  main_manager->delete_requested_children();
133  redraw = true;
134  }
135 
136  if (main_manager->update_info.update_requested) {
137 #if defined(TRACE_REFRESH)
138  fprintf(stderr, "- handling requested updates\n"); fflush(stderr);
139 #endif
140  main_manager->update_requested_children();
141  redraw = true; // @@@ needed ?
142  }
143 
144  while (main_manager->update_info.resize) {
145 #if defined(TRACE_REFRESH)
146  fprintf(stderr, "- handling requested resizes\n"); fflush(stderr);
147 #endif
148  main_manager->resize_requested_children();
149  redraw = true;
150  }
151 
152  // make sure all update request have been handled:
153  e4_assert(!main_manager->update_info.delete_requested);
154  e4_assert(!main_manager->update_info.update_requested);
155  e4_assert(!main_manager->update_info.resize);
156 }
157 
158 void ED4_root::special_window_refresh(bool handle_updates) {
159  // this function should only be used for window specific updates (e.g. cursor placement/deletion)
161 
162  bool redraw = true;
163  if (handle_updates) handle_update_requests(redraw);
164  refresh_window_simple(redraw);
165  // do NOT clear_refresh_requests here!! this is no full refresh!
166 }
167 
169  // if 'redraw' -> update everything (ignoring refresh flag)
170  GB_transaction ta(gb_main);
171 
172  handle_update_requests(redraw);
173 
174  ED4_window *window = first_window;
175  while (window) {
176  ED4_LocalWinContext uses(window);
177  refresh_window_simple(redraw);
178  window = window->next;
179  }
180 
181  if (main_manager->update_info.refresh) main_manager->clear_refresh();
182 
183  if (loadable_SAIs == LSAI_OUTDATED) {
184  GB_touch(GBT_get_SAI_data(gb_main)); // touch SAI data to force update of SAI selection list
186  }
187 
188  return ED4_R_OK;
189 }
190 
191 // --------------------------------------------------------------------------------
192 
193 #ifdef UNIT_TESTS
194 #ifndef TEST_UNIT_H
195 #include <test_unit.h>
196 #endif
197 
198 static arb_test::match_expectation correct_win2world_calculation(ED4_foldable& foldable, int xwin_org, int ywin_org, int xwrld_expd, int ywrld_expd) {
199  using namespace arb_test;
200  match_expectation precondition(all().of(that(xwrld_expd).is_more_or_equal(xwin_org),
201  that(ywrld_expd).is_more_or_equal(ywin_org)));
202 
203  AW_pos xwrld_calc = xwin_org;
204  AW_pos ywrld_calc = ywin_org;
205  foldable.win_to_world_coords(&xwrld_calc, &ywrld_calc);
206 
207  match_expectation win_2_world_conversion(all().of(that(xwrld_calc).is_equal_to(xwrld_expd),
208  that(ywrld_calc).is_equal_to(ywrld_expd)));
209 
210  AW_pos xwin_back = xwrld_calc;
211  AW_pos ywin_back = ywrld_calc;
212  foldable.world_to_win_coords(&xwin_back, &ywin_back);
213 
214  match_expectation world_back2_win_conversion(all().of(that(xwin_back).is_equal_to(xwin_org),
215  that(ywin_back).is_equal_to(ywin_org)));
216 
217  return all().of(precondition, win_2_world_conversion, world_back2_win_conversion);
218 }
219 
220 static arb_test::match_expectation correct_world2win_calculation(ED4_foldable& foldable, int xwrld_org, int ywrld_org, int xwin_expd, int ywin_expd) {
221  using namespace arb_test;
222  match_expectation precondition(all().of(that(xwrld_org).is_more_or_equal(xwin_expd),
223  that(ywrld_org).is_more_or_equal(ywin_expd)));
224 
225 
226  AW_pos xwin_calc = xwrld_org;
227  AW_pos ywin_calc = ywrld_org;
228  foldable.world_to_win_coords(&xwin_calc, &ywin_calc);
229 
230  match_expectation world_2_win_conversion(all().of(that(xwin_calc).is_equal_to(xwin_expd),
231  that(ywin_calc).is_equal_to(ywin_expd)));
232 
233  return all().of(precondition, world_2_win_conversion);
234 }
235 
236 #define TEST_EXPECT_WIN_UNFOLDED(xwi,ywi) TEST_EXPECTATION(correct_win2world_calculation(foldable, xwi, ywi, xwi, ywi))
237 #define TEST_EXPECT_WIN_WORLD_FOLDING(xwi,ywi,fx,fy) TEST_EXPECTATION(correct_win2world_calculation(foldable, xwi, ywi, (xwi)+(fx), (ywi)+(fy)))
238 #define TEST_EXPECT_WORLD_WIN_FOLDING(xwo,ywo,xwi,ywi) TEST_EXPECTATION(correct_world2win_calculation(foldable, xwo, ywo, xwi, ywi))
239 
240 #define TEST_EXPECT_WIN_WORLD_FOLDING__BROKEN(xwi,ywi,fx,fy) TEST_EXPECTATION__BROKEN(correct_win2world_calculation(foldable, xwi, ywi, (xwi)+(fx), (ywi)+(fy)))
241 #define TEST_EXPECT_WIN_WORLD_FOLDING__BROKENIF(when,xwi,ywi,fx,fy) TEST_EXPECTATION__BROKENIF(when, correct_win2world_calculation(foldable, xwi, ywi, (xwi)+(fx), (ywi)+(fy)))
242 
243 void TEST_win_2_world() {
244  ED4_foldable foldable;
245 
246  const int X1 = 200;
247  const int X2 = 300;
248  const int Y1 = 100;
249  const int Y2 = 200;
250 
251  ED4_folding_line *hor100 = foldable.insert_folding_line(Y1, 0, PROP_HORIZONTAL);
252  ED4_folding_line *ver200 = foldable.insert_folding_line(X1, 0, PROP_VERTICAL);
253  ED4_folding_line *hor200 = foldable.insert_folding_line(Y2, 0, PROP_HORIZONTAL);
254  ED4_folding_line *ver300 = foldable.insert_folding_line(X2, 0, PROP_VERTICAL);
255 
256  // nothing folded yet
257 
258  const int x01 = X1/2;
259  const int x12 = (X1+X2)/2;
260  const int x23 = X2+x01;
261 
262  const int y01 = Y1/2;
263  const int y12 = (Y1+Y2)/2;
264  const int y23 = Y2+y01;
265 
266  TEST_EXPECT_WIN_UNFOLDED(x01, y01);
267  TEST_EXPECT_WIN_UNFOLDED(x12, y01);
268  TEST_EXPECT_WIN_UNFOLDED(x23, y01);
269 
270  TEST_EXPECT_WIN_UNFOLDED(x01, y12);
271  TEST_EXPECT_WIN_UNFOLDED(x12, y12);
272  TEST_EXPECT_WIN_UNFOLDED(x23, y12);
273 
274  TEST_EXPECT_WIN_UNFOLDED(x01, y23);
275  TEST_EXPECT_WIN_UNFOLDED(x12, y23);
276  TEST_EXPECT_WIN_UNFOLDED(x23, y23);
277 
278  for (int FACTOR = 1; FACTOR <= 100; FACTOR += 7) {
279  TEST_ANNOTATE(GBS_global_string("FACTOR=%i", FACTOR));
280  int H1 = FACTOR* 10;
281  int H2 = FACTOR* 40;
282  int V1 = FACTOR* 20;
283  int V2 = FACTOR* 80;
284 
285  hor100->set_dimension(H1);
286  hor200->set_dimension(H2);
287  ver200->set_dimension(V1);
288  ver300->set_dimension(V2);
289 
290  TEST_EXPECT_WIN_UNFOLDED (x01, y01); // always in unfolded range
291  TEST_EXPECT_WIN_WORLD_FOLDING(x12, y01, V1, 0);
292  TEST_EXPECT_WIN_WORLD_FOLDING(x23, y01, V1+V2, 0);
293 
294  TEST_EXPECT_WIN_WORLD_FOLDING(x01, y12, 0, H1);
295  TEST_EXPECT_WIN_WORLD_FOLDING(x12, y12, V1, H1);
296  TEST_EXPECT_WIN_WORLD_FOLDING(x23, y12, V1+V2, H1);
297 
298  TEST_EXPECT_WIN_WORLD_FOLDING(x01, y23, 0, H1+H2);
299  TEST_EXPECT_WIN_WORLD_FOLDING(x12, y23, V1, H1+H2);
300  TEST_EXPECT_WIN_WORLD_FOLDING(x23, y23, V1+V2, H1+H2);
301 
302  // test "folded" world positions.
303  // they result in win positions lower than folding line!
304  TEST_EXPECT_WORLD_WIN_FOLDING(X1-1, Y1-1, X1-1, Y1-1); // left of/above folded range
305  TEST_EXPECT_WORLD_WIN_FOLDING(X1, Y1, X1-V1, Y1-H1); // left/upper end of folded range
306  TEST_EXPECT_WORLD_WIN_FOLDING(X1+5, Y1+5, X1+5-V1, Y1+5-H1); // in folded range
307  TEST_EXPECT_WORLD_WIN_FOLDING(X1+V1, Y1+H1, X1, Y1); // right/lower end of folded range
308  TEST_EXPECT_WORLD_WIN_FOLDING(X1+V1+1, Y1+H1+1, X1+1, Y1+1); // right of/below folded range
309  }
310 }
311 
312 #endif // UNIT_TESTS
313 
314 // --------------------------------------------------------------------------------
315 
318  main_multi_man->deselect_all_species_and_SAI();
319 
320  main_multi_man = top_area_man->get_multi_species_manager();
321  main_multi_man->deselect_all_species_and_SAI();
322 
324 
325  return ED4_R_OK;
326 }
327 
328 void ED4_root::remove_from_highlighted(ED4_species_name_terminal *name_term) { // @@@ change param to ED4_species_manager?
329  if (name_term) {
330  if ((highlighted_objects->has_elem(name_term->highlight_info))) {
331  highlighted_objects->remove_elem(name_term->highlight_info);
332 
333  delete name_term->highlight_info;
334  name_term->highlight_info = NULp;
335  name_term->containing_species_manager()->set_highlighted(false);
336  name_term->dragged = false; // @@@ caller shall do this
337 
338 #ifdef DEBUG
339  GBDATA *gbd = name_term->get_species_pointer();
340 
341  if (gbd) {
342  GB_transaction ta(gbd);
343  printf("removed term '%s'\n", GB_read_char_pntr(gbd));
344  }
345  else {
346  ED4_species_manager *spec_man = name_term->get_parent(LEV_SPECIES)->to_species_manager();
347 
348  if (spec_man->is_consensus_manager()) {
349  printf("removed consensus '%s'\n", name_term->id);
350  }
351  else {
352  printf("removed unknown term '%s'\n", name_term->id ? name_term->id : "NULp");
353  }
354  }
355 #endif
356 
357  name_term->request_refresh();
358  ED4_sequence_terminal *seq_term = name_term->corresponding_sequence_terminal();
359  if (seq_term) seq_term->request_refresh();
360 
361  // ProtView: Refresh corresponding orf terminals
362  if (alignment_type == GB_AT_DNA) {
364  }
365 
366  ED4_multi_species_manager *multi_man = name_term->get_parent(LEV_MULTI_SPECIES)->to_multi_species_manager();
367  multi_man->invalidate_species_counters();
368  }
369  }
370 }
371 
373  for (ED4_window *win = first_window; win; win = win->next) {
374  if (win->aww == aww) {
375  most_recently_used_window = win;
376  }
377  }
378 }
379 
380 ED4_returncode ED4_root::add_to_highlighted(ED4_species_name_terminal *name_term) { // @@@ change param to ED4_species_manager?
381  if (!name_term || !name_term->has_property(PROP_SELECTABLE)) { // check if object exists and may be selected
382  return ED4_R_IMPOSSIBLE;
383  }
384 
385  if (!(highlighted_objects->has_elem(name_term->highlight_info))) { // object is really new to our list => append it
387  name_term->highlight_info = hl_info;
388 
389  if (name_term->has_property(PROP_IS_HANDLE)) { // object is a handle for an object up in the hierarchy => search it
390  ED4_level mlevel = name_term->spec.handled_level;
391  ED4_base *tmp_object = name_term;
392 
393  while (tmp_object && !(tmp_object->spec.level & mlevel)) {
394  tmp_object = tmp_object->parent;
395  }
396 
397  if (!tmp_object) return ED4_R_WARNING; // no target level found
398  // ok, found handled object -> use handle ('name_term')
399  }
400  // otherwise selected object is no handle => take it directly
401 
402  hl_info->object = name_term;
404  name_term->containing_species_manager()->set_highlighted(true);
405 
406 #ifdef DEBUG
407  GBDATA *gbd = name_term->get_species_pointer();
408 
409  if (gbd) {
410  printf("added term '%s'\n", GB_read_char_pntr(gbd));
411  }
412  else {
413  ED4_species_manager *spec_man = name_term->get_parent(LEV_SPECIES)->to_species_manager();
414  if (spec_man->is_consensus_manager()) {
415  printf("added consensus '%s'\n", name_term->id);
416  }
417  else {
418  printf("added unknown term '%s'\n", name_term->id ? name_term->id : "NULp");
419  }
420  }
421 #endif
422 
423  name_term->request_refresh();
424  ED4_sequence_terminal *seq_term = name_term->corresponding_sequence_terminal();
425  if (seq_term) seq_term->request_refresh();
426 
427  // ProtView: Refresh corresponding orf terminals
428  if (alignment_type == GB_AT_DNA) {
430  }
431 
432  ED4_multi_species_manager *multi_man = name_term->get_parent(LEV_MULTI_SPECIES)->to_multi_species_manager();
433  multi_man->invalidate_species_counters();
434 
435  return ED4_R_OK;
436  }
437 
438  return ED4_R_IMPOSSIBLE;
439 }
440 
442  while (main_manager->update_info.resize) {
443  main_manager->resize_requested_children();
444  }
445 }
446 
447 static ARB_ERROR change_char_table_length(ED4_base *base, int new_length) {
448  if (base->is_abstract_group_manager()) {
449  ED4_abstract_group_manager *group_man = base->to_abstract_group_manager();
450  group_man->table().change_table_length(new_length);
451  }
452  return NULp;
453 }
454 
455 void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE IF_ASSERTION_USED(gbtype)) { // callback from database
456  e4_assert(gbtype==GB_CB_CHANGED);
457  int new_length = GB_read_int(gb_alignment_len);
458 
459 #if defined(DEBUG) && 1
460  printf("alignment_length_changed from %i to %i\n", MAXSEQUENCECHARACTERLENGTH, new_length);
461 #endif
462 
463  if (MAXSEQUENCECHARACTERLENGTH!=new_length) { // otherwise we already did this (i.e. we were called by changed_by_database)
464  bool was_increased = new_length>MAXSEQUENCECHARACTERLENGTH;
465 
466  MAXSEQUENCECHARACTERLENGTH = new_length;
467 
469  {
470  const char *err = ED4_ROOT->helix->init(gb_main); // reload helix
471  aw_message_if(err);
472  }
473  {
474  const char *err = ED4_ROOT->ecoli_ref->init(gb_main); // reload ecoli
475  aw_message_if(err);
476  }
477 
478  if (ED4_ROOT->alignment_type == GB_AT_AA) {
479  // TODO: is this needed here?
480  const char *err = ED4_pfold_set_SAI(&ED4_ROOT->protstruct, gb_main, ED4_ROOT->get_alignment_name(), &ED4_ROOT->protstruct_len); // reload protstruct
481  aw_message_if(err);
482  }
483 
484  if (was_increased) {
485  ED4_ROOT->main_manager->route_down_hierarchy(makeED4_route_cb(change_char_table_length, new_length)).expect_no_error();
487  }
488  }
489 }
490 
492  GB_transaction ta(gb_main);
493 
494  alignment_name = GBT_get_startup_alignment(gb_main);
495  alignment_type = GBT_get_alignment_type(gb_main, alignment_name);
497  return GBS_global_string("You have to select a valid alignment before you can start ARB_EDIT4\n(%s)", GB_await_error());
498  }
499 
500  GBDATA *gb_alignment = GBT_get_alignment(gb_main, alignment_name);
501  if (!gb_alignment) {
502  return GBS_global_string("You can't edit without an existing alignment\n(%s)", GB_await_error());
503  }
504 
505  GBDATA *gb_alignment_len = GB_search(gb_alignment, "alignment_len", GB_FIND);
506  int alignment_length = GB_read_int(gb_alignment_len);
507  MAXSEQUENCECHARACTERLENGTH = alignment_length;
508 
509  GB_add_callback(gb_alignment_len, GB_CB_CHANGED, makeDatabaseCallback(ED4_alignment_length_changed));
510 
511  return NULp;
512 }
513 
515  int font_GC[] = {
519  };
520 
522  for (unsigned i = 0; i<ARRAY_ELEMS(font_GC); ++i) {
523  ED4_MostRecentWinContext context;
524  font_group.registerFont(current_device(), font_GC[i]);
525  }
526 }
527 
529  if (base->is_multi_species_manager()) {
530  base->to_multi_species_manager()->update_requested_by_child();
531  }
532  return NULp;
533 }
534 
535 ED4_returncode ED4_root::create_hierarchy(const char *area_string_middle, const char *area_string_top) {
536  // creates internal hierarchy of editor
537 
538  long total_no_of_groups = 0;
539  long total_no_of_species = 0;
540  {
541  // count species and related info (e.g. helix) displayed in the top region (a == 0)
542  // count no of species and sais including groups in middle region (a == 1)
543 
544  const char *area_string[2] = { area_string_top, area_string_middle };
545  for (int a = 0; a<2; ++a) {
546  long group_count;
547  long species_count;
548 
549  EDB_root_bact::calc_no_of_all(area_string[a], &group_count, &species_count);
550 
551  total_no_of_groups += group_count;
552  total_no_of_species += species_count;
553  }
554  }
555 
556  SmartPtr<arb_progress> startup_progress = new arb_progress("EDIT4 startup");
557 
558  GB_push_transaction(gb_main);
559 
560  ecoli_ref = new BI_ecoli_ref;
561  ecoli_ref->init(gb_main);
562 
563  // [former position of ali-init-code]
564 
565  main_manager = new ED4_main_manager("Main_Manager", 0, 0, NULp); // build a test hierarchy
566  root_group_man = new ED4_root_group_manager("Root_Group_Manager", 0, 0, main_manager);
567 
568  main_manager->append_member(root_group_man);
569 
570  ED4_device_manager *device_manager = new ED4_device_manager("Device_Manager", 0, 0, root_group_man);
571  root_group_man->append_member(device_manager);
572 
573  {
574  int col_stat_term_height = 50; // @@@ Hoehe des ColumnStatistics Terminals ausrechnen
575 
577  new ED4_sequence_info_terminal("Reference_Sequence_Info_Terminal", MAXINFO_WIDTH, TERMINAL_HEIGHT, NULp),
578  new ED4_sequence_terminal ("Reference_Sequence_Terminal", 300, TERMINAL_HEIGHT, NULp, false),
579  new ED4_sequence_info_terminal("Reference_ColumnStatistics_Info_Terminal", MAXINFO_WIDTH, col_stat_term_height, NULp),
580  new ED4_columnStat_terminal ("Reference_ColumnStatistics_Terminal", 300, col_stat_term_height, NULp)
581  );
582  }
583 
584  {
585  arb_progress species_progress("Loading species", total_no_of_species);
586 
587  // ********** Top Area beginning **********
588 
589  ED4_multi_species_manager *top_multi_species_manager;
590  ED4_spacer_terminal *top_spacer_terminal;
591  ED4_spacer_terminal *top_mid_spacer_terminal;
592  ED4_spacer_terminal *top_multi_spacer_terminal_beg;
593  ED4_line_terminal *top_mid_line_terminal;
594  {
595  ED4_area_manager *top_area_manager = new ED4_area_manager("Top_Area_Manager", 0, 0, device_manager);
596  device_manager->append_member(top_area_manager);
597  top_area_man = top_area_manager;
598 
599  top_spacer_terminal = new ED4_spacer_terminal("Top_Spacer", false, 100, 10, top_area_manager);
600  top_area_manager->append_member(top_spacer_terminal);
601 
602  top_multi_species_manager = new ED4_multi_species_manager("Top_MultiSpecies_Manager", 0, 0, top_area_manager);
603  top_area_manager->append_member(top_multi_species_manager);
604 
605  top_multi_spacer_terminal_beg = new ED4_spacer_terminal("Top_Left_Spacer", false, 0, 3, top_multi_species_manager);
606  top_multi_species_manager->append_member(top_multi_spacer_terminal_beg);
607 
608  reference = new ED4_reference;
609 
610  int index = 0;
611  EDB_root_bact::scan_string(top_multi_species_manager, ref_terminals, area_string_top, &index, species_progress);
612  GB_pop_transaction(gb_main);
613 
614  const int TOP_MID_LINE_HEIGHT = 3;
615  int TOP_MID_SPACER_HEIGHT = font_group.get_max_height()-TOP_MID_LINE_HEIGHT;
616 
617  top_mid_line_terminal = new ED4_line_terminal("Top_Mid_Line_Terminal", 0, TOP_MID_LINE_HEIGHT, device_manager); // width will be set below
618  device_manager->append_member(top_mid_line_terminal);
619 
620  top_mid_spacer_terminal = new ED4_spacer_terminal("Top_Middle_Spacer", true, 880, TOP_MID_SPACER_HEIGHT, device_manager);
621  device_manager->append_member(top_mid_spacer_terminal);
622 
623  // needed to avoid text-clipping problems:
624  main_manager->set_top_middle_spacer_terminal(top_mid_spacer_terminal);
625  main_manager->set_top_middle_line_terminal(top_mid_line_terminal);
626  }
627 
628  // ********** Middle Area beginning **********
629 
630  ED4_area_manager *middle_area_manager;
631  ED4_tree_terminal *tree_terminal;
632  ED4_multi_species_manager *mid_multi_species_manager;
633  ED4_spacer_terminal *mid_multi_spacer_terminal_beg;
634  ED4_line_terminal *mid_bot_line_terminal;
635  ED4_spacer_terminal *total_bottom_spacer;
636  {
637  middle_area_manager = new ED4_area_manager("Middle_Area_Manager", 0, 0, device_manager);
638  device_manager->append_member(middle_area_manager);
639  middle_area_man = middle_area_manager;
640 
641  tree_terminal = new ED4_tree_terminal("Tree", 2, 0, middle_area_manager);
642  middle_area_manager->append_member(tree_terminal);
643 
644  mid_multi_species_manager = new ED4_multi_species_manager("Middle_MultiSpecies_Manager", 0, 0, middle_area_manager);
645  middle_area_manager->append_member(mid_multi_species_manager);
646 
647  mid_multi_spacer_terminal_beg = new ED4_spacer_terminal("Mid_Multi_Spacer_Terminal_Beg", false, 0, 3, mid_multi_species_manager);
648  mid_multi_species_manager->append_member(mid_multi_spacer_terminal_beg);
649 
650  scroll_links.link_for_ver_slider = middle_area_manager;
651 
652  {
653  GB_transaction ta(gb_main);
654  int index = 0;
655  EDB_root_bact::scan_string(mid_multi_species_manager, ref_terminals, area_string_middle, &index, species_progress);
656  }
657 
658  {
659  ED4_spacer_terminal *mid_bot_spacer_terminal = new ED4_spacer_terminal("Middle_Bot_Spacer_Terminal", false, 880, 10, device_manager);
660  device_manager->append_member(mid_bot_spacer_terminal);
661  }
662 
663  mid_bot_line_terminal = new ED4_line_terminal("Mid_Bot_Line_Terminal", 0, 3, device_manager); // width will be set below
664  device_manager->append_member(mid_bot_line_terminal);
665 
666  total_bottom_spacer = new ED4_spacer_terminal("Total_Bottom_Spacer_terminal", false, 0, 10000, device_manager);
667  total_bottom_spacer->clr_property(PROP_DYNA_RESIZE);
668  device_manager->append_member(total_bottom_spacer);
669  }
670 
672  const long ext_width = long(scroll_links.link_for_hor_slider->extension.size[WIDTH]);
673  const long spacer_width = ext_width + MAXNAME_WIDTH + SEQUENCE_INFO_WIDTH;
674  const long line_width = spacer_width + TREE_TERMINAL_WIDTH;
675 
676  top_multi_spacer_terminal_beg->extension.size[WIDTH] = spacer_width;
677  mid_multi_spacer_terminal_beg->extension.size[WIDTH] = spacer_width;
678  total_bottom_spacer->extension.size[WIDTH] = spacer_width;
679 
680  top_mid_line_terminal->extension.size[WIDTH] = line_width;
681  mid_bot_line_terminal->extension.size[WIDTH] = line_width;
682 
683  }
684 
685  tree_terminal->set_links(NULp, mid_multi_species_manager); // set links
686  top_spacer_terminal->set_links(tree_terminal, top_multi_species_manager);
687  top_mid_spacer_terminal->set_links(middle_area_manager, NULp);
688  total_bottom_spacer->set_links(mid_bot_line_terminal, NULp);
689 
690  species_progress.done();
691  }
692 
695 
696  main_manager->route_down_hierarchy(makeED4_route_cb(force_group_update)).expect_no_error();
697 
698  if (!scroll_links.link_for_hor_slider) { // happens when no species AND no SAI has data
699  startup_progress->done();
700  startup_progress.setNull(); // make progress disappear (otherwise prompter below is often behind progress window)
701  GB_pop_transaction(gb_main);
702 
703  aw_popup_ok(GBS_global_string("No species/SAI contains data in '%s'\nARB_EDIT4 will terminate", alignment_name));
704  ED4_exit();
705  }
706 
707  // build consensi
708  {
709  arb_progress consensi_progress("Initializing consensi", total_no_of_species+total_no_of_groups+1); // 1 is root_group_man
710 
711  root_group_man->create_consensus(root_group_man, &consensi_progress);
713  consensi_progress.done(); // if there is a "top"-group, progress increment is one to low
714  }
715 
718 
719  // calc size and display:
720 
722 
724 
725  {
728  ED4_base *width_link = x_link;
729  ED4_base *height_link = y_link;
730 
732  while (win) {
733  win->set_scrolled_rectangle(x_link, y_link, width_link, height_link);
734  win->aww->show();
736  win = win->next;
737  }
738  }
739 
742 
743 #if defined(DEBUG) && 0
744  // dump created hierarchy:
745  puts("---------------------------------------- [main_manager dump start]");
746  main_manager->dump(1);
747  puts("---------------------------------------- [main_manager dump end]");
748 #endif
749 
750  return ED4_R_OK;
751 }
752 
754  // returns win-coordinates of area (defined by folding lines) which contains position x/y
755  int x1, x2, y1, y2;
756  const AW_screen_area& area_rect = current_device()->get_area_size();
757 
758  x1 = area_rect.l;
759  for (const ED4_folding_line *flv=current_ed4w()->get_vertical_folding(); ; flv = flv->get_next()) {
760  if (flv) {
761  x2 = int(flv->get_pos()); // @@@ use AW_INT ?
762  }
763  else {
764  x2 = area_rect.r;
765  if (x1==x2) {
766  break;
767  }
768  }
769 
770  y1 = area_rect.t;
771  for (const ED4_folding_line *flh=current_ed4w()->get_horizontal_folding(); ; flh = flh->get_next()) {
772  if (flh) {
773  y2 = int(flh->get_pos()); // @@@ use AW_INT ?
774  }
775  else {
776  y2 = area_rect.b;
777  if (y1==y2) {
778  break;
779  }
780  }
781 
782  if (x1<=x && x<=x2 && y1<=y && y<=y2) {
783  rect->t = y1;
784  rect->b = y2;
785  rect->l = x1;
786  rect->r = x2;
787  return ED4_R_OK;
788  }
789  y1 = y2;
790  if (!flh) break;
791  }
792  x1 = x2;
793  if (!flv) break;
794  }
795  return ED4_R_IMPOSSIBLE; // no area contains x/y :-(
796 }
797 
799  destination->slider_pos_horizontal = source->slider_pos_horizontal;
800  destination->slider_pos_vertical = source->slider_pos_vertical;
801  destination->coords = source->coords;
802 }
803 
804 
805 static void reload_helix_cb() {
806  const char *err = ED4_ROOT->helix->init(ED4_ROOT->get_gb_main());
807  if (err) aw_message(err);
809 }
810 
811 
812 static void reload_ecoli_cb() {
813  const char *err = ED4_ROOT->ecoli_ref->init(ED4_ROOT->get_gb_main());
814  if (err) aw_message(err);
816 }
817 
818 // ---------------------------------------
819 // recursion through all species
820 
821 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_Species_Callback, ARB_ERROR, GBDATA *); // generates makeED4_Species_Callback
822 
823 static ARB_ERROR do_sth_with_species(ED4_base *base, const ED4_Species_Callback *cb) {
824  ARB_ERROR error = NULp;
825 
826  if (base->is_species_manager()) {
827  ED4_species_manager *species_manager = base->to_species_manager();
828  ED4_species_name_terminal *species_name_terminal = species_manager->search_spec_child_rek(LEV_SPECIES_NAME)->to_species_name_terminal();
829 
830  if (species_name_terminal->get_species_pointer()) {
831  char *species_name = GB_read_as_string(species_name_terminal->get_species_pointer());
832 
833  e4_assert(species_name);
834  GBDATA *species = GBT_find_species(ED4_ROOT->get_gb_main(), species_name);
835 
836  error = species
837  ? (*cb)(species)
838  : GB_append_exportedError(GBS_global_string("can't find species '%s'", species_name));
839 
840  free(species_name);
841  }
842  }
843 
844  return error;
845 }
846 
847 
848 static ARB_ERROR ED4_with_all_loaded_species(const ED4_Species_Callback& cb) {
849  return ED4_ROOT->root_group_man->route_down_hierarchy(makeED4_route_cb(do_sth_with_species, &cb));
850 }
851 
852 static bool is_named(ED4_base *base, const char *wanted_name) {
853  ED4_species_name_terminal *name_term = base->to_species_name_terminal();
854  GBDATA *gbd = name_term->get_species_pointer();
855  if (gbd) {
856  const char *name = GB_read_char_pntr(gbd);
857  e4_assert(name);
858 
859  return strcmp(name, wanted_name) == 0;
860  }
861  return false;
862 }
863 
864 static bool is_species_named(ED4_base *base, const char *species_name) {
865  return base->inside_species_seq_manager() && is_named(base, species_name);
866 }
867 
868 static bool is_SAI_named(ED4_base *base, const char *sai_name) {
869  return base->inside_SAI_manager() && is_named(base, sai_name);
870 }
871 
872 ED4_species_name_terminal *ED4_find_species_or_SAI_name_terminal(const char *species_name) {
873  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_species_named, species_name));
874  return base ? base->to_species_name_terminal() : NULp;
875 }
876 ED4_species_name_terminal *ED4_find_species_name_terminal(const char *species_name) {
877  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_species_named, species_name));
878  return base ? base->to_species_name_terminal() : NULp;
879 }
880 ED4_species_name_terminal *ED4_find_SAI_name_terminal(const char *sai_name) {
881  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_SAI_named, sai_name));
882  return base ? base->to_species_name_terminal() : NULp;
883 }
884 
885 static char *get_group_consensus(const char *species_name, PosRange range) {
886  ED4_species_name_terminal *name_term = ED4_find_species_name_terminal(species_name);
887  char *consensus = NULp;
888 
889  if (name_term) {
890  ED4_abstract_group_manager *group_man = name_term->get_parent(ED4_level(LEV_GROUP|LEV_ROOTGROUP))->to_abstract_group_manager();
891  if (group_man) {
892  consensus = group_man->build_consensus_string(range);
893  }
894  }
895 
896  return consensus;
897 }
898 
899 static bool get_selected_range(PosRange& range) {
901  if (listElem) {
902  ED4_sequence_terminal *seqTerm = listElem->elem()->object->corresponding_sequence_terminal();
903  return ED4_get_highlighted_range(seqTerm, range);
904  }
905  return false;
906 }
907 
909 
911  if (!curr_aligner_elem) return NULp;
912 
913  ED4_species_manager *specMan = curr_aligner_elem->elem()->object->containing_species_manager();
914  curr_aligner_elem = curr_aligner_elem->next();
915  return specMan->get_species_pointer();
916 }
917 
918 static GBDATA *get_first_selected_species(int *total_no_of_selected_species) {
919  int selected = ED4_ROOT->highlighted_objects->size();
920 
921  if (total_no_of_selected_species) {
922  *total_no_of_selected_species = selected;
923  }
924 
925  if (selected) {
926  curr_aligner_elem = ED4_ROOT->highlighted_objects->head();
927  }
928  else {
929  curr_aligner_elem = NULp;
930  }
931 
932  return get_next_selected_species();
933 }
934 
936  return FastAligner_delete_temp_entries(species, alignment_name);
937 }
938 
942  if (!error) error = ED4_with_all_loaded_species(makeED4_Species_Callback(ED4_delete_temp_entries, ED4_ROOT->get_alignment_name()));
943  GB_end_transaction_show_error(gb_main, error, aw_message);
944 }
945 
946 static void toggle_helix_for_SAI(AW_window *aww) {
947  ED4_LocalWinContext uses(aww);
948  ED4_cursor *cursor = &current_cursor();
949 
950  if (cursor->in_SAI_terminal()) {
951  ED4_sequence_terminal *sai_term = cursor->owner_of_cursor->to_sequence_terminal();
952  ED4_sequence_info_terminal *sai_info_term = sai_term->parent->search_spec_child_rek(LEV_SEQUENCE_INFO)->to_sequence_info_terminal();
953 
954  GBDATA *gb_sai_data = sai_info_term->data();
955  GB_transaction ta(gb_sai_data);
956 
957  GBDATA *gb_sai = GB_get_grandfather(gb_sai_data);
958  GBDATA *gb_disp_sec = GB_searchOrCreate_int(gb_sai, "showsec", 0);
959 
960  bool show_sec = 1-bool(GB_read_int(gb_disp_sec));
961  GB_ERROR error = GB_write_int(gb_disp_sec, show_sec);
962  if (!error) {
963  sai_term->set_secstruct_display(show_sec);
964  sai_term->request_refresh();
965  }
966  if (error) aw_message(error);
967  }
968  else {
969  aw_message("Please select an SAI");
970  }
971 }
972 
973 static void title_mode_changed(AW_root *aw_root, AW_window *aww) {
974  int title_mode = aw_root->awar(AWAR_EDIT_TITLE_MODE)->read_int();
975 
976  if (title_mode==0) {
977  aww->set_info_area_height(57);
978  }
979  else {
980  aww->set_info_area_height(170);
981  }
982 }
983 
984 static void ED4_undo_redo(AW_window *aww, GB_UNDO_TYPE undo_type) {
985  ED4_LocalWinContext uses(aww);
986 
988  GB_ERROR error = GB_undo(gb_main, undo_type);
989 
990  if (error) {
991  aw_message(error);
992  }
993  else {
994  GB_begin_transaction(gb_main);
995  GB_commit_transaction(gb_main);
996  ED4_cursor *cursor = &current_cursor();
997  if (cursor->owner_of_cursor) cursor->owner_of_cursor->request_refresh();
998  }
999 }
1000 
1002  AW_window_simple *aws = new AW_window_simple;
1003 
1004  aws->init(root, "ZOOM_ERR_MSG", "Errors and warnings");
1005  aws->load_xfig("edit4/message.fig");
1006 
1007  aws->callback(AW_POPDOWN);
1008  aws->at("hide");
1009  aws->create_button("HIDE", "HIDE");
1010 
1011  aws->callback(aw_clear_message_cb);
1012  aws->at("clear");
1013  aws->create_button("CLEAR", "CLEAR");
1014 
1015  aws->at("errortext");
1016  aws->create_text_field(AWAR_ERROR_MESSAGES);
1017 
1018  return aws;
1019 }
1020 
1021 
1022 static char *cat(char *toBuf, const char *s1, const char *s2) {
1023  char *buf = toBuf;
1024 
1025  while ((*buf++=*s1++)!=0) ;
1026  buf--;
1027  while ((*buf++=*s2++)!=0) ;
1028 
1029  return toBuf;
1030 }
1031 
1033  const char *label_prefix, const char *macro_prefix,
1034  const char *pattern_awar_name, const char *show_awar_name,
1035  int short_form, ED4_SearchPositionType type, ED4_window *ed4w)
1036 {
1037  char buf[200];
1038 
1039  if (!short_form) {
1040  awmm->at(cat(buf, label_prefix, "search"));
1041  awmm->create_input_field(pattern_awar_name, 30);
1042  }
1043 
1044  awmm->at(cat(buf, label_prefix, "n"));
1045  awmm->help_text("e4_search.hlp");
1046  awmm->callback(makeWindowCallback(ED4_search_cb, ED4_encodeSearchDescriptor(+1, type), ed4w));
1047  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_NEXT"), "#edit/next.xpm");
1048 
1049  awmm->at(cat(buf, label_prefix, "l"));
1050  awmm->help_text("e4_search.hlp");
1051  awmm->callback(makeWindowCallback(ED4_search_cb, ED4_encodeSearchDescriptor(-1, type), ed4w));
1052  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_LAST"), "#edit/last.xpm");
1053 
1054  awmm->at(cat(buf, label_prefix, "d"));
1055  awmm->help_text("e4_search.hlp");
1056  awmm->callback(makeWindowCallback(ED4_popup_search_window, type));
1057  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_DETAIL"), "#edit/detail.xpm");
1058 
1059  awmm->at(cat(buf, label_prefix, "s"));
1060  awmm->create_toggle(show_awar_name);
1061 }
1062 
1063 static void ED4_set_protection(AW_window *aww, int wanted_protection) {
1064  ED4_LocalWinContext uses(aww);
1065  ED4_cursor *cursor = &current_cursor();
1066  GB_ERROR error = NULp;
1067 
1068  if (cursor->owner_of_cursor) {
1069  ED4_sequence_terminal *seq_term = cursor->owner_of_cursor->to_sequence_terminal();
1070  ED4_sequence_info_terminal *seq_info_term = seq_term->parent->search_spec_child_rek(LEV_SEQUENCE_INFO)->to_sequence_info_terminal();
1071  GBDATA *gbd = seq_info_term->data();
1072 
1073  GB_transaction ta(gbd);
1074  GB_topSecurityLevel unsecured(gbd);
1075 
1076  error = GB_write_security_write(gbd, wanted_protection);
1077  error = ta.close(error);
1078  }
1079  else {
1080  error = "No species selected";
1081  }
1082 
1083  if (error) aw_message(error);
1084 }
1085 
1097 };
1098 
1099 static void ED4_menu_highlight(AW_window *aww, MenuHighlightType hilight) {
1101  GB_transaction ta(gb_main);
1102 
1104 
1105  e4_assert(middle_multi_man);
1106 
1107  switch (hilight) {
1108  case ED4_MS_NONE: {
1111  }
1112  break;
1113  }
1114  case ED4_MS_ALL: {
1115  middle_multi_man->select_all(true); // only species
1117  break;
1118  }
1119  case ED4_MS_INVERT: {
1120  middle_multi_man->invert_selection_of_all_species();
1122  break;
1123  }
1124  case ED4_MS_SELECT_MARKED: {
1125  middle_multi_man->marked_species_select(true);
1127  break;
1128  }
1129  case ED4_MS_DESELECT_MARKED: {
1130  middle_multi_man->marked_species_select(false);
1132  break;
1133  }
1134  case ED4_MS_UNMARK_ALL: {
1135  GBT_mark_all(gb_main, 0);
1136  break;
1137  }
1138  case ED4_MS_MARK_SELECTED: {
1139  middle_multi_man->selected_species_mark(true);
1141  break;
1142  }
1143  case ED4_MS_UNMARK_SELECTED: {
1144  middle_multi_man->selected_species_mark(false);
1146  break;
1147  }
1148  case ED4_MS_INVERT_GROUP: {
1150  int done = 0;
1151 
1152  if (cursor->owner_of_cursor) {
1153  ED4_multi_species_manager *multi_man = cursor->owner_of_cursor->get_parent(LEV_MULTI_SPECIES)->to_multi_species_manager();
1154 
1155  multi_man->invert_selection_of_all_species();
1157  done = 1;
1158  }
1159 
1160  if (!done) {
1161  aw_message("Place cursor into group");
1162  }
1163  break;
1164  }
1165  case ED4_MS_TOGGLE_BLOCKTYPE: {
1167  break;
1168  }
1169  default: {
1170  e4_assert(0);
1171  break;
1172  }
1173  }
1174 
1176 }
1177 
1180 }
1181 
1182 static void modes_cb(AW_window*, ED4_species_mode smode) {
1183  ED4_ROOT->species_mode = smode;
1184  for (ED4_window *win = ED4_ROOT->first_window; win; win = win->next) {
1185  win->aww->select_mode(smode);
1186  }
1187  if (smode == ED4_SM_INFO) {
1188  AWT_trigger_remote_action(NULp, ED4_ROOT->get_gb_main(), "ARB_NT:species_info");
1189  }
1190 }
1191 
1193  if (ED4_ROOT->species_mode == ED4_SM_KILL) {
1195  }
1196 }
1197 
1198 static char *get_helix_string(GBDATA *gb_main, const char *alignment_name) {
1199  GB_transaction ta(gb_main);
1200 
1201  char *helix_string = NULp;
1202  char *helix_name = GBT_get_default_helix(gb_main);
1203  GBDATA *gb_helix_con = GBT_find_SAI(gb_main, helix_name);
1204  if (gb_helix_con) {
1205  GBDATA *gb_helix = GBT_find_sequence(gb_helix_con, alignment_name);
1206  if (gb_helix) helix_string = GB_read_string(gb_helix);
1207  }
1208  free(helix_name);
1209 
1210  return helix_string;
1211 }
1212 
1214  static SmartPtr<AlignDataAccess> aliDataAccess;
1215 
1216  if (aliDataAccess.isNull()) {
1217  aliDataAccess = new AlignDataAccess(ED4_ROOT->get_gb_main(),
1219  true, ED4_trigger_instant_refresh, // perform refresh
1220  get_group_consensus, // aligner fetches consensus of group of species via this function
1221  get_selected_range, // aligner fetches column range of selection via this function
1222  get_first_selected_species, // aligner fetches first and..
1223  get_next_selected_species, // .. following selected species via these functions
1224  get_helix_string); // used by island_hopping (if configured to use sec-structure)
1225  }
1226 
1227  return aliDataAccess.content();
1228 }
1229 
1231 #if defined(DEBUG)
1232  static const AlignDataAccess *last_data_access = NULp;
1233 
1234  e4_assert(!last_data_access || (last_data_access == data_access)); // there shall be only one AlignDataAccess
1235  last_data_access = data_access;
1236 #endif
1237 
1238  static AW_window *aws = NULp;
1239  if (!aws) aws = FastAligner_create_window(awr, data_access);
1240  return aws;
1241 }
1242 
1243 static const char *propertyName(GBDATA *gb_main, int mode) {
1244  // mode == 0 -> alignment specific (e.g. "edit4_ali_16s.arb")
1245  // mode == 1 -> alignment-type specific (e.g. "edit4_rna.arb")
1246  // mode == 2 -> unspecific (normal) (always "edit4.arb")
1247  //
1248  // Note : result is only valid until next call
1249 
1250  e4_assert(mode >= 0 && mode <= 2);
1251 
1252  const char *result;
1253  if (mode == 2) {
1254  result = "edit4.arb";
1255  }
1256  else {
1257  static char *ali_name = NULp;
1258  static char *ali_type = NULp;
1259  static char *result_copy = NULp;
1260 
1261  if (!ali_name) {
1262  GB_transaction ta(gb_main);
1263 
1264  ali_name = GBT_get_startup_alignment(gb_main);
1265  if (!ali_name) {
1266  e4_assert(!ED4_ROOT); // this should only occur during startup (and only while running from debugger)
1267  GBK_terminatef("Failed to detect default alignment (Reason: %s)", GB_await_error());
1268  }
1269  ali_type = GBT_get_alignment_type_string(gb_main, ali_name);
1270  result_copy = new char[21+strlen(ali_name)];
1271  }
1272 
1273  sprintf(result_copy, "edit4_%s.arb", mode == 0 ? ali_name : ali_type);
1274  result = result_copy;
1275  }
1276 
1277  return result;
1278 }
1279 
1280 static void ED4_save_properties(AW_window *aw, int mode) {
1282 }
1283 
1285  typedef std::map<AW_gc_manager*, AW_window*> gcwin;
1286  static gcwin win;
1287 
1288  gcwin::iterator found = win.find(gcman);
1289 
1290  AW_window *aww = NULp;
1291  if (found == win.end()) {
1292  aww = AW_create_gc_window(awp->get_root(), gcman);
1293  win[gcman] = aww;
1294  }
1295  else {
1296  aww = win[gcman];
1297  }
1298  aww->activate();
1299 }
1300 
1301 static void gc_change_cb(GcChange whatChanged) {
1302  if (whatChanged == GC_FONT_CHANGED) {
1304  }
1306 }
1307 
1309  {
1310  ED4_window *ed4w = first_window;
1311 
1312  while (ed4w) { // before creating a window look for a hidden window
1313  if (ed4w->is_hidden) {
1314  ed4w->aww->show();
1315  ed4w->is_hidden = false;
1316  return ED4_R_BREAK;
1317  }
1318  ed4w = ed4w->next;
1319  }
1320  }
1321 
1322  if (ED4_window::no_of_windows == MAXWINDOWS) { // no more than 5 windows allowed
1323  aw_message(GBS_global_string("Restricted to %i windows", MAXWINDOWS));
1324  return ED4_R_BREAK;
1325  }
1326 
1328  {
1329  int winNum = ED4_window::no_of_windows+1;
1330  char *winName = winNum>1 ? GBS_global_string_copy("ARB_EDIT4_%i", winNum) : ARB_strdup("ARB_EDIT4");
1331  char *winTitle = GBS_global_string_copy("ARB_EDIT4 *%d* [%s]", winNum, alignment_name);
1332 
1333  awmm->init(aw_root, winName, winTitle, 800, 450);
1334 
1335  free(winTitle);
1336  free(winName);
1337  }
1338 
1339  *device = awmm->get_device(AW_MIDDLE_AREA); // points to Middle Area device
1340  *new_window = ED4_window::insert_window(awmm); // append to window list
1341 
1343  bool clone = ED4_window::no_of_windows>1;
1344  if (!clone) { // this is the first window
1345  AW_init_color_group_defaults("arb_edit4");
1346  }
1347  else { // additional edit windows
1348  copy_window_struct(first_window, *new_window);
1349  }
1350 
1351  ED4_LocalWinContext uses(*new_window);
1352 
1353  // each window has its own gc-manager
1354  gc_manager = AW_manage_GC(awmm,
1355  "ARB_EDIT4", // but all gc-managers use the same colors
1356  *device,
1357  ED4_G_DRAG,
1359  makeGcChangedCallback(gc_change_cb), // callback triggering refresh on gc-change
1360 
1361  "#f8f8f8",
1362  "STANDARD$black", // standard color showing species/group info (name, ...)
1363  "FlagInfo$#DDD",
1364  "#SEQUENCES (0)$#505050", // default color for sequences (color 0)
1365 
1366  "+-HELIX (1)$#8E0000", "+-COLOR 2$#0000dd", "-COLOR 3$#00AA55",
1367  "+-COLOR 4$#80f", "+-COLOR 5$#c0a020", "-COLOR 6$grey",
1368  "+-COLOR 7$#ff0000", "+-COLOR 8$#44aaff", "-COLOR 9$#ffaa00",
1369 
1370  "+-CURSOR$#FF0080", "+-MARKED$#f4f8e0", "-SELECTED$#FFFF80",
1371 
1372  "+-RANGE 0$#FFFFFF", "+-RANGE 1$#F0F0F0", "-RANGE 2$#E0E0E0",
1373  "+-RANGE 3$#D8D8D8", "+-RANGE 4$#D0D0D0", "-RANGE 5$#C8C8C8",
1374  "+-RANGE 6$#C0C0C0", "+-RANGE 7$#B8B8B8", "-RANGE 8$#B0B0B0",
1375  "-RANGE 9$#A0A0A0",
1376 
1377  // colors used to Paint search patterns
1378  // (do not change the names of these gcs)
1379  "+-User1$#B8E2F8", "+-User2$#B8E2F8", "-Probe$#B8E2F8", // see also SEC_graphic::init_devices
1380  "+-Primer(l)$#A9FE54", "+-Primer(r)$#A9FE54", "-Primer(g)$#A9FE54",
1381  "+-Sig(l)$#DBB0FF", "+-Sig(r)$#DBB0FF", "-Sig(g)$#DBB0FF",
1382 
1383  "+-MISMATCHES$#FF9AFF", "+-Flag$#7c7ce3", "-FlagFill$#aacef1",
1384 
1385  "&color_groups", // use color groups
1386 
1387  NULp);
1388 
1389  // since the gc-managers of all EDIT4-windows point to the same window properties,
1390  // changing fonts and colors is always done on first gc-manager
1391  static AW_gc_manager *first_gc_manager = NULp;
1392  if (!first_gc_manager) first_gc_manager = gc_manager;
1393 
1394  // --------------
1395  // File
1396 
1397 #if defined(DEBUG)
1398  AWT_create_debug_menu(awmm);
1399 #endif // DEBUG
1400 
1401  awmm->create_menu("File", "F", AWM_ALL);
1402 
1403  awmm->insert_menu_topic("new_win", "New Editor Window", "N", NULp, AWM_ALL, ED4_new_editor_window);
1404  awmm->sep______________();
1405  awmm->insert_menu_topic("save_config", "Save configuration", "S", "species_configs_saveload.hlp", AWM_ALL, makeWindowCallback(ED4_saveConfiguration, false));
1406  awmm->insert_menu_topic(awmm->local_id("save_config_as"), "Save configuration as ...", "a", "species_configs_saveload.hlp", AWM_ALL, ED4_create_saveConfigurationAs_window);
1407  awmm->insert_menu_topic(awmm->local_id("load_config"), "Load configuration ...", "L", "species_configs_saveload.hlp", AWM_ALL, ED4_create_loadConfiguration_window);
1408  awmm->insert_menu_topic("reload_config", "Reload configuration", "R", "species_configs_saveload.hlp", AWM_ALL, ED4_reloadConfiguration);
1409  insert_macro_menu_entry(awmm, true);
1410  awmm->sep______________();
1411  // keep the following entries in sync with ../NTREE/NT_extern.cxx@common_save_menu_entries
1412  awmm->insert_menu_topic("save_changes", "Quicksave changes", "c", "save.hlp", AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NT:save_changes"));
1413  awmm->insert_menu_topic("save_all_as", "Save whole database as ...", "w", "save.hlp", AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NT:save_all_as"));
1414 #if defined(DEBUG)
1415  awmm->sep______________();
1416  awmm->insert_menu_topic("deb1", "[DEBUG] remote: invalid app", "D", NULp, AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NTREE:aljdlaisjdlad"));
1417  awmm->insert_menu_topic("deb2", "[DEBUG] remote: invalid cmd", "E", NULp, AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NT:aljdlaisjdlad"));
1418 #endif
1419  awmm->sep______________();
1420  GDE_load_menu(awmm, AWM_ALL, "Print");
1421  awmm->sep______________();
1422 
1423  if (clone) awmm->insert_menu_topic("close", "CLOSE", "C", NULp, AWM_ALL, ED4_quit_editor);
1424  else awmm->insert_menu_topic("quit", "QUIT", "Q", NULp, AWM_ALL, ED4_quit_editor);
1425 
1426  // ----------------
1427  // Create
1428 
1429  awmm->create_menu("Create", "C", AWM_ALL);
1430  awmm->insert_menu_topic(awmm->local_id("create_species"), "Create new species", "n", NULp, AWM_ALL, makeCreateWindowCallback(ED4_create_new_seq_window, CREATE_NEW_SPECIES));
1431  awmm->insert_menu_topic(awmm->local_id("create_species_from_consensus"), "Create new species from consensus", "u", NULp, AWM_ALL, makeCreateWindowCallback(ED4_create_new_seq_window, CREATE_FROM_CONSENSUS));
1432  awmm->insert_menu_topic(awmm->local_id("copy_species"), "Copy current species", "C", NULp, AWM_ALL, makeCreateWindowCallback(ED4_create_new_seq_window, COPY_SPECIES));
1433  awmm->sep______________();
1434  awmm->insert_menu_topic("create_group", "Create new Group (from selected)", "G", NULp, AWM_ALL, makeWindowCallback(group_species_cb, false));
1435  awmm->insert_menu_topic("create_groups_by_field", "Create new groups using Field", "F", NULp, AWM_ALL, makeWindowCallback(group_species_cb, true));
1436 
1437  // --------------
1438  // Edit
1439 
1440  awmm->create_menu("Edit", "E", AWM_ALL);
1441  awmm->insert_menu_topic("refresh", "Refresh [Ctrl-L]", "f", NULp, AWM_ALL, makeWindowCallback(ED4_request_full_refresh));
1442  awmm->insert_menu_topic("load_current", "Load current species [GET]", "G", "e4_get_species.hlp", AWM_ALL, makeWindowCallback(ED4_get_and_jump_to_current));
1443  awmm->insert_menu_topic("load_marked", "Load marked species", "m", "e4_get_species.hlp", AWM_ALL, makeWindowCallback(ED4_get_marked_from_menu));
1444  awmm->insert_menu_topic(awmm->local_id("load_SAI"), "Load SAI ...", "L", "e4_get_species.hlp", AWM_ALL, ED4_create_loadSAI_window);
1445  awmm->sep______________();
1446  awmm->insert_menu_topic("refresh_ecoli", "Reload Ecoli sequence", "E", "ecoliref.hlp", AWM_ALL, makeWindowCallback(reload_ecoli_cb));
1447  awmm->insert_menu_topic("refresh_helix", "Reload Helix", "H", "helix.hlp", AWM_ALL, makeWindowCallback(reload_helix_cb));
1448  awmm->insert_menu_topic("helix_jump_opposite", "Jump helix opposite [Ctrl-J]", "J", NULp, AWM_ALL, ED4_helix_jump_opposite);
1449  awmm->sep______________();
1450 
1451  awmm->insert_sub_menu("Set protection of current ", "p");
1452  {
1453  char macro[] = "to_0",
1454  topic[] = ".. to 0",
1455  hotkey[] = "0";
1456 
1457  for (char i='0'; i<='6'; i++) {
1458  macro[3] = topic[6] = hotkey[0] = i;
1459  awmm->insert_menu_topic(macro, topic, hotkey, "security.hlp", AWM_ALL, makeWindowCallback(ED4_set_protection, i-'0'));
1460  }
1461  }
1462  awmm->close_sub_menu();
1463 
1464  awmm->sep______________();
1465  awmm->insert_menu_topic(awmm->local_id("fast_aligner"), INTEGRATED_ALIGNERS_TITLE, "I", "faligner.hlp", AWM_ALL, makeCreateWindowCallback(ED4_create_faligner_window, ED4_get_aligner_data_access()));
1466  awmm->insert_menu_topic("fast_align_set_ref", "Set aligner reference [Ctrl-R]", "R", "faligner.hlp", AWM_ALL, RootAsWindowCallback::simple(FastAligner_set_reference_species));
1467  awmm->insert_menu_topic(awmm->local_id("align_sequence"), "Old aligner from ARB_EDIT [broken]", "O", "ne_align_seq.hlp", AWM_DISABLED, makeCreateWindowCallback(create_naligner_window, get_gb_main()));
1468  awmm->insert_menu_topic("sina", "SINA (SILVA Incremental Aligner)", "S", "sina_main.hlp", sina_mask(aw_root), makeWindowCallback(show_sina_window, ED4_get_aligner_data_access()));
1469  awmm->insert_menu_topic("del_ali_tmp", "Remove all aligner Entries", "v", NULp, AWM_ALL, makeWindowCallback(ED4_remove_faligner_entries));
1470  awmm->sep______________();
1471  awmm->insert_menu_topic("missing_bases", "Dot potentially missing bases", "D", "missbase.hlp", AWM_EXP, ED4_popup_dot_missing_bases_window);
1472 
1473  if (alignment_type == GB_AT_RNA) { // if the database contains valid alignment of rRNA sequences
1474  awmm->sep______________();
1475  awmm->insert_menu_topic("sec_edit", "Edit secondary structure", "c", "arb_secedit.hlp", AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "SECEDIT"));
1476 #if defined(ARB_OPENGL)
1477  awmm->insert_menu_topic("rna3d", "View 3D molecule", "3", "rna3d_general.hlp", AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "RNA3D"));
1478 #endif // ARB_OPENGL
1479 #if defined(DEBUG)
1480  awmm->insert_menu_topic("noplugin", "DEBUG: call unknown plugin", "u", NULp, AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "testplugin"));
1481 #endif // DEBUG
1482  }
1483 
1484  // --------------
1485  // View
1486 
1487  awmm->create_menu("View", "V", AWM_ALL);
1488  awmm->insert_sub_menu("Search", "S");
1489  {
1490  int s;
1491  const char *hotkeys = "12Poiclrg";
1492  char hotkey[] = "_";
1493 
1494  e4_assert(strlen(hotkeys) == SEARCH_PATTERNS);
1495 
1496  for (s=0; s<SEARCH_PATTERNS; s++) {
1498  const char *id = ED4_SearchPositionTypeId[type];
1499  int len = strlen(id);
1500  char *macro_name = GB_give_buffer(2*(len+8));
1501  char *menu_entry_name = macro_name+(len+8);
1502 
1503 #ifndef NDEBUG
1504  memset(macro_name, 0, 2*(len+8)); // to avoid memchk-warning
1505 #endif
1506  sprintf(macro_name, "%s_SEARCH", id);
1507  char *p = macro_name;
1508  while (1) {
1509  char c = *p++;
1510  if (!c) break;
1511  p[-1] = toupper(c);
1512  }
1513  sprintf(menu_entry_name, "%s Search", id);
1514 
1515  hotkey[0] = hotkeys[s];
1516  awmm->insert_menu_topic(awmm->local_id(macro_name), menu_entry_name, hotkey, "e4_search.hlp", AWM_ALL, makeWindowCallback(ED4_popup_search_window, type));
1517  }
1518  }
1519  awmm->close_sub_menu();
1520  awmm->sep______________();
1521  awmm->insert_sub_menu("Cursor position ", "p");
1522  awmm->insert_menu_topic("store_curpos", "Store cursor position", "S", NULp, AWM_ALL, ED4_store_curpos);
1523  awmm->insert_menu_topic("restore_curpos", "Restore cursor position ", "R", NULp, AWM_ALL, ED4_restore_curpos);
1524  awmm->insert_menu_topic("clear_curpos", "Clear stored positions", "C", NULp, AWM_ALL, makeWindowCallback(ED4_clear_stored_curpos));
1525  awmm->close_sub_menu();
1526 
1527  awmm->sep______________();
1528  awmm->insert_menu_topic("change_cursor", "Change cursor type", "t", NULp, AWM_ALL, ED4_change_cursor);
1529  awmm->insert_menu_topic(awmm->local_id("view_diff"), "View differences ...", "V", "viewdiff.hlp", AWM_ALL, ED4_create_viewDifferences_window);
1530  awmm->sep______________();
1531  awmm->insert_menu_topic("enable_col_stat", "Activate column statistics", "A", "st_ml.hlp", AWM_EXP, ED4_activate_col_stat);
1532  awmm->insert_menu_topic("disable_col_stat", "Disable column statistics", "i", "st_ml.hlp", AWM_EXP, ED4_disable_col_stat);
1533  awmm->insert_menu_topic("detail_col_stat", "Toggle detailed Col.-Stat.", "C", "st_ml.hlp", AWM_EXP, ED4_toggle_detailed_column_stats);
1534  awmm->insert_menu_topic("dcs_threshold", "Set threshold for D.c.s.", "f", "st_ml.hlp", AWM_EXP, makeWindowCallback(ED4_set_col_stat_threshold));
1535  awmm->sep______________();
1536  awmm->insert_menu_topic(awmm->local_id("visualize_SAI"), "Visualize SAIs", "z", "visualizeSAI.hlp", AWM_ALL, ED4_createVisualizeSAI_window);
1537  awmm->insert_menu_topic("toggle_saisec", "Toggle secondary info for SAI", "o", "toggle_secinfo.hlp", AWM_ALL, toggle_helix_for_SAI);
1538 
1539  // Enable ProteinViewer only for DNA sequence type
1540  if (alignment_type == GB_AT_DNA) {
1541  awmm->insert_menu_topic(awmm->local_id("Protein_Viewer"), "Protein Viewer", "w", "proteinViewer.hlp", AWM_ALL, ED4_CreateProteinViewer_window);
1542  }
1543 
1544  // ---------------
1545  // Block
1546 
1547  awmm->create_menu("Block", "B", AWM_ALL);
1548 
1549  awmm->insert_menu_topic("select_marked", "Highlight marked species", "e", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_SELECT_MARKED));
1550  awmm->insert_menu_topic("deselect_marked", "De-highlight marked species", "k", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_DESELECT_MARKED));
1551  awmm->insert_menu_topic("select_all", "Highlight all species", "s", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_ALL));
1552  awmm->insert_menu_topic("deselect_all", "De-highlight all species", "D", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_NONE));
1553  awmm->sep______________();
1554  awmm->insert_menu_topic("mark_selected", "Mark highlighted species", "M", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_MARK_SELECTED));
1555  awmm->insert_menu_topic("unmark_selected", "Unmark highlighted species", "n", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_UNMARK_SELECTED));
1556  awmm->insert_menu_topic("unmark_all", "Unmark all species", "U", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_UNMARK_ALL));
1557  awmm->sep______________();
1558  awmm->insert_menu_topic("invert_all", "Invert highlighted species", "I", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_INVERT));
1559  awmm->insert_menu_topic("invert_group", "Invert group", "g", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_INVERT_GROUP));
1560  awmm->sep______________();
1561  awmm->insert_menu_topic("lowcase", "Change to lower case ", "w", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_LOWER_CASE));
1562  awmm->insert_menu_topic("upcase", "Change to upper case", "p", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UPPER_CASE));
1563  awmm->sep______________();
1564  awmm->insert_menu_topic("reverse", "Reverse highlighted ", "v", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_REVERSE));
1565  awmm->insert_menu_topic("complement", "Complement highlighted ", "o", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_COMPLEMENT));
1566  awmm->insert_menu_topic("reverse_complement", "Reverse complement", "t", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_REVERSE_COMPLEMENT));
1567  awmm->sep______________();
1568  awmm->insert_menu_topic("unalignBlockLeft", "Unalign block left", "a", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_LEFT));
1569  awmm->insert_menu_topic("unalignBlockCenter", "Unalign block center", "c", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_CENTER));
1570  awmm->insert_menu_topic("unalignBlockRight", "Unalign block right", "b", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_RIGHT));
1571  awmm->sep______________();
1572  awmm->insert_menu_topic(awmm->local_id("replace"), "Search & Replace ", "h", "e4_replace.hlp", AWM_ALL, ED4_create_replace_window);
1573  awmm->insert_menu_topic(awmm->local_id("setsai"), "Modify SAI ", "y", "e4_modsai.hlp", AWM_ALL, ED4_create_modsai_window);
1574  awmm->sep______________();
1575  awmm->insert_menu_topic("toggle_block_type", "Exchange: Line<->Column", "x", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_TOGGLE_BLOCKTYPE));
1576  awmm->insert_menu_topic("shift_left", "Shift block left ", "l", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_SHIFT_LEFT));
1577  awmm->insert_menu_topic("shift_right", "Shift block right", "r", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_SHIFT_RIGHT));
1578 
1579  // --------------------
1580  // Properties
1581 
1582  awmm->create_menu("Properties", "P", AWM_ALL);
1583 
1584  awmm->insert_menu_topic(awmm->local_id("props_frame"), "Frame settings ...", "g", NULp, AWM_ALL, AW_preset_window);
1585  awmm->insert_menu_topic(awmm->local_id("props_options"), "Editor Options ", "O", "e4_options.hlp", AWM_ALL, ED4_create_editor_options_window);
1586  awmm->insert_menu_topic(awmm->local_id("props_consensus"), "Consensus Definition ", "u", "e4_consensus.hlp", AWM_ALL, ED4_create_consensus_definition_window);
1587  awmm->sep______________();
1588 
1589  awmm->insert_menu_topic("props_data", "Change Colors & Fonts ", "C", NULp, AWM_ALL, makeWindowCallback (ED4_popup_gc_window, first_gc_manager));
1590  awmm->insert_menu_topic(awmm->local_id("props_seq_colors"), "Sequence color mapping", "S", "sequence_colors.hlp", AWM_ALL, makeCreateWindowCallback(ED4_create_seq_colors_window, sequence_colors));
1591 
1592  awmm->sep______________();
1593 
1594  awmm->insert_menu_topic(awmm->local_id("props_nds"), "Select visible info (NDS) ", "D", "ed4_nds.hlp", AWM_ALL, ED4_create_nds_window);
1595  awmm->insert_menu_topic(awmm->local_id("props_flags"), "Select species flags", "f", "ed4_flags.hlp", AWM_ALL, makeCreateWindowCallback(ED4_configure_species_flags, gb_main));
1596  {
1597  static WindowCallback reqRelCb = makeWindowCallback(ED4_request_relayout);
1598  if (alignment_type == GB_AT_AA) awmm->insert_menu_topic(awmm->local_id("props_pfold"), "Protein Match Settings ", "P", "pfold_props.hlp", AWM_ALL, makeCreateWindowCallback(ED4_pfold_create_props_window, &reqRelCb));
1599  else awmm->insert_menu_topic(awmm->local_id("props_helix_sym"), "Helix Settings ", "H", "helixsym.hlp", AWM_ALL, makeCreateWindowCallback(create_helix_props_window, &reqRelCb));
1600  }
1601  awmm->insert_menu_topic(awmm->local_id("props_key_map"), "Key Mappings ", "K", "nekey_map.hlp", AWM_ALL, create_key_map_window);
1602 
1603  awmm->sep______________();
1605  awmm->sep______________();
1606  awmm->insert_sub_menu("Save properties ...", "a");
1607  {
1608  static const char * const tag[] = { "save_alispecific_props", "save_alitype_props", "save_props" };
1609  static const char * const entry_type[] = { "alignment specific ", "ali-type specific ", "" };
1610 
1611  // check what is the default mode
1612  int default_mode = -1;
1613  for (int mode = 0; mode <= 2; ++mode) {
1614  if (strcmp(GB_path_in_arbprop(propertyName(gb_main, mode)), db_name) == 0) {
1615  default_mode = mode;
1616  break;
1617  }
1618  }
1619  if (default_mode == -1) default_mode = 2; // no properties yet -> use 'edit4.arb'
1620 
1621  const char *entry = GBS_global_string("Save loaded Properties (%s)", propertyName(gb_main, default_mode));
1622  awmm->insert_menu_topic("save_loaded_props", entry, "l", "e4_defaults.hlp", AWM_ALL, makeWindowCallback(ED4_save_properties, default_mode));
1623  awmm->sep______________();
1624 
1625  for (int mode = 2; mode >= 0; --mode) {
1626  char hotkey[] = "x";
1627  hotkey[0] = "Pta"[mode];
1628  entry = GBS_global_string("Save %sProperties (%s)", entry_type[mode], propertyName(gb_main, mode));
1629  awmm->insert_menu_topic(tag[mode], entry, hotkey, "e4_defaults.hlp", AWM_ALL, makeWindowCallback(ED4_save_properties, mode));
1630  }
1631  }
1632  awmm->close_sub_menu();
1633 
1634  awmm->insert_help_topic("ARB_EDIT4 help", "E", "e4.hlp", AWM_ALL, makeHelpCallback("e4.hlp"));
1635 
1636  // ----------------------------------------------------------------------------------------------------
1637 
1638  aw_root->awar_int(AWAR_EDIT_TITLE_MODE)->add_callback(makeRootCallback(title_mode_changed, static_cast<AW_window*>(awmm)));
1639  awmm->set_bottom_area_height(0); // No bottom area
1640 
1641  awmm->auto_space(5, -2);
1642  awmm->shadow_width(3);
1643 
1644  int db_pathx, db_pathy;
1645  awmm->get_at_position(&db_pathx, &db_pathy);
1646 
1647  awmm->shadow_width(1);
1648  awmm->load_xfig("edit4/editmenu.fig", false);
1649 
1650  // --------------------------
1651  // help /quit /fold
1652 
1653  awmm->button_length(0);
1654 
1655  awmm->at("quit");
1656  awmm->callback(ED4_quit_editor);
1657  awmm->help_text("quit.hlp");
1658 
1659  if (clone) awmm->create_button("CLOSE", "#close.xpm");
1660  else awmm->create_button("QUIT", "#quit.xpm");
1661 
1662  awmm->at("help");
1664  awmm->help_text("e4.hlp");
1665  awmm->create_button("HELP", "#help.xpm");
1666 
1667  awmm->at("fold");
1668  awmm->help_text("e4.hlp");
1669  awmm->create_toggle(AWAR_EDIT_TITLE_MODE, "#more.xpm", "#less.xpm");
1670 
1671  // -------------------
1672  // positions
1673 
1674  awmm->button_length(0);
1675 
1676  awmm->at("posTxt"); awmm->create_button(NULp, "Position");
1677 
1678  awmm->button_length(6+1);
1679 
1680  awmm->at("ecoliTxt"); awmm->create_button(NULp, ED4_AWAR_NDS_ECOLI_NAME, NULp, "+");
1681 
1682  awmm->button_length(0);
1683 
1684  awmm->at("baseTxt"); awmm->create_button(NULp, "Base");
1685  awmm->at("iupacTxt"); awmm->create_button(NULp, "IUPAC");
1686  awmm->at("helixnrTxt"); awmm->create_button(NULp, "Helix#");
1687 
1688  awmm->at("pos");
1689  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_cursor, ED4_POS_SEQUENCE)); // @@@ used as INPUTFIELD_CB (see #559)
1690  awmm->create_input_field(current_ed4w()->awar_path_for_cursor, 7);
1691 
1692  awmm->at("ecoli");
1693  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_Ecoli, ED4_POS_ECOLI)); // @@@ used as INPUTFIELD_CB (see #559)
1694  awmm->create_input_field(current_ed4w()->awar_path_for_Ecoli, 6);
1695 
1696  awmm->at("base");
1697  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_basePos, ED4_POS_BASE)); // @@@ used as INPUTFIELD_CB (see #559)
1698  awmm->create_input_field(current_ed4w()->awar_path_for_basePos, 6);
1699 
1700  awmm->at("iupac");
1701  awmm->callback(makeWindowCallback(ED4_set_iupac, current_ed4w()->awar_path_for_IUPAC)); // @@@ used as INPUTFIELD_CB (see #559)
1702  awmm->create_input_field(current_ed4w()->awar_path_for_IUPAC, 4);
1703 
1704  awmm->at("helixnr");
1705  awmm->callback(makeWindowCallback(ED4_set_helixnr, current_ed4w()->awar_path_for_helixNr)); // @@@ used as INPUTFIELD_CB (see #559)
1706  awmm->create_input_field(current_ed4w()->awar_path_for_helixNr, 5);
1707 
1708  // ----------------------------
1709  // jump/get/undo/redo
1710 
1711  awmm->button_length(4);
1712 
1713  awmm->at("jump");
1715  awmm->help_text("e4_get_species.hlp");
1716  awmm->create_button("JUMP", "Jump");
1717 
1718  awmm->at("get");
1719  awmm->callback(makeWindowCallback(ED4_get_and_jump_to_current));
1720  awmm->help_text("e4_get_species.hlp");
1721  awmm->create_button("GET", "Get");
1722 
1723  awmm->button_length(0);
1724 
1725  awmm->at("undo");
1726  awmm->callback(makeWindowCallback(ED4_undo_redo, GB_UNDO_UNDO));
1727  awmm->help_text("undo.hlp");
1728  awmm->create_button("UNDO", "#undo.xpm");
1729 
1730  awmm->at("redo");
1731  awmm->callback(makeWindowCallback(ED4_undo_redo, GB_UNDO_REDO));
1732  awmm->help_text("undo.hlp");
1733  awmm->create_button("REDO", "#redo.xpm");
1734 
1735  // --------------------------
1736  // aligner / SAIviz
1737 
1738  awmm->button_length(7);
1739 
1740  awmm->at("aligner");
1741  awmm->callback(makeCreateWindowCallback(ED4_create_faligner_window, ED4_get_aligner_data_access()));
1742  awmm->help_text("faligner.hlp");
1743  awmm->create_button("ALIGNER", "Aligner");
1744 
1745  awmm->at("saiviz");
1747  awmm->help_text("visualizeSAI.hlp");
1748  awmm->create_button("SAIVIZ", "SAIviz");
1749 
1750  // -------------------------------------------
1751  // align/insert/protection/direction
1752 
1753  awmm->button_length(0);
1754 
1755  awmm->at("protect");
1757  awmm->insert_option ("0", NULp, 0);
1758  awmm->insert_option ("1", NULp, 1);
1759  awmm->insert_option ("2", NULp, 2);
1760  awmm->insert_option ("3", NULp, 3);
1761  awmm->insert_option ("4", NULp, 4);
1762  awmm->insert_option ("5", NULp, 5);
1763  awmm->insert_default_option("6", NULp, 6);
1764  awmm->update_option_menu();
1765 
1766  // draw protection icon AFTER protection!!
1767  awmm->at("pico");
1768  awmm->create_button(NULp, "#protect.xpm");
1769 
1770  // draw align/edit-button AFTER protection!!
1771  awmm->at("edit");
1772  awmm->create_toggle(AWAR_EDIT_MODE, "#edit/align.xpm", "#edit/editseq.xpm", 7);
1773 
1774  awmm->at("insert");
1775  awmm->create_text_toggle(AWAR_INSERT_MODE, "Replace", "Insert", 7);
1776 
1777  awmm->at("direct");
1778  awmm->create_toggle(AWAR_EDIT_RIGHTWARD, "#edit/3to5.xpm", "#edit/5to3.xpm", 7);
1779 
1780  // -------------------------
1781  // secedit / rna3d
1782 
1783  int xoffset = 0;
1784 
1785  if (alignment_type == GB_AT_RNA) { // if the database contains valid alignment of rRNA sequences
1786  // add buttons for RNA3D and SECEDIT plugins
1787 
1788  awmm->button_length(0);
1789 
1790  awmm->at("secedit");
1791  awmm->callback(makeWindowCallback(ED4_start_plugin, gb_main, "SECEDIT"));
1792  awmm->help_text("arb_secedit.hlp");
1793  awmm->create_button("SECEDIT", "#edit/secedit.xpm");
1794 
1795 #if defined(ARB_OPENGL)
1796  awmm->at("rna3d");
1797  awmm->callback(makeWindowCallback(ED4_start_plugin, gb_main, "RNA3D"));
1798  awmm->help_text("rna3d_general.hlp");
1799  awmm->create_button("RNA3D", "#edit/rna3d.xpm");
1800 #endif // ARB_OPENGL
1801  }
1802  else {
1803  awmm->at("secedit");
1804  int xsecedit = awmm->get_at_xposition();
1805  awmm->at("zoom");
1806  int xzoom = awmm->get_at_xposition();
1807  xoffset = xsecedit-xzoom; // shift message stuff to the left by xoffset
1808  }
1809 
1810  {
1811  int x, y;
1812 
1813  awmm->at("zoom");
1814  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1816  awmm->create_button("ZOOM", "#edit/zoom.xpm");
1817 
1818  awmm->at("clear");
1819  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1821  awmm->create_button("CLEAR", "#edit/clear.xpm");
1822 
1823  awmm->at("errortext");
1824  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1825  aw_root->awar_string(AWAR_ERROR_MESSAGES, "This is ARB Edit4 [Build " ARB_VERSION "]");
1828  }
1829 
1830  // ---------------------
1831  // 'more' area
1832 
1833  awmm->at("cons");
1834  awmm->create_toggle(ED4_AWAR_CONSENSUS_SHOW, "#edit/nocons.xpm", "#edit/cons.xpm");
1835 
1836  awmm->at("num");
1837  awmm->create_toggle(ED4_AWAR_DIGITS_AS_REPEAT, "#edit/norepeat.xpm", "#edit/repeat.xpm");
1838 
1839  awmm->at("key");
1840  awmm->create_toggle("key_mapping/enable", "#edit/nokeymap.xpm", "#edit/keymap.xpm");
1841 
1842  // search
1843 
1844  awmm->button_length(0);
1845 #define INSERT_SEARCH_FIELDS(Short, label_prefix, prefix) \
1846  insert_search_fields(awmm, \
1847  #label_prefix, \
1848  #prefix, \
1849  ED4_AWAR_##prefix##_SEARCH_PATTERN, \
1850  ED4_AWAR_##prefix##_SEARCH_SHOW, \
1851  Short, \
1852  ED4_##prefix##_PATTERN, \
1853  current_ed4w() \
1854  )
1855 
1856  INSERT_SEARCH_FIELDS(0, u1, USER1);
1857  INSERT_SEARCH_FIELDS(0, u2, USER2);
1858  INSERT_SEARCH_FIELDS(0, pro, PROBE);
1859  INSERT_SEARCH_FIELDS(1, pri1, PRIMER1);
1860  INSERT_SEARCH_FIELDS(1, pri2, PRIMER2);
1861  INSERT_SEARCH_FIELDS(1, pri3, PRIMER3);
1862  INSERT_SEARCH_FIELDS(1, sig1, SIG1);
1863  INSERT_SEARCH_FIELDS(1, sig2, SIG2);
1864  INSERT_SEARCH_FIELDS(1, sig3, SIG3);
1865 
1866 #undef INSERT_SEARCH_FIELDS
1867 
1868  awmm->at("alast");
1870  awmm->create_button("ALL_SEARCH_LAST", "#edit/last.xpm");
1871 
1872  awmm->at("anext");
1874  awmm->create_button("ALL_SEARCH_NEXT", "#edit/next.xpm");
1875 
1876  title_mode_changed(aw_root, awmm);
1877 
1878  // Buttons at left window border
1879 
1880  awmm->create_mode("edit/arrow.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_MOVE));
1881  awmm->create_mode("edit/kill.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_KILL));
1882  awmm->create_mode("edit/mark.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_MARK));
1883  awmm->create_mode("mode_info.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_INFO));
1884 
1886 
1887 #if defined(DEBUG)
1888  AWT_check_action_ids(awmm->get_root(), "");
1889 #endif
1890 
1891  announce_useraction_in(awmm);
1892 
1893  return ED4_R_OK;
1894 }
1895 
1897  // Note: other windows are generated by generate_window
1898  AW_device *device = NULp;
1899  ED4_window *new_window = NULp;
1900 
1901  generate_window(&device, &new_window);
1902 
1903  ED4_LocalWinContext uses(new_window);
1904 
1905  ED4_calc_terminal_extentions(); // (Note: done again later, but otherwise variables are used uninitialized);
1906 
1907  DRAW = 1;
1909 
1911 
1912  return new_window->aww;
1913 }
1914 
1916  // 'click_x' is the x-offset into the terminal in pixels
1917  // returns the x-offset into the terminal in base positions (clipped to max. allowed position)
1918 
1919  int length_of_char = font_group.get_width(ED4_G_SEQUENCES);
1920  ED4_index scr_pos = int((click_x-CHARACTEROFFSET) / length_of_char);
1921  int max_scrpos = root_group_man->remap()->get_max_screen_pos();
1922 
1923  if (scr_pos>max_scrpos) scr_pos = max_scrpos;
1924 
1925  return scr_pos;
1926 }
1927 
1929  char *propname = NULp;
1930 
1931  // check if edit4_?na.arb / edit4_ali_???.arb exist in $ARB_PROP
1932  for (int mode = 0; !propname && mode <= 1; ++mode) {
1933  const char *fullprop = GB_path_in_arbprop(propertyName(gb_main, mode));
1934  if (GB_is_regularfile(fullprop)) {
1935  freedup(propname, fullprop);
1936  }
1937  }
1938 
1939  // if not, use 'mode 2', i.e. "edit4.arb"
1940  // (no full path, we want to load default from arb_defaults)
1941  if (!propname) propname = ARB_strdup(propertyName(gb_main, 2));
1942 
1943  return propname;
1944 }
1945 
1947  : most_recently_used_window(NULp),
1948  cons_param(NULp),
1949  gb_main(gb_main_),
1951  db_name(detectProperties(gb_main)),
1952  aw_root(AWT_create_root(db_name, "ARB_EDIT4", need_macro_ability())),
1953  props_db(AW_ROOT_DEFAULT),
1954  first_window(NULp),
1955  main_manager(NULp),
1956  middle_area_man(NULp),
1957  top_area_man(NULp),
1958  root_group_man(NULp),
1959  highlighted_objects(new ED4_highlighted_list),
1960  folding_action(false),
1961  species_mode(ED4_SM_MOVE),
1962  ecoli_ref(NULp),
1963  alignment_type(GB_AT_UNKNOWN),
1964  reference(NULp),
1965  sequence_colors(NULp),
1966  gc_manager(NULp),
1967  st_ml(NULp),
1968  helix(NULp),
1969  helix_spacing(0),
1970  helix_add_spacing(0),
1971  terminal_add_spacing(0),
1972  protstruct(NULp),
1973  protstruct_len(0),
1974  edk(NULp),
1975  column_stat_activated(false),
1976  column_stat_initialized(false),
1977  visualizeSAI(false),
1978  visualizeSAI_allSpecies(false),
1979  loadable_SAIs(LSAI_UNUSED),
1980  temp_gc(0)
1981 {}
1982 
1983 
1985  delete aw_root;
1986  delete first_window;
1987  delete reference; // needs to be deleted before main_manager (to ensure reference callbacks are removed)
1988  delete main_manager; // also deletes middle_area_man + top_area_man
1989  delete ecoli_ref;
1990  delete highlighted_objects;
1991  delete helix;
1992  delete sequence_colors;
1993  delete edk;
1995 
1996  free(protstruct);
1997  free(db_name);
1998  free(alignment_name);
1999 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2528
bool inside_SAI_manager() const
Definition: ed4_class.hxx:1845
void insert_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
static ARB_ERROR change_char_table_length(ED4_base *base, int new_length)
Definition: ED4_root.cxx:447
static bool have_context()
Definition: ed4_class.hxx:1393
void ED4_set_iupac(AW_window *aww, const char *awar_name)
ED4_species_mode
Definition: ed4_class.hxx:1340
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:296
void FastAligner_create_variables(AW_root *root, AW_default db1)
static ARB_ERROR force_group_update(ED4_base *base)
Definition: ED4_root.cxx:528
string result
static void reload_ecoli_cb()
Definition: ED4_root.cxx:812
ED4_returncode generate_window(AW_device **device, ED4_window **new_window)
Definition: ED4_root.cxx:1308
void ED4_get_marked_from_menu(AW_window *)
Definition: ED4_cursor.cxx:683
GB_TYPES type
void group_species_cb(AW_window *aww, bool use_fields)
void calc_no_of_all(const char *string_to_scan, long *group, long *species)
AW_device * current_device()
Definition: ed4_class.hxx:1397
GB_ERROR GB_commit_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2551
static void reload_helix_cb()
Definition: ED4_root.cxx:805
char * db_name
Definition: ed4_class.hxx:1424
AW_helix * helix
Definition: ed4_class.hxx:1445
void ED4_jump_to_cursor_position(AW_window *aww, const char *awar_name, PositionType posType)
void button_length(int length)
Definition: AW_at.cxx:288
group_matcher all()
Definition: test_unit.h:1011
GB_CSTR GB_path_in_arbprop(const char *relative_path)
Definition: adsocket.cxx:1166
void special_window_refresh(bool handle_updates)
Definition: ED4_root.cxx:158
int get_at_xposition() const
Definition: AW_at.cxx:301
AW_font_group font_group
Definition: ed4_class.hxx:1467
AW_pos size[2]
Definition: ed4_defs.hxx:255
#define AWAR_EDIT_SECURITY_LEVEL
Definition: ed4_defs.hxx:92
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:537
long GB_read_int(GBDATA *gbd)
Definition: arbdb.cxx:729
#define AWAR_EDIT_TITLE_MODE
Definition: ed4_defs.hxx:105
const AW_screen_area & get_area_size() const
Definition: AW_device.cxx:57
static char * y[maxsp+1]
static ARB_ERROR ED4_delete_temp_entries(GBDATA *species, GB_CSTR alignment_name)
Definition: ED4_root.cxx:935
AW_window * ED4_pfold_create_props_window(AW_root *awr, const WindowCallback *refreshCallback)
Creates the "Protein Match Settings" window.
#define MAXWINDOWS
Definition: ed4_defs.hxx:88
ED4_area_manager * top_area_man
Definition: ed4_class.hxx:1431
void ED4_activate_col_stat(AW_window *aww)
Definition: ED4_colStat.cxx:99
bool DRAW
Definition: ED4_main.cxx:68
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:595
AW_window * create_key_map_window(AW_root *root)
Definition: AWT_map_key.cxx:77
void set_dimension(AW_pos dim)
Definition: ed4_class.hxx:310
GB_ERROR GB_append_exportedError(GB_ERROR error)
Definition: arb_msg.cxx:387
AW_window * ED4_create_modsai_window(AW_root *root)
Definition: ED4_block.cxx:985
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
int MAXNAME_WIDTH
Definition: ED4_main.cxx:56
void aw_set_local_message()
Definition: AW_status.cxx:1137
GB_ERROR GB_add_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
Definition: ad_cb.cxx:356
void request_refresh_for_all_terminals()
Definition: ED4_root.cxx:83
void update_window_coords()
Definition: ED4_window.cxx:52
long GBT_mark_all(GBDATA *gb_main, int flag)
Definition: aditem.cxx:295
virtual ARB_ERROR route_down_hierarchy(const ED4_route_cb &cb)
Definition: ED4_base.cxx:387
static bool is_named(ED4_base *base, const char *wanted_name)
Definition: ED4_root.cxx:852
MenuHighlightType
Definition: ED4_root.cxx:1086
void at(int x, int y)
Definition: AW_at.cxx:93
long
Definition: AW_awar.cxx:152
ED4_area_manager * middle_area_man
Definition: ed4_class.hxx:1430
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:808
void ED4_setBlocktype(ED4_blocktype bt)
Definition: ED4_block.cxx:364
BaseFrequencies & table()
Definition: ed4_class.hxx:1648
void ED4_request_relayout()
void ED4_search_cb(UNFIXED, int searchDescriptor, ED4_window *ed4w)
#define INTEGRATED_ALIGNERS_TITLE
ED4_returncode get_area_rectangle(AW_screen_area *rect, AW_pos x, AW_pos y)
Definition: ED4_root.cxx:753
ED4_returncode deselect_all()
Definition: ED4_root.cxx:316
char * ARB_strdup(const char *str)
Definition: arb_string.h:27
void create_toggle(const char *awar_name)
Definition: AW_button.cxx:844
void warn_illegal_dimension()
Definition: ED4_root.cxx:60
static const char * propertyName(GBDATA *gb_main, int mode)
Definition: ED4_root.cxx:1243
void change_table_length(int new_length)
Definition: chartable.cxx:1126
void set_secstruct_display(bool show)
Definition: ed4_class.hxx:2001
void GB_end_transaction_show_error(GBDATA *gbd, GB_ERROR error, void(*error_handler)(GB_ERROR))
Definition: arbdb.cxx:2584
char * GB_read_as_string(GBDATA *gbd)
Definition: arbdb.cxx:1060
long read_int() const
Definition: AW_awar.cxx:184
#define AWAR_INSERT_MODE
Definition: ed4_defs.hxx:91
static bool is_SAI_named(ED4_base *base, const char *sai_name)
Definition: ED4_root.cxx:868
void win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:361
static GBDATA * get_next_selected_species()
Definition: ED4_root.cxx:910
int slider_pos_horizontal
Definition: ed4_class.hxx:707
ST_ML * st_ml
ED4_level level
Definition: ed4_class.hxx:225
ED4_reference * reference
Definition: ed4_class.hxx:1441
static bool get_selected_range(PosRange &range)
Definition: ED4_root.cxx:899
ed_key * edk
Definition: ed4_class.hxx:1451
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
void PV_CallBackFunction(AW_root *root)
void marked_species_select(bool select)
ED4_root * ED4_ROOT
Definition: ED4_main.cxx:48
int is_species_manager() const
Definition: ed4_class.hxx:1109
void ED4_trigger_instant_refresh()
ED4_highlighted_list * highlighted_objects
Definition: ed4_class.hxx:1433
static char * alignment_name
void GBK_terminatef(const char *templat,...)
Definition: arb_msg.cxx:523
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void AW_insert_common_property_menu_entries(AW_window_menu_modes *awmm)
Definition: AW_preset.cxx:1445
#define ARB_VERSION
Definition: arb_build.h:1
void unregisterAll()
ED4_window * get_matching_ed4w(AW_window *aww)
Definition: ED4_window.cxx:107
void update_scrolled_rectangle()
Definition: ED4_window.cxx:144
size_t get_max_screen_pos() const
Definition: ed4_class.hxx:1733
void ED4_clear_stored_curpos()
AW_window * ED4_configure_species_flags(AW_root *root, GBDATA *gb_main)
Definition: ED4_flags.cxx:213
bool isNull() const
test if SmartPtr is NULp
Definition: smartptr.h:248
#define TREE_TERMINAL_WIDTH
Definition: ed4_defs.hxx:81
ED4_terminal * owner_of_cursor
Definition: ed4_class.hxx:644
void create_consensus(ED4_abstract_group_manager *upper_group_manager, arb_progress *progress)
Definition: ED4_base.cxx:569
ED4_species_name_terminal * object
Definition: ed4_defs.hxx:246
void ED4_change_cursor(AW_window *aww)
static ED4_window * insert_window(AW_window_menu_modes *new_aww)
Definition: ED4_window.cxx:395
void ED4_disable_col_stat(AW_window *)
ED4_folding_line * insert_folding_line(AW_pos pos, AW_pos dimension, ED4_properties prop)
Definition: ED4_window.cxx:97
int get_width(int gc) const
ED4_manager * parent
Definition: ed4_class.hxx:916
AW_gc_manager * gc_manager
Definition: ed4_class.hxx:1443
AW_gc_manager * AW_manage_GC(AW_window *aww, const char *gc_base_name, AW_device *device, int base_drag, AW_GCM_AREA area, const GcChangedCallback &changecb, const char *default_background_color,...)
Definition: AW_preset.cxx:969
bool in_SAI_terminal() const
Definition: ed4_class.hxx:1854
void ED4_request_full_instant_refresh()
const ED4_folding_line * get_horizontal_folding()
Definition: ed4_class.hxx:351
void ED4_request_full_refresh()
ED4_reference_terminals ref_terminals
Definition: ed4_class.hxx:1436
#define ARRAY_ELEMS(array)
Definition: arb_defs.h:19
char * protstruct
Definition: ed4_class.hxx:1449
AW_window * ED4_create_viewDifferences_window(AW_root *awr)
GBDATA * GB_get_grandfather(GBDATA *gbd)
Definition: arbdb.cxx:1728
char * GBT_get_alignment_type_string(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:858
void setNull()
set SmartPtr to NULp
Definition: smartptr.h:251
void update_option_menu()
#define ED4_AWAR_CONSENSUS_SHOW
Definition: ed4_awars.hxx:51
GB_ERROR GB_push_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2494
void activate()
Definition: aw_window.hxx:360
static ED4_highlighted_elem * curr_aligner_elem
Definition: ED4_root.cxx:908
void AW_init_color_group_defaults(const char *for_program)
Definition: AW_preset.cxx:1113
ED4_base * find_first_that(ED4_level level, const ED4_basePredicate &fulfills_predicate)
Definition: ED4_base.cxx:402
char * GBT_get_startup_alignment(GBDATA *gb_main)
Definition: adali.cxx:757
AW_window * ED4_create_new_seq_window(AW_root *root, SpeciesCreationMode creation_mode)
#define cb(action)
ED4_coords coords
Definition: ed4_class.hxx:711
#define AWAR_EDIT_RIGHTWARD
Definition: ed4_extern.hxx:76
static void gc_change_cb(GcChange whatChanged)
Definition: ED4_root.cxx:1301
#define e4_assert(bed)
Definition: ed4_class.hxx:14
const int WIDTH
void ED4_quit_editor(AW_window *aww)
int is_multi_species_manager() const
Definition: ed4_class.hxx:1101
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:231
const ED4_objspec & spec
Definition: ed4_class.hxx:914
void init(ED4_sequence_info_terminal *, ED4_sequence_terminal *, ED4_sequence_info_terminal *, ED4_columnStat_terminal *)
static ARB_ERROR do_sth_with_species(ED4_base *base, const ED4_Species_Callback *cb)
Definition: ED4_root.cxx:823
Definition: ed4_defs.hxx:245
char * detectProperties(GBDATA *gb_main)
Definition: ED4_root.cxx:1928
void world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:354
void request_refresh_for_specific_terminals(ED4_level lev)
Definition: ED4_root.cxx:87
GB_UNDO_TYPE
Definition: arbdb.h:107
bool is_consensus_manager() const
Definition: ed4_class.hxx:1835
void ED4_jump_to_current_species(AW_window *)
Definition: ED4_cursor.cxx:518
void ED4_new_editor_window(AW_window *aww)
GBDATA * GBT_find_SAI(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:177
static void insert_search_fields(AW_window_menu_modes *awmm, const char *label_prefix, const char *macro_prefix, const char *pattern_awar_name, const char *show_awar_name, int short_form, ED4_SearchPositionType type, ED4_window *ed4w)
Definition: ED4_root.cxx:1032
void ED4_popup_search_window(AW_window *aww, ED4_SearchPositionType type)
GcChange
Definition: aw_base.hxx:94
char * build_consensus_string(PosRange range) const
Definition: ed4_class.hxx:1655
ED4_level
Definition: ed4_defs.hxx:118
#define SEQUENCE_INFO_WIDTH
Definition: ed4_defs.hxx:80
ED4_species_name_terminal * ED4_find_species_name_terminal(const char *species_name)
Definition: ED4_root.cxx:876
int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:2986
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:342
void show()
Definition: AW_window.cxx:1683
void recalc_font_group()
Definition: ED4_root.cxx:514
#define ED4_AWAR_NDS_ECOLI_NAME
Definition: ed4_awars.hxx:74
void ED4_toggle_detailed_column_stats(AW_window *aww)
double AW_pos
Definition: aw_base.hxx:29
void GDE_load_menu(AW_window *awm, AW_active, const char *menulabel)
Definition: GDE.cxx:436
void aw_clear_message_cb(AW_window *aww)
Definition: AW_status.cxx:914
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
ED4_species_name_terminal * ED4_find_species_or_SAI_name_terminal(const char *species_name)
Definition: ED4_root.cxx:872
static ARB_ERROR request_terminal_refresh(ED4_base *base, ED4_level lev)
Definition: ED4_root.cxx:76
void append_member(ED4_base *new_member)
fflush(stdout)
static char * get_group_consensus(const char *species_name, PosRange range)
Definition: ED4_root.cxx:885
AW_window * ED4_create_saveConfigurationAs_window(AW_root *awr)
void FastAligner_set_reference_species(AW_root *root)
bool inside_species_seq_manager() const
Definition: ed4_class.hxx:1846
int is_abstract_group_manager() const
Definition: ed4_class.hxx:1107
ED4_window * next
Definition: ed4_class.hxx:706
ED4_returncode
Definition: ed4_defs.hxx:159
AW_window * ED4_CreateProteinViewer_window(AW_root *aw_root)
GB_ERROR ED4_pfold_set_SAI(char **protstruct, GBDATA *gb_main, const char *alignment_name, long *protstruct_len)
Sets the reference protein secondary structure SAI.
T * elem() const
Definition: ed4_list.hxx:25
void show_sina_window(UNFIXED, const AlignDataAccess *alignData)
AW_window * ED4_create_loadConfiguration_window(AW_root *awr)
void aw_popup_ok(const char *msg)
GBDATA * get_gb_main() const
Definition: ed4_class.hxx:1422
static void ED4_undo_redo(AW_window *aww, GB_UNDO_TYPE undo_type)
Definition: ED4_root.cxx:984
Generic smart pointer.
Definition: smartptr.h:149
LoadableSaiState loadable_SAIs
Definition: ed4_class.hxx:1463
void ED4_toggle_block_type()
Definition: ED4_block.cxx:365
virtual void request_refresh(int clear=1)=0
GB_BUFFER GB_give_buffer(size_t size)
Definition: arbdb.cxx:311
void remove_from_highlighted(ED4_species_name_terminal *object)
Definition: ED4_root.cxx:328
#define false
Definition: ureadseq.h:13
ED4_returncode add_to_highlighted(ED4_species_name_terminal *object)
Definition: ED4_root.cxx:380
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:472
ED4_window * first_window
Definition: ed4_class.hxx:1428
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
Definition: AW_preset.cxx:1373
void help_text(const char *id)
Definition: AW_window.cxx:116
static char const * macro_name
Definition: mkptypes.cxx:81
static ARB_ERROR ED4_with_all_loaded_species(const ED4_Species_Callback &cb)
Definition: ED4_root.cxx:848
int size() const
Definition: ed4_list.hxx:47
static void error(const char *msg)
Definition: mkptypes.cxx:96
void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
Definition: AW_window.cxx:2402
void STAT_destroy_ST_ML(ST_ML *&st_ml)
Definition: ST_window.cxx:113
void scan_string(ED4_multi_species_manager *parent, ED4_reference_terminals &refterms, const char *str, int *index, arb_progress &progress)
ED4_cursor cursor
Definition: ed4_class.hxx:722
AW_window * AW_preset_window(AW_root *root)
Definition: AW_preset.cxx:1920
void mark_compile_needed_force()
AW_window * ED4_create_seq_colors_window(AW_root *awr, ED4_seq_colors *sc)
GBDATA * GB_searchOrCreate_int(GBDATA *gb_container, const char *fieldpath, long default_value)
Definition: adquery.cxx:569
#define ED4_AWAR_DIGITS_AS_REPEAT
Definition: ed4_awars.hxx:27
void insert_help_topic(const char *labeli, const char *mnemonic, const char *helpText, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:569
#define that(thing)
Definition: test_unit.h:1043
void ED4_no_dangerous_modes()
Definition: ED4_root.cxx:1192
ED4_root_group_manager * root_group_man
Definition: ed4_class.hxx:1432
void announce_useraction_in(AW_window *aww)
Definition: ED4_root.cxx:372
#define CHARACTEROFFSET
Definition: ed4_defs.hxx:109
GB_alignment_type GBT_get_alignment_type(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:873
ARB_ERROR route_down_hierarchy(const ED4_route_cb &cb) FINAL_OVERRIDE
Definition: ED4_base.cxx:392
void init(const char *seq, int size)
Definition: BI_basepos.hxx:109
ED4_main_manager * main_manager
Definition: ed4_class.hxx:1429
ED4_species_name_terminal * ED4_find_SAI_name_terminal(const char *sai_name)
Definition: ED4_root.cxx:880
const T * content() const
convert SmartPtr to plain old pointer (also works if isNull())
Definition: smartptr.h:263
static void ED4_menu_perform_block_operation(AW_window *, ED4_blockoperation_type type)
Definition: ED4_root.cxx:1178
UserActionTracker * need_macro_ability()
Definition: trackers.cxx:450
GB_ERROR GB_write_security_write(GBDATA *gbd, unsigned long level)
Definition: arbdb.cxx:1584
static WindowCallback simple(void(*root_cb)(AW_root *, T), T t)
Definition: rootAsWin.h:47
static void modes_cb(AW_window *, ED4_species_mode smode)
Definition: ED4_root.cxx:1182
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GB_ERROR GB_pop_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2524
void ED4_get_and_jump_to_current(AW_window *)
Definition: ED4_cursor.cxx:672
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:645
void ED4_exit() __ATTR__NORETURN
#define INSERT_SEARCH_FIELDS(Short, label_prefix, prefix)
Definition: arbdb.h:86
ED4_scroll_links scroll_links
Definition: ed4_class.hxx:1434
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
Definition: adali.cxx:708
ED4_list_elem * next() const
Definition: ed4_list.hxx:24
AW_window * ED4_create_loadSAI_window(AW_root *awr)
GB_alignment_type alignment_type
Definition: ed4_class.hxx:1440
static char * cat(char *toBuf, const char *s1, const char *s2)
Definition: ED4_root.cxx:1022
static AW_window * ED4_zoom_message_window(AW_root *root)
Definition: ED4_root.cxx:1001
GB_ERROR GB_write_int(GBDATA *gbd, long i)
Definition: arbdb.cxx:1250
ED4_extension extension
Definition: ed4_class.hxx:924
#define is_equal_to(val)
Definition: test_unit.h:1025
AW_window * ED4_create_nds_window(AW_root *root)
Definition: ED4_nds.cxx:111
void selected_species_mark(bool mark)
ED4_blocktype ED4_getBlocktype()
Definition: ED4_block.cxx:363
void insert_default_option(AW_label choice_label, const char *mnemonic, const char *var_value, const char *name_of_color=NULp)
int TERMINAL_HEIGHT
Definition: ED4_main.cxx:50
GB_ERROR GB_undo(GBDATA *gb_main, GB_UNDO_TYPE type) __ATTR__USERESULT
Definition: adindex.cxx:755
void ED4_calc_terminal_extentions()
ED4_multi_species_manager * get_multi_species_manager() const
Definition: ed4_class.hxx:1589
AW_root * AWT_create_root(const char *properties, const char *program, UserActionTracker *user_tracker)
void copy_window_struct(ED4_window *source, ED4_window *destination)
Definition: ED4_root.cxx:798
void set_info_area_height(int height)
Definition: AW_window.cxx:796
void create_input_field(const char *awar_name, int columns=0)
Definition: AW_button.cxx:857
void ED4_popup_dot_missing_bases_window(AW_window *editor_window)
Definition: ED4_dots.cxx:234
ED4_base * search_spec_child_rek(ED4_level level)
Definition: ED4_base.cxx:434
void resize_all_requesting_childs()
Definition: ED4_root.cxx:441
void AWT_trigger_remote_action(UNFIXED, GBDATA *gb_main, const char *remote_action_spec)
void set_bottom_area_height(int height)
Definition: AW_window.cxx:801
ED4_cursor & current_cursor()
Definition: ed4_class.hxx:1400
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
long protstruct_len
Definition: ed4_class.hxx:1450
#define AWAR_EDIT_MODE
Definition: ed4_defs.hxx:90
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
#define IF_ASSERTION_USED(x)
Definition: arb_assert.h:308
int MAXSEQUENCECHARACTERLENGTH
Definition: ED4_main.cxx:55
void ED4_init_notFoundMessage()
Definition: ED4_cursor.cxx:566
GB_ERROR close(GB_ERROR error)
Definition: arbdbpp.cxx:35
void AW_help_entry_pressed(AW_window *aww)
Definition: AW_root.cxx:37
static ARB_ERROR request_sequence_refresh(ED4_base *base, bool consensi)
Definition: ED4_root.cxx:92
ED4_root(GBDATA *gb_main_)
Definition: ED4_root.cxx:1946
void ED4_restore_curpos(AW_window *aww)
#define AWAR_ERROR_MESSAGES
static void title_mode_changed(AW_root *aw_root, AW_window *aww)
Definition: ED4_root.cxx:973
void ED4_store_curpos(AW_window *aww)
bool has_elem(const T *elem) const
Definition: ed4_list.hxx:98
AW_window * FastAligner_create_window(AW_root *root, const AlignDataAccess *data_access)
void GB_touch(GBDATA *gbd)
Definition: arbdb.cxx:2802
const ED4_folding_line * get_next() const
Definition: ed4_class.hxx:306
void ED4_popup_gc_window(AW_window *awp, AW_gc_manager *gcman)
Definition: ED4_root.cxx:1284
int ED4_encodeSearchDescriptor(int direction, ED4_SearchPositionType pattern)
Definition: ed4_search.hxx:50
ARB_ERROR FastAligner_delete_temp_entries(GBDATA *gb_species, const char *alignment)
AW_window * create_naligner_window(AW_root *root, GBDATA *gb_main)
static char * get_helix_string(GBDATA *gb_main, const char *alignment_name)
Definition: ED4_root.cxx:1198
const char * get_alignment_name() const
Definition: ed4_class.hxx:1458
char * GB_read_string(GBDATA *gbd)
Definition: arbdb.cxx:909
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:416
ED4_window * current_ed4w()
Definition: ed4_class.hxx:1398
BI_ecoli_ref * ecoli_ref
Definition: ed4_class.hxx:1439
ED4_seq_colors * sequence_colors
Definition: ed4_class.hxx:1442
void registerFont(AW_device *device_, int gc, const char *chars=NULp)
DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_Species_Callback, ARB_ERROR, GBDATA *)
AW_root * aw_root
Definition: ed4_class.hxx:1425
int slider_pos_vertical
Definition: ed4_class.hxx:708
void close_sub_menu()
Definition: AW_window.cxx:486
void ED4_resize_all_extensions()
static bool is_species_named(ED4_base *base, const char *species_name)
Definition: ED4_root.cxx:864
ED4_list_elem< T > * head() const
Definition: ed4_list.hxx:45
static void ED4_set_protection(AW_window *aww, int wanted_protection)
Definition: ED4_root.cxx:1063
bool ok() const
Definition: chartable.cxx:1148
void ED4_reloadConfiguration(AW_window *aww)
ED4_returncode set_scrolled_rectangle(ED4_base *x_link, ED4_base *y_link, ED4_base *width_link, ED4_base *height_link)
Definition: ED4_window.cxx:183
void request_refresh(int clear=1) FINAL_OVERRIDE
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
void select_all(bool only_species)
void ED4_set_helixnr(AW_window *aww, const char *awar_name)
AW_option_menu_struct * create_option_menu(const char *awar_name)
ED4_index pixel2pos(AW_pos click_x)
Definition: ED4_root.cxx:1915
void AW_save_specific_properties(AW_window *aw, const char *filename)
Definition: AW_preset.cxx:1448
void insert_macro_menu_entry(AW_window *awm, bool prepend_separator)
Definition: macro_gui.cxx:171
AW_window * ED4_createVisualizeSAI_window(AW_root *aw_root)
AW_root * get_root()
Definition: aw_window.hxx:354
static void ED4_remove_faligner_entries()
Definition: ED4_root.cxx:939
AW_window * create_helix_props_window(AW_root *awr, const WindowCallback *refreshCallback)
Definition: AW_helix.cxx:186
char * GBT_get_default_helix(GBDATA *)
Definition: adtools.cxx:64
ED4_returncode refresh_all_windows(bool redraw)
Definition: ED4_root.cxx:168
long max_seq_terminal_length
Definition: ED4_main.cxx:65
bool ED4_get_highlighted_range(ED4_terminal *term, PosRange &range)
Definition: ED4_block.cxx:355
AW_window_simple * win
#define NULp
Definition: cxxforward.h:114
AW_window * create_first_window()
Definition: ED4_root.cxx:1896
bool GB_is_regularfile(const char *path)
Definition: arb_file.cxx:76
static void ED4_save_properties(AW_window *aw, int mode)
Definition: ED4_root.cxx:1280
void create_text_toggle(const char *var_name, const char *noText, const char *yesText, int buttonWidth=0)
Definition: AW_button.cxx:833
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:139
static void ED4_menu_highlight(AW_window *aww, MenuHighlightType hilight)
Definition: ED4_root.cxx:1099
const ED4_remap * remap() const
Definition: ed4_class.hxx:1781
ED4_blockoperation_type
Definition: ed4_block.hxx:22
static GBDATA * get_first_selected_species(int *total_no_of_selected_species)
Definition: ED4_root.cxx:918
AW_default props_db
Definition: ed4_class.hxx:1426
void request_refresh_for_sequence_terminals()
Definition: ED4_root.cxx:106
static AW_window * ED4_create_faligner_window(AW_root *awr, const AlignDataAccess *data_access)
Definition: ED4_root.cxx:1230
void ED4_saveConfiguration(AW_window *aww, bool hide_aww)
void sep______________()
Definition: AW_window.cxx:753
bool is_hidden
Definition: ed4_class.hxx:721
ED4_species_mode species_mode
Definition: ed4_class.hxx:1437
static int no_of_windows
Definition: ed4_class.hxx:713
const char * local_id(const char *id) const
Definition: AW_window.cxx:747
void remove_elem(const T *elem)
Definition: ed4_list.hxx:75
void ED4_correctBlocktypeAfterModification()
Definition: ED4_block.cxx:366
void ED4_start_plugin(AW_window *aw, GBDATA *gb_main, const char *pluginname)
#define is_more_or_equal(val)
Definition: test_unit.h:1035
AW_window_menu_modes * aww
Definition: ed4_class.hxx:705
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:133
ED4_returncode create_hierarchy(const char *area_string_middle, const char *area_string_top)
Definition: ED4_root.cxx:535
const AlignDataAccess * ED4_get_aligner_data_access()
Definition: ED4_root.cxx:1213
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
Definition: arbdb.cxx:904
GBDATA * gb_main
Definition: adname.cxx:32
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
void prepend_elem(T *elem)
Definition: ed4_list.hxx:62
ED4_SearchPositionType
Definition: ed4_search.hxx:34
void request_refresh_for_consensus_terminals()
Definition: ED4_root.cxx:103
GBDATA * GBT_get_SAI_data(GBDATA *gb_main)
Definition: aditem.cxx:154
int is_terminal() const
Definition: ed4_class.hxx:1076
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
ARB_ERROR init_alignment()
Definition: ED4_root.cxx:491
void shadow_width(int shadow_thickness)
Definition: AW_window.cxx:1078
GB_CB_TYPE
Definition: arbdb_base.h:46
int get_max_height() const
int MAXINFO_WIDTH
Definition: ED4_main.cxx:57
AW_window * ED4_create_consensus_definition_window(AW_root *root)
ED4_manager * get_parent(ED4_level lev) const
Definition: ed4_class.hxx:1821
void ED4_helix_jump_opposite(AW_window *aww)
GB_ERROR init(GBDATA *gb_main)
Definition: BI_helix.cxx:306
static void toggle_helix_for_SAI(AW_window *aww)
Definition: ED4_root.cxx:946
AW_window * ED4_create_replace_window(AW_root *root)
Definition: ED4_block.cxx:695
AW_window * ED4_create_editor_options_window(AW_root *root)
static ED4_WinContext current_context
Definition: ed4_class.hxx:1383
void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE gbtype)
Definition: ED4_root.cxx:455
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
void ED4_set_col_stat_threshold()
const char * ED4_SearchPositionTypeId[SEARCH_PATTERNS+1]
Definition: ED4_search.cxx:35
long ED4_index
Definition: ed4_defs.hxx:113
void ED4_perform_block_operation(ED4_blockoperation_type operationType)
Definition: ED4_block.cxx:892
ST_ML * st_ml
Definition: ed4_class.hxx:1444
void create_text_field(const char *awar_name, int columns=20, int rows=4)
Definition: AW_button.cxx:988
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:194
AW_active sina_mask(AW_root *awr)
Adds support for protein structure prediction, comparison of two protein secondary structures and of ...
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:448
void ED4_finish_and_show_notFoundMessage()
Definition: ED4_cursor.cxx:570
GB_write_int const char s
Definition: AW_awar.cxx:154