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