ARB
ed4_class.hxx
Go to the documentation of this file.
1 #ifndef ED4_CLASS_HXX
2 #define ED4_CLASS_HXX
3 
4 #ifndef AW_FONT_GROUP_HXX
5 #include <aw_font_group.hxx>
6 #endif
7 #ifndef POS_RANGE_H
8 #include <pos_range.h>
9 #endif
10 
11 #define e4_assert(bed) arb_assert(bed)
12 
13 #define concat(a,b) a##b
14 
15 #ifdef DEBUG
16 # define IMPLEMENT_DUMP // comment out this line to skip compilation of the dump() methods
17 #endif
18 
19 #ifndef ARB_ERROR_H
20 #include <arb_error.h>
21 #endif
22 #ifndef ED4_DEFS_HXX
23 #include "ed4_defs.hxx"
24 #endif
25 #ifndef ED4_SEARCH_HXX
26 #include "ed4_search.hxx"
27 #endif
28 #ifndef _GLIBCXX_LIST
29 #include <list>
30 #endif
31 #ifndef ATTRIBUTES_H
32 #include <attributes.h>
33 #endif
34 #ifndef BI_BASEPOS_HXX
35 #include <BI_basepos.hxx>
36 #endif
37 #ifndef DOWNCAST_H
38 #include <downcast.h>
39 #endif
40 #ifndef CHARTABLE_H
41 #include "chartable.h"
42 #endif
43 
44 #if defined(IMPLEMENT_DUMP) // ------------------------------
45 
46 #if 0
47 #define WARN(msg) void dummy_to_produce_a_warning(int msg) {}
48 #else
49 #define WARN(msg)
50 #endif
51 
52 #define EMPTY_FUNCTION(name) void name() const {}
53 #define EMPTY_FUNCTION_VERBOSE(name) void name(int je_mappelle_##name) const {}
54 
55 #define DERIVABLEFROM(base) concat(prohibited_leafclass_derivation,base)
56 
57 #define COMMON_FOR_BASES() \
58  virtual void dump(size_t indent) const = 0; \
59 
60 #define COMMON_FOR_DERIVABLE(self) \
61  void dump_base(size_t indent) const; \
62  EMPTY_FUNCTION(DERIVABLEFROM(self)); \
63 
64 #define COMMON_FOR_DERIVED(mybase) \
65  void dump_my_base(size_t indent) const { mybase::dump_base(indent); } \
66  virtual const char *baseclassname() const { return #mybase; } \
67 
68 #define COMMON_FOR_INSTANCIABLE(mybase) \
69  void dump(size_t indent) const OVERRIDE; \
70 
71 #define DECLARE_DUMP_FOR_ROOTCLASS(self) \
72  COMMON_FOR_BASES(); \
73  COMMON_FOR_DERIVABLE(self); \
74 
75 #define DECLARE_DUMP_FOR_BASECLASS(self,mybase) \
76  COMMON_FOR_BASES(); \
77  COMMON_FOR_DERIVABLE(self); \
78  COMMON_FOR_DERIVED(mybase); \
79 
80 #define DECLARE_DUMP_FOR_MIDCLASS(self,mybase) \
81  WARN(midclass_is_unwanted); \
82  COMMON_FOR_DERIVABLE(self); \
83  COMMON_FOR_DERIVED(mybase); \
84  COMMON_FOR_INSTANCIABLE(mybase); \
85 
86 #define DECLARE_DUMP_FOR_LEAFCLASS(mybase) \
87  virtual void leaf() { DERIVABLEFROM(mybase)(); } \
88  COMMON_FOR_DERIVED(mybase); \
89  COMMON_FOR_INSTANCIABLE(mybase); \
90 
91 #else
92 #define DECLARE_DUMP_FOR_ROOTCLASS(self)
93 #define DECLARE_DUMP_FOR_BASECLASS(self,mybase)
94 #define DECLARE_DUMP_FOR_MIDCLASS(self,mybase)
95 #define DECLARE_DUMP_FOR_LEAFCLASS(mybase)
96 
97 #endif // IMPLEMENT_DUMP ------------------------------
98 
99 
100 
101 // #define LIMIT_TOP_AREA_SPACE // if defined, top area is size-limited
102 #ifdef LIMIT_TOP_AREA_SPACE
103 #define MAX_TOP_AREA_SIZE 10 // size limit for top-area
104 #endif
105 
106 #define ed4_beep() do { fputc(char(7), stdout); fflush(stdout); } while (0)
107 
112 };
113 
114 // ****************************************
115 // needed prototypes, definitions below
116 // ****************************************
117 
118 class ED4_Edit_String;
119 class ED4_area_manager;
121 class ED4_base;
123 class BaseFrequencies;
124 class ED4_columnStat_terminal;
126 class ED4_cursor;
127 class ED4_device_manager;
128 class ED4_folding_line;
129 class ED4_group_manager;
130 class ED4_line_terminal;
131 class ED4_main_manager;
132 class ED4_manager;
136 class ED4_name_manager;
137 class ED4_pure_text_terminal;
139 class ED4_remap;
140 class ED4_root;
142 class ED4_sequence_info_terminal;
145 class ED4_orf_terminal;
146 class ED4_spacer_terminal;
147 class ED4_species_manager;
148 class ED4_species_name_terminal;
149 class ED4_species_pointer;
150 class ED4_terminal;
151 class ED4_text_terminal;
152 class ED4_tree_terminal;
153 class ED4_flag_header_terminal;
154 class ED4_flag_terminal;
155 class ED4_window;
156 
157 class AP_tree;
158 class ED4_reference;
159 class ED4_seq_colors;
160 class BI_ecoli_ref;
161 class AW_helix;
162 class arb_progress;
163 class ST_ML;
164 class ed_key;
166 
167 template <class T> class ED4_list; // derived from Noncopyable
168 template <class T> class ED4_list_elem; // derived from Noncopyable
169 
172 
175 
176 
178  char *make_string();
179  char *make_top_bot_string();
180 
181  void calc_no_of_all(const char *string_to_scan, // group gets the number of groups in string_to_scan,
182  long *group, // species gets the number of species in string_to_scan
183  long *species);
184 
186  ED4_reference_terminals& refterms,
187  const char *str,
188  int *index,
189  int group_depth,
190  arb_progress *progress);
191 
192  ED4_returncode fill_data(ED4_multi_species_manager *multi_species_manager,
193  ED4_reference_terminals& refterms,
194  char *str,
195  int group_depth,
196  ED4_datamode datamode); // flag only needed for loading a new configuration
197 
199  ED4_reference_terminals& refterms,
200  GBDATA *gb_ali_xxx, // alignment-container (or any subcontainer of)
201  int count_too,
202  ED4_index *max_sequence_terminal_length,
203  bool isSAI);
204 
206  ED4_reference_terminals& refterms,
207  const char *str,
208  int *index,
209  arb_progress& progress);
210 
211  void save_current_config(char *confname);
212 
214 };
215 
216 #define SPECIFIED_OBJECT_TYPES 23
217 
218 class ED4_objspec : public Noncopyable {
219  static bool object_specs_initialized;
220  static bool descendants_uptodate;
221 
222  mutable ED4_level used_children; // in any object of this type
223  mutable ED4_level possible_descendants; // below any object of this type (depends on used_children)
224  mutable ED4_level allowed_descendants; // below any object of this type (depends on allowed_children)
225 
226  void calc_descendants() const;
227 
228 public:
234 
235  ED4_objspec(ED4_properties static_prop_, ED4_level level_, ED4_level allowed_children_, ED4_level handled_level_, ED4_level restriction_level_);
236 
237 #if defined(IMPLEMENT_DUMP)
238  void dump(size_t indent) const;
239 #endif // IMPLEMENT_DUMP
240 
241  static void init_object_specs();
242 
243  bool is_manager() const { return static_prop & PROP_IS_MANAGER; }
244  bool is_terminal() const { return static_prop & PROP_IS_TERMINAL; }
245 
246  bool allowed_to_contain(ED4_level child_level) const {
247  // e4_assert(object_specs_initialized); // @@@ cant check here.. but where
248  e4_assert(is_manager()); // terminals can't contain anything - your test is senseless
249  return allowed_children & child_level;
250  }
251 
252  void announce_added(ED4_level child_level) const {
253  e4_assert(allowed_to_contain(child_level));
254  used_children = ED4_level(used_children|child_level);
255  descendants_uptodate = false;
256  }
257 
258  static void recalc_descendants();
259 
262  if (!descendants_uptodate) recalc_descendants();
263  return possible_descendants;
264  }
265  ED4_level get_allowed_descendants() const { // (allowed = possible + those allowed to add, but not added anywhere)
267  if (!descendants_uptodate) recalc_descendants();
268  return allowed_descendants;
269  }
270 };
271 
272 class ED4_folding_line : virtual Noncopyable {
273  AW_pos dimension; // amount of pixel folded away
274  AW_pos pos; // window position of folding line (x or y, only owner knows which coordinate is folded)
275  ED4_folding_line *next;
276 
277  ED4_folding_line *insert(ED4_folding_line *fl) {
278  e4_assert(!fl->next);
279  if (pos <= fl->pos) { // insert behind
280  next = next ? next->insert(fl) : fl;
281  return this;
282  }
283 
284  fl->next = this;
285  return fl;
286  }
287 
288 public:
289 
290  ED4_folding_line(AW_pos world, AW_pos dim) : dimension(dim), next(NULp) { set_pos(world-dimension); }
291 
292  ~ED4_folding_line() { delete next; }
293 
295  ED4_folding_line *other = ptr;
296  e4_assert(knownNonNull(this));
297  ptr = other ? other->insert(this) : this;
298  }
299 
301  ED4_folding_line *result = this;
302  if (this == fl) {
303  result = next;
304  next = NULp;
305  delete this;
306  }
307  return result;
308  }
309 
310  AW_pos get_dimension() const { return dimension; }
311  const ED4_folding_line *get_next() const { return next; }
312 
313  void warn_illegal_dimension();
314 
315  void set_dimension(AW_pos dim) { dimension = dim; warn_illegal_dimension(); }
317 
318  void set_pos(AW_pos p) { pos = p; }
319  AW_pos get_pos() const { return pos; }
320 
322  if (win<pos) return win;
323  return (next ? next->win2world(win) : win)+dimension;
324  }
325  AW_pos world2win(AW_pos world) const {
326  if (world<pos) return world;
327  world -= dimension;
328  if (!next) return world;
329  return next->world2win(world);
330  }
331 };
332 
336 
337  ED4_scroll_links() : link_for_hor_slider(NULp), link_for_ver_slider(NULp) {}
338 };
339 
340 class ED4_foldable : virtual Noncopyable {
341  ED4_folding_line *horizontal_fl;
342  ED4_folding_line *vertical_fl;
343 protected:
344  void reset() {
345  delete horizontal_fl;
346  delete vertical_fl;
347  horizontal_fl = NULp;
348  vertical_fl = NULp;
349  }
350  bool is_reset() const { return !horizontal_fl && !vertical_fl; }
351 public:
352 
353  ED4_foldable() : horizontal_fl(NULp), vertical_fl(NULp) {}
355 
356  const ED4_folding_line *get_horizontal_folding() { return horizontal_fl; }
357  const ED4_folding_line *get_vertical_folding() { return vertical_fl; }
358 
359  void world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) const { // @@@ old style
360  // Calculates transformation from world to window coordinates in a given window.
361  // world-coordinates inside folded range result in window coordinates lower than folding line position.
362  e4_assert(!is_reset());
363  *xPtr = vertical_fl->world2win(*xPtr);
364  *yPtr = horizontal_fl->world2win(*yPtr);
365  }
366  void win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) const { // @@@ old style
367  // calculates transformation from window to world coordinates in a given window
368  e4_assert(!is_reset());
369  *xPtr = vertical_fl->win2world(*xPtr);
370  *yPtr = horizontal_fl->win2world(*yPtr);
371  }
372 
374  e4_assert(!is_reset());
375  return AW::Position(vertical_fl->world2win(pos.xpos()),
376  horizontal_fl->world2win(pos.ypos()));
377  }
379  e4_assert(!is_reset());
380  return AW::Position(vertical_fl->win2world(pos.xpos()),
381  horizontal_fl->win2world(pos.ypos()));
382  }
383 
386 };
387 
388 
390  ED4_folding_line *scroll_bottom;
391  ED4_folding_line *scroll_right;
392  ED4_folding_line *scroll_top;
393  ED4_folding_line *scroll_left;
394 
395  ED4_base *x_link;
396  ED4_base *y_link;
397  ED4_base *width_link;
398  ED4_base *height_link;
399 
400  AW::Rectangle world;
401 
402  bool folding_dimensions_calculated; // flag to ensure calc_bottomRight_folding_dimensions is called before get_window_rect
403 
404  void init_links() {
405  x_link = NULp;
406  y_link = NULp;
407  width_link = NULp;
408  height_link = NULp;
409  }
410 
411  void init_folding_lines() {
412  scroll_top = NULp;
413  scroll_bottom = NULp;
414  scroll_left = NULp;
415  scroll_right = NULp;
416 
417  folding_dimensions_calculated = false;
418  }
419  void init_pos_size() { world = AW::Rectangle(AW::Origin, AW::ZeroVector); }
420 
421  void init() {
422  init_folding_lines();
423  init_pos_size();
424  init_links();
425  }
426 
427  void update_folding_line_positions() {
428  scroll_top->set_pos(world.top());
429  scroll_left->set_pos(world.left());
430  }
431 
432 public:
433 
435 
436  AW_pos bottom() const { return world.bottom(); }
437  AW_pos right() const { return world.right(); }
438 
439  void reset(ED4_foldable& owner) {
440  destroy_folding_lines(owner);
441  init_pos_size();
442  }
443 
444  AW_pos top_dim() const { return scroll_top->get_dimension(); }
445  AW_pos left_dim() const { return scroll_left->get_dimension(); }
446 
447  bool exists() const { return scroll_top && scroll_bottom && scroll_left && scroll_right; }
448  bool is_linked() const {
449  if (x_link) {
450  e4_assert(y_link);
451  e4_assert(width_link);
452  e4_assert(height_link);
453  return true;
454  }
455  e4_assert(!y_link);
456  e4_assert(!width_link);
457  e4_assert(!height_link);
458  return false;
459  }
460  void link(ED4_base *x, ED4_base *y, ED4_base *w, ED4_base *h) {
461  e4_assert(x && y && w && h);
462 
463  x_link = x;
464  y_link = y;
465  width_link = w;
466  height_link = h;
467  }
468 
469  void replace_x_width_link_to(ED4_base *old_link, ED4_base *new_link) {
470  if (x_link == old_link) x_link = new_link;
471  if (width_link == old_link) width_link = new_link;
472  }
473 
474  void add_to_top_left_dimension(int dx, int dy) {
475  scroll_left->add_to_dimension(dx);
476  scroll_top->add_to_dimension(dy);
477  }
478 
479  void scroll(int dx, int dy) {
480  scroll_left->add_to_dimension(-dx);
481  scroll_top->add_to_dimension(-dy);
482  scroll_right->add_to_dimension(dx);
483  scroll_bottom->add_to_dimension(dy);
484  }
485 
487  e4_assert(folding_dimensions_calculated);
488  return AW::Rectangle(scroll_left->get_pos(), scroll_top->get_pos(),
489  scroll_right->get_pos(), scroll_bottom->get_pos());
490  }
491 
493 
494  void set_rect(const AW::Rectangle& rect) { world = rect; }
496  set_rect(rect);
497  update_folding_line_positions();
498  }
499 
500  void calc_bottomRight_folding_dimensions(int area_width, int area_height) {
501  area_width -= SLIDER_OFFSET;
502  area_height -= SLIDER_OFFSET;
503 
504  AW_pos dim;
505  if (bottom() > area_height) { // our world doesn't fit vertically in our window
506  dim = bottom()-area_height; // calc dimension of both horizontal folding lines
507  scroll_top->set_dimension(std::min(dim, scroll_top->get_dimension()));
508  scroll_bottom->set_dimension(std::max(0, int(dim - scroll_top->get_dimension())));
509  }
510  else {
511  dim = 0;
512  scroll_bottom->set_dimension(0);
513  scroll_top->set_dimension(0);
514  }
515 
516  e4_assert(dim == (scroll_top->get_dimension()+scroll_bottom->get_dimension()));
517  scroll_bottom->set_pos(world.bottom()-dim+SLIDER_OFFSET);
518 
519  if (right()>area_width) { // our world doesn't fit horizontally in our window
520  dim = right()-area_width; // calc dimension of both vertical folding lines
521  scroll_left->set_dimension(std::min(dim, scroll_left->get_dimension()));
522  scroll_right->set_dimension(std::max(0, int(dim - scroll_left->get_dimension())));
523  }
524  else {
525  dim = 0;
526  scroll_right->set_dimension(0);
527  scroll_left->set_dimension(0);
528  }
529 
530  e4_assert(dim == (scroll_left->get_dimension()+scroll_right->get_dimension()));
531  scroll_right->set_pos(world.right()-dim+SLIDER_OFFSET);
532 
533  folding_dimensions_calculated = true;
534  }
535 
536  void create_folding_lines(ED4_foldable& owner, const AW::Rectangle& rect, int area_width, int area_height) {
537  scroll_top = owner.insert_folding_line(rect.top(), 0, PROP_HORIZONTAL);
538  scroll_left = owner.insert_folding_line(rect.left(), 0, PROP_VERTICAL);
539 
540  AW_pos dim = 0;
541  if (rect.bottom() > area_height) dim = rect.bottom() - area_height;
542  scroll_bottom = owner.insert_folding_line(rect.bottom(), dim, PROP_HORIZONTAL);
543 
544  dim = 0;
545  if (rect.right() > area_width) dim = rect.right() - area_width;
546  scroll_right = owner.insert_folding_line(rect.right(), dim, PROP_VERTICAL);
547  }
548 
550  if (scroll_top) owner.delete_folding_line(scroll_top, PROP_HORIZONTAL);
551  if (scroll_bottom) owner.delete_folding_line(scroll_bottom, PROP_HORIZONTAL);
552  if (scroll_left) owner.delete_folding_line(scroll_left, PROP_VERTICAL);
553  if (scroll_right) owner.delete_folding_line(scroll_right, PROP_VERTICAL);
554 
555  init_folding_lines();
556  }
557 };
558 
559 class ED4_base_position : private BasePosition { // derived from a Noncopyable
560  const ED4_terminal *calced4term; // if calced4term => callback is bound to its species manager
561  bool needUpdate;
562 
563  void calc4term(const ED4_terminal *term);
564  void set_term(const ED4_terminal *term) {
565  if (calced4term != term || needUpdate) {
566  calc4term(term);
567  }
568  }
569  void remove_changed_cb();
570 
571 public:
572 
574  : calced4term(NULp),
575  needUpdate(true)
576  {}
577 
579  remove_changed_cb();
580  }
581 
582  void invalidate() {
583  needUpdate = true;
584  }
585 
586  void announce_deletion(const ED4_terminal *term) {
587  if (term == calced4term) {
588  invalidate();
589  remove_changed_cb();
590  }
591  e4_assert(calced4term != term);
592  }
594  if (calced4term) announce_deletion(calced4term);
595  }
596 
597  int get_base_position(const ED4_terminal *base, int sequence_position);
598  int get_sequence_position(const ED4_terminal *base, int base_position);
599 
600  int get_base_count(const ED4_terminal *term) { set_term(term); return base_count(); }
601  int get_abs_len(const ED4_terminal *term) { set_term(term); return abs_count(); }
602 };
603 
604 class ED4_CursorShape;
605 
606 
614 
616 
617 };
618 
621  virtual bool fulfilled_by(const ED4_terminal *) const = 0;
622 };
623 
624 class ED4_WinContextFree { // denies usage of the following functions in classes derived from this
625  AW_device *current_device();
626  ED4_window *current_ed4w();
627  AW_window *current_aww();
628  ED4_cursor& current_cursor();
629 public:
630  void avoid_warning() {}
631 };
632 
633 class ED4_cursor : virtual Noncopyable, virtual ED4_WinContextFree {
634  ED4_window *win;
635  ED4_index cursor_abs_x; // absolute (to terminal) x-position of cursor (absolute world coordinate of edit window)
636  int screen_position; // number of displayed characters leading the cursor
637  mutable ED4_base_position base_position; // # of bases left of cursor
638  ED4_CursorType ctype;
639  ED4_CursorShape *cursor_shape;
640 
641  ED4_returncode draw_cursor(AW_pos x, AW_pos y);
642  ED4_returncode delete_cursor(AW_pos del_mark, ED4_base *target_terminal);
643 
644  void updateAwars(bool new_term_selected);
645 
646 public:
647 
648  bool allowed_to_draw; // needed for cursor handling
650 
651  bool is_partly_visible() const;
652  bool is_completely_visible() const;
653 
654  bool is_hidden_inside_group() const;
655 
656  void changeType(ED4_CursorType typ);
657  ED4_CursorType getType() const { return ctype; }
658 
659  void redraw() { changeType(getType()); }
660 
661  ED4_returncode HideCursor(); // deletes cursor and does refresh
663  ED4_returncode show_clicked_cursor(AW_pos click_xpos, ED4_terminal *target_terminal);
664  ED4_returncode show_cursor_at(ED4_terminal *target_terminal, ED4_index what_pos);
665  ED4_returncode ShowCursor(ED4_index offset_x, ED4_cursor_move move, int move_pos = 1);
666 
667  int get_sequence_pos() const;
668  int get_screen_pos() const { return screen_position; }
669 
670  long get_abs_x() const { return cursor_abs_x; }
671  void set_abs_x();
672 
673  int base2sequence_position(int base_pos) const { return base_position.get_sequence_position(owner_of_cursor, base_pos); }
674  int sequence2base_position(int seq_pos) const { return base_position.get_base_position(owner_of_cursor, seq_pos); }
675 
677 
678  void prepare_shutdown() { base_position.prepare_shutdown(); }
679 
680  void jump_screen_pos(int screen_pos, ED4_CursorJumpType jump_type);
681  void jump_sequence_pos(int sequence_pos, ED4_CursorJumpType jump_type);
682  void jump_base_pos(int base_pos, ED4_CursorJumpType jump_type);
683 
684  int get_screen_relative_pos() const;
685  void set_screen_relative_pos(int scroll_to_relpos);
686 
687  void set_to_terminal(ED4_terminal *terminal, int seq_pos, ED4_CursorJumpType jump_type);
688 
689  inline bool in_species_seq_terminal() const;
690  inline bool in_consensus_terminal() const;
691  inline bool in_SAI_terminal() const;
692 
694  base_position.announce_deletion(object);
695  if (object == owner_of_cursor) owner_of_cursor = NULp; // no need to delete the cursor (deletion triggers full redraw)
696  }
697 
698  void init();
699 
700  ED4_window *window() const { return win; }
701 
702  ED4_cursor(ED4_window *win);
703  ~ED4_cursor();
704 };
705 
706 class ED4_window : public ED4_foldable, virtual ED4_WinContextFree { // derived from Noncopyable
707  void set_scrollbar_indents();
708 
709 public:
710  AW_window_menu_modes *aww; // Points to Window
715  int id; // unique id in window-list
717 
718  static int no_of_windows;
719 
720  char awar_path_for_cursor[50]; // position in current sequence, range = [1;len]
721  char awar_path_for_Ecoli[50]; // position relative to ecoli
722  char awar_path_for_basePos[50]; // base position in current sequence (# of bases left to cursor)
723  char awar_path_for_IUPAC[50]; // IUPAC decoder content for current position
724  char awar_path_for_helixNr[50]; // # of helix (or 0) for current position
725 
726  bool is_hidden;
728 
729  // ED4_window controlling functions
730  static ED4_window *insert_window(AW_window_menu_modes *new_aww); // append to window list
731 
732  void delete_window(ED4_window *window); // delete from window list
733  void reset_all_for_new_config(); // reset structures for loading new config
735 
736  void announce_deletion(ED4_terminal *object) { cursor.announce_deletion(object); }
737 
738  // functions concerned the scrolled area
740  ED4_returncode scroll_rectangle(int dx, int dy);
741  ED4_returncode set_scrolled_rectangle(ED4_base *x_link, ED4_base *y_link, ED4_base *width_link, ED4_base *height_link);
742 
744  // Scrolling in EDIT4 window uses redundant data
745  // - dimension of folding lines
746  // - slider positions in AW_window and ED4_window
747  // This function checks whether they are in sync.
748 
749  bool inSync =
750  (scrolled_rect.top_dim() == aww->slider_pos_vertical) &&
751  (scrolled_rect.left_dim() == aww->slider_pos_horizontal);
752 
753 #if defined(DEBUG)
754  if (!inSync) {
755  fputs("scrollbars not in sync with scrolled_rect:\n", stderr);
756  fprintf(stderr, " aww->slider_pos_vertical =%i scrolled_rect->top_dim() =%f\n", aww->slider_pos_vertical, scrolled_rect.top_dim());
757  fprintf(stderr, " aww->slider_pos_horizontal=%i scrolled_rect->left_dim()=%f\n", aww->slider_pos_horizontal, scrolled_rect.left_dim());
758  }
759 #endif
760 
761  return inSync;
762  }
763 
765 
766  bool shows_xpos(int x) const { return x >= coords.window_left_clip_point && x <= coords.window_right_clip_point; }
767  bool partly_shows(int x1, int y1, int x2, int y2) const;
768  bool completely_shows(int x1, int y1, int x2, int y2) const;
769 
770  void update_window_coords();
771 
772  AW_device *get_device() const { return aww->get_device(AW_MIDDLE_AREA); }
773 
775  ~ED4_window();
776 };
777 
778 class ED4_container : virtual Noncopyable {
779  // contains children of a manager
780 
781  ED4_base **memberList;
782  ED4_index no_of_members; // How much members are in the list
783  ED4_index size_of_list; // allocated size
784 
785  void correct_insert_position(ED4_index& index);
786  void resize(ED4_index needed_size);
787 
788  void shift_list(ED4_index start_index, int length);
789 
790 protected:
791 
792  bool valid_index(ED4_index idx) const { return idx >= 0 && idx<size_of_list; }
793  bool existing_index(ED4_index idx) const { return idx >= 0 && idx<no_of_members; }
794 
795 public:
796 
797  ED4_manager *owner() { return DOWNCAST(ED4_manager*, this); }
798  const ED4_manager *owner() const { return const_cast<ED4_container*>(this)->owner(); }
799 
800  ED4_base* member(ED4_index i) const { e4_assert(i>=0 && i<size_of_list); return memberList[i]; }
801 
802  ED4_index members() const { return no_of_members; }
803  bool empty() const { return !members(); }
804  void clear();
805 
806  void insert_member(ED4_base *new_member); // only used to move members with mouse
807  void append_member(ED4_base *new_member);
808 
809  // an array is chosen instead of a linked list, because destructorhandling is more comfortable in various destructors (manager-destructors)
810 
812  ED4_index search_member(ED4_extension *location, ED4_properties prop); // search member
813 
814  ED4_returncode search_target_species(ED4_extension *location, ED4_properties prop, ED4_base **found_member, ED4_level return_level);
815 
816  ED4_returncode move_member(ED4_index old_pos, ED4_index new_pos);
817 
818 #if defined(IMPLEMENT_DUMP)
819  void dump_container(size_t indent) const;
820 #endif // IMPLEMENT_DUMP
821 
822 #if defined(ASSERTION_USED)
823  bool members_ok() const;
824 #endif // ASSERTION_USED
825 
826  ED4_container();
827  virtual ~ED4_container();
828 };
829 
830 // ----------------------------
831 // ED4_species_pointer
832 
834  // @@@ shall be renamed into ED4_gbdata_pointer to reflect general usage
835 
836  GBDATA *species_pointer; // points to database
837 
838  void addCallback(ED4_base *base);
839  void removeCallback(ED4_base *base);
840 
841 public:
842 
845 
846  GBDATA *Get() const { return species_pointer; }
847  void Set(GBDATA *gbd, ED4_base *base);
848  void notify_deleted() {
849  species_pointer=NULp;
850  }
851 };
852 
853 // ------------------------
854 // callback types
855 
856 template <class BASE, class BASECB>
857 class ED4_cb_list {
858  std::list<BASECB> callbacks;
859 public:
860 #if defined(ASSERTION_USED)
863  e4_assert(empty()); // calling ED4_root::remove_all_callbacks() did not remove all callbacks!
864  }
865 #endif
866  void add_cb(BASECB cb) { callbacks.push_back(cb); }
867  void remove_cb(BASECB cb) { callbacks.remove(cb); }
868 
869  void call(BASE *b) {
870  for (typename std::list<BASECB>::iterator cb = callbacks.begin(); cb != callbacks.end();) {
871  typename std::list<BASECB>::iterator curr = cb;
872  ++cb;
873  (*curr)(b); // Note: may be removed while called
874  }
875  }
876  void clear() { callbacks.clear(); }
877  bool empty() const { return callbacks.empty(); }
878 };
879 
880 // declare callback types used in ED4_cb_list:
881 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_managerCallback, void, ED4_manager*); // generates makeED4_managerCallback
882 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_species_managerCallback, void, ED4_species_manager*); // generates makeED4_species_managerCallback
883 
884 // -----------------
885 // ED4_base
886 
887 class ED4_base;
888 
889 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_route_cb, ARB_ERROR, ED4_base*); // generates makeED4_route_cb
890 
896 };
897 
898 class ED4_base : virtual Noncopyable {
899  // base object
900 
901  ED4_species_pointer my_species_pointer;
902 
903  // cache world coordinates:
904 
905  static int currTimestamp;
906  mutable AW::Position lastPos;
907  mutable int timestamp;
908 
909  ED4_base_list *linked_objects; // linked list of objects which are depending from this object
910 
911  virtual bool set_dynamic_size() {
912  // default behavior: keep size
913  // (overload to implement dynamic sizing; also set static_prop!)
914  e4_assert(!(spec.static_prop & PROP_DYNA_RESIZE)); // forgot to overload set_dynamic_size?
915  return false; // = "nothing changed"
916  }
917 
918 public:
919  const ED4_objspec& spec; // contains information about Objectproperties
920 
921  ED4_manager *parent; // Points to parent
922 
923 
924  ED4_properties dynamic_prop; // contains info about what i am, what i can do, what i should do
925  char *id; // globally unique name in hierarchy
926  ED4_index index; // defines the order of child objects
927  ED4_base *width_link; // concerning the hierarchy
928  ED4_base *height_link; // concerning the hierarchy
929  ED4_extension extension; // contains relative info about graphical properties
930  ED4_update_info update_info; // info about things to be done for the object, i.e. refresh; flag structure
931  struct {
932  unsigned int hidden : 1; // flag whether object is hidden or not
933  } flag;
934 
935  void draw_bb(int color);
936 
938 
939  // function for species_pointer
940  //
941  // Notes:
942  //
943  // * design is broken @@@
944  // - my_species_pointer should be member of those derived classes, where it's used
945  // - accessor functions should tell what we get (eg. ED4_species_name_terminal::get_name_entry() or similar)
946  //
947  // * current uses of my_species_pointer (grepped for 'set_species_pointer' to detect):
948  // - ED4_species_manager [holds pointer to] species/SAI container
949  // - ED4_species_name_terminal [holds pointer to] the 'name' entry of species/SAI
950  // - ED4_sequence_info_terminal [holds pointer to] the displayed sub-entry of the alignment-container of species/SAI (multiple may exist per species)
951  // - ED4_text_terminal [holds pointer to] same as ED4_sequence_info_terminal (Caution: not true for all text terminals!)
952 
953  GBDATA *get_species_pointer() const { return my_species_pointer.Get(); }
954  void set_species_pointer(GBDATA *gbd) { my_species_pointer.Set(gbd, this); }
955  bool has_callback() const { return get_species_pointer(); }
956 
957  // callbacks
958 
959  virtual void changed_by_database();
960  virtual void deleted_from_database();
961 
962  // functions concerned with graphic output
964  virtual void Show(bool refresh_all, bool is_cleared) = 0;
965 
966  virtual bool calc_bounding_box() = 0;
967  void resize_dynamic() {
968  if (set_dynamic_size()) {
969  e4_assert(has_property(PROP_DYNA_RESIZE)); // object dynamically changed size (but isn't allowed to!)
970  request_resize();
971  }
972  }
973 
974  ED4_returncode clear_background(int color=0);
975 
976  void set_links(ED4_base *width_ref, ED4_base *height_ref);
977  void set_both_links(ED4_base *ref) { set_links(ref, ref); }
978 
979  // functions concerned with special initialization
980  void set_property(ED4_properties prop) { dynamic_prop = (ED4_properties) (dynamic_prop | prop); }
981  void clr_property(ED4_properties prop) { dynamic_prop = (ED4_properties) (dynamic_prop & ~prop); }
982  bool has_property(ED4_properties prop) const { return dynamic_prop & prop; }
983 
984  // functions concerned with coordinate transformation
985 
986  void calc_rel_coords(AW_pos *x, AW_pos *y);
987 
988  void calc_world_coords(AW_pos *x, AW_pos *y) const {
990  *x = lastPos.xpos();
991  *y = lastPos.ypos();
992  }
995  return lastPos;
996  }
997 
999  bool cache_up_to_date = timestamp == currTimestamp;
1000  if (!cache_up_to_date) {
1001  if (parent) {
1002  ED4_base *pab = (ED4_base*)parent;
1003  lastPos = pab->calc_world_coords();
1004  }
1005  else {
1006  lastPos = AW::Origin;
1007  }
1008  lastPos.move(extension.get_parent_offset());
1009  timestamp = currTimestamp;
1010  }
1011  }
1012 
1013  static void touch_world_cache() {
1014  currTimestamp++;
1015  }
1016 
1019  return AW::Rectangle(pos, extension.get_size()-AW::Vector(1, 1));
1020  }
1021 
1022  // functions which refer to the object as a child, i.e. travelling down the hierarchy
1023  virtual void request_refresh(int clear=1) = 0;
1024 
1025  inline void request_resize();
1026  void request_resize_of_linked();
1028  virtual void resize_requested_children() = 0;
1029 
1030  virtual void delete_requested_children() = 0;
1031  virtual void Delete() = 0;
1032 
1033  inline void set_update();
1034  virtual void update_requested_children() = 0;
1035 
1036  virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) = 0;
1037 
1038  virtual ARB_ERROR route_down_hierarchy(const ED4_route_cb& cb);
1039 
1040  int calc_group_depth();
1041 
1042  // general purpose functions
1043  virtual ED4_base *search_ID(const char *id) = 0;
1044 
1045  void check_all();
1046  short in_border(AW_pos abs_x, AW_pos abs_y, ED4_movemode mode);
1048 
1049 
1050  ED4_AREA_LEVEL get_area_level(ED4_multi_species_manager **multi_species_manager=NULp) const; // returns area we belong to and the next multi species manager of the area
1051 
1052  inline ED4_manager *get_parent(ED4_level lev) const;
1053  void unlink_from_parent();
1054  bool has_parent(ED4_manager *Parent);
1055  bool is_child_of(ED4_manager *Parent) { return has_parent(Parent); }
1056 
1057  virtual char *resolve_pointer_to_string_copy(int *str_len = NULp) const;
1058  virtual const char *resolve_pointer_to_char_pntr(int *str_len = NULp) const;
1059 
1061  virtual bool is_hidden() const = 0;
1062 
1063  char *get_name_of_species(); // go from terminal to name of species
1064 
1065  // functions which refer to the selected object(s), i.e. across the hierarchy
1066 
1069 
1071 
1072  virtual void remove_callbacks() = 0;
1073 
1075 
1076  ED4_base(const ED4_objspec& spec_, GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
1077  virtual ~ED4_base();
1078 
1079  // use the following functions to test which derived class we have
1080 
1081  int is_terminal() const { e4_assert(knownNonNull(this)); return spec.static_prop & PROP_IS_TERMINAL; }
1082 
1084 
1086 
1089  int is_orf_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_ORF; }
1090 
1091  int is_pure_text_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_PURE_TEXT; }
1092  int is_columnStat_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_COL_STAT; }
1093 
1094  int is_bracket_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_BRACKET; }
1095  int is_spacer_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_SPACER; }
1096  int is_line_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_LINE; }
1097 
1098  int is_flag_header_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_FLAG_HEADER; }
1099  int is_flag_terminal() const { e4_assert(knownNonNull(this)); return spec.level & LEV_FLAG; }
1100 
1101  int is_manager() const { e4_assert(knownNonNull(this)); return spec.static_prop & PROP_IS_MANAGER; }
1102 
1103  int is_sequence_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_SEQUENCE; }
1104  int is_multi_name_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_MULTI_NAME; }
1105  int is_name_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_NAME_MANAGER; }
1108  int is_device_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_DEVICE; }
1109 
1110  int is_group_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_GROUP; }
1111  int is_root_group_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_ROOTGROUP; }
1113 
1114  int is_species_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_SPECIES; }
1115  int is_area_manager() const { e4_assert(knownNonNull(this)); return spec.level & LEV_AREA; }
1116 
1117  // use the following functions to cast ED4_base to derived classes:
1118 
1119 #define E4B_DECL_CASTOP_helper(Class,toName) \
1120  inline const Class *toName() const; \
1121  inline Class *toName();
1122 
1123 #define E4B_AVOID_CAST__helper(Class,toName,isName) \
1124  const Class *toName() const; \
1125  Class *toName(); \
1126  int isName() const;
1127 
1128 #define E4B_IMPL_CASTOP_helper(Class,toName,isName) \
1129  const Class *ED4_base::toName() const { \
1130  e4_assert(isName()); \
1131  return DOWNCAST(const Class*, this); \
1132  } \
1133  Class *ED4_base::toName() { \
1134  return const_cast<Class*>(const_cast<const ED4_base*>(this)->toName()); \
1135  }
1136 
1137 #define E4B_DECL_CASTOP(name) E4B_DECL_CASTOP_helper(concat(ED4_,name), concat(to_,name))
1138 #define E4B_AVOID_UNNEEDED_CASTS(name) E4B_AVOID_CAST__helper(concat(ED4_,name), concat(to_,name), concat(is_,name))
1139 #define E4B_IMPL_CASTOP(name) E4B_IMPL_CASTOP_helper(concat(ED4_,name), concat(to_,name), concat(is_,name))
1140 
1141  E4B_DECL_CASTOP(area_manager); // to_area_manager
1142  E4B_DECL_CASTOP(abstract_group_manager); // to_abstract_group_manager
1143  E4B_DECL_CASTOP(bracket_terminal); // to_bracket_terminal
1144  E4B_DECL_CASTOP(columnStat_terminal); // to_columnStat_terminal
1145  E4B_DECL_CASTOP(consensus_sequence_terminal); // to_consensus_sequence_terminal
1146  E4B_DECL_CASTOP(device_manager); // to_device_manager
1147  E4B_DECL_CASTOP(group_manager); // to_group_manager
1148  E4B_DECL_CASTOP(line_terminal); // to_line_terminal
1149  E4B_DECL_CASTOP(manager); // to_manager
1150  E4B_DECL_CASTOP(multi_name_manager); // to_multi_name_manager
1151  E4B_DECL_CASTOP(multi_sequence_manager); // to_multi_sequence_manager
1152  E4B_DECL_CASTOP(multi_species_manager); // to_multi_species_manager
1153  E4B_DECL_CASTOP(name_manager); // to_name_manager
1154  E4B_DECL_CASTOP(orf_terminal); // to_orf_terminal
1155  E4B_DECL_CASTOP(pure_text_terminal); // to_pure_text_terminal
1156  E4B_DECL_CASTOP(root_group_manager); // to_root_group_manager
1157  E4B_DECL_CASTOP(sequence_info_terminal); // to_sequence_info_terminal
1158  E4B_DECL_CASTOP(sequence_manager); // to_sequence_manager
1159  E4B_DECL_CASTOP(sequence_terminal); // to_sequence_terminal
1160  E4B_DECL_CASTOP(spacer_terminal); // to_spacer_terminal
1161  E4B_DECL_CASTOP(species_manager); // to_species_manager
1162  E4B_DECL_CASTOP(species_name_terminal); // to_species_name_terminal
1163  E4B_DECL_CASTOP(terminal); // to_terminal
1164  E4B_DECL_CASTOP(text_terminal); // to_text_terminal
1165  E4B_DECL_CASTOP(flag_header_terminal); // to_flag_header_terminal
1166  E4B_DECL_CASTOP(flag_terminal); // to_flag_terminal
1167 
1168  // simple access to containing managers
1169  inline ED4_species_manager *containing_species_manager() const;
1170 
1171  // discriminate between different sequence managers:
1172 
1173  inline bool is_consensus_manager() const;
1174  inline bool is_SAI_manager() const;
1175  inline bool is_species_seq_manager() const;
1176 
1177  inline ED4_species_type get_species_type() const; // works for all items (recursively) contained in ED4_species_manager
1178 
1179  inline bool inside_consensus_manager() const;
1180  inline bool inside_SAI_manager() const;
1181  inline bool inside_species_seq_manager() const;
1182 
1183  inline bool is_consensus_terminal() const;
1184  inline bool is_SAI_terminal() const;
1185  inline bool is_species_seq_terminal() const;
1186 
1187  inline bool is_consensus_sequence_terminal() const { // alias for CASTOP
1188  return is_consensus_terminal();
1189  }
1190 };
1191 MARK_NONFINAL_FUNCTION(ED4_base,bool,set_dynamic_size,(),false);
1192 
1193 DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_basePredicate, bool, ED4_base*); // generates makeED4_basePredicate
1194 
1195 class ED4_manager : public ED4_base, public ED4_container { // derived from a Noncopyable
1197 public:
1198 
1199  E4B_AVOID_UNNEEDED_CASTS(manager);
1201 
1202  void add_delete_callback(const ED4_managerCallback& cb) { delete_cbs.add_cb(cb); }
1203  void remove_delete_callback(const ED4_managerCallback& cb) { delete_cbs.remove_cb(cb); }
1204 
1205  int refresh_flag_ok();
1206 
1209 
1210  // functions concerned with graphics
1211  void Show(bool refresh_all, bool is_cleared) OVERRIDE;
1213 
1215 
1216  // top-down functions, means travelling down the hierarchy
1217  ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) FINAL_OVERRIDE;
1218 
1219  void request_refresh(int clear=1) FINAL_OVERRIDE;
1221 
1222  void resize_requested_children() OVERRIDE;
1223 
1224  void update_requested_children() OVERRIDE;
1225 
1226  void delete_requested_children() OVERRIDE;
1227  void Delete() FINAL_OVERRIDE;
1228 
1230 
1231  void create_consensus(ED4_abstract_group_manager *upper_group_manager, arb_progress *progress);
1232 
1233  ARB_ERROR route_down_hierarchy(const ED4_route_cb& cb) FINAL_OVERRIDE;
1234 
1235  ED4_base *find_first_that(ED4_level level, const ED4_basePredicate& fulfills_predicate);
1236 
1237  // bottom-up functions
1239  inline void resize_requested_by_child();
1243 
1244  ED4_base *get_defined_level(ED4_level lev) const;
1245 
1246  // functions referring the consensus
1247 
1248  void update_consensus(ED4_manager *old_parent, ED4_manager *new_parent, ED4_base *sequence);
1249  ED4_returncode rebuild_consensi(ED4_base *start_species, ED4_update_flag update_flag);
1250 
1251  ED4_returncode check_in_bases(ED4_base *added_base);
1252  ED4_returncode check_out_bases(ED4_base *subbed_base);
1253 
1254  ED4_returncode update_bases(const ED4_base *old_base, const ED4_base *new_base, PosRange range = PosRange::whole());
1255  ED4_returncode update_bases(const char *old_seq, int old_len, const char *new_seq, int new_len, PosRange range = PosRange::whole());
1256  ED4_returncode update_bases(const char *old_seq, int old_len, const ED4_base *new_base, PosRange range = PosRange::whole());
1257  ED4_returncode update_bases(const BaseFrequencies *old_table, const BaseFrequencies *new_table, PosRange range = PosRange::whole());
1258 
1259  ED4_returncode update_bases_and_rebuild_consensi(const char *old_seq, int old_len, ED4_base *species, ED4_update_flag update_flag, PosRange range = PosRange::whole());
1260 
1261  // handle moves across the hierarchy
1263 
1266  ED4_base *search_spec_child_rek(ED4_level level); // recursive search for level
1267 
1268  // general purpose functions
1269  ED4_base *search_ID(const char *id) FINAL_OVERRIDE;
1270  void remove_callbacks() OVERRIDE;
1271 
1272  ED4_terminal *get_first_terminal(int start_index=0) const;
1273  ED4_terminal *get_last_terminal(int start_index=-1) const;
1274 
1275  void hide_children();
1276  void unhide_children();
1277 
1278  bool is_hidden() const FINAL_OVERRIDE {
1279  if (flag.hidden) return true;
1280  if (!parent) return false;
1281  return parent->is_hidden();
1282  }
1283 
1284  ED4_manager(const ED4_objspec& spec_, const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1286 };
1289 
1290 class ED4_terminal : public ED4_base { // derived from a Noncopyable
1291  E4B_AVOID_UNNEEDED_CASTS(terminal);
1292 
1293 public:
1294 
1295  struct { unsigned int deleted : 1; } tflag; // @@@ go bool
1296 
1298 
1300 
1301  // callbacks
1302 
1305 
1306  // functions concerning graphic output
1307  void Show(bool refresh_all, bool is_cleared) OVERRIDE;
1308  virtual void draw() = 0;
1309 
1311 
1312  ED4_returncode draw_drag_box(AW_pos x, AW_pos y, GB_CSTR text = NULp, int cursor_y=-1);
1313 
1314  // functions which concern the object as a child
1315  void request_refresh(int clear=1) FINAL_OVERRIDE;
1316 
1317  void resize_requested_children() OVERRIDE;
1318 
1319  void update_requested_children() OVERRIDE;
1320  void delete_requested_children() OVERRIDE;
1321  void Delete() OVERRIDE;
1322 
1323  ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) OVERRIDE;
1324 
1325  ED4_returncode kill_object();
1326 
1327  // general purpose functions
1328  ED4_base *search_ID(const char *id) OVERRIDE;
1329  char *resolve_pointer_to_string_copy(int *str_len = NULp) const FINAL_OVERRIDE;
1330  const char *resolve_pointer_to_char_pntr(int *str_len = NULp) const FINAL_OVERRIDE;
1331  void remove_callbacks() FINAL_OVERRIDE;
1332 
1333  GB_ERROR write_sequence(const char *seq, int seq_len);
1334 
1335  void scroll_into_view(ED4_window *ed4w);
1336  inline bool setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfoldGroups, ED4_CursorJumpType jump_type);
1337 
1338  bool is_hidden() const FINAL_OVERRIDE { return parent && parent->is_hidden(); }
1339 
1340  ED4_terminal(const ED4_objspec& spec_, GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
1342 };
1344 
1349  ED4_SM_INFO // same functionality as AWT_MODE_INFO
1350 };
1351 
1353  ED4_sequence_info_terminal *ref_sequence_info;
1354  ED4_sequence_terminal *ref_sequence;
1355  ED4_sequence_info_terminal *ref_column_stat_info;
1356  ED4_columnStat_terminal *ref_column_stat;
1357 
1358  void null() { ref_sequence_info = NULp; ref_sequence = NULp; ref_column_stat = NULp; ref_column_stat_info = NULp; }
1359 public:
1360  void clear();
1361  void init(ED4_sequence_info_terminal *, ED4_sequence_terminal *, ED4_sequence_info_terminal *, ED4_columnStat_terminal *);
1362 
1363  ED4_sequence_terminal *sequence() { return ref_sequence; }
1364  ED4_sequence_info_terminal *sequence_info() { return ref_sequence_info; }
1365  ED4_columnStat_terminal *column_stat() { return ref_column_stat; }
1366  ED4_sequence_info_terminal *column_stat_info() { return ref_column_stat_info; }
1367 
1370 };
1371 
1373  ED4_window *ed4w;
1374  AW_device *device;
1375 
1376  bool is_set() const { return ed4w; }
1377  void init(ED4_window *ew) {
1378  e4_assert(ew);
1379  ed4w = ew;
1380  device = ed4w->get_device();
1381  }
1382 
1383  void warn_missing_context() const;
1384  void expect_context() const { if (!is_set()) warn_missing_context(); }
1385 
1386 protected:
1387  ED4_WinContext() : ed4w(NULp), device(NULp) {}
1389 
1390 public:
1391  inline ED4_WinContext(AW_window *aww_);
1392  ED4_WinContext(ED4_window *ed4w_) { init(ed4w_); }
1393 
1394  AW_device *get_device() const { expect_context(); return device; }
1395  ED4_window *get_ed4w() const { expect_context(); return ed4w; }
1396 
1397  static const ED4_WinContext& get_current_context() { return current_context; }
1398  static bool have_context() { return current_context.is_set(); }
1399 };
1400 
1401 // accessors for current context (see also ED4_WinContextFree)
1404 inline AW_window *current_aww() { return current_ed4w()->aww; }
1406 
1411 };
1412 
1413 class ED4_root : virtual Noncopyable {
1414  void ED4_ROOT() const { e4_assert(0); } // avoid ED4_root-members use global ED4_ROOT
1415 
1416  void refresh_window_simple(bool redraw);
1417  void handle_update_requests(bool& redraw);
1418 
1419  ED4_window *most_recently_used_window;
1420  ConsensusBuildParams *cons_param;
1421 
1422 public:
1423  char *db_name; // name of Default Properties database (complete path)
1424  AW_root *aw_root; // Points to 'AW-Window-Controller'
1425  AW_default props_db; // Default Properties database
1426 
1427  ED4_window *first_window; // Points to List of Main Windows of ED4
1428  ED4_main_manager *main_manager; // Points to Main manager of ED4
1429  ED4_area_manager *middle_area_man; // Points to middle area
1432  EDB_root_bact *database; // Points to Object which controls Data
1435  bool folding_action; // flag tells whether action was folding action or not
1450  char *protstruct; // protein structure summary
1451  long protstruct_len; // protein structure summary
1454 
1459 
1460  const ConsensusBuildParams& get_consensus_params();
1461  void reset_consensus_params();
1462 
1463  LoadableSaiState loadable_SAIs; // maintain proper refresh of list of loadable SAIs
1464  void loadable_SAIs_may_have_changed() { if (loadable_SAIs == LSAI_UPTODATE) loadable_SAIs = LSAI_OUTDATED; }
1465 
1466  int temp_gc;
1468 
1469  void announce_useraction_in(AW_window *aww);
1471  e4_assert(most_recently_used_window);
1472  return most_recently_used_window;
1473  }
1474 
1475  inline ED4_device_manager *get_device_manager();
1476 
1477  // Initializing functions
1478  ED4_returncode create_hierarchy(const char *area_string_middle, const char *area_string_top);
1479  ARB_ERROR init_alignment();
1480  void recalc_font_group();
1481 
1482  AW_window *create_first_window();
1483  ED4_returncode generate_window(AW_device **device, ED4_window **new_window);
1484  void copy_window_struct(ED4_window *source, ED4_window *destination);
1485 
1486  // functions concerned with global refresh and resize
1487  void resize_all_requesting_childs();
1488 
1489  void special_window_refresh(bool handle_updates);
1490  ED4_returncode refresh_all_windows(bool redraw);
1491 
1492  void request_refresh_for_all_terminals();
1493  void request_refresh_for_specific_terminals(ED4_level lev);
1494  void request_refresh_for_consensus_terminals();
1495  void request_refresh_for_sequence_terminals();
1496 
1497  inline void announce_deletion(ED4_base *object); // before deleting an object, use this to announce
1498 
1499  // functions concerned with list of selected objects
1500  ED4_returncode add_to_selected(ED4_species_name_terminal *object);
1501  void remove_from_selected(ED4_species_name_terminal *object);
1502  ED4_returncode deselect_all();
1503 
1504  ED4_returncode get_area_rectangle(AW_screen_area *rect, AW_pos x, AW_pos y);
1505 
1506  ED4_index pixel2pos(AW_pos click_x);
1507 
1508  void remove_all_callbacks();
1509 
1510  ED4_root(int *argc, char*** argv);
1511  ~ED4_root();
1512 };
1513 
1515 
1517  ED4_LocalWinContext(AW_window *aww) : ED4_WinContext(current_context) { current_context = ED4_WinContext(aww); }
1518  ED4_LocalWinContext(ED4_window *ew) : ED4_WinContext(current_context) { current_context = ED4_WinContext(ew); }
1519  ~ED4_LocalWinContext() { current_context = *this; }
1520 };
1521 
1523  ED4_LocalWinContext *most_recent;
1524 public:
1525  ED4_MostRecentWinContext() : most_recent(NULp) {
1528  }
1529  }
1531  delete most_recent;
1532  }
1533 };
1534 
1535 inline void ED4_root::announce_deletion(ED4_base *object) {
1536  if (object->is_terminal()) {
1537  ED4_terminal *term = object->to_terminal();
1538  for (ED4_window *win = first_window; win; win = win->next) {
1539  ED4_LocalWinContext uses(win);
1540  win->announce_deletion(term);
1541  }
1542  }
1543 }
1544 
1545 // ------------------------
1546 // manager classes
1547 //
1548 // All manager classes only differ in their static properties.
1549 // This kind of construction was chosen for using a minimum of RAM
1550 
1551 class ED4_main_manager FINAL_TYPE : public ED4_manager { // derived from a Noncopyable
1552  // first in hierarchy
1553 
1554  E4B_AVOID_UNNEEDED_CASTS(main_manager);
1555 
1556  // these terminals are redrawn after refresh (with increase clipping area)
1557  // to revert text from middle area drawn into top area:
1558  ED4_terminal *top_middle_line;
1559  ED4_terminal *top_middle_spacer;
1560 
1561 public:
1562  ED4_main_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1563 
1564  void set_top_middle_spacer_terminal(ED4_terminal *top_middle_spacer_) { top_middle_spacer = top_middle_spacer_; }
1565  void set_top_middle_line_terminal(ED4_terminal *top_middle_line_) { top_middle_line = top_middle_line_; }
1566 
1567  ED4_terminal *get_top_middle_spacer_terminal() const { return top_middle_spacer; }
1568  ED4_terminal *get_top_middle_line_terminal() const { return top_middle_line; }
1569 
1570  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1571 
1572  void Show(bool refresh_all, bool is_cleared) OVERRIDE;
1573  void resize_requested_children() OVERRIDE;
1574 
1575  void clear_whole_background();
1576 };
1577 
1578 struct ED4_device_manager : public ED4_manager {
1579  E4B_AVOID_UNNEEDED_CASTS(device_manager);
1580  ED4_device_manager (const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1581  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1582 };
1583 
1584 struct ED4_area_manager : public ED4_manager {
1585  E4B_AVOID_UNNEEDED_CASTS(area_manager);
1586  ED4_area_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1587  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1588 
1590  return get_defined_level(LEV_MULTI_SPECIES)->to_multi_species_manager();
1591  }
1592 };
1593 
1594 class ED4_multi_species_manager : public ED4_manager {
1595  E4B_AVOID_UNNEEDED_CASTS(multi_species_manager);
1596 
1597  int species; // # of species (-1 == unknown)
1598  int selected_species; // # of selected species (-1 == unknown)
1599 
1600  void set_species_counters(int no_of_species, int no_of_selected);
1601 #ifdef DEBUG
1602  void count_species(int *speciesPtr, int *selectedPtr) const;
1603 #endif
1604  void update_species_counters();
1605 
1606 public:
1607  ED4_multi_species_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1608 
1609  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1610 
1613 
1614  int count_visible_children(); // is called by a multi_species_manager
1615 
1616  ED4_species_manager *get_consensus_manager() const; // returns the consensus-manager or NULp
1617  ED4_species_name_terminal *get_consensus_name_terminal() const; // returns the consensus-name-terminal or NULp
1618 
1619  // functions concerned with selection
1620  int get_no_of_selected_species();
1621  int get_no_of_species();
1622 
1623  void update_group_id();
1624 
1625  void invalidate_species_counters();
1626  int has_valid_counters() const { return species != -1 && selected_species!=-1; }
1627  bool all_are_selected() const { e4_assert(has_valid_counters()); return species == selected_species; }
1628 
1629  void select_all(bool only_species);
1630  void deselect_all_species_and_SAI();
1631  void invert_selection_of_all_species();
1632  void marked_species_select(bool select);
1633  void selected_species_mark(bool mark);
1634 
1635  void toggle_selected_species();
1636 };
1637 
1638 class ED4_abstract_group_manager : public ED4_manager {
1639  E4B_AVOID_UNNEEDED_CASTS(abstract_group_manager);
1640 protected:
1641  BaseFrequencies my_table; // table concerning Consensusfunction
1642 
1643 public:
1644  ED4_abstract_group_manager(const ED4_objspec& spec_, const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1645 
1647 
1648  BaseFrequencies& table() { return my_table; }
1649  const BaseFrequencies& table() const { return my_table; }
1650 
1652  return get_defined_level(LEV_MULTI_SPECIES)->to_multi_species_manager();
1653  }
1654 
1655  char *build_consensus_string(PosRange range) const { return table().build_consensus_string(range, ED4_ROOT->get_consensus_params()); }
1656  char *build_consensus_string(int *cons_length = NULp) const {
1657  if (cons_length) *cons_length = table().size();
1658  return table().build_consensus_string(ED4_ROOT->get_consensus_params());
1659  }
1660 };
1661 
1663  E4B_AVOID_UNNEEDED_CASTS(group_manager);
1664  ED4_group_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1666  void reinit_char_table();
1667 
1668  void fold();
1669  void unfold();
1670  void toggle_folding();
1671 };
1672 
1674  ED4_RM_NONE, // no remapping (normal mode)
1675  ED4_RM_SHOW_ABOVE, // Show all positions, where xxx% of all edited sequences have any base
1676  ED4_RM_MAX_ALIGN, // ------------------------- any edited sequence has a base
1677  ED4_RM_MAX_EDIT, // like ED4_RM_MAX_ALIGN, but bases are pushed OVER remapped gaps (not INTO)
1678  ED4_RM_DYNAMIC_GAPS, // gaps shown as spaces (more gaps => more spaces)
1679 
1681 
1682 };
1683 
1684 class ED4_remap : virtual Noncopyable {
1685 
1686  ED4_remap_mode mode;
1687  int show_above_percent; // used only for ED4_RM_SHOW_ABOVE
1688 
1689  size_t sequence_table_len; // allocated size of sequence_to_screen_tab
1690  size_t screen_table_len; // allocated size of screen_to_sequence_tab
1691 
1692  size_t sequence_len; // size of recently compiled part of sequence_to_screen_tab
1693  size_t screen_len; // size of recently compiled part of screen_to_sequence_tab
1694 
1695  int *screen_to_sequence_tab;
1696  int *sequence_to_screen_tab; // <0 means position is not mapped (last displayed sequence position); 0 may be mapped or not; see is_shown() below
1697 
1698  int changed; // remap-table changed at last compile
1699  int update_needed; // remapping should be recompiled
1700 
1701  inline void set_sequence_to_screen(int pos, int newVal);
1702 
1703 public:
1704 
1705  ED4_remap();
1706  ~ED4_remap();
1707 
1708  int screen_to_sequence(int screen_pos) const;
1709 
1710  int sequence_to_screen_PLAIN(int sequence_pos) const {
1711  e4_assert(sequence_pos>=0 && size_t(sequence_pos)<=sequence_len);
1712  return sequence_to_screen_tab[sequence_pos];
1713  }
1714  int shown_sequence_to_screen(int sequence_pos) const {
1715  // as well works for sequence_pos == MAXSEQUENCECHARACTERLENGTH
1716  int screen_pos = sequence_to_screen_PLAIN(sequence_pos);
1717  e4_assert(screen_pos >= 0); // sequence_pos expected to be visible (i.e. not folded away)
1718  return screen_pos;
1719  }
1720 
1721  int clipped_sequence_to_screen_PLAIN(int sequence_pos) const;
1722  int sequence_to_screen(int sequence_pos) const;
1723 
1725  e4_assert(!range.is_empty());
1726  return PosRange(sequence_to_screen(range.start()), sequence_to_screen(range.end()));
1727  }
1729  e4_assert(!range.is_empty());
1730  if (range.is_unlimited()) return PosRange::from(screen_to_sequence(range.start()));
1731  return PosRange(screen_to_sequence(range.start()), screen_to_sequence(range.end()));
1732  }
1733 
1734  size_t get_max_screen_pos() const { return screen_len-1; }
1735 
1736  void adjacent_screen_positions(int seq_pos, int& screen_pos_left, int& screen_pos_right);
1737 
1738  ED4_remap_mode get_mode() const { return mode; }
1739  void set_mode(ED4_remap_mode Mode, int above_percent) {
1741  Mode = ED4_RM_NONE;
1742  }
1743  if (mode!=Mode) {
1744  mode = Mode;
1745  update_needed = 1;
1746  }
1747 
1748  if (show_above_percent!=above_percent) {
1749  show_above_percent = above_percent;
1750  if (mode==ED4_RM_SHOW_ABOVE) {
1751  update_needed = 1;
1752  }
1753  }
1754  }
1755 
1756  void mark_compile_needed(); // recompile if mode != none
1757  void mark_compile_needed_force(); // always recompile
1758  int compile_needed() const { return update_needed; }
1759 
1760  GB_ERROR compile(ED4_root_group_manager *gm);
1761  int was_changed() const { return changed; } // mapping changed by last compile ?
1762 
1763  int is_shown(int seq_pos) const {
1764  int scr_pos = sequence_to_screen_PLAIN(seq_pos);
1765  if (scr_pos<0) return false;
1766  if (scr_pos>0) return true;
1767 
1768  int seq_pos2 = screen_to_sequence_tab[0];
1769  return seq_pos == seq_pos2;
1770  }
1771 
1772  ExplicitRange clip_screen_range(PosRange screen_range) const { return ExplicitRange(screen_range, screen_len-1); }
1773 };
1774 
1776  E4B_AVOID_UNNEEDED_CASTS(root_group_manager);
1777  ED4_remap my_remap;
1778 public:
1779  ED4_root_group_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1780 
1781  bool update_remap(); // 'true' if mapping has changed
1782 
1783  const ED4_remap *remap() const { return &my_remap; }
1784  ED4_remap *remap() { return &my_remap; }
1785 
1786  void Show(bool refresh_all, bool is_cleared) OVERRIDE;
1787  void resize_requested_children() OVERRIDE;
1788 
1790 };
1791 
1792 class ED4_species_manager FINAL_TYPE : public ED4_manager {
1793  E4B_AVOID_UNNEEDED_CASTS(species_manager);
1794 
1795  ED4_cb_list<ED4_species_manager, ED4_species_managerCallback> changed_cbs; // called when sequence changes
1796 
1798  bool selected;
1799 
1800 public:
1801  ED4_species_manager(ED4_species_type type_, const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1802  ~ED4_species_manager() OVERRIDE;
1803 
1804  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1805 
1806  ED4_species_type get_type() const { return type; }
1807 
1808  bool is_selected() const { return selected; }
1809  void set_selected(bool select) {
1810  // e4_assert(type != ED4_SP_CONSENSUS); // it's not allowed to select a consensus // @@@ happens atm when moving a group
1811  selected = select;
1812  }
1813 
1814  bool setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfold_groups, ED4_CursorJumpType jump_type);
1815 
1816  void add_sequence_changed_cb(const ED4_species_managerCallback& cb) { changed_cbs.add_cb(cb); }
1817  void remove_sequence_changed_cb(const ED4_species_managerCallback& cb) { changed_cbs.remove_cb(cb); }
1818  void do_callbacks() { changed_cbs.call(this); }
1819 
1820  ED4_species_name_terminal *get_name_terminal() const { return member(0)->to_species_name_terminal(); }
1821 };
1822 
1823 inline ED4_manager *ED4_base::get_parent(ED4_level lev) const {
1824  ED4_manager *temp_parent = parent;
1825  while (temp_parent && !(temp_parent->spec.level & lev)) {
1826  temp_parent = temp_parent->parent;
1827  }
1828  return temp_parent;
1829 }
1830 
1831 
1832 inline ED4_species_manager *ED4_base::containing_species_manager() const {
1833  ED4_base *sman = get_parent(LEV_SPECIES);
1834  return sman ? sman->to_species_manager() : NULp;
1835 }
1836 
1837 inline bool ED4_base::is_consensus_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_CONSENSUS; }
1838 inline bool ED4_base::is_SAI_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_SAI; }
1839 inline bool ED4_base::is_species_seq_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_SPECIES; }
1840 
1842  ED4_species_manager *sman = containing_species_manager();
1843  return sman ? sman->get_type() : ED4_SP_NONE;
1844 }
1845 
1847 inline bool ED4_base::inside_SAI_manager() const { return get_species_type() == ED4_SP_SAI; }
1849 
1853 
1854 inline bool ED4_cursor::in_species_seq_terminal() const { return owner_of_cursor && owner_of_cursor->is_species_seq_terminal(); }
1855 inline bool ED4_cursor::in_consensus_terminal() const { return owner_of_cursor && owner_of_cursor->is_consensus_terminal(); }
1856 inline bool ED4_cursor::in_SAI_terminal() const { return owner_of_cursor && owner_of_cursor->is_SAI_terminal(); }
1857 
1858 
1859 struct ED4_multi_sequence_manager : public ED4_manager {
1860  E4B_AVOID_UNNEEDED_CASTS(multi_sequence_manager);
1861  ED4_multi_sequence_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1862  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1863 };
1864 
1865 struct ED4_sequence_manager : public ED4_manager {
1866  E4B_AVOID_UNNEEDED_CASTS(sequence_manager);
1867  ED4_sequence_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1868  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1869 };
1870 
1871 struct ED4_multi_name_manager : public ED4_manager {
1872  E4B_AVOID_UNNEEDED_CASTS(multi_name_manager);
1873  // member of ED4_species_manager (contains ED4_name_manager for name and info)
1874  ED4_multi_name_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1875  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1876 };
1877 
1878 
1879 struct ED4_name_manager : public ED4_manager {
1880  E4B_AVOID_UNNEEDED_CASTS(name_manager);
1881  // member of ED4_multi_name_manager (contains speciesname or other info concerning the species)
1882  ED4_name_manager(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1883  DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1884 };
1885 
1886 
1887 // -------------------------
1888 // terminal classes
1889 
1890 
1891 struct ED4_tree_terminal FINAL_TYPE : public ED4_terminal {
1892  E4B_AVOID_UNNEEDED_CASTS(tree_terminal);
1893 
1894  void draw() OVERRIDE;
1895 
1896  ED4_tree_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1897 
1899 };
1900 
1901 struct ED4_bracket_terminal : public ED4_terminal {
1902  E4B_AVOID_UNNEEDED_CASTS(bracket_terminal);
1903 
1904  void draw() OVERRIDE;
1905 
1906  void toggle_folding();
1907 
1908  ED4_bracket_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1909 
1910  DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
1911 };
1912 
1914  E4B_AVOID_UNNEEDED_CASTS(text_terminal);
1915 
1916  // functions concerning graphic output
1917  void draw() OVERRIDE;
1918 
1919  virtual int get_length() const = 0;
1921 
1922  ED4_text_terminal(const ED4_objspec& spec_, GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
1923  ~ED4_text_terminal() OVERRIDE {}
1924 
1926 };
1927 
1928 class ED4_abstract_sequence_terminal : public ED4_text_terminal { // derived from a Noncopyable
1929 
1930  PosRange pixel2index(PosRange pixel_range);
1931 
1932  E4B_AVOID_UNNEEDED_CASTS(abstract_sequence_terminal);
1933 public:
1934  char *species_name; // @@@ wrong place (may be member of ED4_sequence_manager)
1935 
1936 
1937  ED4_abstract_sequence_terminal(const ED4_objspec& spec_, const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1938  ~ED4_abstract_sequence_terminal() OVERRIDE;
1939 
1940  virtual GB_alignment_type GetAliType() = 0;
1941  int get_length() const OVERRIDE { int len; resolve_pointer_to_char_pntr(&len); return len; }
1942 
1943  ED4_species_name_terminal *corresponding_species_name_terminal() const {
1944  return get_parent(LEV_SPECIES)->search_spec_child_rek(LEV_SPECIES_NAME)->to_species_name_terminal();
1945  }
1946  PosRange calc_interval_displayed_in_rectangle(AW_screen_area *area_rect);
1947  PosRange calc_update_interval();
1948 
1950 };
1951 
1952 class ED4_orf_terminal : public ED4_abstract_sequence_terminal { // derived from a Noncopyable
1953  // NOTE: ED4_orf_terminal is a separate terminal class used to display Open Reading Frames (ORFs)
1954  // for the corresponding gene (DNA) sequence. It is used in ProteinViewer Module and should not be
1955  // used for drawing aminoacid sequence alone as in protein alignment. Aminoacid sequences are
1956  // handled by the standard "ED4_sequence_terminal" class.
1957 
1958  char *aaSequence;
1959  size_t aaSeqLen;
1960  char *aaColor;
1961  int aaStartPos;
1962  int aaStrandType;
1963 
1964  void draw() OVERRIDE;
1965  E4B_AVOID_UNNEEDED_CASTS(orf_terminal);
1966 public:
1967  ED4_orf_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
1969 
1970  GB_alignment_type GetAliType() OVERRIDE { return GB_AT_AA; }
1971 
1972  void SET_aaSeqFlags (int startPos, int strandType) { aaStartPos = startPos; aaStrandType = strandType; }
1973  void SET_aaSequence(const char *aaSeq) { freedup(aaSequence, aaSeq); aaSeqLen = strlen(aaSequence); }
1974  void SET_aaColor(const char *aaSeq) { freedup(aaColor, aaSeq); }
1975 
1976  int GET_aaStartPos () { return aaStartPos; }
1977  int GET_aaStrandType () { return aaStrandType; }
1978 
1980 };
1981 
1982 class ED4_sequence_terminal : public ED4_abstract_sequence_terminal { // derived from a Noncopyable
1983  mutable ED4_SearchResults searchResults;
1984  bool shall_display_secstruct_info; // helix or protstruct
1985 
1986  void draw() OVERRIDE;
1987 
1988  E4B_AVOID_UNNEEDED_CASTS(sequence_terminal);
1989 
1990 public:
1991 
1993 
1994  ED4_sequence_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent, bool shall_display_secstruct_info_);
1995 
1997 
1998  void deleted_from_database() OVERRIDE;
1999  int get_length() const OVERRIDE { return ED4_abstract_sequence_terminal::get_length(); }
2000 
2001  virtual char *get_sequence_copy(int *str_len = NULp) const { return resolve_pointer_to_string_copy(str_len); }
2002 
2003  void set_secstruct_display(bool show) { shall_display_secstruct_info = show; }
2004 
2005  ED4_SearchResults& results() const { return searchResults; }
2006 
2007  ED4_columnStat_terminal *corresponding_columnStat_terminal() const {
2009  return col_term ? col_term->to_columnStat_terminal() : NULp;
2010  }
2011 
2014 };
2016 MARK_NONFINAL_FUNCTION(ED4_sequence_terminal,int,get_length,()const,0);
2017 MARK_NONFINAL_FUNCTION(ED4_sequence_terminal,char*,get_sequence_copy,(int*)const,NULp);
2018 
2019 class ED4_columnStat_terminal FINAL_TYPE : public ED4_text_terminal { // derived from a Noncopyable
2020  char *likelihood[4]; // likelihood-array for each base (ACGU) [length of array = alignment_length]
2021  int latest_update;
2022 
2023  static double threshold;
2024 
2025  int update_likelihood();
2026 
2027  E4B_AVOID_UNNEEDED_CASTS(columnStat_terminal);
2028 
2029 public:
2030  // functions concerning graphic output
2031  void draw() OVERRIDE;
2032  int get_length() const OVERRIDE { return corresponding_sequence_terminal()->get_length(); }
2033 
2034  static int threshold_is_set();
2035  static void set_threshold(double aThreshold);
2036  static double get_threshold() { return threshold; }
2037 
2039 
2040  ED4_columnStat_terminal(GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
2041  ~ED4_columnStat_terminal() OVERRIDE;
2042 
2044 };
2045 
2046 class ED4_species_name_terminal FINAL_TYPE : public ED4_text_terminal { // derived from a Noncopyable
2047  E4B_AVOID_UNNEEDED_CASTS(species_name_terminal);
2048  bool set_dynamic_size() OVERRIDE;
2049 
2050 public:
2051  ED4_species_name_terminal(GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
2052  ~ED4_species_name_terminal() OVERRIDE { delete selection_info; }
2053 
2054 
2055  ED4_selection_entry *selection_info; // Info about i.e. Position
2056  bool dragged;
2057 
2058  GB_CSTR get_displayed_text() const;
2059  int get_length() const OVERRIDE { return strlen(get_displayed_text()); }
2060 
2063  return seq_term ? seq_term->to_sequence_terminal() : NULp;
2064  }
2065 
2066  DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
2067 };
2068 
2069 class ED4_flag_header_terminal FINAL_TYPE : public ED4_text_terminal { // derived from a Noncopyable
2070  // displays header of flags
2071 
2072  E4B_AVOID_UNNEEDED_CASTS(flag_header_terminal);
2073  bool set_dynamic_size() OVERRIDE;
2074 
2075 public:
2076  ED4_flag_header_terminal(GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent);
2077 
2078  GB_CSTR get_displayed_text() const;
2079  int get_length() const OVERRIDE;
2080 
2082 };
2083 
2084 class ED4_sequence_info_terminal FINAL_TYPE : public ED4_text_terminal {
2085  E4B_AVOID_UNNEEDED_CASTS(sequence_info_terminal);
2086  bool set_dynamic_size() OVERRIDE;
2087 
2088 public:
2089  ED4_sequence_info_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
2090 
2091  ED4_species_name_terminal *corresponding_species_name_terminal() const {
2092  return get_parent(LEV_SPECIES)->search_spec_child_rek(LEV_SPECIES_NAME)->to_species_name_terminal();
2093  }
2094 
2095  void draw() OVERRIDE;
2096 
2097  GBDATA *data() { return get_species_pointer(); } // DB-entry ("ali_xxx/data")
2098  const GBDATA *data() const { return get_species_pointer(); }
2099 
2100  int get_length() const OVERRIDE { return 1+strlen(id); }
2101 
2102  DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
2103 };
2104 
2105 struct ED4_pure_text_terminal FINAL_TYPE : public ED4_text_terminal {
2106  E4B_AVOID_UNNEEDED_CASTS(pure_text_terminal);
2107 
2108  ED4_pure_text_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
2109 
2110  int get_length() const OVERRIDE { int len; resolve_pointer_to_char_pntr(&len); return len; }
2111 
2113 };
2114 
2115 class ED4_consensus_sequence_terminal : public ED4_sequence_terminal { // derived from a Noncopyable
2116  E4B_AVOID_UNNEEDED_CASTS(consensus_sequence_terminal);
2117 
2118  void draw() OVERRIDE;
2119  const ED4_abstract_group_manager *get_group_manager() const { return get_parent(LEV_GROUP)->to_group_manager(); }
2120  const BaseFrequencies& get_char_table() const { return get_group_manager()->table(); }
2121 
2122 public:
2123  char *temp_cons_seq; // used for editing consensus (normally NULp)
2124 
2125  ED4_consensus_sequence_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
2126 #if defined(ASSERTION_USED)
2127  virtual ~ED4_consensus_sequence_terminal() { e4_assert(!temp_cons_seq); }
2128 #endif
2129 
2130  int get_length() const OVERRIDE;
2131  char *get_sequence_copy(int *str_len = NULp) const FINAL_OVERRIDE { return get_group_manager()->build_consensus_string(str_len); }
2132 
2134 };
2135 
2136 class ED4_spacer_terminal FINAL_TYPE : public ED4_terminal {
2137  E4B_AVOID_UNNEEDED_CASTS(spacer_terminal);
2138  bool shallDraw; // true -> spacer is really drawn (otherwise it's only a placeholder)
2139 
2140  bool set_dynamic_size() OVERRIDE;
2141 
2142 public:
2143  void Show(bool refresh_all, bool is_cleared) OVERRIDE;
2144  void draw() OVERRIDE;
2145 
2146  ED4_spacer_terminal(const char *id, bool shallDraw_, AW_pos width, AW_pos height, ED4_manager *parent);
2147 
2149 };
2150 
2151 class ED4_line_terminal : public ED4_terminal {
2152  E4B_AVOID_UNNEEDED_CASTS(line_terminal);
2153  bool set_dynamic_size() OVERRIDE;
2154 
2155 public:
2156  void draw() OVERRIDE;
2157 
2158  ED4_line_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
2159 
2160  DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
2161 };
2162 
2163 class ED4_flag_terminal FINAL_TYPE : public ED4_terminal {
2164  E4B_AVOID_UNNEEDED_CASTS(flag_terminal);
2165  bool set_dynamic_size() OVERRIDE;
2166 
2167 public:
2168  void draw() OVERRIDE;
2169 
2170  ED4_flag_terminal(const char *id, AW_pos width, AW_pos height, ED4_manager *parent);
2171 
2173  void handle_left_click(const AW::Position& click);
2174 
2176 };
2177 
2178 
2179 // ----------------------------------------------
2180 // inlines which need complete classdefs
2181 
2182 inline void ED4_base::set_update() { // @@@ rename into request_update
2185  if (parent) parent->update_requested_by_child();
2186  }
2187 }
2188 
2191  if (parent) parent->resize_requested_by_child();
2192 }
2193 
2196 }
2197 
2198 inline bool ED4_terminal::setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfoldGroups, ED4_CursorJumpType jump_type) {
2199  ED4_species_manager *sm = get_parent(LEV_SPECIES)->to_species_manager();
2200  return sm->setCursorTo(cursor, seq_pos, unfoldGroups, jump_type);
2201 }
2202 
2203 E4B_IMPL_CASTOP(area_manager); // to_area_manager
2204 E4B_IMPL_CASTOP(abstract_group_manager); // to_abstract_group_manager
2205 E4B_IMPL_CASTOP(bracket_terminal); // to_bracket_terminal
2206 E4B_IMPL_CASTOP(columnStat_terminal); // to_columnStat_terminal
2207 E4B_IMPL_CASTOP(consensus_sequence_terminal); // to_consensus_sequence_terminal
2208 E4B_IMPL_CASTOP(device_manager); // to_device_manager
2209 E4B_IMPL_CASTOP(group_manager); // to_group_manager
2210 E4B_IMPL_CASTOP(line_terminal); // to_line_terminal
2211 E4B_IMPL_CASTOP(manager); // to_manager
2212 E4B_IMPL_CASTOP(multi_name_manager); // to_multi_name_manager
2213 E4B_IMPL_CASTOP(multi_sequence_manager); // to_multi_sequence_manager
2214 E4B_IMPL_CASTOP(multi_species_manager); // to_multi_species_manager
2215 E4B_IMPL_CASTOP(name_manager); // to_name_manager
2216 E4B_IMPL_CASTOP(orf_terminal); // to_orf_terminal
2217 E4B_IMPL_CASTOP(pure_text_terminal); // to_pure_text_terminal
2218 E4B_IMPL_CASTOP(root_group_manager); // to_root_group_manager
2219 E4B_IMPL_CASTOP(sequence_info_terminal); // to_sequence_info_terminal
2220 E4B_IMPL_CASTOP(sequence_manager); // to_sequence_manager
2221 E4B_IMPL_CASTOP(sequence_terminal); // to_sequence_terminal
2222 E4B_IMPL_CASTOP(spacer_terminal); // to_spacer_terminal
2223 E4B_IMPL_CASTOP(species_manager); // to_species_manager
2224 E4B_IMPL_CASTOP(species_name_terminal); // to_species_name_terminal
2225 E4B_IMPL_CASTOP(terminal); // to_terminal
2226 E4B_IMPL_CASTOP(text_terminal); // to_text_terminal
2227 E4B_IMPL_CASTOP(flag_header_terminal); // to_flag_header_terminal
2228 E4B_IMPL_CASTOP(flag_terminal); // to_flag_terminal
2229 
2231  return main_manager->search_spec_child_rek(LEV_DEVICE)->to_device_manager();
2232 }
2233 
2234 
2235 inline ED4_species_name_terminal *ED4_multi_species_manager::get_consensus_name_terminal() const {
2236  ED4_species_manager *consensus_man = get_consensus_manager();
2237  return consensus_man ? consensus_man->get_name_terminal() : NULp;
2238 }
2239 
2240 // ----------------------------------------
2241 
2244  CREATE_FROM_CONSENSUS, // create new species from group consensus (of surrounding group)
2245  COPY_SPECIES, // copy current species
2246 };
2247 
2248 #if defined(ASSERTION_USED)
2250 #endif
2251 
2252 extern ST_ML *st_ml;
2253 struct AlignDataAccess;
2254 
2255 // -------------------------------------------------
2256 // factory functions (hierarchy builders):
2257 
2258 ED4_group_manager *ED4_build_group_manager_start(ED4_manager *group_parent,
2259  GB_CSTR group_name,
2260  int group_depth,
2261  bool is_folded,
2262  ED4_reference_terminals& refterms,
2263  ED4_multi_species_manager*& multi_species_manager);
2264 
2265 void ED4_build_group_manager_end(ED4_multi_species_manager *multi_species_manager);
2266 
2267 // -------------------------------------
2268 // hierarchy access functions:
2269 
2270 ED4_species_name_terminal *ED4_find_species_name_terminal(const char *species_name);
2271 ED4_species_name_terminal *ED4_find_SAI_name_terminal(const char *sai_name);
2272 ED4_species_name_terminal *ED4_find_species_or_SAI_name_terminal(const char *species_name);
2273 
2275 
2276 // --------------------------
2277 // other functions:
2278 
2279 void ED4_new_editor_window(AW_window *aww);
2280 void ED4_with_all_edit_windows(void (*cb)(ED4_window *));
2281 
2284 
2285 void ED4_input_cb(AW_window *aww);
2286 void ED4_remote_event(AW_event *faked_event);
2287 void ED4_motion_cb(AW_window *aww);
2292 void ED4_request_relayout();
2295 
2296 void ED4_store_curpos(AW_window *aww);
2297 void ED4_restore_curpos(AW_window *aww);
2300 void ED4_jump_to_cursor_position(AW_window *aww, const char *awar_name, PositionType posType);
2302 void ED4_change_cursor(AW_window *aww);
2303 
2304 void ED4_set_iupac(AW_window *aww, const char *awar_name);
2305 void ED4_set_helixnr(AW_window *aww, const char *awar_name);
2306 void ed4_changesecurity(AW_root *root);
2307 void ed4_change_edit_mode(AW_root *root);
2308 
2311 void ED4_get_and_jump_to_species(GB_CSTR species_name);
2312 
2315 
2318 void ED4_selected_SAI_changed_cb(AW_root *aw_root);
2319 
2322 
2324 
2325 void ED4_popup_gc_window(AW_window *awp, AW_gc_manager *gcman);
2326 void ED4_no_dangerous_modes();
2327 
2328 void group_species_cb(AW_window *aww, bool use_fields);
2330 
2333 void ED4_saveConfiguration(AW_window *aww, bool hide_aww);
2335 
2336 ARB_ERROR rebuild_consensus(ED4_base *object);
2337 
2338 void ED4_create_consensus_awars(AW_root *aw_root);
2342 
2344 void ED4_compression_toggle_changed_cb(AW_root *root, bool hideChanged);
2346 void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE gbtype);
2347 
2349 
2350 void ED4_quit_editor(AW_window *aww);
2351 void ED4_exit() __ATTR__NORETURN;
2352 
2353 
2354 #else
2355 #error ed4_class included twice
2356 #endif
virtual bool fulfilled_by(const ED4_terminal *) const =0
void ED4_selected_species_changed_cb(AW_root *aw_root)
Definition: ED4_cursor.cxx:499
ED4_species_name_terminal * ED4_find_SAI_name_terminal(const char *sai_name)
Definition: ED4_root.cxx:893
void calc_rel_coords(AW_pos *x, AW_pos *y)
Definition: ED4_base.cxx:808
void clr_property(ED4_properties prop)
Definition: ed4_class.hxx:981
bool inside_SAI_manager() const
Definition: ed4_class.hxx:1847
virtual ~ED4_container()
bool column_stat_activated
Definition: ed4_class.hxx:1455
void set_both_links(ED4_base *ref)
Definition: ed4_class.hxx:977
bool folding_action
Definition: ed4_class.hxx:1435
static bool have_context()
Definition: ed4_class.hxx:1398
ED4_update_flag
Definition: ed4_defs.hxx:203
void unhide_children()
Definition: ED4_base.cxx:828
void ED4_set_iupac(AW_window *aww, const char *awar_name)
const char * GB_ERROR
Definition: arb_core.h:25
ED4_species_mode
Definition: ed4_class.hxx:1345
void set_resize(int value)
Definition: ed4_defs.hxx:340
int is_pure_text_terminal() const
Definition: ed4_class.hxx:1091
ED4_returncode clear_refresh()
string result
void remove_cb(BASECB cb)
Definition: ed4_class.hxx:867
AW_device * get_device() const
Definition: ed4_class.hxx:772
ED4_selected_list * selected_objects
Definition: ed4_class.hxx:1433
void ED4_get_marked_from_menu(AW_window *)
Definition: ED4_cursor.cxx:681
GB_TYPES type
int compile_needed() const
Definition: ed4_class.hxx:1758
void group_species_cb(AW_window *aww, bool use_fields)
ED4_sequence_info_terminal * column_stat_info()
Definition: ed4_class.hxx:1366
ED4_base * get_competent_child(AW_pos x, AW_pos y, ED4_properties relevant_prop)
virtual void delete_requested_children()=0
bool is_species_seq_terminal() const
Definition: ed4_class.hxx:1852
AW_device * current_device()
Definition: ed4_class.hxx:1402
char * db_name
Definition: ed4_class.hxx:1423
E4B_DECL_CASTOP(area_manager)
AW_helix * helix
Definition: ed4_class.hxx:1446
void resize_requested_by_child()
Definition: ed4_class.hxx:2194
void ED4_jump_to_cursor_position(AW_window *aww, const char *awar_name, PositionType posType)
ED4_folding_line(AW_pos world, AW_pos dim)
Definition: ed4_class.hxx:290
ED4_returncode set_width()
Definition: ED4_base.cxx:717
ED4_returncode move_cursor(AW_event *event)
bool exists() const
Definition: ed4_class.hxx:447
static PosRange from(int pos)
Definition: pos_range.h:54
char * build_consensus_string(int *cons_length=NULp) const
Definition: ed4_class.hxx:1656
bool is_hidden() const FINAL_OVERRIDE
Definition: ed4_class.hxx:1278
virtual bool is_hidden() const =0
AW_font_group font_group
Definition: ed4_class.hxx:1467
void set_to_terminal(ED4_terminal *terminal, int seq_pos, ED4_CursorJumpType jump_type)
ED4_returncode ShowCursor(ED4_index offset_x, ED4_cursor_move move, int move_pos=1)
AW_device * get_device(AW_area area)
Definition: AW_window.cxx:534
ED4_LocalWinContext(ED4_window *ew)
Definition: ed4_class.hxx:1518
void move(const Vector &movement)
void insert_member(ED4_base *new_member)
static char * y[maxsp+1]
ED4_window * window() const
Definition: ed4_class.hxx:700
int is_text_terminal() const
Definition: ed4_class.hxx:1083
void resize_requested_by_link(ED4_base *link)
void announce_deletion(ED4_terminal *object)
Definition: ed4_class.hxx:693
ED4_area_manager * top_area_man
Definition: ed4_class.hxx:1430
void set_dimension(AW_pos dim)
Definition: ed4_class.hxx:315
virtual char * resolve_pointer_to_string_copy(int *str_len=NULp) const
Definition: ED4_base.cxx:228
ED4_manager * owner()
Definition: ed4_class.hxx:797
ARB_ERROR rebuild_consensus(ED4_base *object)
AW_window * ED4_create_group_species_by_field_window(AW_root *aw_root)
SpeciesCreationMode
Definition: ed4_class.hxx:2242
ED4_terminal * get_first_terminal(int start_index=0) const
bool is_SAI_terminal() const
Definition: ed4_class.hxx:1851
void ED4_horizontal_change_cb(AW_window *aww)
ED4_base * member(ED4_index i) const
Definition: ed4_class.hxx:800
ED4_scrolled_rectangle scrolled_rect
Definition: ed4_class.hxx:714
ED4_group_manager * is_in_folded_group() const
Definition: ED4_base.cxx:20
GBDATA * get_species_pointer() const
Definition: ed4_class.hxx:953
void reset()
Definition: ed4_class.hxx:344
bool is_selected() const
Definition: ed4_class.hxx:1808
void update_window_coords()
Definition: ED4_window.cxx:52
GB_alignment_type GetAliType() OVERRIDE
Definition: ed4_class.hxx:1970
virtual ARB_ERROR route_down_hierarchy(const ED4_route_cb &cb)
Definition: ED4_base.cxx:385
ED4_datamode
Definition: ed4_defs.hxx:148
ED4_SearchResults & results() const
Definition: ed4_class.hxx:2005
void clear()
Definition: ed4_class.hxx:876
ED4_properties static_prop
Definition: ed4_class.hxx:229
ED4_columnStat_terminal * corresponding_columnStat_terminal() const
Definition: ed4_class.hxx:2007
char * id
Definition: ed4_class.hxx:925
void resize_dynamic()
Definition: ed4_class.hxx:967
void redraw()
Definition: ed4_class.hxx:659
int start() const
Definition: pos_range.h:57
bool in_species_seq_terminal() const
Definition: ed4_class.hxx:1854
int is_columnStat_terminal() const
Definition: ed4_class.hxx:1092
ED4_remap_mode get_mode() const
Definition: ed4_class.hxx:1738
ExplicitRange clip_screen_range(PosRange screen_range) const
Definition: ed4_class.hxx:1772
int get_abs_len(const ED4_terminal *term)
Definition: ed4_class.hxx:601
ED4_area_manager * middle_area_man
Definition: ed4_class.hxx:1429
ED4_base * get_defined_level(ED4_level lev) const
Definition: ED4_base.cxx:694
virtual void remove_callbacks()=0
bool all_are_selected() const
Definition: ed4_class.hxx:1627
#define SLIDER_OFFSET
Definition: ed4_defs.hxx:70
BaseFrequencies & table()
Definition: ed4_class.hxx:1648
void request_resize()
Definition: ed4_class.hxx:2189
AW::Position world_to_win_coords(const AW::Position &pos) const
Definition: ed4_class.hxx:373
void ED4_request_relayout()
double right() const
virtual void resize_requested_children()=0
int is_shown(int seq_pos) const
Definition: ed4_class.hxx:1763
virtual ~ED4_base()
Definition: ED4_base.cxx:1024
void Show(bool refresh_all, bool is_cleared) OVERRIDE
void warn_illegal_dimension()
Definition: ED4_root.cxx:60
GBDATA * Get() const
Definition: ed4_class.hxx:846
void set_secstruct_display(bool show)
Definition: ed4_class.hxx:2003
bool shows_xpos(int x) const
Definition: ed4_class.hxx:766
EDB_root_bact * database
Definition: ed4_class.hxx:1432
void add_sequence_changed_cb(const ED4_species_managerCallback &cb)
Definition: ed4_class.hxx:1816
void win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:366
int slider_pos_horizontal
Definition: ed4_class.hxx:712
void ED4_create_consensus_awars(AW_root *aw_root)
void set_species_pointer(GBDATA *gbd)
Definition: ed4_class.hxx:954
ST_ML * st_ml
ED4_level level
Definition: ed4_class.hxx:230
int is_flag_header_terminal() const
Definition: ed4_class.hxx:1098
int base2sequence_position(int base_pos) const
Definition: ed4_class.hxx:673
ED4_reference * reference
Definition: ed4_class.hxx:1442
ed_key * edk
Definition: ed4_class.hxx:1452
bool column_stat_initialized
Definition: ed4_class.hxx:1456
ED4_multi_species_manager * get_multi_species_manager() const
Definition: ed4_class.hxx:1651
static void touch_world_cache()
Definition: ed4_class.hxx:1013
ED4_root * ED4_ROOT
Definition: ED4_main.cxx:48
int is_species_manager() const
Definition: ed4_class.hxx:1114
void ED4_trigger_instant_refresh()
void update_world_coords_cache() const
Definition: ed4_class.hxx:998
char awar_path_for_IUPAC[50]
Definition: ed4_class.hxx:723
int base_count() const
Definition: BI_basepos.hxx:100
void scan_string(ED4_multi_species_manager *parent, ED4_reference_terminals &refterms, const char *str, int *index, arb_progress &progress)
ED4_terminal * get_top_middle_spacer_terminal() const
Definition: ed4_class.hxx:1567
AW_pos win2world(AW_pos win) const
Definition: ed4_class.hxx:321
ED4_update_info update_info
Definition: ed4_class.hxx:930
long curr_timestamp
Definition: ed4_class.hxx:1297
void delete_requested_children() OVERRIDE
bool is_terminal() const
Definition: ed4_class.hxx:244
ED4_list< ED4_base > ED4_base_list
Definition: ed4_class.hxx:168
ED4_base * search_ID(const char *id) FINAL_OVERRIDE
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:1734
void ED4_clear_stored_curpos()
int get_sequence_position(const ED4_terminal *base, int base_position)
double top() const
ED4_species_type get_species_type() const
Definition: ed4_class.hxx:1841
static double get_threshold()
Definition: ed4_class.hxx:2036
ED4_AREA_LEVEL
Definition: ed4_defs.hxx:169
ED4_terminal * owner_of_cursor
Definition: ed4_class.hxx:649
int slider_pos_horizontal
current position of the vertical slider
Definition: aw_window.hxx:339
void create_consensus(ED4_abstract_group_manager *upper_group_manager, arb_progress *progress)
Definition: ED4_base.cxx:567
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_selected_SAI_changed_cb(AW_root *aw_root)
Definition: ED4_cursor.cxx:484
static void init_object_specs()
Definition: ED4_objspec.cxx:98
bool is_species_seq_manager() const
Definition: ed4_class.hxx:1839
int get_base_position() const
Definition: ed4_class.hxx:676
virtual void Show(bool refresh_all, bool is_cleared)=0
ED4_folding_line * insert_folding_line(AW_pos pos, AW_pos dimension, ED4_properties prop)
Definition: ED4_window.cxx:97
ED4_movemode
Definition: ed4_defs.hxx:154
ED4_returncode clear_background(int color=0)
Definition: ED4_base.cxx:937
ED4_manager * parent
Definition: ed4_class.hxx:921
void SET_aaSequence(const char *aaSeq)
Definition: ed4_class.hxx:1973
AW_gc_manager * gc_manager
Definition: ed4_class.hxx:1444
bool in_SAI_terminal() const
Definition: ed4_class.hxx:1856
void ED4_request_full_instant_refresh()
virtual void deleted_from_database()
Definition: ED4_base.cxx:88
const ED4_folding_line * get_horizontal_folding()
Definition: ed4_class.hxx:356
bool is_empty() const
Definition: pos_range.h:69
void ED4_request_full_refresh()
char * protstruct
Definition: ed4_class.hxx:1450
ED4_reference_terminals ref_terminals
Definition: ed4_class.hxx:1436
bool allowed_to_contain(ED4_level child_level) const
Definition: ed4_class.hxx:246
char awar_path_for_basePos[50]
Definition: ed4_class.hxx:722
#define DECLARE_DUMP_FOR_MIDCLASS(self, mybase)
Definition: ed4_class.hxx:94
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
FILE * seq
Definition: rns.c:46
int get_base_count(const ED4_terminal *term)
Definition: ed4_class.hxx:600
virtual void update_requested_children()=0
ED4_base * find_first_that(ED4_level level, const ED4_basePredicate &fulfills_predicate)
Definition: ED4_base.cxx:400
void unlink_from_parent()
Definition: ED4_base.cxx:673
AW_window * ED4_create_new_seq_window(AW_root *root, SpeciesCreationMode creation_mode)
#define cb(action)
ED4_coords coords
Definition: ed4_class.hxx:716
int get_screen_pos() const
Definition: ed4_class.hxx:668
#define e4_assert(bed)
Definition: ed4_class.hxx:11
void ED4_quit_editor(AW_window *aww)
#define DOWNCAST(totype, expr)
Definition: downcast.h:141
DECLARE_CBTYPE_FVV_AND_BUILDERS(ED4_managerCallback, void, ED4_manager *)
#define FINAL_OVERRIDE
Definition: cxxforward.h:95
static int get_species(char *species_string, unsigned int species_number, char *buffer)
Definition: ali_main.cxx:97
int sequence2base_position(int seq_pos) const
Definition: ed4_class.hxx:674
int is_multi_species_manager() const
Definition: ed4_class.hxx:1106
virtual char * get_sequence_copy(int *str_len=NULp) const
Definition: ed4_class.hxx:2001
void scroll(int dx, int dy)
Definition: ed4_class.hxx:479
AW_pos right() const
Definition: ed4_class.hxx:437
void set_top_middle_spacer_terminal(ED4_terminal *top_middle_spacer_)
Definition: ed4_class.hxx:1564
void ED4_motion_cb(AW_window *aww)
const ED4_objspec & spec
Definition: ed4_class.hxx:919
void remove_delete_callback(const ED4_managerCallback &cb)
Definition: ed4_class.hxx:1203
void jump_screen_pos(int screen_pos, ED4_CursorJumpType jump_type)
Definition: ED4_cursor.cxx:927
Definition: st_ml.hxx:111
bool is_reset() const
Definition: ed4_class.hxx:350
ED4_list_elem< ED4_base > ED4_base_list_elem
Definition: ed4_class.hxx:171
void remove_callbacks() OVERRIDE
void do_callbacks()
Definition: ed4_class.hxx:1818
void announce_deletion(ED4_terminal *object)
Definition: ed4_class.hxx:736
bool has_property(ED4_properties prop) const
Definition: ed4_class.hxx:982
AW::Vector get_size() const
Definition: ed4_defs.hxx:265
void world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) const
Definition: ed4_class.hxx:359
ED4_level restriction_level
Definition: ed4_class.hxx:233
const Vector ZeroVector
int is_sequence_manager() const
Definition: ed4_class.hxx:1103
const AW::Position & calc_world_coords() const
Definition: ed4_class.hxx:993
void check_all()
Definition: ED4_base.cxx:892
MARK_NONFINAL_CLASS(ED4_sequence_terminal)
bool is_consensus_manager() const
Definition: ed4_class.hxx:1837
ED4_scroll_picture scroll_picture
Definition: ed4_class.hxx:1438
void ed4_change_edit_mode(AW_root *root)
void ED4_jump_to_current_species(AW_window *)
Definition: ED4_cursor.cxx:518
void ED4_new_editor_window(AW_window *aww)
ED4_WinContext(ED4_window *ed4w_)
Definition: ed4_class.hxx:1392
char * build_consensus_string(PosRange range) const
Definition: ed4_class.hxx:1655
bool is_child_of(ED4_manager *Parent)
Definition: ed4_class.hxx:1055
ED4_level
Definition: ed4_defs.hxx:120
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww)=0
static void recalc_descendants()
bool is_hidden_inside_group() const
ED4_selection_entry * selection_info
Definition: ed4_class.hxx:2055
long helix_add_spacing
Definition: ed4_class.hxx:1448
AW_pos top_dim() const
Definition: ed4_class.hxx:444
double AW_pos
Definition: aw_base.hxx:29
char * get_name_of_species()
Definition: ED4_base.cxx:678
void prepare_shutdown()
Definition: ed4_class.hxx:678
void append_member(ED4_base *new_member)
ED4_index index
Definition: ed4_class.hxx:926
bool empty() const
Definition: ed4_class.hxx:877
void calc_no_of_all(const char *string_to_scan, long *group, long *species)
BaseFrequencies my_table
Definition: ed4_class.hxx:1641
int is_manager() const
Definition: ed4_class.hxx:1101
void prepare_shutdown()
Definition: ed4_class.hxx:593
AW_window * ED4_create_saveConfigurationAs_window(AW_root *awr)
ED4_index members() const
Definition: ed4_class.hxx:802
bool is_linked() const
Definition: ed4_class.hxx:448
int helix_spacing
Definition: ed4_class.hxx:1447
bool inside_species_seq_manager() const
Definition: ed4_class.hxx:1848
void ED4_compression_toggle_changed_cb(AW_root *root, bool hideChanged)
int is_abstract_group_manager() const
Definition: ed4_class.hxx:1112
ED4_window * next
Definition: ed4_class.hxx:711
void ED4_no_dangerous_modes()
Definition: ED4_root.cxx:1200
ED4_returncode
Definition: ed4_defs.hxx:161
ED4_returncode move_member(ED4_index old_pos, ED4_index new_pos)
ED4_folding_line * delete_member(ED4_folding_line *fl)
Definition: ed4_class.hxx:300
void update_requested_children() OVERRIDE
void save_current_config(char *confname)
ED4_manager(const ED4_objspec &spec_, const char *id, AW_pos width, AW_pos height, ED4_manager *parent)
void hide_children()
Definition: ED4_base.cxx:817
AW_window * ED4_create_loadConfiguration_window(AW_root *awr)
void add_delete_callback(const ED4_managerCallback &cb)
Definition: ed4_class.hxx:1202
const double & ypos() const
void jump_base_pos(int base_pos, ED4_CursorJumpType jump_type)
void link(ED4_base *x, ED4_base *y, ED4_base *w, ED4_base *h)
Definition: ed4_class.hxx:460
ED4_returncode handle_move(ED4_move_info *moveinfo)
ED4_terminal * get_last_terminal(int start_index=-1) const
ED4_returncode fill_species(ED4_multi_species_manager *multi_species_manager, ED4_reference_terminals &refterms, const char *str, int *index, int group_depth, arb_progress *progress)
void check_valid_scrollbar_values()
Definition: ed4_class.hxx:764
LoadableSaiState loadable_SAIs
Definition: ed4_class.hxx:1463
void ED4_alignment_length_changed(GBDATA *gb_alignment_len, GB_CB_TYPE gbtype)
Definition: ED4_root.cxx:468
virtual void request_refresh(int clear=1)=0
char * alignment_name
Definition: ed4_class.hxx:1440
void announce_deletion(const ED4_terminal *term)
Definition: ed4_class.hxx:586
AW_pos get_pos() const
Definition: ed4_class.hxx:319
#define true
Definition: ureadseq.h:14
DECLARE_DUMP_FOR_BASECLASS(ED4_manager, ED4_base)
int get_length() const OVERRIDE
Definition: ed4_class.hxx:2059
PosRange sequence_to_screen(PosRange range) const
Definition: ed4_class.hxx:1724
static int group[MAXN+1]
Definition: ClustalV.cxx:65
void ED4_input_cb(AW_window *aww)
void init()
Definition: ED4_cursor.cxx:383
ED4_returncode rebuild_consensi(ED4_base *start_species, ED4_update_flag update_flag)
ED4_multi_species_manager * ED4_find_MoreSequences_manager()
Definition: ED4_cursor.cxx:558
ED4_species_name_terminal * ED4_find_species_name_terminal(const char *species_name)
Definition: ED4_root.cxx:889
ED4_species_name_terminal * ED4_find_species_or_SAI_name_terminal(const char *species_name)
Definition: ED4_root.cxx:885
virtual const char * resolve_pointer_to_char_pntr(int *str_len=NULp) const
Definition: ED4_base.cxx:229
bool in_consensus_terminal() const
Definition: ed4_class.hxx:1855
ED4_species_type
Definition: ed4_class.hxx:891
void Set(GBDATA *gbd, ED4_base *base)
Definition: ED4_base.cxx:181
void ED4_remote_event(AW_event *faked_event)
ED4_window * first_window
Definition: ed4_class.hxx:1427
ED4_species_name_terminal * get_name_terminal() const
Definition: ed4_class.hxx:1820
void calc_bottomRight_folding_dimensions(int area_width, int area_height)
Definition: ed4_class.hxx:500
ED4_terminal * get_next_terminal()
Definition: ED4_base.cxx:452
virtual void Delete()=0
void set_links(ED4_base *width_ref, ED4_base *height_ref)
Definition: ED4_base.cxx:911
void reset(ED4_foldable &owner)
Definition: ed4_class.hxx:439
ED4_returncode show_clicked_cursor(AW_pos click_xpos, ED4_terminal *target_terminal)
ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) FINAL_OVERRIDE
int is_device_manager() const
Definition: ed4_class.hxx:1108
ED4_window(AW_window_menu_modes *window)
Definition: ED4_window.cxx:428
ED4_cursor cursor
Definition: ed4_class.hxx:727
virtual void changed_by_database()
Definition: ED4_base.cxx:28
bool has_callback() const
Definition: ed4_class.hxx:955
void reset_all_for_new_config()
Definition: ED4_window.cxx:20
AW_window * current_aww()
Definition: ed4_class.hxx:1404
ED4_returncode move_requested_by_parent(ED4_move_info *mi)
#define CONSTEXPR_INLINE
Definition: cxxforward.h:92
ED4_objspec(ED4_properties static_prop_, ED4_level level_, ED4_level allowed_children_, ED4_level handled_level_, ED4_level restriction_level_)
ED4_level handled_level
Definition: ed4_class.hxx:232
PositionType
Definition: ed4_class.hxx:108
E4B_AVOID_UNNEEDED_CASTS(manager)
ED4_root_group_manager * root_group_man
Definition: ed4_class.hxx:1431
int sequence_to_screen_PLAIN(int sequence_pos) const
Definition: ed4_class.hxx:1710
int shown_sequence_to_screen(int sequence_pos) const
Definition: ed4_class.hxx:1714
bool is_unlimited() const
Definition: pos_range.h:75
ED4_level get_possible_descendants() const
Definition: ed4_class.hxx:260
void set_screen_relative_pos(int scroll_to_relpos)
Definition: ED4_cursor.cxx:909
ED4_columnStat_terminal * column_stat()
Definition: ed4_class.hxx:1365
int abs_count() const
Definition: BI_basepos.hxx:101
const BaseFrequencies & table() const
Definition: ed4_class.hxx:1649
char awar_path_for_cursor[50]
Definition: ed4_class.hxx:720
int is_multi_sequence_manager() const
Definition: ed4_class.hxx:1107
ARB_ERROR route_down_hierarchy(const ED4_route_cb &cb) FINAL_OVERRIDE
Definition: ED4_base.cxx:390
void ED4_consensus_definition_changed(AW_root *)
void destroy_folding_lines(ED4_foldable &owner)
Definition: ed4_class.hxx:549
ED4_main_manager * main_manager
Definition: ed4_class.hxx:1428
void deleted_from_database() OVERRIDE
Definition: ED4_base.cxx:125
bool calc_bounding_box() FINAL_OVERRIDE
ED4_returncode fill_data(ED4_multi_species_manager *multi_species_manager, ED4_reference_terminals &refterms, char *str, int group_depth, ED4_datamode datamode)
bool valid_index(ED4_index idx) const
Definition: ed4_class.hxx:792
#define PREPARE_MARK_NONFINAL_CLASS(CLASS)
Definition: cxxforward.h:175
void calc_world_coords(AW_pos *x, AW_pos *y) const
Definition: ed4_class.hxx:988
void set_update()
Definition: ed4_class.hxx:2182
ED4_group_manager * ED4_build_group_manager_start(ED4_manager *group_parent, GB_CSTR group_name, int group_depth, bool is_folded, ED4_reference_terminals &refterms, ED4_multi_species_manager *&multi_species_manager)
Definition: ED4_base.cxx:231
ED4_returncode HideCursor()
Definition: ED4_cursor.cxx:768
void set_mode(ED4_remap_mode Mode, int above_percent)
Definition: ed4_class.hxx:1739
CONSTEXPR_INLINE bool valid(SpeciesCreationMode m)
Definition: ed4_class.hxx:2249
void ed4_changesecurity(AW_root *root)
AW::Vector get_parent_offset() const
Definition: ed4_defs.hxx:266
int was_changed() const
Definition: ed4_class.hxx:1761
void ED4_get_and_jump_to_current(AW_window *)
Definition: ED4_cursor.cxx:670
ED4_LocalWinContext(AW_window *aww)
Definition: ed4_class.hxx:1517
unsigned int update_requested
Definition: ed4_defs.hxx:332
MARK_NONFINAL_METHOD(ED4_manager, update_requested_children,())
void ED4_consensus_display_changed(AW_root *root)
void ED4_exit() __ATTR__NORETURN
void delete_window(ED4_window *window)
Definition: ED4_window.cxx:349
int is_line_terminal() const
Definition: ed4_class.hxx:1096
int refresh_flag_ok()
ED4_scroll_links scroll_links
Definition: ed4_class.hxx:1434
int is_sequence_info_terminal() const
Definition: ed4_class.hxx:1087
AW_window * ED4_create_loadSAI_window(AW_root *awr)
GB_alignment_type alignment_type
Definition: ed4_class.hxx:1441
ED4_base(const ED4_objspec &spec_, GB_CSTR id, AW_pos width, AW_pos height, ED4_manager *parent)
Definition: ED4_base.cxx:991
bool setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfoldGroups, ED4_CursorJumpType jump_type)
Definition: ed4_class.hxx:2198
const ConsensusBuildParams & get_consensus_params()
ED4_extension extension
Definition: ed4_class.hxx:929
bool is_SAI_manager() const
Definition: ed4_class.hxx:1838
bool inside_consensus_manager() const
Definition: ed4_class.hxx:1846
void changeType(ED4_CursorType typ)
Definition: ED4_cursor.cxx:779
void ED4_vertical_change_cb(AW_window *aww)
const ED4_manager * owner() const
Definition: ed4_class.hxx:798
void ED4_compression_changed_cb(AW_root *awr)
AW_pos world2win(AW_pos world) const
Definition: ed4_class.hxx:325
GB_alignment_type
Definition: arbdb_base.h:61
int calc_group_depth()
Definition: ED4_base.cxx:422
ED4_sequence_terminal * corresponding_sequence_terminal() const
Definition: ed4_class.hxx:2038
AW::Rectangle get_world_rect() const
Definition: ED4_window.cxx:131
double bottom() const
int adjust_clipping_rectangle()
Definition: ED4_base.cxx:905
TYPE get_type() const
Definition: probe_tree.h:64
void set_top_middle_line_terminal(ED4_terminal *top_middle_line_)
Definition: ed4_class.hxx:1565
long int flag
Definition: f2c.h:39
bool knownNonNull(const void *nonnull)
Definition: arb_assert.h:368
ED4_terminal * get_top_middle_line_terminal() const
Definition: ed4_class.hxx:1568
ED4_species_name_terminal * get_consensus_name_terminal() const
Definition: ed4_class.hxx:2235
void ED4_calc_terminal_extentions()
bool members_ok() const
ED4_multi_species_manager * get_multi_species_manager() const
Definition: ed4_class.hxx:1589
ED4_sequence_info_terminal * sequence_info()
Definition: ed4_class.hxx:1364
void Delete() FINAL_OVERRIDE
ED4_window * get_ed4w() const
Definition: ed4_class.hxx:1395
double left() const
bool is_consensus_terminal() const
Definition: ed4_class.hxx:1850
Definition: ed4_defs.hxx:247
bool visualizeSAI_allSpecies
Definition: ed4_class.hxx:1458
int is_orf_terminal() const
Definition: ed4_class.hxx:1089
AW::Rectangle get_window_rect() const
Definition: ed4_class.hxx:486
ED4_returncode update_bases_and_rebuild_consensi(const char *old_seq, int old_len, ED4_base *species, ED4_update_flag update_flag, PosRange range=PosRange::whole())
fputs(TRACE_PREFIX, stderr)
ED4_CursorJumpType
Definition: ed4_defs.hxx:291
ED4_base * search_spec_child_rek(ED4_level level)
Definition: ED4_base.cxx:432
bool is_completely_visible() const
ED4_base * width_link
Definition: ed4_class.hxx:927
void call(BASE *b)
Definition: ed4_class.hxx:869
ED4_cursor & current_cursor()
Definition: ed4_class.hxx:1405
long protstruct_len
Definition: ed4_class.hxx:1451
ED4_species_name_terminal * corresponding_species_name_terminal() const
Definition: ed4_class.hxx:1943
void generate_configuration_string(GBS_strstruct &buffer)
Definition: ED4_base.cxx:322
bool visualizeSAI
Definition: ed4_class.hxx:1457
bool scrollbars_and_scrolledRect_inSync() const
Definition: ed4_class.hxx:743
xml element
void ED4_init_notFoundMessage()
Definition: ED4_cursor.cxx:564
ED4_returncode remove_member(ED4_base *member)
void set_property(ED4_properties prop)
Definition: ed4_class.hxx:980
ED4_CursorType getType() const
Definition: ed4_class.hxx:657
void ED4_restore_curpos(AW_window *aww)
char awar_path_for_Ecoli[50]
Definition: ed4_class.hxx:721
void ED4_with_all_edit_windows(void(*cb)(ED4_window *))
Definition: ED4_main.cxx:264
void ED4_store_curpos(AW_window *aww)
AW::Position win_to_world_coords(const AW::Position &pos) const
Definition: ed4_class.hxx:378
void create_folding_lines(ED4_foldable &owner, const AW::Rectangle &rect, int area_width, int area_height)
Definition: ed4_class.hxx:536
long terminal_add_spacing
Definition: ed4_class.hxx:1449
bool is_consensus_sequence_terminal() const
Definition: ed4_class.hxx:1187
aisc_com * link
ED4_cursor(ED4_window *win)
Definition: ED4_cursor.cxx:376
Definition: output.h:122
#define OVERRIDE
Definition: cxxforward.h:93
int get_length() const OVERRIDE
Definition: ed4_class.hxx:1941
ED4_list_elem< ED4_selection_entry > ED4_selected_elem
Definition: ed4_class.hxx:174
int is_name_manager() const
Definition: ed4_class.hxx:1105
const ED4_folding_line * get_next() const
Definition: ed4_class.hxx:311
void replace_x_width_link_to(ED4_base *old_link, ED4_base *new_link)
Definition: ed4_class.hxx:469
ED4_AREA_LEVEL get_area_level(ED4_multi_species_manager **multi_species_manager=NULp) const
Definition: ED4_base.cxx:495
char awar_path_for_helixNr[50]
Definition: ed4_class.hxx:724
ED4_list< ED4_selection_entry > ED4_selected_list
Definition: ed4_class.hxx:173
bool existing_index(ED4_index idx) const
Definition: ed4_class.hxx:793
ED4_returncode update_bases(const ED4_base *old_base, const ED4_base *new_base, PosRange range=PosRange::whole())
ED4_returncode distribute_children()
void SET_aaSeqFlags(int startPos, int strandType)
Definition: ed4_class.hxx:1972
ED4_returncode show_cursor_at(ED4_terminal *target_terminal, ED4_index what_pos)
ED4_returncode move_requested_by_child(ED4_move_info *moveinfo)
AW_pos get_dimension() const
Definition: ed4_class.hxx:310
void jump_sequence_pos(int sequence_pos, ED4_CursorJumpType jump_type)
void insertAs(ED4_folding_line *&ptr)
Definition: ed4_class.hxx:294
void add_cb(BASECB cb)
Definition: ed4_class.hxx:866
BI_ecoli_ref * ecoli_ref
Definition: ed4_class.hxx:1439
ED4_window * current_ed4w()
Definition: ed4_class.hxx:1403
ED4_seq_colors * sequence_colors
Definition: ed4_class.hxx:1443
AW_root * aw_root
Definition: ed4_class.hxx:1424
void set_abs_x()
int slider_pos_vertical
Definition: ed4_class.hxx:713
void delete_requested_by_child()
~ED4_text_terminal() OVERRIDE
Definition: ed4_class.hxx:1923
void ED4_resize_all_extensions()
void ED4_get_and_jump_to_species(GB_CSTR species_name)
Definition: ED4_cursor.cxx:650
ED4_sequence_terminal * sequence()
Definition: ed4_class.hxx:1363
ED4_properties
Definition: ed4_defs.hxx:176
void ED4_reloadConfiguration(AW_window *aww)
unsigned int hidden
Definition: ed4_class.hxx:932
static ARB_init_perl_interface init
Definition: ARB_ext.c:101
void update_requested_by_child()
void add_to_top_left_dimension(int dx, int dy)
Definition: ed4_class.hxx:474
long window_right_clip_point
Definition: ed4_defs.hxx:350
DECLARE_DUMP_FOR_ROOTCLASS(ED4_base)
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
static const ED4_WinContext & get_current_context()
Definition: ed4_class.hxx:1397
ED4_returncode scroll_rectangle(int dx, int dy)
Definition: ED4_window.cxx:291
void ED4_set_helixnr(AW_window *aww, const char *awar_name)
void ED4_popup_gc_window(AW_window *awp, AW_gc_manager *gcman)
Definition: ED4_root.cxx:1255
ED4_returncode refresh_requested_by_child()
bool completely_shows(int x1, int y1, int x2, int y2) const
Definition: ED4_base.cxx:217
int is_multi_name_manager() const
Definition: ed4_class.hxx:1104
void ED4_remote_set_cursor_cb(AW_root *awr)
const double & xpos() const
ED4_species_manager * containing_species_manager() const
Definition: ed4_class.hxx:1832
ED4_level allowed_children
Definition: ed4_class.hxx:231
AW_window_simple * win
#define NULp
Definition: cxxforward.h:97
void ED4_build_group_manager_end(ED4_multi_species_manager *multi_species_manager)
Definition: ED4_base.cxx:314
GB_alignment_type GetAliType() FINAL_OVERRIDE
Definition: ed4_class.hxx:1996
PosRange screen_to_sequence(PosRange range) const
Definition: ed4_class.hxx:1728
unsigned int resize
Definition: ed4_defs.hxx:324
int is_area_manager() const
Definition: ed4_class.hxx:1115
const ED4_remap * remap() const
Definition: ed4_class.hxx:1783
ED4_index search_member(ED4_extension *location, ED4_properties prop)
MARK_NONFINAL_FUNCTION(ED4_base, bool, set_dynamic_size,(), false)
int end() const
Definition: pos_range.h:61
AW_default props_db
Definition: ed4_class.hxx:1425
AW_pos bottom() const
Definition: ed4_class.hxx:436
AW::Rectangle get_win_area(ED4_window *ed4w) const
Definition: ed4_class.hxx:1017
void request_resize_of_linked()
void SET_aaColor(const char *aaSeq)
Definition: ed4_class.hxx:1974
AW_device * get_device() const
Definition: ed4_class.hxx:1394
#define __ATTR__NORETURN
Definition: attributes.h:56
ED4_level get_allowed_descendants() const
Definition: ed4_class.hxx:265
ED4_returncode search_target_species(ED4_extension *location, ED4_properties prop, ED4_base **found_member, ED4_level return_level)
ED4_CursorType
Definition: ed4_class.hxx:607
#define offset(field)
Definition: GLwDrawA.c:73
int is_sequence_terminal() const
Definition: ed4_class.hxx:1088
int get_base_position(const ED4_terminal *base, int sequence_position)
void ED4_saveConfiguration(AW_window *aww, bool hide_aww)
virtual ED4_base * search_ID(const char *id)=0
int is_flag_terminal() const
Definition: ed4_class.hxx:1099
ED4_species_mode species_mode
Definition: ed4_class.hxx:1437
bool is_hidden
Definition: ed4_class.hxx:726
static int no_of_windows
Definition: ed4_class.hxx:718
void delete_folding_line(ED4_folding_line *fl, ED4_properties prop)
Definition: ED4_window.cxx:121
void resize_requested_children() OVERRIDE
ED4_returncode check_in_bases(ED4_base *added_base)
ED4_cursor_move
Definition: ed4_defs.hxx:195
void changed_by_database() OVERRIDE
Definition: ED4_base.cxx:34
const AlignDataAccess * ED4_get_aligner_data_access()
Definition: ED4_root.cxx:1221
void add_to_dimension(AW_pos offset)
Definition: ed4_class.hxx:316
char * make_top_bot_string()
bool is_manager() const
Definition: ed4_class.hxx:243
int is_bracket_terminal() const
Definition: ed4_class.hxx:1094
int get_sequence_pos() const
Definition: ED4_cursor.cxx:393
AW_window_menu_modes * aww
Definition: ed4_class.hxx:710
const GBDATA * data() const
Definition: ed4_class.hxx:2098
void draw_bb(int color)
Definition: ED4_base.cxx:978
virtual ~ED4_TerminalPredicate()
Definition: ed4_class.hxx:620
const ED4_folding_line * get_vertical_folding()
Definition: ed4_class.hxx:357
bool partly_shows(int x1, int y1, int x2, int y2) const
Definition: ED4_base.cxx:206
int has_valid_counters() const
Definition: ed4_class.hxx:1626
ED4_returncode check_out_bases(ED4_base *subbed_base)
void set_selected(bool select)
Definition: ed4_class.hxx:1809
void ED4_scrollbar_change_cb(AW_window *aww)
long window_left_clip_point
Definition: ed4_defs.hxx:350
ED4_Edit_String * edit_string
Definition: ed4_class.hxx:1453
bool is_partly_visible() const
void announce_added(ED4_level child_level) const
Definition: ed4_class.hxx:252
int is_terminal() const
Definition: ed4_class.hxx:1081
char * make_string()
ED4_terminal * get_prev_terminal()
Definition: ED4_base.cxx:465
bool empty() const
Definition: ed4_class.hxx:803
void remove_sequence_changed_cb(const ED4_species_managerCallback &cb)
Definition: ed4_class.hxx:1817
int is_spacer_terminal() const
Definition: ed4_class.hxx:1095
ED4_base * height_link
Definition: ed4_class.hxx:928
size_t length
GB_CB_TYPE
Definition: arbdb_base.h:46
int get_screen_relative_pos() const
Definition: ED4_cursor.cxx:905
void set_rect(const AW::Rectangle &rect)
Definition: ed4_class.hxx:494
ED4_device_manager * get_device_manager()
Definition: ed4_class.hxx:2230
AW_window * ED4_create_consensus_definition_window(AW_root *root)
ED4_manager * get_parent(ED4_level lev) const
Definition: ed4_class.hxx:1823
void update_consensus(ED4_manager *old_parent, ED4_manager *new_parent, ED4_base *sequence)
#define min(a, b)
Definition: f2c.h:153
const Position Origin
void ED4_helix_jump_opposite(AW_window *aww)
int slider_pos_vertical
window id
Definition: aw_window.hxx:338
#define E4B_IMPL_CASTOP(name)
Definition: ed4_class.hxx:1139
struct ED4_base::@7 flag
AW_window * ED4_create_editor_options_window(AW_root *root)
bool has_parent(ED4_manager *Parent)
Definition: ED4_base.cxx:481
static ED4_WinContext current_context
Definition: ed4_class.hxx:1388
const char * GB_CSTR
Definition: arbdb_base.h:25
ED4_remap_mode
Definition: ed4_class.hxx:1673
void set_rect_and_update_folding_line_positions(const AW::Rectangle &rect)
Definition: ed4_class.hxx:495
const ED4_terminal * get_consensus_relevant_terminal() const
Definition: ED4_base.cxx:617
void set_pos(AW_pos p)
Definition: ed4_class.hxx:318
int is_group_manager() const
Definition: ed4_class.hxx:1110
void loadable_SAIs_may_have_changed()
Definition: ed4_class.hxx:1464
ED4_properties dynamic_prop
Definition: ed4_class.hxx:924
#define DECLARE_DUMP_FOR_LEAFCLASS(mybase)
Definition: ed4_class.hxx:95
void announce_deletion(ED4_base *object)
Definition: ed4_class.hxx:1535
virtual bool calc_bounding_box()=0
void ED4_get_and_jump_to_selected_SAI(AW_window *aww)
Definition: ED4_cursor.cxx:627
long ED4_index
Definition: ed4_defs.hxx:115
long get_abs_x() const
Definition: ed4_class.hxx:670
LoadableSaiState
Definition: ed4_class.hxx:1407
int is_species_name_terminal() const
Definition: ed4_class.hxx:1085
AW_pos left_dim() const
Definition: ed4_class.hxx:445
bool allowed_to_draw
Definition: ed4_class.hxx:648
void request_refresh(int clear=1) FINAL_OVERRIDE
ST_ML * st_ml
Definition: ed4_class.hxx:1445
ED4_base * get_competent_clicked_child(AW_pos x, AW_pos y, ED4_properties relevant_prop)
ED4_returncode search_sequence_data_rek(ED4_multi_sequence_manager *multi_sequence_manager, ED4_reference_terminals &refterms, GBDATA *gb_ali_xxx, int count_too, ED4_index *max_sequence_terminal_length, bool isSAI)
int is_root_group_manager() const
Definition: ed4_class.hxx:1111
~ED4_manager() OVERRIDE
void ED4_finish_and_show_notFoundMessage()
Definition: ED4_cursor.cxx:569
ED4_window * get_most_recently_used_window() const
Definition: ed4_class.hxx:1470
short in_border(AW_pos abs_x, AW_pos abs_y, ED4_movemode mode)
Definition: ED4_base.cxx:787
#define max(a, b)
Definition: f2c.h:154