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_selected(ED4_species_name_terminal *name_term) { // @@@ change param to ED4_species_manager ?
329  if (name_term) {
330  if ((selected_objects->has_elem(name_term->selection_info))) {
331  selected_objects->remove_elem(name_term->selection_info);
332 
333  delete name_term->selection_info;
334  name_term->selection_info = NULp;
335  name_term->containing_species_manager()->set_selected(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_selected(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 (!(selected_objects->has_elem(name_term->selection_info))) { // object is really new to our list => calculate current extension and append it
387  name_term->selection_info = sel_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 
399  sel_info->actual_width = tmp_object->extension.size[WIDTH];
400  sel_info->actual_height = tmp_object->extension.size[HEIGHT];
401  }
402  else { // selected object is no handle => take it directly
403  sel_info->actual_width = name_term->extension.size[WIDTH];
404  sel_info->actual_height = name_term->extension.size[HEIGHT];
405  }
406 
407  sel_info->drag_old_x = 0;
408  sel_info->drag_old_y = 0;
409  sel_info->drag_off_x = 0;
410  sel_info->drag_off_y = 0;
411  sel_info->old_event_y = 0;
412 
413  sel_info->object = name_term;
414 
415  selected_objects->prepend_elem(sel_info);
416 
417  name_term->containing_species_manager()->set_selected(true);
418 
419 #ifdef DEBUG
420  GBDATA *gbd = name_term->get_species_pointer();
421 
422  if (gbd) {
423  printf("added term '%s'\n", GB_read_char_pntr(gbd));
424  }
425  else {
426  ED4_species_manager *spec_man = name_term->get_parent(LEV_SPECIES)->to_species_manager();
427  if (spec_man->is_consensus_manager()) {
428  printf("added consensus '%s'\n", name_term->id);
429  }
430  else {
431  printf("added unknown term '%s'\n", name_term->id ? name_term->id : "NULp");
432  }
433  }
434 #endif
435 
436  name_term->request_refresh();
437  ED4_sequence_terminal *seq_term = name_term->corresponding_sequence_terminal();
438  if (seq_term) seq_term->request_refresh();
439 
440  // ProtView: Refresh corresponding orf terminals
441  if (alignment_type == GB_AT_DNA) {
443  }
444 
445  ED4_multi_species_manager *multi_man = name_term->get_parent(LEV_MULTI_SPECIES)->to_multi_species_manager();
446  multi_man->invalidate_species_counters();
447 
448  return ED4_R_OK;
449  }
450 
451  return ED4_R_IMPOSSIBLE;
452 }
453 
455  while (main_manager->update_info.resize) {
456  main_manager->resize_requested_children();
457  }
458 }
459 
460 static ARB_ERROR change_char_table_length(ED4_base *base, int new_length) {
461  if (base->is_abstract_group_manager()) {
462  ED4_abstract_group_manager *group_man = base->to_abstract_group_manager();
463  group_man->table().change_table_length(new_length);
464  }
465  return NULp;
466 }
467 
468 void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE IF_ASSERTION_USED(gbtype)) { // callback from database
469  e4_assert(gbtype==GB_CB_CHANGED);
470  int new_length = GB_read_int(gb_alignment_len);
471 
472 #if defined(DEBUG) && 1
473  printf("alignment_length_changed from %i to %i\n", MAXSEQUENCECHARACTERLENGTH, new_length);
474 #endif
475 
476  if (MAXSEQUENCECHARACTERLENGTH!=new_length) { // otherwise we already did this (i.e. we were called by changed_by_database)
477  bool was_increased = new_length>MAXSEQUENCECHARACTERLENGTH;
478 
479  MAXSEQUENCECHARACTERLENGTH = new_length;
480 
482  {
483  const char *err = ED4_ROOT->helix->init(gb_main); // reload helix
484  aw_message_if(err);
485  }
486  {
487  const char *err = ED4_ROOT->ecoli_ref->init(gb_main); // reload ecoli
488  aw_message_if(err);
489  }
490 
491  if (ED4_ROOT->alignment_type == GB_AT_AA) {
492  // TODO: is this needed here?
493  const char *err = ED4_pfold_set_SAI(&ED4_ROOT->protstruct, gb_main, ED4_ROOT->alignment_name, &ED4_ROOT->protstruct_len); // reload protstruct
494  aw_message_if(err);
495  }
496 
497  if (was_increased) {
498  ED4_ROOT->main_manager->route_down_hierarchy(makeED4_route_cb(change_char_table_length, new_length)).expect_no_error();
500  }
501  }
502 }
503 
505  GB_transaction ta(gb_main);
506 
510  return GBS_global_string("You have to select a valid alignment before you can start ARB_EDIT4\n(%s)", GB_await_error());
511  }
512 
513  GBDATA *gb_alignment = GBT_get_alignment(gb_main, alignment_name);
514  if (!gb_alignment) {
515  return GBS_global_string("You can't edit without an existing alignment\n(%s)", GB_await_error());
516  }
517 
518  GBDATA *gb_alignment_len = GB_search(gb_alignment, "alignment_len", GB_FIND);
519  int alignment_length = GB_read_int(gb_alignment_len);
520  MAXSEQUENCECHARACTERLENGTH = alignment_length;
521 
522  GB_add_callback(gb_alignment_len, GB_CB_CHANGED, makeDatabaseCallback(ED4_alignment_length_changed));
523 
525 
526  return NULp;
527 }
528 
530  int font_GC[] = {
534  };
535 
537  for (unsigned i = 0; i<ARRAY_ELEMS(font_GC); ++i) {
538  ED4_MostRecentWinContext context;
539  font_group.registerFont(current_device(), font_GC[i]);
540  }
541 }
542 
544  if (base->is_multi_species_manager()) {
545  base->to_multi_species_manager()->update_requested_by_child();
546  }
547  return NULp;
548 }
549 
550 ED4_returncode ED4_root::create_hierarchy(const char *area_string_middle, const char *area_string_top) {
551  // creates internal hierarchy of editor
552 
553  long total_no_of_groups = 0;
554  long total_no_of_species = 0;
555  {
556  // count species and related info (e.g. helix) displayed in the top region (a == 0)
557  // count no of species and sais including groups in middle region (a == 1)
558 
559  const char *area_string[2] = { area_string_top, area_string_middle };
560  for (int a = 0; a<2; ++a) {
561  long group_count;
562  long species_count;
563  database->calc_no_of_all(area_string[a], &group_count, &species_count);
564 
565  total_no_of_groups += group_count;
566  total_no_of_species += species_count;
567  }
568  }
569 
570  SmartPtr<arb_progress> startup_progress = new arb_progress("EDIT4 startup");
571 
572  GB_push_transaction(gb_main);
573 
574  ecoli_ref = new BI_ecoli_ref;
575  ecoli_ref->init(gb_main);
576 
577  // [former position of ali-init-code]
578 
579  main_manager = new ED4_main_manager("Main_Manager", 0, 0, NULp); // build a test hierarchy
580  root_group_man = new ED4_root_group_manager("Root_Group_Manager", 0, 0, main_manager);
581 
582  main_manager->append_member(root_group_man);
583 
584  ED4_device_manager *device_manager = new ED4_device_manager("Device_Manager", 0, 0, root_group_man);
585  root_group_man->append_member(device_manager);
586 
587  {
588  int col_stat_term_height = 50; // @@@ Hoehe des ColumnStatistics Terminals ausrechnen
589 
591  new ED4_sequence_info_terminal("Reference_Sequence_Info_Terminal", MAXINFO_WIDTH, TERMINAL_HEIGHT, NULp),
592  new ED4_sequence_terminal ("Reference_Sequence_Terminal", 300, TERMINAL_HEIGHT, NULp, false),
593  new ED4_sequence_info_terminal("Reference_ColumnStatistics_Info_Terminal", MAXINFO_WIDTH, col_stat_term_height, NULp),
594  new ED4_columnStat_terminal ("Reference_ColumnStatistics_Terminal", 300, col_stat_term_height, NULp)
595  );
596  }
597 
598  {
599  arb_progress species_progress("Loading species", total_no_of_species);
600 
601  // ********** Top Area beginning **********
602 
603  ED4_multi_species_manager *top_multi_species_manager;
604  ED4_spacer_terminal *top_spacer_terminal;
605  ED4_spacer_terminal *top_mid_spacer_terminal;
606  ED4_spacer_terminal *top_multi_spacer_terminal_beg;
607  ED4_line_terminal *top_mid_line_terminal;
608  {
609  ED4_area_manager *top_area_manager = new ED4_area_manager("Top_Area_Manager", 0, 0, device_manager);
610  device_manager->append_member(top_area_manager);
611  top_area_man = top_area_manager;
612 
613  top_spacer_terminal = new ED4_spacer_terminal("Top_Spacer", false, 100, 10, top_area_manager);
614  top_area_manager->append_member(top_spacer_terminal);
615 
616  top_multi_species_manager = new ED4_multi_species_manager("Top_MultiSpecies_Manager", 0, 0, top_area_manager);
617  top_area_manager->append_member(top_multi_species_manager);
618 
619  top_multi_spacer_terminal_beg = new ED4_spacer_terminal("Top_Left_Spacer", false, 0, 3, top_multi_species_manager);
620  top_multi_species_manager->append_member(top_multi_spacer_terminal_beg);
621 
622  reference = new ED4_reference;
623 
624  int index = 0;
625  database->scan_string(top_multi_species_manager, ref_terminals, area_string_top, &index, species_progress);
626  GB_pop_transaction(gb_main);
627 
628  const int TOP_MID_LINE_HEIGHT = 3;
629  int TOP_MID_SPACER_HEIGHT = font_group.get_max_height()-TOP_MID_LINE_HEIGHT;
630 
631  top_mid_line_terminal = new ED4_line_terminal("Top_Mid_Line_Terminal", 0, TOP_MID_LINE_HEIGHT, device_manager); // width will be set below
632  device_manager->append_member(top_mid_line_terminal);
633 
634  top_mid_spacer_terminal = new ED4_spacer_terminal("Top_Middle_Spacer", true, 880, TOP_MID_SPACER_HEIGHT, device_manager);
635  device_manager->append_member(top_mid_spacer_terminal);
636 
637  // needed to avoid text-clipping problems:
638  main_manager->set_top_middle_spacer_terminal(top_mid_spacer_terminal);
639  main_manager->set_top_middle_line_terminal(top_mid_line_terminal);
640  }
641 
642  // ********** Middle Area beginning **********
643 
644  ED4_area_manager *middle_area_manager;
645  ED4_tree_terminal *tree_terminal;
646  ED4_multi_species_manager *mid_multi_species_manager;
647  ED4_spacer_terminal *mid_multi_spacer_terminal_beg;
648  ED4_line_terminal *mid_bot_line_terminal;
649  ED4_spacer_terminal *total_bottom_spacer;
650  {
651  middle_area_manager = new ED4_area_manager("Middle_Area_Manager", 0, 0, device_manager);
652  device_manager->append_member(middle_area_manager);
653  middle_area_man = middle_area_manager;
654 
655  tree_terminal = new ED4_tree_terminal("Tree", 2, 0, middle_area_manager);
656  middle_area_manager->append_member(tree_terminal);
657 
658  mid_multi_species_manager = new ED4_multi_species_manager("Middle_MultiSpecies_Manager", 0, 0, middle_area_manager);
659  middle_area_manager->append_member(mid_multi_species_manager);
660 
661  mid_multi_spacer_terminal_beg = new ED4_spacer_terminal("Mid_Multi_Spacer_Terminal_Beg", false, 0, 3, mid_multi_species_manager);
662  mid_multi_species_manager->append_member(mid_multi_spacer_terminal_beg);
663 
664  scroll_links.link_for_ver_slider = middle_area_manager;
665 
666  {
667  GB_transaction ta(gb_main);
668  int index = 0;
669  database->scan_string(mid_multi_species_manager, ref_terminals, area_string_middle, &index, species_progress);
670  }
671 
672  {
673  ED4_spacer_terminal *mid_bot_spacer_terminal = new ED4_spacer_terminal("Middle_Bot_Spacer_Terminal", false, 880, 10, device_manager);
674  device_manager->append_member(mid_bot_spacer_terminal);
675  }
676 
677  mid_bot_line_terminal = new ED4_line_terminal("Mid_Bot_Line_Terminal", 0, 3, device_manager); // width will be set below
678  device_manager->append_member(mid_bot_line_terminal);
679 
680  total_bottom_spacer = new ED4_spacer_terminal("Total_Bottom_Spacer_terminal", false, 0, 10000, device_manager);
681  total_bottom_spacer->clr_property(PROP_DYNA_RESIZE);
682  device_manager->append_member(total_bottom_spacer);
683  }
684 
686  const long ext_width = long(scroll_links.link_for_hor_slider->extension.size[WIDTH]);
687  const long spacer_width = ext_width + MAXNAME_WIDTH + SEQUENCE_INFO_WIDTH;
688  const long line_width = spacer_width + TREE_TERMINAL_WIDTH;
689 
690  top_multi_spacer_terminal_beg->extension.size[WIDTH] = spacer_width;
691  mid_multi_spacer_terminal_beg->extension.size[WIDTH] = spacer_width;
692  total_bottom_spacer->extension.size[WIDTH] = spacer_width;
693 
694  top_mid_line_terminal->extension.size[WIDTH] = line_width;
695  mid_bot_line_terminal->extension.size[WIDTH] = line_width;
696 
697  }
698 
699  tree_terminal->set_links(NULp, mid_multi_species_manager); // set links
700  top_spacer_terminal->set_links(tree_terminal, top_multi_species_manager);
701  top_mid_spacer_terminal->set_links(middle_area_manager, NULp);
702  total_bottom_spacer->set_links(mid_bot_line_terminal, NULp);
703 
704  species_progress.done();
705  }
706 
709 
710  main_manager->route_down_hierarchy(makeED4_route_cb(force_group_update)).expect_no_error();
711 
712  if (!scroll_links.link_for_hor_slider) { // happens when no species AND no SAI has data
713  startup_progress->done();
714  startup_progress.setNull(); // make progress disappear (otherwise prompter below is often behind progress window)
715  GB_pop_transaction(gb_main);
716 
717  aw_popup_ok(GBS_global_string("No species/SAI contains data in '%s'\nARB_EDIT4 will terminate", alignment_name));
718  ED4_exit();
719  }
720 
721  // build consensi
722  {
723  arb_progress consensi_progress("Initializing consensi", total_no_of_species+total_no_of_groups+1); // 1 is root_group_man
724 
725  root_group_man->create_consensus(root_group_man, &consensi_progress);
727  consensi_progress.done(); // if there is a "top"-group, progress increment is one to low
728  }
729 
732 
733  // calc size and display:
734 
736 
738 
739  {
742  ED4_base *width_link = x_link;
743  ED4_base *height_link = y_link;
744 
746  while (win) {
747  win->set_scrolled_rectangle(x_link, y_link, width_link, height_link);
748  win->aww->show();
750  win = win->next;
751  }
752  }
753 
756 
757 #if defined(DEBUG) && 0
758  // dump created hierarchy:
759  puts("---------------------------------------- [main_manager dump start]");
760  main_manager->dump(1);
761  puts("---------------------------------------- [main_manager dump end]");
762 #endif
763 
764  return ED4_R_OK;
765 }
766 
768  // returns win-coordinates of area (defined by folding lines) which contains position x/y
769  int x1, x2, y1, y2;
770  const AW_screen_area& area_rect = current_device()->get_area_size();
771 
772  x1 = area_rect.l;
773  for (const ED4_folding_line *flv=current_ed4w()->get_vertical_folding(); ; flv = flv->get_next()) {
774  if (flv) {
775  x2 = int(flv->get_pos()); // @@@ use AW_INT ?
776  }
777  else {
778  x2 = area_rect.r;
779  if (x1==x2) {
780  break;
781  }
782  }
783 
784  y1 = area_rect.t;
785  for (const ED4_folding_line *flh=current_ed4w()->get_horizontal_folding(); ; flh = flh->get_next()) {
786  if (flh) {
787  y2 = int(flh->get_pos()); // @@@ use AW_INT ?
788  }
789  else {
790  y2 = area_rect.b;
791  if (y1==y2) {
792  break;
793  }
794  }
795 
796  if (x1<=x && x<=x2 && y1<=y && y<=y2) {
797  rect->t = y1;
798  rect->b = y2;
799  rect->l = x1;
800  rect->r = x2;
801  return ED4_R_OK;
802  }
803  y1 = y2;
804  if (!flh) break;
805  }
806  x1 = x2;
807  if (!flv) break;
808  }
809  return ED4_R_IMPOSSIBLE; // no area contains x/y :-(
810 }
811 
813  destination->slider_pos_horizontal = source->slider_pos_horizontal;
814  destination->slider_pos_vertical = source->slider_pos_vertical;
815  destination->coords = source->coords;
816 }
817 
818 
819 static void reload_helix_cb() {
820  const char *err = ED4_ROOT->helix->init(ED4_ROOT->get_gb_main());
821  if (err) aw_message(err);
823 }
824 
825 
826 static void reload_ecoli_cb() {
827  const char *err = ED4_ROOT->ecoli_ref->init(ED4_ROOT->get_gb_main());
828  if (err) aw_message(err);
830 }
831 
832 // ---------------------------------------
833 // recursion through all species
834 
835 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_Species_Callback, ARB_ERROR, GBDATA *); // generates makeED4_Species_Callback
836 
837 static ARB_ERROR do_sth_with_species(ED4_base *base, const ED4_Species_Callback *cb) {
838  ARB_ERROR error = NULp;
839 
840  if (base->is_species_manager()) {
841  ED4_species_manager *species_manager = base->to_species_manager();
842  ED4_species_name_terminal *species_name_terminal = species_manager->search_spec_child_rek(LEV_SPECIES_NAME)->to_species_name_terminal();
843 
844  if (species_name_terminal->get_species_pointer()) {
845  char *species_name = GB_read_as_string(species_name_terminal->get_species_pointer());
846 
847  e4_assert(species_name);
848  GBDATA *species = GBT_find_species(ED4_ROOT->get_gb_main(), species_name);
849 
850  error = species
851  ? (*cb)(species)
852  : GB_append_exportedError(GBS_global_string("can't find species '%s'", species_name));
853 
854  free(species_name);
855  }
856  }
857 
858  return error;
859 }
860 
861 
862 static ARB_ERROR ED4_with_all_loaded_species(const ED4_Species_Callback& cb) {
863  return ED4_ROOT->root_group_man->route_down_hierarchy(makeED4_route_cb(do_sth_with_species, &cb));
864 }
865 
866 static bool is_named(ED4_base *base, const char *wanted_name) {
867  ED4_species_name_terminal *name_term = base->to_species_name_terminal();
868  GBDATA *gbd = name_term->get_species_pointer();
869  if (gbd) {
870  const char *name = GB_read_char_pntr(gbd);
871  e4_assert(name);
872 
873  return strcmp(name, wanted_name) == 0;
874  }
875  return false;
876 }
877 
878 static bool is_species_named(ED4_base *base, const char *species_name) {
879  return base->inside_species_seq_manager() && is_named(base, species_name);
880 }
881 
882 static bool is_SAI_named(ED4_base *base, const char *sai_name) {
883  return base->inside_SAI_manager() && is_named(base, sai_name);
884 }
885 
886 ED4_species_name_terminal *ED4_find_species_or_SAI_name_terminal(const char *species_name) {
887  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_species_named, species_name));
888  return base ? base->to_species_name_terminal() : NULp;
889 }
890 ED4_species_name_terminal *ED4_find_species_name_terminal(const char *species_name) {
891  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_species_named, species_name));
892  return base ? base->to_species_name_terminal() : NULp;
893 }
894 ED4_species_name_terminal *ED4_find_SAI_name_terminal(const char *sai_name) {
895  ED4_base *base = ED4_ROOT->root_group_man->find_first_that(LEV_SPECIES_NAME, makeED4_basePredicate(is_SAI_named, sai_name));
896  return base ? base->to_species_name_terminal() : NULp;
897 }
898 
899 static char *get_group_consensus(const char *species_name, PosRange range) {
900  ED4_species_name_terminal *name_term = ED4_find_species_name_terminal(species_name);
901  char *consensus = NULp;
902 
903  if (name_term) {
904  ED4_abstract_group_manager *group_man = name_term->get_parent(ED4_level(LEV_GROUP|LEV_ROOTGROUP))->to_abstract_group_manager();
905  if (group_man) {
906  consensus = group_man->build_consensus_string(range);
907  }
908  }
909 
910  return consensus;
911 }
912 
913 static bool get_selected_range(PosRange& range) {
915  if (listElem) {
916  ED4_sequence_terminal *seqTerm = listElem->elem()->object->corresponding_sequence_terminal();
917  return ED4_get_selected_range(seqTerm, range);
918  }
919  return false;
920 }
921 
923 
925  if (!curr_aligner_elem) return NULp;
926 
927  ED4_species_manager *specMan = curr_aligner_elem->elem()->object->containing_species_manager();
928  curr_aligner_elem = curr_aligner_elem->next();
929  return specMan->get_species_pointer();
930 }
931 
932 static GBDATA *get_first_selected_species(int *total_no_of_selected_species) {
933  int selected = ED4_ROOT->selected_objects->size();
934 
935  if (total_no_of_selected_species) {
936  *total_no_of_selected_species = selected;
937  }
938 
939  if (selected) {
940  curr_aligner_elem = ED4_ROOT->selected_objects->head();
941  }
942  else {
943  curr_aligner_elem = NULp;
944  }
945 
946  return get_next_selected_species();
947 }
948 
950  return FastAligner_delete_temp_entries(species, alignment_name);
951 }
952 
956  if (!error) error = ED4_with_all_loaded_species(makeED4_Species_Callback(ED4_delete_temp_entries, ED4_ROOT->alignment_name));
957  GB_end_transaction_show_error(gb_main, error, aw_message);
958 }
959 
960 static void toggle_helix_for_SAI(AW_window *aww) {
961  ED4_LocalWinContext uses(aww);
962  ED4_cursor *cursor = &current_cursor();
963 
964  if (cursor->in_SAI_terminal()) {
965  ED4_sequence_terminal *sai_term = cursor->owner_of_cursor->to_sequence_terminal();
966  ED4_sequence_info_terminal *sai_info_term = sai_term->parent->search_spec_child_rek(LEV_SEQUENCE_INFO)->to_sequence_info_terminal();
967 
968  GBDATA *gb_sai_data = sai_info_term->data();
969  GB_transaction ta(gb_sai_data);
970 
971  GBDATA *gb_sai = GB_get_grandfather(gb_sai_data);
972  GBDATA *gb_disp_sec = GB_searchOrCreate_int(gb_sai, "showsec", 0);
973 
974  bool show_sec = 1-bool(GB_read_int(gb_disp_sec));
975  GB_ERROR error = GB_write_int(gb_disp_sec, show_sec);
976  if (!error) {
977  sai_term->set_secstruct_display(show_sec);
978  sai_term->request_refresh();
979  }
980  if (error) aw_message(error);
981  }
982  else {
983  aw_message("Please select an SAI");
984  }
985 }
986 
987 static void title_mode_changed(AW_root *aw_root, AW_window *aww) {
988  int title_mode = aw_root->awar(AWAR_EDIT_TITLE_MODE)->read_int();
989 
990  if (title_mode==0) {
991  aww->set_info_area_height(57);
992  }
993  else {
994  aww->set_info_area_height(170);
995  }
996 }
997 
998 static void ED4_undo_redo(AW_window *aww, GB_UNDO_TYPE undo_type) {
999  ED4_LocalWinContext uses(aww);
1000 
1002  GB_ERROR error = GB_undo(gb_main, undo_type);
1003 
1004  if (error) {
1005  aw_message(error);
1006  }
1007  else {
1008  GB_begin_transaction(gb_main);
1009  GB_commit_transaction(gb_main);
1010  ED4_cursor *cursor = &current_cursor();
1011  if (cursor->owner_of_cursor) cursor->owner_of_cursor->request_refresh();
1012  }
1013 }
1014 
1016  AW_window_simple *aws = new AW_window_simple;
1017 
1018  aws->init(root, "ZOOM_ERR_MSG", "Errors and warnings");
1019  aws->load_xfig("edit4/message.fig");
1020 
1021  aws->callback(AW_POPDOWN);
1022  aws->at("hide");
1023  aws->create_button("HIDE", "HIDE");
1024 
1025  aws->callback(aw_clear_message_cb);
1026  aws->at("clear");
1027  aws->create_button("CLEAR", "CLEAR");
1028 
1029  aws->at("errortext");
1030  aws->create_text_field(AWAR_ERROR_MESSAGES);
1031 
1032  return aws;
1033 }
1034 
1035 
1036 static char *cat(char *toBuf, const char *s1, const char *s2) {
1037  char *buf = toBuf;
1038 
1039  while ((*buf++=*s1++)!=0) ;
1040  buf--;
1041  while ((*buf++=*s2++)!=0) ;
1042 
1043  return toBuf;
1044 }
1045 
1047  const char *label_prefix, const char *macro_prefix,
1048  const char *pattern_awar_name, const char *show_awar_name,
1049  int short_form, ED4_SearchPositionType type, ED4_window *ed4w)
1050 {
1051  char buf[200];
1052 
1053  if (!short_form) {
1054  awmm->at(cat(buf, label_prefix, "search"));
1055  awmm->create_input_field(pattern_awar_name, 30);
1056  }
1057 
1058  awmm->at(cat(buf, label_prefix, "n"));
1059  awmm->help_text("e4_search.hlp");
1060  awmm->callback(makeWindowCallback(ED4_search_cb, ED4_encodeSearchDescriptor(+1, type), ed4w));
1061  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_NEXT"), "#edit/next.xpm");
1062 
1063  awmm->at(cat(buf, label_prefix, "l"));
1064  awmm->help_text("e4_search.hlp");
1065  awmm->callback(makeWindowCallback(ED4_search_cb, ED4_encodeSearchDescriptor(-1, type), ed4w));
1066  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_LAST"), "#edit/last.xpm");
1067 
1068  awmm->at(cat(buf, label_prefix, "d"));
1069  awmm->help_text("e4_search.hlp");
1070  awmm->callback(makeWindowCallback(ED4_popup_search_window, type));
1071  awmm->create_button(cat(buf, macro_prefix, "_SEARCH_DETAIL"), "#edit/detail.xpm");
1072 
1073  awmm->at(cat(buf, label_prefix, "s"));
1074  awmm->create_toggle(show_awar_name);
1075 }
1076 
1077 static void ED4_set_protection(AW_window *aww, int wanted_protection) {
1078  ED4_LocalWinContext uses(aww);
1079  ED4_cursor *cursor = &current_cursor();
1080  GB_ERROR error = NULp;
1081 
1082  if (cursor->owner_of_cursor) {
1083  ED4_sequence_terminal *seq_term = cursor->owner_of_cursor->to_sequence_terminal();
1084  ED4_sequence_info_terminal *seq_info_term = seq_term->parent->search_spec_child_rek(LEV_SEQUENCE_INFO)->to_sequence_info_terminal();
1085  GBDATA *gbd = seq_info_term->data();
1086 
1087  GB_transaction ta(gbd);
1088  GB_topSecurityLevel unsecured(gbd);
1089 
1090  error = GB_write_security_write(gbd, wanted_protection);
1091  error = ta.close(error);
1092  }
1093  else {
1094  error = "No species selected";
1095  }
1096 
1097  if (error) aw_message(error);
1098 }
1099 
1100 enum MenuSelectType { // @@@ rename -> MenuHighlightType
1111 };
1112 
1113 static void ED4_menu_highlight(AW_window *aww, MenuSelectType select) { // @@@ rename select -> hilight
1115  GB_transaction ta(gb_main);
1116 
1118 
1119  e4_assert(middle_multi_man);
1120 
1121  switch (select) {
1122  case ED4_MS_NONE: {
1125  }
1126  break;
1127  }
1128  case ED4_MS_ALL: {
1129  middle_multi_man->select_all(true); // only species
1131  break;
1132  }
1133  case ED4_MS_INVERT: {
1134  middle_multi_man->invert_selection_of_all_species();
1136  break;
1137  }
1138  case ED4_MS_SELECT_MARKED: {
1139  middle_multi_man->marked_species_select(true);
1141  break;
1142  }
1143  case ED4_MS_DESELECT_MARKED: {
1144  middle_multi_man->marked_species_select(false);
1146  break;
1147  }
1148  case ED4_MS_UNMARK_ALL: {
1149  GBT_mark_all(gb_main, 0);
1150  break;
1151  }
1152  case ED4_MS_MARK_SELECTED: {
1153  middle_multi_man->selected_species_mark(true);
1155  break;
1156  }
1157  case ED4_MS_UNMARK_SELECTED: {
1158  middle_multi_man->selected_species_mark(false);
1160  break;
1161  }
1162  case ED4_MS_INVERT_GROUP: {
1164  int done = 0;
1165 
1166  if (cursor->owner_of_cursor) {
1167  ED4_multi_species_manager *multi_man = cursor->owner_of_cursor->get_parent(LEV_MULTI_SPECIES)->to_multi_species_manager();
1168 
1169  multi_man->invert_selection_of_all_species();
1171  done = 1;
1172  }
1173 
1174  if (!done) {
1175  aw_message("Place cursor into group");
1176  }
1177  break;
1178  }
1179  case ED4_MS_TOGGLE_BLOCKTYPE: {
1181  break;
1182  }
1183  default: {
1184  e4_assert(0);
1185  break;
1186  }
1187  }
1188 
1190 }
1191 
1194 }
1195 
1196 static void modes_cb(AW_window*, ED4_species_mode smode) {
1197  ED4_ROOT->species_mode = smode;
1198  for (ED4_window *win = ED4_ROOT->first_window; win; win = win->next) {
1199  win->aww->select_mode(smode);
1200  }
1201  if (smode == ED4_SM_INFO) {
1202  AWT_trigger_remote_action(NULp, ED4_ROOT->get_gb_main(), "ARB_NT:species_info");
1203  }
1204 }
1205 
1207  if (ED4_ROOT->species_mode == ED4_SM_KILL) {
1209  }
1210 }
1211 
1212 static char *get_helix_string(GBDATA *gb_main, const char *alignment_name) {
1213  GB_transaction ta(gb_main);
1214 
1215  char *helix_string = NULp;
1216  char *helix_name = GBT_get_default_helix(gb_main);
1217  GBDATA *gb_helix_con = GBT_find_SAI(gb_main, helix_name);
1218  if (gb_helix_con) {
1219  GBDATA *gb_helix = GBT_find_sequence(gb_helix_con, alignment_name);
1220  if (gb_helix) helix_string = GB_read_string(gb_helix);
1221  }
1222  free(helix_name);
1223 
1224  return helix_string;
1225 }
1226 
1228  static SmartPtr<AlignDataAccess> aliDataAccess;
1229 
1230  if (aliDataAccess.isNull()) {
1231  aliDataAccess = new AlignDataAccess(ED4_ROOT->get_gb_main(),
1233  true, ED4_trigger_instant_refresh, // perform refresh
1234  get_group_consensus, // aligner fetches consensus of group of species via this function
1235  get_selected_range, // aligner fetches column range of selection via this function
1236  get_first_selected_species, // aligner fetches first and..
1237  get_next_selected_species, // .. following selected species via these functions
1238  get_helix_string); // used by island_hopping (if configured to use sec-structure)
1239  }
1240 
1241  return aliDataAccess.content();
1242 }
1243 
1245 #if defined(DEBUG)
1246  static const AlignDataAccess *last_data_access = NULp;
1247 
1248  e4_assert(!last_data_access || (last_data_access == data_access)); // there shall be only one AlignDataAccess
1249  last_data_access = data_access;
1250 #endif
1251 
1252  static AW_window *aws = NULp;
1253  if (!aws) aws = FastAligner_create_window(awr, data_access);
1254  return aws;
1255 }
1256 
1257 static const char *propertyName(GBDATA *gb_main, int mode) {
1258  // mode == 0 -> alignment specific (e.g. "edit4_ali_16s.arb")
1259  // mode == 1 -> alignment-type specific (e.g. "edit4_rna.arb")
1260  // mode == 2 -> unspecific (normal) (always "edit4.arb")
1261  //
1262  // Note : result is only valid until next call
1263 
1264  e4_assert(mode >= 0 && mode <= 2);
1265 
1266  const char *result;
1267  if (mode == 2) {
1268  result = "edit4.arb";
1269  }
1270  else {
1271  static char *ali_name = NULp;
1272  static char *ali_type = NULp;
1273  static char *result_copy = NULp;
1274 
1275  if (!ali_name) {
1276  GB_transaction ta(gb_main);
1277 
1278  ali_name = GBT_get_default_alignment(gb_main);
1279  ali_type = GBT_get_alignment_type_string(gb_main, ali_name);
1280  result_copy = new char[21+strlen(ali_name)];
1281  }
1282 
1283  sprintf(result_copy, "edit4_%s.arb", mode == 0 ? ali_name : ali_type);
1284  result = result_copy;
1285  }
1286 
1287  return result;
1288 }
1289 
1290 static void ED4_save_properties(AW_window *aw, int mode) {
1292 }
1293 
1295  typedef std::map<AW_gc_manager*, AW_window*> gcwin;
1296  static gcwin win;
1297 
1298  gcwin::iterator found = win.find(gcman);
1299 
1300  AW_window *aww = NULp;
1301  if (found == win.end()) {
1302  aww = AW_create_gc_window(awp->get_root(), gcman);
1303  win[gcman] = aww;
1304  }
1305  else {
1306  aww = win[gcman];
1307  }
1308  aww->activate();
1309 }
1310 
1311 static void gc_change_cb(GcChange whatChanged) {
1312  if (whatChanged == GC_FONT_CHANGED) {
1314  }
1316 }
1317 
1319  {
1320  ED4_window *ed4w = first_window;
1321 
1322  while (ed4w) { // before creating a window look for a hidden window
1323  if (ed4w->is_hidden) {
1324  ed4w->aww->show();
1325  ed4w->is_hidden = false;
1326  return ED4_R_BREAK;
1327  }
1328  ed4w = ed4w->next;
1329  }
1330  }
1331 
1332  if (ED4_window::no_of_windows == MAXWINDOWS) { // no more than 5 windows allowed
1333  aw_message(GBS_global_string("Restricted to %i windows", MAXWINDOWS));
1334  return ED4_R_BREAK;
1335  }
1336 
1338  {
1339  int winNum = ED4_window::no_of_windows+1;
1340  char *winName = winNum>1 ? GBS_global_string_copy("ARB_EDIT4_%i", winNum) : ARB_strdup("ARB_EDIT4");
1341  char *winTitle = GBS_global_string_copy("ARB_EDIT4 *%d* [%s]", winNum, alignment_name);
1342 
1343  awmm->init(aw_root, winName, winTitle, 800, 450);
1344 
1345  free(winTitle);
1346  free(winName);
1347  }
1348 
1349  *device = awmm->get_device(AW_MIDDLE_AREA); // points to Middle Area device
1350  *new_window = ED4_window::insert_window(awmm); // append to window list
1351 
1353  bool clone = ED4_window::no_of_windows>1;
1354  if (!clone) { // this is the first window
1355  AW_init_color_group_defaults("arb_edit4");
1356  }
1357  else { // additional edit windows
1358  copy_window_struct(first_window, *new_window);
1359  }
1360 
1361  ED4_LocalWinContext uses(*new_window);
1362 
1363  // each window has its own gc-manager
1364  gc_manager = AW_manage_GC(awmm,
1365  "ARB_EDIT4", // but all gc-managers use the same colors
1366  *device,
1367  ED4_G_DRAG,
1369  makeGcChangedCallback(gc_change_cb), // callback triggering refresh on gc-change
1370 
1371  "#f8f8f8",
1372  "STANDARD$black", // standard color showing species/group info (name, ...)
1373  "FlagInfo$#DDD",
1374  "#SEQUENCES (0)$#505050", // default color for sequences (color 0)
1375 
1376  "+-HELIX (1)$#8E0000", "+-COLOR 2$#0000dd", "-COLOR 3$#00AA55",
1377  "+-COLOR 4$#80f", "+-COLOR 5$#c0a020", "-COLOR 6$grey",
1378  "+-COLOR 7$#ff0000", "+-COLOR 8$#44aaff", "-COLOR 9$#ffaa00",
1379 
1380  "+-CURSOR$#FF0080", "+-MARKED$#f4f8e0", "-SELECTED$#FFFF80",
1381 
1382  "+-RANGE 0$#FFFFFF", "+-RANGE 1$#F0F0F0", "-RANGE 2$#E0E0E0",
1383  "+-RANGE 3$#D8D8D8", "+-RANGE 4$#D0D0D0", "-RANGE 5$#C8C8C8",
1384  "+-RANGE 6$#C0C0C0", "+-RANGE 7$#B8B8B8", "-RANGE 8$#B0B0B0",
1385  "-RANGE 9$#A0A0A0",
1386 
1387  // colors used to Paint search patterns
1388  // (do not change the names of these gcs)
1389  "+-User1$#B8E2F8", "+-User2$#B8E2F8", "-Probe$#B8E2F8", // see also SEC_graphic::init_devices
1390  "+-Primer(l)$#A9FE54", "+-Primer(r)$#A9FE54", "-Primer(g)$#A9FE54",
1391  "+-Sig(l)$#DBB0FF", "+-Sig(r)$#DBB0FF", "-Sig(g)$#DBB0FF",
1392 
1393  "+-MISMATCHES$#FF9AFF", "+-Flag$#7c7ce3", "-FlagFill$#aacef1",
1394 
1395  "&color_groups", // use color groups
1396 
1397  NULp);
1398 
1399  // since the gc-managers of all EDIT4-windows point to the same window properties,
1400  // changing fonts and colors is always done on first gc-manager
1401  static AW_gc_manager *first_gc_manager = NULp;
1402  if (!first_gc_manager) first_gc_manager = gc_manager;
1403 
1404  // --------------
1405  // File
1406 
1407 #if defined(DEBUG)
1408  AWT_create_debug_menu(awmm);
1409 #endif // DEBUG
1410 
1411  awmm->create_menu("File", "F", AWM_ALL);
1412 
1413  awmm->insert_menu_topic("new_win", "New Editor Window", "N", NULp, AWM_ALL, ED4_new_editor_window);
1414  awmm->sep______________();
1415  awmm->insert_menu_topic("save_config", "Save configuration", "S", "species_configs_saveload.hlp", AWM_ALL, makeWindowCallback(ED4_saveConfiguration, false));
1416  awmm->insert_menu_topic(awmm->local_id("save_config_as"), "Save configuration as ...", "a", "species_configs_saveload.hlp", AWM_ALL, ED4_create_saveConfigurationAs_window);
1417  awmm->insert_menu_topic(awmm->local_id("load_config"), "Load configuration ...", "L", "species_configs_saveload.hlp", AWM_ALL, ED4_create_loadConfiguration_window);
1418  awmm->insert_menu_topic("reload_config", "Reload configuration", "R", "species_configs_saveload.hlp", AWM_ALL, ED4_reloadConfiguration);
1419  insert_macro_menu_entry(awmm, true);
1420  awmm->sep______________();
1421  // keep the following entries in sync with ../NTREE/NT_extern.cxx@common_save_menu_entries
1422  awmm->insert_menu_topic("save_changes", "Quicksave changes", "c", "save.hlp", AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NT:save_changes"));
1423  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"));
1424 #if defined(DEBUG)
1425  awmm->sep______________();
1426  awmm->insert_menu_topic("deb1", "[DEBUG] remote: invalid app", "D", NULp, AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NTREE:aljdlaisjdlad"));
1427  awmm->insert_menu_topic("deb2", "[DEBUG] remote: invalid cmd", "E", NULp, AWM_ALL, makeWindowCallback(AWT_trigger_remote_action, gb_main, "ARB_NT:aljdlaisjdlad"));
1428 #endif
1429  awmm->sep______________();
1430  GDE_load_menu(awmm, AWM_ALL, "Print");
1431  awmm->sep______________();
1432 
1433  if (clone) awmm->insert_menu_topic("close", "CLOSE", "C", NULp, AWM_ALL, ED4_quit_editor);
1434  else awmm->insert_menu_topic("quit", "QUIT", "Q", NULp, AWM_ALL, ED4_quit_editor);
1435 
1436  // ----------------
1437  // Create
1438 
1439  awmm->create_menu("Create", "C", AWM_ALL);
1440  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));
1441  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));
1442  awmm->insert_menu_topic(awmm->local_id("copy_species"), "Copy current species", "C", NULp, AWM_ALL, makeCreateWindowCallback(ED4_create_new_seq_window, COPY_SPECIES));
1443  awmm->sep______________();
1444  awmm->insert_menu_topic("create_group", "Create new Group (from selected)", "G", NULp, AWM_ALL, makeWindowCallback(group_species_cb, false));
1445  awmm->insert_menu_topic("create_groups_by_field", "Create new groups using Field", "F", NULp, AWM_ALL, makeWindowCallback(group_species_cb, true));
1446 
1447  // --------------
1448  // Edit
1449 
1450  awmm->create_menu("Edit", "E", AWM_ALL);
1451  awmm->insert_menu_topic("refresh", "Refresh [Ctrl-L]", "f", NULp, AWM_ALL, makeWindowCallback(ED4_request_full_refresh));
1452  awmm->insert_menu_topic("load_current", "Load current species [GET]", "G", "e4_get_species.hlp", AWM_ALL, makeWindowCallback(ED4_get_and_jump_to_current));
1453  awmm->insert_menu_topic("load_marked", "Load marked species", "m", "e4_get_species.hlp", AWM_ALL, makeWindowCallback(ED4_get_marked_from_menu));
1454  awmm->insert_menu_topic(awmm->local_id("load_SAI"), "Load SAI ...", "L", "e4_get_species.hlp", AWM_ALL, ED4_create_loadSAI_window);
1455  awmm->sep______________();
1456  awmm->insert_menu_topic("refresh_ecoli", "Reload Ecoli sequence", "E", "ecoliref.hlp", AWM_ALL, makeWindowCallback(reload_ecoli_cb));
1457  awmm->insert_menu_topic("refresh_helix", "Reload Helix", "H", "helix.hlp", AWM_ALL, makeWindowCallback(reload_helix_cb));
1458  awmm->insert_menu_topic("helix_jump_opposite", "Jump helix opposite [Ctrl-J]", "J", NULp, AWM_ALL, ED4_helix_jump_opposite);
1459  awmm->sep______________();
1460 
1461  awmm->insert_sub_menu("Set protection of current ", "p");
1462  {
1463  char macro[] = "to_0",
1464  topic[] = ".. to 0",
1465  hotkey[] = "0";
1466 
1467  for (char i='0'; i<='6'; i++) {
1468  macro[3] = topic[6] = hotkey[0] = i;
1469  awmm->insert_menu_topic(macro, topic, hotkey, "security.hlp", AWM_ALL, makeWindowCallback(ED4_set_protection, i-'0'));
1470  }
1471  }
1472  awmm->close_sub_menu();
1473 
1474  awmm->sep______________();
1475  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()));
1476  awmm->insert_menu_topic("fast_align_set_ref", "Set aligner reference [Ctrl-R]", "R", "faligner.hlp", AWM_ALL, RootAsWindowCallback::simple(FastAligner_set_reference_species));
1477  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()));
1478  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()));
1479  awmm->insert_menu_topic("del_ali_tmp", "Remove all aligner Entries", "v", NULp, AWM_ALL, makeWindowCallback(ED4_remove_faligner_entries));
1480  awmm->sep______________();
1481  awmm->insert_menu_topic("missing_bases", "Dot potentially missing bases", "D", "missbase.hlp", AWM_EXP, ED4_popup_dot_missing_bases_window);
1482 
1483  if (alignment_type == GB_AT_RNA) { // if the database contains valid alignment of rRNA sequences
1484  awmm->sep______________();
1485  awmm->insert_menu_topic("sec_edit", "Edit secondary structure", "c", "arb_secedit.hlp", AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "SECEDIT"));
1486 #if defined(ARB_OPENGL)
1487  awmm->insert_menu_topic("rna3d", "View 3D molecule", "3", "rna3d_general.hlp", AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "RNA3D"));
1488 #endif // ARB_OPENGL
1489 #if defined(DEBUG)
1490  awmm->insert_menu_topic("noplugin", "DEBUG: call unknown plugin", "u", NULp, AWM_ALL, makeWindowCallback(ED4_start_plugin, gb_main, "testplugin"));
1491 #endif // DEBUG
1492  }
1493 
1494  // --------------
1495  // View
1496 
1497  awmm->create_menu("View", "V", AWM_ALL);
1498  awmm->insert_sub_menu("Search", "S");
1499  {
1500  int s;
1501  const char *hotkeys = "12Poiclrg";
1502  char hotkey[] = "_";
1503 
1504  e4_assert(strlen(hotkeys) == SEARCH_PATTERNS);
1505 
1506  for (s=0; s<SEARCH_PATTERNS; s++) {
1508  const char *id = ED4_SearchPositionTypeId[type];
1509  int len = strlen(id);
1510  char *macro_name = GB_give_buffer(2*(len+8));
1511  char *menu_entry_name = macro_name+(len+8);
1512 
1513 #ifndef NDEBUG
1514  memset(macro_name, 0, 2*(len+8)); // to avoid memchk-warning
1515 #endif
1516  sprintf(macro_name, "%s_SEARCH", id);
1517  char *p = macro_name;
1518  while (1) {
1519  char c = *p++;
1520  if (!c) break;
1521  p[-1] = toupper(c);
1522  }
1523  sprintf(menu_entry_name, "%s Search", id);
1524 
1525  hotkey[0] = hotkeys[s];
1526  awmm->insert_menu_topic(awmm->local_id(macro_name), menu_entry_name, hotkey, "e4_search.hlp", AWM_ALL, makeWindowCallback(ED4_popup_search_window, type));
1527  }
1528  }
1529  awmm->close_sub_menu();
1530  awmm->sep______________();
1531  awmm->insert_sub_menu("Cursor position ", "p");
1532  awmm->insert_menu_topic("store_curpos", "Store cursor position", "S", NULp, AWM_ALL, ED4_store_curpos);
1533  awmm->insert_menu_topic("restore_curpos", "Restore cursor position ", "R", NULp, AWM_ALL, ED4_restore_curpos);
1534  awmm->insert_menu_topic("clear_curpos", "Clear stored positions", "C", NULp, AWM_ALL, makeWindowCallback(ED4_clear_stored_curpos));
1535  awmm->close_sub_menu();
1536 
1537  awmm->sep______________();
1538  awmm->insert_menu_topic("change_cursor", "Change cursor type", "t", NULp, AWM_ALL, ED4_change_cursor);
1539  awmm->insert_menu_topic(awmm->local_id("view_diff"), "View differences ...", "V", "viewdiff.hlp", AWM_ALL, ED4_create_viewDifferences_window);
1540  awmm->sep______________();
1541  awmm->insert_menu_topic("enable_col_stat", "Activate column statistics", "A", "st_ml.hlp", AWM_EXP, ED4_activate_col_stat);
1542  awmm->insert_menu_topic("disable_col_stat", "Disable column statistics", "i", "st_ml.hlp", AWM_EXP, ED4_disable_col_stat);
1543  awmm->insert_menu_topic("detail_col_stat", "Toggle detailed Col.-Stat.", "C", "st_ml.hlp", AWM_EXP, ED4_toggle_detailed_column_stats);
1544  awmm->insert_menu_topic("dcs_threshold", "Set threshold for D.c.s.", "f", "st_ml.hlp", AWM_EXP, makeWindowCallback(ED4_set_col_stat_threshold));
1545  awmm->sep______________();
1546  awmm->insert_menu_topic(awmm->local_id("visualize_SAI"), "Visualize SAIs", "z", "visualizeSAI.hlp", AWM_ALL, ED4_createVisualizeSAI_window);
1547  awmm->insert_menu_topic("toggle_saisec", "Toggle secondary info for SAI", "o", "toggle_secinfo.hlp", AWM_ALL, toggle_helix_for_SAI);
1548 
1549  // Enable ProteinViewer only for DNA sequence type
1550  if (alignment_type == GB_AT_DNA) {
1551  awmm->insert_menu_topic(awmm->local_id("Protein_Viewer"), "Protein Viewer", "w", "proteinViewer.hlp", AWM_ALL, ED4_CreateProteinViewer_window);
1552  }
1553 
1554  // ---------------
1555  // Block
1556 
1557  awmm->create_menu("Block", "B", AWM_ALL);
1558 
1559  awmm->insert_menu_topic("select_marked", "Highlight marked species", "e", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_SELECT_MARKED));
1560  awmm->insert_menu_topic("deselect_marked", "De-highlight marked species", "k", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_DESELECT_MARKED));
1561  awmm->insert_menu_topic("select_all", "Highlight all species", "s", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_ALL));
1562  awmm->insert_menu_topic("deselect_all", "De-highlight all species", "D", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_NONE));
1563  awmm->sep______________();
1564  awmm->insert_menu_topic("mark_selected", "Mark highlighted species", "M", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_MARK_SELECTED));
1565  awmm->insert_menu_topic("unmark_selected", "Unmark highlighted species", "n", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_UNMARK_SELECTED));
1566  awmm->insert_menu_topic("unmark_all", "Unmark all species", "U", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_UNMARK_ALL));
1567  awmm->sep______________();
1568  awmm->insert_menu_topic("invert_all", "Invert highlighted species", "I", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_INVERT));
1569  awmm->insert_menu_topic("invert_group", "Invert group", "g", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_INVERT_GROUP));
1570  awmm->sep______________();
1571  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));
1572  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));
1573  awmm->sep______________();
1574  awmm->insert_menu_topic("reverse", "Reverse highlighted ", "v", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_REVERSE));
1575  awmm->insert_menu_topic("complement", "Complement highlighted ", "o", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_COMPLEMENT));
1576  awmm->insert_menu_topic("reverse_complement", "Reverse complement", "t", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_REVERSE_COMPLEMENT));
1577  awmm->sep______________();
1578  awmm->insert_menu_topic("unalignBlockLeft", "Unalign block left", "a", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_LEFT));
1579  awmm->insert_menu_topic("unalignBlockCenter", "Unalign block center", "c", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_CENTER));
1580  awmm->insert_menu_topic("unalignBlockRight", "Unalign block right", "b", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_perform_block_operation, ED4_BO_UNALIGN_RIGHT));
1581  awmm->sep______________();
1582  awmm->insert_menu_topic(awmm->local_id("replace"), "Search & Replace ", "h", "e4_replace.hlp", AWM_ALL, ED4_create_replace_window);
1583  awmm->insert_menu_topic(awmm->local_id("setsai"), "Modify SAI ", "y", "e4_modsai.hlp", AWM_ALL, ED4_create_modsai_window);
1584  awmm->sep______________();
1585  awmm->insert_menu_topic("toggle_block_type", "Exchange: Line<->Column", "x", "e4_block.hlp", AWM_ALL, makeWindowCallback(ED4_menu_highlight, ED4_MS_TOGGLE_BLOCKTYPE));
1586  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));
1587  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));
1588 
1589  // --------------------
1590  // Properties
1591 
1592  awmm->create_menu("Properties", "P", AWM_ALL);
1593 
1594  awmm->insert_menu_topic(awmm->local_id("props_frame"), "Frame settings ...", "g", NULp, AWM_ALL, AW_preset_window);
1595  awmm->insert_menu_topic(awmm->local_id("props_options"), "Editor Options ", "O", "e4_options.hlp", AWM_ALL, ED4_create_editor_options_window);
1596  awmm->insert_menu_topic(awmm->local_id("props_consensus"), "Consensus Definition ", "u", "e4_consensus.hlp", AWM_ALL, ED4_create_consensus_definition_window);
1597  awmm->sep______________();
1598 
1599  awmm->insert_menu_topic("props_data", "Change Colors & Fonts ", "C", NULp, AWM_ALL, makeWindowCallback (ED4_popup_gc_window, first_gc_manager));
1600  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));
1601 
1602  awmm->sep______________();
1603 
1604  awmm->insert_menu_topic(awmm->local_id("props_nds"), "Select visible info (NDS) ", "D", "ed4_nds.hlp", AWM_ALL, ED4_create_nds_window);
1605  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));
1606  {
1607  static WindowCallback reqRelCb = makeWindowCallback(ED4_request_relayout);
1608  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));
1609  else awmm->insert_menu_topic(awmm->local_id("props_helix_sym"), "Helix Settings ", "H", "helixsym.hlp", AWM_ALL, makeCreateWindowCallback(create_helix_props_window, &reqRelCb));
1610  }
1611  awmm->insert_menu_topic(awmm->local_id("props_key_map"), "Key Mappings ", "K", "nekey_map.hlp", AWM_ALL, create_key_map_window);
1612 
1613  awmm->sep______________();
1615  awmm->sep______________();
1616  awmm->insert_sub_menu("Save properties ...", "a");
1617  {
1618  static const char * const tag[] = { "save_alispecific_props", "save_alitype_props", "save_props" };
1619  static const char * const entry_type[] = { "alignment specific ", "ali-type specific ", "" };
1620 
1621  // check what is the default mode
1622  int default_mode = -1;
1623  for (int mode = 0; mode <= 2; ++mode) {
1624  if (strcmp(GB_path_in_arbprop(propertyName(gb_main, mode)), db_name) == 0) {
1625  default_mode = mode;
1626  break;
1627  }
1628  }
1629  if (default_mode == -1) default_mode = 2; // no properties yet -> use 'edit4.arb'
1630 
1631  const char *entry = GBS_global_string("Save loaded Properties (%s)", propertyName(gb_main, default_mode));
1632  awmm->insert_menu_topic("save_loaded_props", entry, "l", "e4_defaults.hlp", AWM_ALL, makeWindowCallback(ED4_save_properties, default_mode));
1633  awmm->sep______________();
1634 
1635  for (int mode = 2; mode >= 0; --mode) {
1636  char hotkey[] = "x";
1637  hotkey[0] = "Pta"[mode];
1638  entry = GBS_global_string("Save %sProperties (%s)", entry_type[mode], propertyName(gb_main, mode));
1639  awmm->insert_menu_topic(tag[mode], entry, hotkey, "e4_defaults.hlp", AWM_ALL, makeWindowCallback(ED4_save_properties, mode));
1640  }
1641  }
1642  awmm->close_sub_menu();
1643 
1644  awmm->insert_help_topic("ARB_EDIT4 help", "E", "e4.hlp", AWM_ALL, makeHelpCallback("e4.hlp"));
1645 
1646  // ----------------------------------------------------------------------------------------------------
1647 
1648  aw_root->awar_int(AWAR_EDIT_TITLE_MODE)->add_callback(makeRootCallback(title_mode_changed, static_cast<AW_window*>(awmm)));
1649  awmm->set_bottom_area_height(0); // No bottom area
1650 
1651  awmm->auto_space(5, -2);
1652  awmm->shadow_width(3);
1653 
1654  int db_pathx, db_pathy;
1655  awmm->get_at_position(&db_pathx, &db_pathy);
1656 
1657  awmm->shadow_width(1);
1658  awmm->load_xfig("edit4/editmenu.fig", false);
1659 
1660  // --------------------------
1661  // help /quit /fold
1662 
1663  awmm->button_length(0);
1664 
1665  awmm->at("quit");
1666  awmm->callback(ED4_quit_editor);
1667  awmm->help_text("quit.hlp");
1668 
1669  if (clone) awmm->create_button("CLOSE", "#close.xpm");
1670  else awmm->create_button("QUIT", "#quit.xpm");
1671 
1672  awmm->at("help");
1674  awmm->help_text("e4.hlp");
1675  awmm->create_button("HELP", "#help.xpm");
1676 
1677  awmm->at("fold");
1678  awmm->help_text("e4.hlp");
1679  awmm->create_toggle(AWAR_EDIT_TITLE_MODE, "#more.xpm", "#less.xpm");
1680 
1681  // -------------------
1682  // positions
1683 
1684  awmm->button_length(0);
1685 
1686  awmm->at("posTxt"); awmm->create_button(NULp, "Position");
1687 
1688  awmm->button_length(6+1);
1689 
1690  awmm->at("ecoliTxt"); awmm->create_button(NULp, ED4_AWAR_NDS_ECOLI_NAME, NULp, "+");
1691 
1692  awmm->button_length(0);
1693 
1694  awmm->at("baseTxt"); awmm->create_button(NULp, "Base");
1695  awmm->at("iupacTxt"); awmm->create_button(NULp, "IUPAC");
1696  awmm->at("helixnrTxt"); awmm->create_button(NULp, "Helix#");
1697 
1698  awmm->at("pos");
1699  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_cursor, ED4_POS_SEQUENCE)); // @@@ used as INPUTFIELD_CB (see #559)
1700  awmm->create_input_field(current_ed4w()->awar_path_for_cursor, 7);
1701 
1702  awmm->at("ecoli");
1703  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_Ecoli, ED4_POS_ECOLI)); // @@@ used as INPUTFIELD_CB (see #559)
1704  awmm->create_input_field(current_ed4w()->awar_path_for_Ecoli, 6);
1705 
1706  awmm->at("base");
1707  awmm->callback(makeWindowCallback(ED4_jump_to_cursor_position, current_ed4w()->awar_path_for_basePos, ED4_POS_BASE)); // @@@ used as INPUTFIELD_CB (see #559)
1708  awmm->create_input_field(current_ed4w()->awar_path_for_basePos, 6);
1709 
1710  awmm->at("iupac");
1711  awmm->callback(makeWindowCallback(ED4_set_iupac, current_ed4w()->awar_path_for_IUPAC)); // @@@ used as INPUTFIELD_CB (see #559)
1712  awmm->create_input_field(current_ed4w()->awar_path_for_IUPAC, 4);
1713 
1714  awmm->at("helixnr");
1715  awmm->callback(makeWindowCallback(ED4_set_helixnr, current_ed4w()->awar_path_for_helixNr)); // @@@ used as INPUTFIELD_CB (see #559)
1716  awmm->create_input_field(current_ed4w()->awar_path_for_helixNr, 5);
1717 
1718  // ----------------------------
1719  // jump/get/undo/redo
1720 
1721  awmm->button_length(4);
1722 
1723  awmm->at("jump");
1725  awmm->help_text("e4_get_species.hlp");
1726  awmm->create_button("JUMP", "Jump");
1727 
1728  awmm->at("get");
1729  awmm->callback(makeWindowCallback(ED4_get_and_jump_to_current));
1730  awmm->help_text("e4_get_species.hlp");
1731  awmm->create_button("GET", "Get");
1732 
1733  awmm->button_length(0);
1734 
1735  awmm->at("undo");
1736  awmm->callback(makeWindowCallback(ED4_undo_redo, GB_UNDO_UNDO));
1737  awmm->help_text("undo.hlp");
1738  awmm->create_button("UNDO", "#undo.xpm");
1739 
1740  awmm->at("redo");
1741  awmm->callback(makeWindowCallback(ED4_undo_redo, GB_UNDO_REDO));
1742  awmm->help_text("undo.hlp");
1743  awmm->create_button("REDO", "#redo.xpm");
1744 
1745  // --------------------------
1746  // aligner / SAIviz
1747 
1748  awmm->button_length(7);
1749 
1750  awmm->at("aligner");
1751  awmm->callback(makeCreateWindowCallback(ED4_create_faligner_window, ED4_get_aligner_data_access()));
1752  awmm->help_text("faligner.hlp");
1753  awmm->create_button("ALIGNER", "Aligner");
1754 
1755  awmm->at("saiviz");
1757  awmm->help_text("visualizeSAI.hlp");
1758  awmm->create_button("SAIVIZ", "SAIviz");
1759 
1760  // -------------------------------------------
1761  // align/insert/protection/direction
1762 
1763  awmm->button_length(0);
1764 
1765  awmm->at("protect");
1767  awmm->insert_option ("0", NULp, 0);
1768  awmm->insert_option ("1", NULp, 1);
1769  awmm->insert_option ("2", NULp, 2);
1770  awmm->insert_option ("3", NULp, 3);
1771  awmm->insert_option ("4", NULp, 4);
1772  awmm->insert_option ("5", NULp, 5);
1773  awmm->insert_default_option("6", NULp, 6);
1774  awmm->update_option_menu();
1775 
1776  // draw protection icon AFTER protection!!
1777  awmm->at("pico");
1778  awmm->create_button(NULp, "#protect.xpm");
1779 
1780  // draw align/edit-button AFTER protection!!
1781  awmm->at("edit");
1782  awmm->create_toggle(AWAR_EDIT_MODE, "#edit/align.xpm", "#edit/editseq.xpm", 7);
1783 
1784  awmm->at("insert");
1785  awmm->create_text_toggle(AWAR_INSERT_MODE, "Replace", "Insert", 7);
1786 
1787  awmm->at("direct");
1788  awmm->create_toggle(AWAR_EDIT_RIGHTWARD, "#edit/3to5.xpm", "#edit/5to3.xpm", 7);
1789 
1790  // -------------------------
1791  // secedit / rna3d
1792 
1793  int xoffset = 0;
1794 
1795  if (alignment_type == GB_AT_RNA) { // if the database contains valid alignment of rRNA sequences
1796  // add buttons for RNA3D and SECEDIT plugins
1797 
1798  awmm->button_length(0);
1799 
1800  awmm->at("secedit");
1801  awmm->callback(makeWindowCallback(ED4_start_plugin, gb_main, "SECEDIT"));
1802  awmm->help_text("arb_secedit.hlp");
1803  awmm->create_button("SECEDIT", "#edit/secedit.xpm");
1804 
1805 #if defined(ARB_OPENGL)
1806  awmm->at("rna3d");
1807  awmm->callback(makeWindowCallback(ED4_start_plugin, gb_main, "RNA3D"));
1808  awmm->help_text("rna3d_general.hlp");
1809  awmm->create_button("RNA3D", "#edit/rna3d.xpm");
1810 #endif // ARB_OPENGL
1811  }
1812  else {
1813  awmm->at("secedit");
1814  int xsecedit = awmm->get_at_xposition();
1815  awmm->at("zoom");
1816  int xzoom = awmm->get_at_xposition();
1817  xoffset = xsecedit-xzoom; // shift message stuff to the left by xoffset
1818  }
1819 
1820  {
1821  int x, y;
1822 
1823  awmm->at("zoom");
1824  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1826  awmm->create_button("ZOOM", "#edit/zoom.xpm");
1827 
1828  awmm->at("clear");
1829  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1831  awmm->create_button("CLEAR", "#edit/clear.xpm");
1832 
1833  awmm->at("errortext");
1834  if (xoffset) { awmm->get_at_position(&x, &y); awmm->at(x+xoffset, y); }
1835  aw_root->awar_string(AWAR_ERROR_MESSAGES, "This is ARB Edit4 [Build " ARB_VERSION "]");
1838  }
1839 
1840  // ---------------------
1841  // 'more' area
1842 
1843  awmm->at("cons");
1844  awmm->create_toggle(ED4_AWAR_CONSENSUS_SHOW, "#edit/nocons.xpm", "#edit/cons.xpm");
1845 
1846  awmm->at("num");
1847  awmm->create_toggle(ED4_AWAR_DIGITS_AS_REPEAT, "#edit/norepeat.xpm", "#edit/repeat.xpm");
1848 
1849  awmm->at("key");
1850  awmm->create_toggle("key_mapping/enable", "#edit/nokeymap.xpm", "#edit/keymap.xpm");
1851 
1852  // search
1853 
1854  awmm->button_length(0);
1855 #define INSERT_SEARCH_FIELDS(Short, label_prefix, prefix) \
1856  insert_search_fields(awmm, \
1857  #label_prefix, \
1858  #prefix, \
1859  ED4_AWAR_##prefix##_SEARCH_PATTERN, \
1860  ED4_AWAR_##prefix##_SEARCH_SHOW, \
1861  Short, \
1862  ED4_##prefix##_PATTERN, \
1863  current_ed4w() \
1864  )
1865 
1866  INSERT_SEARCH_FIELDS(0, u1, USER1);
1867  INSERT_SEARCH_FIELDS(0, u2, USER2);
1868  INSERT_SEARCH_FIELDS(0, pro, PROBE);
1869  INSERT_SEARCH_FIELDS(1, pri1, PRIMER1);
1870  INSERT_SEARCH_FIELDS(1, pri2, PRIMER2);
1871  INSERT_SEARCH_FIELDS(1, pri3, PRIMER3);
1872  INSERT_SEARCH_FIELDS(1, sig1, SIG1);
1873  INSERT_SEARCH_FIELDS(1, sig2, SIG2);
1874  INSERT_SEARCH_FIELDS(1, sig3, SIG3);
1875 
1876 #undef INSERT_SEARCH_FIELDS
1877 
1878  awmm->at("alast");
1880  awmm->create_button("ALL_SEARCH_LAST", "#edit/last.xpm");
1881 
1882  awmm->at("anext");
1884  awmm->create_button("ALL_SEARCH_NEXT", "#edit/next.xpm");
1885 
1886  title_mode_changed(aw_root, awmm);
1887 
1888  // Buttons at left window border
1889 
1890  awmm->create_mode("edit/arrow.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_MOVE));
1891  awmm->create_mode("edit/kill.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_KILL));
1892  awmm->create_mode("edit/mark.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_MARK));
1893  awmm->create_mode("mode_info.xpm", "e4_mode.hlp", AWM_ALL, makeWindowCallback(modes_cb, ED4_SM_INFO));
1894 
1896 
1897 #if defined(DEBUG)
1898  AWT_check_action_ids(awmm->get_root(), "");
1899 #endif
1900 
1901  announce_useraction_in(awmm);
1902 
1903  return ED4_R_OK;
1904 }
1905 
1907  // Note: other windows are generated by generate_window
1908  AW_device *device = NULp;
1909  ED4_window *new_window = NULp;
1910 
1911  generate_window(&device, &new_window);
1912 
1913  ED4_LocalWinContext uses(new_window);
1914 
1915  ED4_calc_terminal_extentions(); // (Note: done again later, but otherwise variables are used uninitialized);
1916 
1917  DRAW = 1;
1918  move_cursor = 0;
1920 
1922 
1923  return new_window->aww;
1924 }
1925 
1927  // 'click_x' is the x-offset into the terminal in pixels
1928  // returns the x-offset into the terminal in base positions (clipped to max. allowed position)
1929 
1930  int length_of_char = font_group.get_width(ED4_G_SEQUENCES);
1931  ED4_index scr_pos = int((click_x-CHARACTEROFFSET) / length_of_char);
1932  int max_scrpos = root_group_man->remap()->get_max_screen_pos();
1933 
1934  if (scr_pos>max_scrpos) scr_pos = max_scrpos;
1935 
1936  return scr_pos;
1937 }
1938 
1940  char *propname = NULp;
1941 
1942  // check if edit4_?na.arb / edit4_ali_???.arb exist in $ARB_PROP
1943  for (int mode = 0; !propname && mode <= 1; ++mode) {
1944  const char *fullprop = GB_path_in_arbprop(propertyName(gb_main, mode));
1945  if (GB_is_regularfile(fullprop)) {
1946  freedup(propname, fullprop);
1947  }
1948  }
1949 
1950  // if not, use 'mode 2', i.e. "edit4.arb"
1951  // (no full path, we want to load default from arb_defaults)
1952  if (!propname) propname = ARB_strdup(propertyName(gb_main, 2));
1953 
1954  return propname;
1955 }
1956 
1958  : most_recently_used_window(NULp),
1959  cons_param(NULp),
1960  gb_main(gb_main_),
1961  db_name(detectProperties(gb_main)),
1962  aw_root(AWT_create_root(db_name, "ARB_EDIT4", need_macro_ability())),
1963  props_db(AW_ROOT_DEFAULT),
1964  first_window(NULp),
1965  main_manager(NULp),
1966  middle_area_man(NULp),
1967  top_area_man(NULp),
1968  root_group_man(NULp),
1969  database(NULp),
1970  selected_objects(new ED4_selected_list),
1971  folding_action(false),
1972  species_mode(ED4_SM_MOVE),
1973  ecoli_ref(NULp),
1975  alignment_type(GB_AT_UNKNOWN),
1976  reference(NULp),
1977  sequence_colors(NULp),
1978  gc_manager(NULp),
1979  st_ml(NULp),
1980  helix(NULp),
1981  helix_spacing(0),
1982  helix_add_spacing(0),
1983  terminal_add_spacing(0),
1984  protstruct(NULp),
1985  protstruct_len(0),
1986  edk(NULp),
1987  edit_string(NULp),
1988  column_stat_activated(false),
1989  column_stat_initialized(false),
1990  visualizeSAI(false),
1991  visualizeSAI_allSpecies(false),
1992  loadable_SAIs(LSAI_UNUSED),
1993  temp_gc(0)
1994 {}
1995 
1996 
1998  delete aw_root;
1999  delete first_window;
2000  delete reference; // needs to be deleted before main_manager (to ensure reference callbacks are removed)
2001  delete main_manager; // also deletes middle_area_man + top_area_man
2002  delete database;
2003  delete ecoli_ref;
2004  delete selected_objects;
2005  delete helix;
2006  delete sequence_colors;
2007  delete edk;
2009 
2010  free(protstruct);
2011  free(db_name);
2012  free(alignment_name);
2013 }
GB_ERROR GB_begin_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2516
bool inside_SAI_manager() const
Definition: ed4_class.hxx:1852
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:460
static bool have_context()
Definition: ed4_class.hxx:1398
void ED4_set_iupac(AW_window *aww, const char *awar_name)
ED4_species_mode
Definition: ed4_class.hxx:1345
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:291
void FastAligner_create_variables(AW_root *root, AW_default db1)
static ARB_ERROR force_group_update(ED4_base *base)
Definition: ED4_root.cxx:543
string result
static void reload_ecoli_cb()
Definition: ED4_root.cxx:826
ED4_returncode generate_window(AW_device **device, ED4_window **new_window)
Definition: ED4_root.cxx:1318
ED4_selected_list * selected_objects
Definition: ed4_class.hxx:1438
void ED4_get_marked_from_menu(AW_window *)
Definition: ED4_cursor.cxx:684
GB_TYPES type
void group_species_cb(AW_window *aww, bool use_fields)
AW_device * current_device()
Definition: ed4_class.hxx:1402
GB_ERROR GB_commit_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2539
static void reload_helix_cb()
Definition: ED4_root.cxx:819
char * db_name
Definition: ed4_class.hxx:1428
AW_helix * helix
Definition: ed4_class.hxx:1451
void ED4_jump_to_cursor_position(AW_window *aww, const char *awar_name, PositionType posType)
void button_length(int length)
Definition: AW_at.cxx:283
group_matcher all()
Definition: test_unit.h:1000
GB_CSTR GB_path_in_arbprop(const char *relative_path)
Definition: adsocket.cxx:1109
void special_window_refresh(bool handle_updates)
Definition: ED4_root.cxx:158
int get_at_xposition() const
Definition: AW_at.cxx:296
AW_font_group font_group
Definition: ed4_class.hxx:1472
static ED4_selected_elem * curr_aligner_elem
Definition: ED4_root.cxx:922
AW_pos size[2]
Definition: ed4_defs.hxx:261
#define AWAR_EDIT_SECURITY_LEVEL
Definition: ed4_defs.hxx:93
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:534
long GB_read_int(GBDATA *gbd)
Definition: arbdb.cxx:723
#define AWAR_EDIT_TITLE_MODE
Definition: ed4_defs.hxx:106
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:949
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:89
ED4_area_manager * top_area_man
Definition: ed4_class.hxx:1435
void ED4_activate_col_stat(AW_window *aww)
Definition: ED4_colStat.cxx:99
bool DRAW
Definition: ED4_main.cxx:69
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:592
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:315
GB_ERROR GB_append_exportedError(GB_ERROR error)
Definition: arb_msg.cxx:399
AW_window * ED4_create_modsai_window(AW_root *root)
Definition: ED4_block.cxx:976
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:717
int MAXNAME_WIDTH
Definition: ED4_main.cxx:56
void aw_set_local_message()
Definition: AW_status.cxx:927
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
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:866
AW_pos drag_off_y
Definition: ed4_defs.hxx:247
static void ED4_menu_highlight(AW_window *aww, MenuSelectType select)
Definition: ED4_root.cxx:1113
ED4_species_name_terminal * object
Definition: ed4_defs.hxx:252
void at(int x, int y)
Definition: AW_at.cxx:93
long
Definition: AW_awar.cxx:154
ED4_area_manager * middle_area_man
Definition: ed4_class.hxx:1434
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:684
void ED4_setBlocktype(ED4_blocktype bt)
Definition: ED4_block.cxx:361
BaseFrequencies & table()
Definition: ed4_class.hxx:1653
const char * init(GBDATA *gb_main)
Definition: BI_helix.cxx:299
void ED4_request_relayout()
AW_pos actual_width
Definition: ed4_defs.hxx:249
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:767
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:842
void warn_illegal_dimension()
Definition: ED4_root.cxx:60
static const char * propertyName(GBDATA *gb_main, int mode)
Definition: ED4_root.cxx:1257
void change_table_length(int new_length)
Definition: chartable.cxx:1126
void set_secstruct_display(bool show)
Definition: ed4_class.hxx:2008
void GB_end_transaction_show_error(GBDATA *gbd, GB_ERROR error, void(*error_handler)(GB_ERROR))
Definition: arbdb.cxx:2572
char * GB_read_as_string(GBDATA *gbd)
Definition: arbdb.cxx:1054
long read_int() const
Definition: AW_awar.cxx:187
void remove_from_selected(ED4_species_name_terminal *object)
Definition: ED4_root.cxx:328
#define AWAR_INSERT_MODE
Definition: ed4_defs.hxx:92
static bool is_SAI_named(ED4_base *base, const char *sai_name)
Definition: ED4_root.cxx:882
EDB_root_bact * database
Definition: ed4_class.hxx:1437
void win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:366
static GBDATA * get_next_selected_species()
Definition: ED4_root.cxx:924
int slider_pos_horizontal
Definition: ed4_class.hxx:712
ST_ML * st_ml
ED4_level level
Definition: ed4_class.hxx:230
ED4_reference * reference
Definition: ed4_class.hxx:1447
static bool get_selected_range(PosRange &range)
Definition: ED4_root.cxx:913
ed_key * edk
Definition: ed4_class.hxx:1457
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:204
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:1114
void ED4_trigger_instant_refresh()
static char * alignment_name
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void scan_string(ED4_multi_species_manager *parent, ED4_reference_terminals &refterms, const char *str, int *index, arb_progress &progress)
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:1739
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:82
ED4_terminal * owner_of_cursor
Definition: ed4_class.hxx:649
void create_consensus(ED4_abstract_group_manager *upper_group_manager, arb_progress *progress)
Definition: ED4_base.cxx:569
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:921
AW_gc_manager * gc_manager
Definition: ed4_class.hxx:1449
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:1861
void ED4_request_full_instant_refresh()
const ED4_folding_line * get_horizontal_folding()
Definition: ed4_class.hxx:356
void ED4_request_full_refresh()
ED4_reference_terminals ref_terminals
Definition: ed4_class.hxx:1441
#define ARRAY_ELEMS(array)
Definition: arb_defs.h:19
char * protstruct
Definition: ed4_class.hxx:1455
AW_window * ED4_create_viewDifferences_window(AW_root *awr)
GBDATA * GB_get_grandfather(GBDATA *gbd)
Definition: arbdb.cxx:1726
char * GBT_get_alignment_type_string(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:727
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:2482
void activate()
Definition: aw_window.hxx:354
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
AW_window * ED4_create_new_seq_window(AW_root *root, SpeciesCreationMode creation_mode)
#define cb(action)
ED4_coords coords
Definition: ed4_class.hxx:716
#define AWAR_EDIT_RIGHTWARD
Definition: ed4_extern.hxx:76
static void gc_change_cb(GcChange whatChanged)
Definition: ED4_root.cxx:1311
#define e4_assert(bed)
Definition: ed4_class.hxx:11
const int WIDTH
void ED4_quit_editor(AW_window *aww)
int is_multi_species_manager() const
Definition: ed4_class.hxx:1106
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:234
const ED4_objspec & spec
Definition: ed4_class.hxx:919
void ED4_correctBlocktypeAfterSelection()
Definition: ED4_block.cxx:363
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:837
char * detectProperties(GBDATA *gb_main)
Definition: ED4_root.cxx:1939
void world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:359
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:1842
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:1046
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:1660
ED4_level
Definition: ed4_defs.hxx:119
#define SEQUENCE_INFO_WIDTH
Definition: ed4_defs.hxx:81
ED4_species_name_terminal * ED4_find_species_name_terminal(const char *species_name)
Definition: ED4_root.cxx:890
int create_mode(const char *pixmap, const char *help_text_, AW_active mask, const WindowCallback &cb)
Definition: AW_window.cxx:2958
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:353
void show()
Definition: AW_window.cxx:1658
void recalc_font_group()
Definition: ED4_root.cxx:529
#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:433
void aw_clear_message_cb(AW_window *aww)
Definition: AW_status.cxx:747
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:886
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)
void calc_no_of_all(const char *string_to_scan, long *group, long *species)
static char * get_group_consensus(const char *species_name, PosRange range)
Definition: ED4_root.cxx:899
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:1853
int is_abstract_group_manager() const
Definition: ed4_class.hxx:1112
ED4_window * next
Definition: ed4_class.hxx:711
ED4_returncode
Definition: ed4_defs.hxx:160
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:1426
ED4_returncode add_to_selected(ED4_species_name_terminal *object)
Definition: ED4_root.cxx:380
static void ED4_undo_redo(AW_window *aww, GB_UNDO_TYPE undo_type)
Definition: ED4_root.cxx:998
Generic smart pointer.
Definition: smartptr.h:149
LoadableSaiState loadable_SAIs
Definition: ed4_class.hxx:1468
void ED4_toggle_block_type()
Definition: ED4_block.cxx:362
virtual void request_refresh(int clear=1)=0
char * alignment_name
Definition: ed4_class.hxx:1445
GB_BUFFER GB_give_buffer(size_t size)
Definition: arbdb.cxx:305
#define false
Definition: ureadseq.h:13
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:469
ED4_window * first_window
Definition: ed4_class.hxx:1432
AW_window * AW_create_gc_window(AW_root *aw_root, AW_gc_manager *gcman)
Definition: AW_preset.cxx:1373
void help_text(const char *id)
Definition: AW_window.cxx:113
static 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:862
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:2374
void STAT_destroy_ST_ML(ST_ML *&st_ml)
Definition: ST_window.cxx:113
ED4_cursor cursor
Definition: ed4_class.hxx:727
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:566
#define that(thing)
Definition: test_unit.h:1032
void ED4_no_dangerous_modes()
Definition: ED4_root.cxx:1206
ED4_root_group_manager * root_group_man
Definition: ed4_class.hxx:1436
void announce_useraction_in(AW_window *aww)
Definition: ED4_root.cxx:372
bool ED4_get_selected_range(ED4_terminal *term, PosRange &range)
Definition: ED4_block.cxx:352
#define CHARACTEROFFSET
Definition: ed4_defs.hxx:110
GB_alignment_type GBT_get_alignment_type(GBDATA *gb_main, const char *aliname)
Definition: adali.cxx:740
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:1433
ED4_species_name_terminal * ED4_find_SAI_name_terminal(const char *sai_name)
Definition: ED4_root.cxx:894
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:1192
UserActionTracker * need_macro_ability()
Definition: trackers.cxx:450
GB_ERROR GB_write_security_write(GBDATA *gbd, unsigned long level)
Definition: arbdb.cxx:1582
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:1196
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
GB_ERROR GB_pop_transaction(GBDATA *gbd)
Definition: arbdb.cxx:2512
void ED4_get_and_jump_to_current(AW_window *)
Definition: ED4_cursor.cxx:673
void insert_sub_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:642
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:1439
AW_option_menu_struct * create_option_menu(const char *awar_name, bool fallback2default)
AW_pos drag_old_y
Definition: ed4_defs.hxx:248
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
Definition: adali.cxx:670
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:1446
static char * cat(char *toBuf, const char *s1, const char *s2)
Definition: ED4_root.cxx:1036
static AW_window * ED4_zoom_message_window(AW_root *root)
Definition: ED4_root.cxx:1015
GB_ERROR GB_write_int(GBDATA *gbd, long i)
Definition: arbdb.cxx:1244
ED4_extension extension
Definition: ed4_class.hxx:929
#define is_equal_to(val)
Definition: test_unit.h:1014
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:360
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:752
void ED4_calc_terminal_extentions()
ED4_multi_species_manager * get_multi_species_manager() const
Definition: ed4_class.hxx:1594
#define AWAR_EDITOR_ALIGNMENT
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:812
void set_info_area_height(int height)
Definition: AW_window.cxx:793
Definition: ed4_defs.hxx:246
void create_input_field(const char *awar_name, int columns=0)
Definition: AW_button.cxx:855
void ED4_popup_dot_missing_bases_window(AW_window *editor_window)
Definition: ED4_dots.cxx:234
AW_active sina_mask(AW_root *root)
ED4_base * search_spec_child_rek(ED4_level level)
Definition: ED4_base.cxx:434
void resize_all_requesting_childs()
Definition: ED4_root.cxx:454
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:798
ED4_cursor & current_cursor()
Definition: ed4_class.hxx:1405
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:1456
#define AWAR_EDIT_MODE
Definition: ed4_defs.hxx:91
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:32
void AW_help_entry_pressed(AW_window *aww)
Definition: AW_root.cxx:37
AW_pos drag_old_x
Definition: ed4_defs.hxx:248
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:1957
void ED4_restore_curpos(AW_window *aww)
#define AWAR_ERROR_MESSAGES
AW_pos drag_off_x
Definition: ed4_defs.hxx:247
static void title_mode_changed(AW_root *aw_root, AW_window *aww)
Definition: ED4_root.cxx:987
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:2790
const ED4_folding_line * get_next() const
Definition: ed4_class.hxx:311
void ED4_popup_gc_window(AW_window *awp, AW_gc_manager *gcman)
Definition: ED4_root.cxx:1294
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:1212
char * GB_read_string(GBDATA *gbd)
Definition: arbdb.cxx:903
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:428
ED4_window * current_ed4w()
Definition: ed4_class.hxx:1403
BI_ecoli_ref * ecoli_ref
Definition: ed4_class.hxx:1444
ED4_seq_colors * sequence_colors
Definition: ed4_class.hxx:1448
void registerFont(AW_device *device_, int gc, const char *chars=NULp)
bool move_cursor
Definition: ED4_main.cxx:68
DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_Species_Callback, ARB_ERROR, GBDATA *)
AW_root * aw_root
Definition: ed4_class.hxx:1429
int slider_pos_vertical
Definition: ed4_class.hxx:713
void close_sub_menu()
Definition: AW_window.cxx:483
void ED4_resize_all_extensions()
static bool is_species_named(ED4_base *base, const char *species_name)
Definition: ED4_root.cxx:878
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:1077
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:932
void select_all(bool only_species)
void ED4_set_helixnr(AW_window *aww, const char *awar_name)
ED4_index pixel2pos(AW_pos click_x)
Definition: ED4_root.cxx:1926
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:348
static void ED4_remove_faligner_entries()
Definition: ED4_root.cxx:953
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
AW_window_simple * win
#define NULp
Definition: cxxforward.h:97
AW_window * create_first_window()
Definition: ED4_root.cxx:1906
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:1290
void create_text_toggle(const char *var_name, const char *noText, const char *yesText, int buttonWidth=0)
Definition: AW_button.cxx:831
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
Definition: aditem.cxx:139
const ED4_remap * remap() const
Definition: ed4_class.hxx:1788
ED4_blockoperation_type
Definition: ed4_block.hxx:22
static GBDATA * get_first_selected_species(int *total_no_of_selected_species)
Definition: ED4_root.cxx:932
AW_default props_db
Definition: ed4_class.hxx:1430
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:1244
void ED4_saveConfiguration(AW_window *aww, bool hide_aww)
char * GBT_get_default_alignment(GBDATA *gb_main)
Definition: adali.cxx:675
void sep______________()
Definition: AW_window.cxx:750
bool is_hidden
Definition: ed4_class.hxx:726
ED4_species_mode species_mode
Definition: ed4_class.hxx:1442
static int no_of_windows
Definition: ed4_class.hxx:718
const char * local_id(const char *id) const
Definition: AW_window.cxx:744
void remove_elem(const T *elem)
Definition: ed4_list.hxx:75
void GBT_mark_all(GBDATA *gb_main, int flag)
Definition: aditem.cxx:295
void ED4_start_plugin(AW_window *aw, GBDATA *gb_main, const char *pluginname)
#define is_more_or_equal(val)
Definition: test_unit.h:1024
AW_window_menu_modes * aww
Definition: ed4_class.hxx:710
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:130
ED4_returncode create_hierarchy(const char *area_string_middle, const char *area_string_top)
Definition: ED4_root.cxx:550
const AlignDataAccess * ED4_get_aligner_data_access()
Definition: ED4_root.cxx:1227
GB_CSTR GB_read_char_pntr(GBDATA *gbd)
Definition: arbdb.cxx:898
GBDATA * gb_main
Definition: adname.cxx:33
MenuSelectType
Definition: ED4_root.cxx:1100
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:1081
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
Definition: adquery.cxx:531
ARB_ERROR init_alignment()
Definition: ED4_root.cxx:504
void shadow_width(int shadow_thickness)
Definition: AW_window.cxx:1075
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:1828
void ED4_helix_jump_opposite(AW_window *aww)
static void toggle_helix_for_SAI(AW_window *aww)
Definition: ED4_root.cxx:960
AW_window * ED4_create_replace_window(AW_root *root)
Definition: ED4_block.cxx:686
AW_window * ED4_create_editor_options_window(AW_root *root)
#define HEIGHT
Definition: ed4_defs.hxx:75
static ED4_WinContext current_context
Definition: ed4_class.hxx:1388
void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE gbtype)
Definition: ED4_root.cxx:468
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
int old_event_y
Definition: ed4_defs.hxx:250
AW_pos actual_height
Definition: ed4_defs.hxx:249
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:114
void ED4_perform_block_operation(ED4_blockoperation_type operationType)
Definition: ED4_block.cxx:883
ST_ML * st_ml
Definition: ed4_class.hxx:1450
void create_text_field(const char *awar_name, int columns=20, int rows=4)
Definition: AW_button.cxx:985
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:195
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:446
void ED4_finish_and_show_notFoundMessage()
Definition: ED4_cursor.cxx:571
GB_write_int const char s
Definition: AW_awar.cxx:156