81
155
class AWT_seq_colors;
82
156
class BI_ecoli_ref;
87
// --------------------------------------------------------------------------------
88
// class EDB_root_bact
89
// --------------------------------------------------------------------------------
93
char *make_string(); //just for debuggig
94
char *make_top_bot_string(); //just for debugging
96
void calc_no_of_all(char *string_to_scan, // group gets the number of groups in string_to_scan,
97
long *group, // species gets the number of species in string_to_scan
162
template <class T> class ED4_list; // derived from Noncopyable
163
template <class T> class ED4_list_elem; // derived from Noncopyable
165
typedef ED4_list<ED4_base> ED4_base_list;
166
typedef ED4_list_elem<ED4_base> ED4_base_list_elem;
168
typedef ED4_list<ED4_selection_entry> ED4_selected_list;
169
typedef ED4_list_elem<ED4_selection_entry> ED4_selected_elem;
172
struct EDB_root_bact {
174
char *make_top_bot_string();
176
void calc_no_of_all(const char *string_to_scan, // group gets the number of groups in string_to_scan,
177
long *group, // species gets the number of species in string_to_scan
100
ED4_returncode fill_species(ED4_multi_species_manager *multi_species_manager,
180
ED4_returncode fill_species(ED4_multi_species_manager *multi_species_manager,
101
181
ED4_sequence_info_terminal *ref_sequence_info_terminal,
102
ED4_sequence_terminal *ref_sequence_terminal,
106
ED4_index actual_local_position,
107
ED4_index *length_of_terminals,
182
ED4_sequence_terminal *ref_sequence_terminal,
186
ED4_index curr_local_position,
187
ED4_index *length_of_terminals,
189
arb_progress *progress);
110
ED4_returncode fill_data(ED4_multi_species_manager *multi_species_manager,
191
ED4_returncode fill_data(ED4_multi_species_manager *multi_species_manager,
111
192
ED4_sequence_info_terminal *ref_sequence_info_terminal,
112
ED4_sequence_terminal *ref_sequence_terminal,
115
ED4_index actual_local_position,
116
ED4_index *length_of_terminals,
118
ED4_datamode datamode); // flag only needed for loading a new configuration
193
ED4_sequence_terminal *ref_sequence_terminal,
196
ED4_index curr_local_position,
197
ED4_index *length_of_terminals,
199
ED4_datamode datamode); // flag only needed for loading a new configuration
120
201
ED4_returncode search_sequence_data_rek(ED4_multi_sequence_manager *multi_sequence_manager,
121
202
ED4_sequence_info_terminal *ref_sequence_info_terminal,
122
ED4_sequence_terminal *ref_sequence_terminal,
125
ED4_index *seq_coords,
126
ED4_index *max_seq_terminal_length,
127
ED4_alignment alignment_flag);
203
ED4_sequence_terminal *ref_sequence_terminal,
206
ED4_index *seq_coords,
207
ED4_index *max_seq_terminal_length,
208
ED4_alignment alignment_flag,
129
ED4_index scan_string(ED4_multi_species_manager *parent,
211
ED4_index scan_string(ED4_multi_species_manager *parent,
130
212
ED4_sequence_info_terminal *ref_sequence_info_terminal,
131
ED4_sequence_terminal *ref_sequence_terminal,
213
ED4_sequence_terminal *ref_sequence_terminal,
217
arb_progress& progress);
136
ED4_returncode create_group_header(ED4_multi_species_manager *parent,
137
ED4_sequence_info_terminal *ref_sequence_info_terminal,
138
ED4_sequence_terminal *ref_sequence_terminal,
139
ED4_multi_species_manager **multi_species_manager,
140
ED4_bracket_terminal **bracket_terminal,
145
ED4_index local_count_position);
219
ED4_returncode create_group_header(ED4_multi_species_manager *parent,
220
ED4_sequence_info_terminal *ref_sequence_info_terminal,
221
ED4_sequence_terminal *ref_sequence_terminal,
222
ED4_multi_species_manager **multi_species_manager,
223
ED4_bracket_terminal **bracket_terminal,
228
ED4_index local_count_position);
147
230
char *generate_config_string(char *confname);
156
// --------------------------------------------------------------------------------
157
// struct ED4_object_specification
158
// --------------------------------------------------------------------------------
159
struct ED4_object_specification
236
#define SPECIFIED_OBJECT_TYPES 21
238
class ED4_objspec : public Noncopyable {
239
static bool object_specs_initialized;
240
static bool descendants_uptodate;
242
mutable ED4_level used_children; // in any object of this type
243
mutable ED4_level possible_descendants; // below any object of this type (depends on used_children)
244
mutable ED4_level allowed_descendants; // below any object of this type (depends on allowed_children)
246
void calc_descendants() const;
161
249
ED4_properties static_prop;
163
251
ED4_level allowed_children;
164
252
ED4_level handled_level;
165
253
ED4_level restriction_level;
166
float justification; //Justification of Object, which is controlled by a manager
255
ED4_objspec(ED4_properties static_prop_, ED4_level level_, ED4_level allowed_children_, ED4_level handled_level_, ED4_level restriction_level_);
168
257
#if defined(IMPLEMENT_DUMP)
169
258
void dump(size_t indent) const;
170
259
#endif // IMPLEMENT_DUMP
172
}; //Manager coordinates Layout
175
// --------------------------------------------------------------------------------
176
// class ED4_folding_line
177
// --------------------------------------------------------------------------------
178
class ED4_folding_line
179
//properties of an object, i.e. concerning rectangles on screen showing sequences
181
ED4_folding_line(const ED4_folding_line&); // copy-constructor not allowed
184
AW_pos window_pos[2];
261
static void init_object_specs();
263
bool is_manager() const { return static_prop & ED4_P_IS_MANAGER; }
264
bool is_terminal() const { return static_prop & ED4_P_IS_TERMINAL; }
266
bool allowed_to_contain(ED4_level child_level) const {
267
// e4_assert(object_specs_initialized); // @@@ cant check here.. but where
268
e4_assert(is_manager()); // terminals can't contain anything - your test is senseless
269
return allowed_children & child_level;
272
void announce_added(ED4_level child_level) const {
273
e4_assert(allowed_to_contain(child_level));
274
used_children = ED4_level(used_children|child_level);
275
descendants_uptodate = false;
278
static void recalc_descendants();
280
ED4_level get_possible_descendants() const {
281
e4_assert(is_manager());
282
if (!descendants_uptodate) recalc_descendants();
283
return possible_descendants;
285
ED4_level get_allowed_descendants() const { // (allowed = possible + those allowed to add, but not added anywhere)
286
e4_assert(is_manager());
287
if (!descendants_uptodate) recalc_descendants();
288
return allowed_descendants;
292
class ED4_folding_line : virtual Noncopyable {
293
AW_pos dimension; // amount of pixel folded away
294
AW_pos pos; // window position of folding line (x or y, only owner knows which coordinate is folded)
188
295
ED4_folding_line *next;
297
ED4_folding_line *insert(ED4_folding_line *fl) {
298
e4_assert(!fl->next);
299
if (pos <= fl->pos) { // insert behind
300
next = next ? next->insert(fl) : fl;
310
ED4_folding_line(AW_pos world, AW_pos dim) : dimension(dim), next(0) { set_pos(world-dimension); }
312
~ED4_folding_line() { delete next; }
314
void insertAs(ED4_folding_line*& ptr) {
315
ED4_folding_line *other = ptr;
317
ptr = other ? other->insert(this) : this;
320
ED4_folding_line *delete_member(ED4_folding_line *fl) {
321
ED4_folding_line *result = this;
330
AW_pos get_dimension() const { return dimension; }
331
const ED4_folding_line *get_next() const { return next; }
333
void warn_illegal_dimension();
335
void set_dimension(AW_pos dim) { dimension = dim; warn_illegal_dimension(); }
336
void add_to_dimension(AW_pos offset) { dimension += offset; warn_illegal_dimension(); }
338
void set_pos(AW_pos p) { pos = p; }
339
AW_pos get_pos() const { return pos; }
341
AW_pos win2world(AW_pos win) const {
342
if (win<pos) return win;
343
return (next ? next->win2world(win) : win)+dimension;
345
AW_pos world2win(AW_pos world) const {
346
if (world<pos) return world;
348
if (!next) return world;
349
return next->world2win(world);
194
// --------------------------------------------------------------------------------
195
// struct ED4_scroll_links
196
// --------------------------------------------------------------------------------
197
struct ED4_scroll_links
353
struct ED4_scroll_links {
199
354
ED4_base *link_for_hor_slider;
200
355
ED4_base *link_for_ver_slider;
204
// --------------------------------------------------------------------------------
205
// struct ED4_scrolled_rectangle
206
// --------------------------------------------------------------------------------
207
struct ED4_scrolled_rectangle
209
ED4_folding_line *scroll_top, *scroll_bottom, *scroll_left, *scroll_right;
210
ED4_base *x_link, *y_link, *width_link, *height_link;
211
AW_pos world_x, world_y, width, height;
357
ED4_scroll_links() : link_for_hor_slider(0), link_for_ver_slider(0) {}
360
class ED4_foldable : virtual Noncopyable {
361
ED4_folding_line *horizontal_fl;
362
ED4_folding_line *vertical_fl;
365
delete horizontal_fl;
367
horizontal_fl = NULL;
370
bool is_reset() const { return !horizontal_fl && !vertical_fl; }
373
ED4_foldable() : horizontal_fl(NULL), vertical_fl(NULL) {}
374
~ED4_foldable() { reset(); }
376
const ED4_folding_line *get_horizontal_folding() { return horizontal_fl; }
377
const ED4_folding_line *get_vertical_folding() { return vertical_fl; }
379
void world_to_win_coords(AW_pos *xPtr, AW_pos *yPtr) const { // @@@ old style
380
// Calculates transformation from world to window coordinates in a given window.
381
// world-coordinates inside folded range result in window coordinates lower than folding line position.
382
e4_assert(!is_reset());
383
*xPtr = vertical_fl->world2win(*xPtr);
384
*yPtr = horizontal_fl->world2win(*yPtr);
386
void win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) const { // @@@ old style
387
// calculates transformation from window to world coordinates in a given window
388
e4_assert(!is_reset());
389
*xPtr = vertical_fl->win2world(*xPtr);
390
*yPtr = horizontal_fl->win2world(*yPtr);
393
AW::Position world_to_win_coords(const AW::Position& pos) const {
394
e4_assert(!is_reset());
395
return AW::Position(vertical_fl->world2win(pos.xpos()),
396
horizontal_fl->world2win(pos.ypos()));
398
AW::Position win_to_world_coords(const AW::Position& pos) const {
399
e4_assert(!is_reset());
400
return AW::Position(vertical_fl->win2world(pos.xpos()),
401
horizontal_fl->win2world(pos.ypos()));
404
ED4_folding_line *insert_folding_line(AW_pos pos, AW_pos dimension, ED4_properties prop);
405
void delete_folding_line(ED4_folding_line *fl, ED4_properties prop);
409
class ED4_scrolled_rectangle : virtual Noncopyable {
410
ED4_folding_line *scroll_bottom;
411
ED4_folding_line *scroll_right;
412
ED4_folding_line *scroll_top;
413
ED4_folding_line *scroll_left;
417
ED4_base *width_link;
418
ED4_base *height_link;
422
bool folding_dimensions_calculated; // flag to ensure calc_bottomRight_folding_dimensions is called before get_window_rect
431
void init_folding_lines() {
215
433
scroll_bottom = 0;
217
435
scroll_right = 0;
229
// --------------------------------------------------------------------------------
230
// class ED4_list_elem
231
// --------------------------------------------------------------------------------
235
ED4_list_elem *my_next;
237
ED4_list_elem(void *element) { my_elem = element; my_next = 0; }
240
ED4_list_elem *next() const { return my_next; }
241
void *elem() const { return my_elem; }
243
void set_next(ED4_list_elem *the_next) { my_next = the_next; }
247
// --------------------------------------------------------------------------------
249
// --------------------------------------------------------------------------------
251
// class which implements a general purpose linked list of void*
253
ED4_list_elem *my_first;
254
ED4_list_elem *my_last;
255
ED4_index my_no_of_entries;
257
ED4_list(const ED4_list&); // copy-constructor not allowed
261
ED4_list_elem *first() const { return my_first; }
262
ED4_list_elem *last() const { return my_last; }
263
ED4_index no_of_entries() const { return my_no_of_entries; }
265
ED4_returncode append_elem( void *elem );
266
ED4_returncode delete_elem( void *elem );
267
ED4_returncode append_elem_backwards( void *elem );
268
short is_elem( void *elem );
276
// --------------------------------------------------------------------------------
277
// class ED4_base_position
278
// --------------------------------------------------------------------------------
279
class ED4_base_position
281
const ED4_base *calced4base;
285
void calc4base(const ED4_base *base);
287
ED4_base_position(const ED4_base_position&); // copy-constructor not allowed
292
~ED4_base_position();
296
int get_base_position(const ED4_base *base, int sequence_position);
297
int get_sequence_position(const ED4_base *base, int base_position);
437
folding_dimensions_calculated = false;
439
void init_pos_size() { world = AW::Rectangle(AW::Origin, AW::ZeroVector); }
442
init_folding_lines();
447
void update_folding_line_positions() {
448
scroll_top->set_pos(world.top());
449
scroll_left->set_pos(world.left());
454
ED4_scrolled_rectangle() { init(); }
456
AW_pos bottom() const { return world.bottom(); }
457
AW_pos right() const { return world.right(); }
459
void reset(ED4_foldable& owner) {
460
destroy_folding_lines(owner);
464
AW_pos top_dim() const { return scroll_top->get_dimension(); }
465
AW_pos left_dim() const { return scroll_left->get_dimension(); }
467
bool exists() const { return scroll_top && scroll_bottom && scroll_left && scroll_right; }
468
bool is_linked() const {
471
e4_assert(width_link);
472
e4_assert(height_link);
476
e4_assert(!width_link);
477
e4_assert(!height_link);
480
void link(ED4_base *x, ED4_base *y, ED4_base *w, ED4_base *h) {
481
e4_assert(x && y && w && h);
489
void replace_x_width_link_to(ED4_base *old_link, ED4_base *new_link) {
490
if (x_link == old_link) x_link = new_link;
491
if (width_link == old_link) width_link = new_link;
494
void add_to_top_left_dimension(int dx, int dy) {
495
scroll_left->add_to_dimension(dx);
496
scroll_top->add_to_dimension(dy);
499
void scroll(int dx, int dy) {
500
scroll_left->add_to_dimension(-dx);
501
scroll_top->add_to_dimension(-dy);
502
scroll_right->add_to_dimension(dx);
503
scroll_bottom->add_to_dimension(dy);
506
AW::Rectangle get_window_rect() const {
507
e4_assert(folding_dimensions_calculated);
508
return AW::Rectangle(scroll_left->get_pos(), scroll_top->get_pos(),
509
scroll_right->get_pos(), scroll_bottom->get_pos());
512
AW::Rectangle get_world_rect() const;
514
void set_rect(const AW::Rectangle& rect) { world = rect; }
515
void set_rect_and_update_folding_line_positions(const AW::Rectangle& rect) {
517
update_folding_line_positions();
520
void calc_bottomRight_folding_dimensions(int area_width, int area_height) {
521
area_width -= SLIDER_OFFSET;
522
area_height -= SLIDER_OFFSET;
525
if (bottom() > area_height) { // our world doesn't fit vertically in our window
526
dim = bottom()-area_height; // calc dimension of both horizontal folding lines
527
scroll_top->set_dimension(std::min(dim, scroll_top->get_dimension()));
528
scroll_bottom->set_dimension(std::max(0, int(dim - scroll_top->get_dimension())));
532
scroll_bottom->set_dimension(0);
533
scroll_top->set_dimension(0);
536
e4_assert(dim == (scroll_top->get_dimension()+scroll_bottom->get_dimension()));
537
scroll_bottom->set_pos(world.bottom()-dim+SLIDER_OFFSET);
539
if (right()>area_width) { // our world doesn't fit horizontally in our window
540
dim = right()-area_width; // calc dimension of both vertical folding lines
541
scroll_left->set_dimension(std::min(dim, scroll_left->get_dimension()));
542
scroll_right->set_dimension(std::max(0, int(dim - scroll_left->get_dimension())));
546
scroll_right->set_dimension(0);
547
scroll_left->set_dimension(0);
550
e4_assert(dim == (scroll_left->get_dimension()+scroll_right->get_dimension()));
551
scroll_right->set_pos(world.right()-dim+SLIDER_OFFSET);
553
folding_dimensions_calculated = true;
556
void create_folding_lines(ED4_foldable& owner, const AW::Rectangle& rect, int area_width, int area_height) {
557
scroll_top = owner.insert_folding_line(rect.top(), 0, ED4_P_HORIZONTAL);
558
scroll_left = owner.insert_folding_line(rect.left(), 0, ED4_P_VERTICAL);
561
if (rect.bottom() > area_height) dim = rect.bottom() - area_height;
562
scroll_bottom = owner.insert_folding_line(rect.bottom(), dim, ED4_P_HORIZONTAL);
565
if (rect.right() > area_width) dim = rect.right() - area_width;
566
scroll_right = owner.insert_folding_line(rect.right(), dim, ED4_P_VERTICAL);
569
void destroy_folding_lines(ED4_foldable& owner) {
570
if (scroll_top) owner.delete_folding_line(scroll_top, ED4_P_HORIZONTAL);
571
if (scroll_bottom) owner.delete_folding_line(scroll_bottom, ED4_P_HORIZONTAL);
572
if (scroll_left) owner.delete_folding_line(scroll_left, ED4_P_VERTICAL);
573
if (scroll_right) owner.delete_folding_line(scroll_right, ED4_P_VERTICAL);
575
init_folding_lines();
579
class ED4_base_position : private BasePosition { // derived from a Noncopyable
580
const ED4_terminal *calced4term; // if calced4term!=NULL => callback is bound to its species manager
583
void calc4term(const ED4_terminal *term);
584
void set_term(const ED4_terminal *term) {
585
if (calced4term != term || needUpdate) {
589
void remove_changed_cb();
598
~ED4_base_position() {
606
void announce_deletion(const ED4_terminal *term) {
607
if (term == calced4term) {
611
e4_assert(calced4term != term);
613
void prepare_shutdown() {
614
if (calced4term) announce_deletion(calced4term);
617
int get_base_position(const ED4_terminal *base, int sequence_position);
618
int get_sequence_position(const ED4_terminal *base, int base_position);
620
int get_base_count(const ED4_terminal *term) { set_term(term); return base_count(); }
621
int get_abs_len(const ED4_terminal *term) { set_term(term); return abs_count(); }
301
624
class ED4_CursorShape;
366
698
int get_base_position() const { return sequence2base_position(get_sequence_pos()); }
368
void invalidate_base_position() { base_position.invalidate(); }
370
void jump_screen_pos(AW_window *aww, int screen_pos, ED4_CursorJumpType jump_type);
371
void jump_sequence_pos(AW_window *aww, int sequence_pos, ED4_CursorJumpType jump_type);
372
void jump_base_pos(AW_window *aww, int base_pos, ED4_CursorJumpType jump_type);
374
int get_screen_relative_pos();
375
void set_screen_relative_pos(AW_window *aww, int scroll_to_relpos);
377
void set_to_terminal(AW_window *aww, ED4_terminal *terminal, int seq_pos, ED4_CursorJumpType jump_type);
700
void prepare_shutdown() { base_position.prepare_shutdown(); }
702
void jump_screen_pos(int screen_pos, ED4_CursorJumpType jump_type);
703
void jump_sequence_pos(int sequence_pos, ED4_CursorJumpType jump_type);
704
void jump_base_pos(int base_pos, ED4_CursorJumpType jump_type);
706
int get_screen_relative_pos() const;
707
void set_screen_relative_pos(int scroll_to_relpos);
709
void set_to_terminal(ED4_terminal *terminal, int seq_pos, ED4_CursorJumpType jump_type);
711
inline bool in_species_seq_terminal() const;
712
inline bool in_consensus_terminal() const;
713
inline bool in_SAI_terminal() const;
715
void announce_deletion(ED4_terminal *object) {
716
base_position.announce_deletion(object);
717
if (object == owner_of_cursor) owner_of_cursor = NULL; // no need to delete the cursor (deletion triggers full redraw)
381
ED4_window *window() const;
722
ED4_window *window() const { return win; }
724
ED4_cursor(ED4_window *win);
387
// --------------------------------------------------------------------------------
389
// --------------------------------------------------------------------------------
392
ED4_window(const ED4_window&); // copy-constructor not allowed
728
class ED4_window : public ED4_foldable, virtual ED4_WinContextFree { // derived from Noncopyable
729
void set_scrollbar_indents();
394
AW_window *aww; //Points to Window
732
AW_window_menu_modes *aww; // Points to Window
395
733
ED4_window *next;
396
734
int slider_pos_horizontal;
397
735
int slider_pos_vertical;
398
ED4_folding_line *horizontal_fl;
399
ED4_folding_line *vertical_fl;
400
736
ED4_scrolled_rectangle scrolled_rect;
401
int id; //unique id in window-list
737
int id; // unique id in window-list
402
738
ED4_coords coords;
403
static int no_of_windows;
405
char awar_path_for_cursor[50]; // position in current sequence, range=[1;len]
406
char awar_path_for_Ecoli[50]; // position relative to ecoli
407
char awar_path_for_basePos[50]; // base position in current sequence (# of bases left to cursor)
408
char awar_path_for_IUPAC[50]; // IUPAC decoder content for current position
409
char awar_path_for_helixNr[50]; // # of helix (or 0) for current position
740
static int no_of_windows;
742
char awar_path_for_cursor[50]; // position in current sequence, range = [1;len]
743
char awar_path_for_Ecoli[50]; // position relative to ecoli
744
char awar_path_for_basePos[50]; // base position in current sequence (# of bases left to cursor)
745
char awar_path_for_IUPAC[50]; // IUPAC decoder content for current position
746
char awar_path_for_helixNr[50]; // # of helix (or 0) for current position
412
749
ED4_cursor cursor;
414
//ED4_window controlling functions
415
static ED4_window *insert_window(AW_window *new_aww); //append to window list
417
void delete_window( ED4_window *window); //delete from window list
418
void reset_all_for_new_config(); //reset structures for loading new config
419
ED4_window *get_matching_ed4w( AW_window *aww );
421
//functions concerned the scrolled area
422
ED4_returncode update_scrolled_rectangle( void );
423
ED4_returncode set_scrollbar_indents( void );
424
ED4_returncode scroll_rectangle( int dx, int dy );
425
ED4_returncode set_scrolled_rectangle( AW_pos world_x, AW_pos world_y, AW_pos width, AW_pos height,
426
ED4_base *x_link, ED4_base *y_link, ED4_base *width_link, ED4_base *height_link );
751
// ED4_window controlling functions
752
static ED4_window *insert_window(AW_window_menu_modes *new_aww); // append to window list
754
void delete_window(ED4_window *window); // delete from window list
755
void reset_all_for_new_config(); // reset structures for loading new config
756
ED4_window *get_matching_ed4w(AW_window *aww);
758
void announce_deletion(ED4_terminal *object) { cursor.announce_deletion(object); }
760
// functions concerned the scrolled area
761
void update_scrolled_rectangle();
762
ED4_returncode scroll_rectangle(int dx, int dy);
763
ED4_returncode set_scrolled_rectangle(ED4_base *x_link, ED4_base *y_link, ED4_base *width_link, ED4_base *height_link);
765
bool scrollbars_and_scrolledRect_inSync() const {
766
// Scrolling in EDIT4 window uses redundant data
767
// - dimension of folding lines
768
// - slider positions in AW_window and ED4_window
769
// This function checks whether they are in sync.
772
(scrolled_rect.top_dim() == aww->slider_pos_vertical) &&
773
(scrolled_rect.left_dim() == aww->slider_pos_horizontal);
777
fputs("scrollbars not in sync with scrolled_rect:\n", stderr);
779
#define POSTYPE "%zu"
783
fprintf(stderr, " aww->slider_pos_vertical =" POSTYPE " scrolled_rect->top_dim() =%f\n", aww->slider_pos_vertical, scrolled_rect.top_dim());
784
fprintf(stderr, " aww->slider_pos_horizontal=" POSTYPE " scrolled_rect->left_dim()=%f\n", aww->slider_pos_horizontal, scrolled_rect.left_dim());
791
void check_valid_scrollbar_values() { e4_assert(scrollbars_and_scrolledRect_inSync()); }
793
bool shows_xpos(int x) const { return x >= coords.window_left_clip_point && x <= coords.window_right_clip_point; }
794
bool partly_shows(int x1, int y1, int x2, int y2) const;
795
bool completely_shows(int x1, int y1, int x2, int y2) const;
428
797
void update_window_coords();
430
// functions concerned with folding lines
431
ED4_folding_line *insert_folding_line( AW_pos world_x, AW_pos world_y, AW_pos length, AW_pos dimension, ED4_base *link, ED4_properties prop );
432
ED4_returncode delete_folding_line( ED4_folding_line *fl, ED4_properties prop );
799
AW_device *get_device() const { return aww->get_device(AW_MIDDLE_AREA); }
434
ED4_window(AW_window *window);
801
ED4_window(AW_window_menu_modes *window);
438
// --------------------------------------------------------------------------------
440
// --------------------------------------------------------------------------------
442
//contains children related functions from members of a manager
444
ED4_members(const ED4_members&); // copy-constructor not allowed
805
class ED4_members : virtual Noncopyable {
806
// contains children related functions from members of a manager
446
ED4_manager *my_owner; //who is controlling this object
808
ED4_manager *my_owner; // who is controlling this object
447
809
ED4_base **memberList;
448
ED4_index no_of_members; //How much members are in the list
810
ED4_index no_of_members; // How much members are in the list
449
811
ED4_index size_of_list;
648
1016
ED4_bases_table& table(int c) { e4_assert(c>0 && c<MAXCHARTABLE); return linear_table(char_to_index_tab[c]); }
649
1017
const ED4_bases_table& table(int c) const { e4_assert(c>0 && c<MAXCHARTABLE); return linear_table(char_to_index_tab[c]); }
651
int changed_range(const ED4_char_table& other, int *start, int *end) const;
652
static int changed_range(const char *string1, const char *string2, int min_len, int *start, int *end);
1019
const PosRange *changed_range(const ED4_char_table& other) const;
1020
static const PosRange *changed_range(const char *string1, const char *string2, int min_len);
654
1022
void add(const ED4_char_table& other);
655
1023
void sub(const ED4_char_table& other);
656
1024
void sub_and_add(const ED4_char_table& Sub, const ED4_char_table& Add);
657
void sub_and_add(const ED4_char_table& Sub, const ED4_char_table& Add, int start, int end);
1025
void sub_and_add(const ED4_char_table& Sub, const ED4_char_table& Add, PosRange range);
659
1027
void add(const char *string, int len);
660
1028
void sub(const char *string, int len);
661
void sub_and_add(const char *old_string, const char *new_string, int start, int end);
1029
void sub_and_add(const char *old_string, const char *new_string, PosRange range);
663
char *build_consensus_string(int left_idx=0, int right_index=-1, char *fill_id=0) const;
1031
void build_consensus_string_to(char *buffer, ExplicitRange range) const;
1032
char *build_consensus_string(PosRange range) const;
1033
char *build_consensus_string() const { return build_consensus_string(PosRange::whole()); }
665
1035
void change_table_length(int new_length);
668
// --------------------------------------------------------------------------------
669
// class ED4_species_pointer
670
// --------------------------------------------------------------------------------
671
class ED4_species_pointer // @@@ shall be renamed into ED4_gbdata_pointer to reflect general usage
1038
// ----------------------------
1039
// ED4_species_pointer
1041
class ED4_species_pointer : virtual Noncopyable {
1042
// @@@ shall be renamed into ED4_gbdata_pointer to reflect general usage
673
1044
GBDATA *species_pointer; // points to database
675
void add_callback(int *clientdata);
676
void remove_callback(int *clientdata);
1046
void addCallback(ED4_base *base);
1047
void removeCallback(ED4_base *base);
680
1051
ED4_species_pointer();
681
1052
~ED4_species_pointer();
683
GBDATA *get_species_pointer() const { return species_pointer; }
684
void set_species_pointer(GBDATA *gbd, int *clientdata);
1054
GBDATA *Get() const { return species_pointer; }
1055
void Set(GBDATA *gbd, ED4_base *base);
685
1056
void notify_deleted() {
686
1057
species_pointer=0;
690
// --------------------------------------------------------------------------------
692
// --------------------------------------------------------------------------------
693
class ED4_base //functions and variables which are available in all objects
1061
// -----------------
1065
typedef ARB_ERROR (*ED4_cb)(ED4_base *, AW_CL, AW_CL);
1066
typedef ARB_ERROR (*ED4_cb1)(ED4_base *, AW_CL);
1067
typedef ARB_ERROR (*ED4_cb0)(ED4_base *);
1069
enum ED4_species_type {
1076
class ED4_base : virtual Noncopyable {
695
1079
ED4_species_pointer my_species_pointer;
696
ED4_base(const ED4_base&); // copy-constructor not allowed
698
1081
// cache world coordinates:
700
static int actualTimestamp;
1083
static int currTimestamp;
1084
mutable AW::Position lastPos;
1085
mutable int timestamp;
1087
ED4_base_list *linked_objects; // linked list of objects which are depending from this object
707
ED4_manager *parent; //Points to parent
708
ED4_object_specification *spec; //contains information about Objectproperties
709
ED4_properties dynamic_prop; //contains info about what i am, what i can do, what i should do
710
char *id; //globally unique name in hierarchy
711
ED4_index index; //defines the order of child objects
712
ED4_base *width_link; //concerning the hierarchy
713
ED4_base *height_link; //concerning the hierarchy
714
ED4_extension extension; //contains relativ info about graphical properties
715
ED4_list linked_objects; //linked list of objects which are depending from this object
716
ED4_update_info update_info; //info about things to be done for the object, i.e. refresh; flag structure
1090
const ED4_objspec& spec; // contains information about Objectproperties
1092
ED4_manager *parent; // Points to parent
1095
ED4_properties dynamic_prop; // contains info about what i am, what i can do, what i should do
1096
char *id; // globally unique name in hierarchy
1097
ED4_index index; // defines the order of child objects
1098
ED4_base *width_link; // concerning the hierarchy
1099
ED4_base *height_link; // concerning the hierarchy
1100
ED4_extension extension; // contains relative info about graphical properties
1101
ED4_update_info update_info; // info about things to be done for the object, i.e. refresh; flag structure
718
unsigned int hidden:1; //flag whether object is hidden or not
719
unsigned int is_consensus:1; //indicates whether object is consensus(manager)
720
unsigned int is_SAI:1; //indicates whether object is extendend
1103
unsigned int hidden : 1; // flag whether object is hidden or not
723
1106
void draw_bb(int color);
725
#if defined(IMPLEMENT_DUMP)
726
virtual void dump(size_t indent) const = 0;
727
void dump_base(size_t indent) const;
728
#endif // IMPLEMENT_DUMP
1108
DECLARE_DUMP_FOR_ROOTCLASS(ED4_base);
730
1110
// function for species_pointer
732
GBDATA *get_species_pointer() const { return my_species_pointer.get_species_pointer(); }
733
void set_species_pointer(GBDATA *gbd) { my_species_pointer.set_species_pointer(gbd, (int*)(this)); }
1112
GBDATA *get_species_pointer() const { return my_species_pointer.Get(); }
1113
void set_species_pointer(GBDATA *gbd) { my_species_pointer.Set(gbd, this); }
734
1114
int has_callback() const { return get_species_pointer()!=0; }
738
1118
virtual void changed_by_database();
739
1119
virtual void deleted_from_database();
741
virtual bool remove_deleted_childs();
743
1121
// functions concerned with graphic output
744
virtual int adjust_clipping_rectangle(void); //sets scrolling area in AW_MIDDLE_AREA
1122
int adjust_clipping_rectangle();
745
1123
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) = 0;
746
virtual ED4_returncode Resize() = 0;
747
virtual ED4_returncode clear_background(int color=0);
748
virtual short calc_bounding_box(void) = 0;
750
ED4_returncode clear_whole_background( void ); // clear AW_MIDDLE_AREA
751
bool is_visible(AW_pos x, AW_pos y, ED4_direction direction);
752
bool is_visible(AW_pos x1, AW_pos y1, AW_pos x2, AW_pos y2, ED4_direction direction);
754
//functions concerned with links in the hierarchy
755
virtual ED4_returncode set_links(ED4_base *width_link, ED4_base *height_link);
756
virtual ED4_returncode link_changed(ED4_base *link);
758
//functions concerned with special initialisation
759
virtual void set_properties (ED4_properties prop);
761
//functions concerned with coordinate transformation
763
void update_world_coords_cache();
764
void calc_rel_coords( AW_pos *x, AW_pos *y );
766
void calc_world_coords(AW_pos *x, AW_pos *y) {
767
bool cache_up_to_date = timestamp == actualTimestamp;
1124
virtual bool calc_bounding_box() = 0;
1126
ED4_returncode clear_background(int color=0);
1128
void set_links(ED4_base *width_link, ED4_base *height_link);
1130
// functions concerned with special initialization
1131
void set_property(ED4_properties prop) { dynamic_prop = (ED4_properties) (dynamic_prop | prop); }
1132
void clr_property(ED4_properties prop) { dynamic_prop = (ED4_properties) (dynamic_prop & ~prop); }
1134
// functions concerned with coordinate transformation
1136
void calc_rel_coords(AW_pos *x, AW_pos *y);
1138
void calc_world_coords(AW_pos *x, AW_pos *y) const {
1139
update_world_coords_cache();
1140
*x = lastPos.xpos();
1141
*y = lastPos.ypos();
1143
const AW::Position& calc_world_coords() const {
1144
update_world_coords_cache();
1148
void update_world_coords_cache() const {
1149
bool cache_up_to_date = timestamp == currTimestamp;
768
1150
if (!cache_up_to_date) {
769
update_world_coords_cache();
1152
ED4_base *pab = (ED4_base*)parent;
1153
lastPos = pab->calc_world_coords();
1156
lastPos = AW::Origin;
1158
lastPos.move(extension.get_parent_offset());
1159
timestamp = currTimestamp;
775
1163
static void touch_world_cache() {
779
//functions which refer to the object as a child, i.e. travelling down the hierarchy
780
virtual ED4_returncode set_refresh (int clear=1)=0;
781
virtual ED4_returncode resize_requested_by_child(void)=0;
782
virtual ED4_returncode resize_requested_by_parent(void)=0;
784
virtual ED4_returncode delete_requested_by_parent(void)=0;
785
virtual ED4_returncode delete_requested_by_child(void);
786
virtual ED4_returncode delete_requested_childs(void)=0;
788
virtual ED4_returncode calc_size_requested_by_parent( void )=0;
789
virtual ED4_returncode move_requested_by_parent( ED4_move_info *mi )=0;
1167
AW::Rectangle get_win_area(ED4_window *ed4w) const {
1168
AW::Position pos = ed4w->world_to_win_coords(calc_world_coords());
1169
return AW::Rectangle(pos, extension.get_size()-AW::Vector(1, 1));
1172
// functions which refer to the object as a child, i.e. travelling down the hierarchy
1173
virtual void request_refresh(int clear=1) = 0;
1175
inline void request_resize();
1176
void request_resize_of_linked();
1177
void resize_requested_by_link(ED4_base *link);
1178
virtual void resize_requested_children() = 0;
1180
virtual void delete_requested_children() = 0;
1181
virtual void Delete() = 0;
1183
inline void set_update();
1184
virtual void update_requested_children() = 0;
1186
virtual ED4_returncode move_requested_by_parent(ED4_move_info *mi) = 0;
790
1187
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww);
791
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo)=0;
793
virtual ED4_returncode handle_move(ED4_move_info *moveinfo)=0;
794
virtual ED4_returncode route_down_hierarchy(void **arg1, void **arg2, ED4_returncode (*function) (void **, void **, ED4_base *));
795
int calc_group_depth();
797
//general purpose functions
798
virtual ED4_base *search_ID(const char *id)=0;
799
virtual void check_all();
800
virtual short in_border( AW_pos abs_x, AW_pos abs_y, ED4_movemode mode );
801
virtual ED4_returncode set_width();
802
ED4_base *get_parent(ED4_level lev) const;
804
ED4_AREA_LEVEL get_area_level(ED4_multi_species_manager **multi_species_manager=0) const; // returns area we belong to and the next multi species manager of the area
1188
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo) = 0;
1191
virtual ED4_returncode handle_move(ED4_move_info *moveinfo) = 0;
1193
virtual ARB_ERROR route_down_hierarchy(ED4_cb cb, AW_CL cd1, AW_CL cd2);
1194
virtual ARB_ERROR route_down_hierarchy(ED4_cb1 cb, AW_CL cd) { return route_down_hierarchy(ED4_cb(cb), cd, 0); }
1195
virtual ARB_ERROR route_down_hierarchy(ED4_cb0 cb) { return route_down_hierarchy(ED4_cb(cb), 0, 0); }
1197
int calc_group_depth();
1199
// general purpose functions
1200
virtual ED4_base *search_ID(const char *id) = 0;
1203
short in_border(AW_pos abs_x, AW_pos abs_y, ED4_movemode mode);
1204
ED4_returncode set_width();
1207
ED4_AREA_LEVEL get_area_level(ED4_multi_species_manager **multi_species_manager=0) const; // returns area we belong to and the next multi species manager of the area
1209
ED4_base *get_parent(ED4_level lev) const;
1210
void unlink_from_parent();
806
1211
bool has_parent(ED4_manager *Parent);
807
1212
bool is_child_of(ED4_manager *Parent) { return has_parent(Parent); }
809
ED4_group_manager *is_in_folded_group() const;
810
virtual char *resolve_pointer_to_string_copy(int *str_len = 0) const;
811
virtual const char *resolve_pointer_to_char_pntr(int *str_len = 0) const;
812
virtual ED4_ERROR *write_sequence(const char *seq, int seq_len);
813
char *get_name_of_species(); // go from terminal to name of species
1214
virtual char *resolve_pointer_to_string_copy(int *str_len = 0) const;
1215
virtual const char *resolve_pointer_to_char_pntr(int *str_len = 0) const;
1217
ED4_group_manager *is_in_folded_group() const;
1218
virtual bool is_hidden() const = 0;
1220
char *get_name_of_species(); // go from terminal to name of species
815
1222
// functions which refer to the selected object(s), i.e. across the hierarchy
816
virtual ED4_base *get_competent_child( AW_pos x, AW_pos y, ED4_properties relevant_prop)=0;
817
virtual ED4_base *get_competent_clicked_child( AW_pos x, AW_pos y, ED4_properties relevant_prop)=0;
818
virtual ED4_base *search_spec_child_rek( ED4_level level ); //recursive search for level
1223
virtual ED4_base *get_competent_child(AW_pos x, AW_pos y, ED4_properties relevant_prop)=0;
1224
virtual ED4_base *get_competent_clicked_child(AW_pos x, AW_pos y, ED4_properties relevant_prop)=0;
1225
virtual ED4_base *search_spec_child_rek(ED4_level level); // recursive search for level
820
1227
ED4_terminal *get_next_terminal();
821
1228
ED4_terminal *get_prev_terminal();
823
1230
ED4_returncode generate_configuration_string(char **generated_string);
825
1232
virtual ED4_returncode remove_callbacks();
826
ED4_terminal *get_consensus_relevant_terminal();
1234
const ED4_terminal *get_consensus_relevant_terminal() const;
828
ED4_base(GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1236
ED4_base(const ED4_objspec& spec_, GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
829
1237
virtual ~ED4_base();
831
1239
// use the following functions to test which derived class we have
833
int is_terminal() const { return !this || spec->static_prop & ED4_P_IS_TERMINAL; }
835
int is_text_terminal() const { return !this || spec->level & (ED4_L_SPECIES_NAME|ED4_L_SEQUENCE_INFO|ED4_L_SEQUENCE_STRING|ED4_L_PURE_TEXT|ED4_L_COL_STAT); }
837
int is_species_name_terminal() const { return !this || spec->level & ED4_L_SPECIES_NAME; }
838
int is_sequence_info_terminal() const { return !this || spec->level & ED4_L_SEQUENCE_INFO; }
839
int is_sequence_terminal() const { return !this || spec->level & ED4_L_SEQUENCE_STRING; }
840
int is_aa_sequence_terminal() const { return !this || spec->level & ED4_L_AA_SEQUENCE_STRING; }//ykadi
841
int is_pure_text_terminal() const { return !this || spec->level & ED4_L_PURE_TEXT; }
842
int is_columnStat_terminal() const { return !this || spec->level & ED4_L_COL_STAT; }
844
int is_bracket_terminal() const { return !this || spec->level & ED4_L_BRACKET; }
845
int is_spacer_terminal() const { return !this || spec->level & ED4_L_SPACER; }
846
int is_line_terminal() const { return !this || spec->level & ED4_L_LINE; }
848
int is_manager() const { return !this || spec->static_prop & ED4_P_IS_MANAGER; }
850
int is_sequence_manager() const { return !this || spec->level & ED4_L_SEQUENCE; }
851
int is_multi_name_manager() const { return !this || spec->level & ED4_L_MULTI_NAME; }
852
int is_name_manager() const { return !this || spec->level & ED4_L_NAME_MANAGER; }
853
int is_multi_species_manager() const { return !this || spec->level & ED4_L_MULTI_SPECIES; }
854
int is_multi_sequence_manager() const { return !this || spec->level & ED4_L_MULTI_SEQUENCE; }
855
int is_device_manager() const { return !this || spec->level & ED4_L_DEVICE; }
856
int is_group_manager() const { return !this || spec->level & ED4_L_GROUP; }
857
int is_species_manager() const { return !this || spec->level & ED4_L_SPECIES; }
858
int is_area_manager() const { return !this || spec->level & ED4_L_AREA; }
1241
int is_terminal() const { e4_assert(this); return spec.static_prop & ED4_P_IS_TERMINAL; }
1243
int is_text_terminal() const { e4_assert(this); return spec.level & (ED4_L_SPECIES_NAME|ED4_L_SEQUENCE_INFO|ED4_L_SEQUENCE_STRING|ED4_L_PURE_TEXT|ED4_L_COL_STAT); }
1245
int is_species_name_terminal() const { e4_assert(this); return spec.level & ED4_L_SPECIES_NAME; }
1247
int is_sequence_info_terminal() const { e4_assert(this); return spec.level & ED4_L_SEQUENCE_INFO; }
1248
int is_sequence_terminal() const { e4_assert(this); return spec.level & ED4_L_SEQUENCE_STRING; }
1249
int is_orf_terminal() const { e4_assert(this); return spec.level & ED4_L_ORF; }
1251
int is_pure_text_terminal() const { e4_assert(this); return spec.level & ED4_L_PURE_TEXT; }
1252
int is_columnStat_terminal() const { e4_assert(this); return spec.level & ED4_L_COL_STAT; }
1254
int is_bracket_terminal() const { e4_assert(this); return spec.level & ED4_L_BRACKET; }
1255
int is_spacer_terminal() const { e4_assert(this); return spec.level & ED4_L_SPACER; }
1256
int is_line_terminal() const { e4_assert(this); return spec.level & ED4_L_LINE; }
1258
int is_manager() const { e4_assert(this); return spec.static_prop & ED4_P_IS_MANAGER; }
1260
int is_sequence_manager() const { e4_assert(this); return spec.level & ED4_L_SEQUENCE; }
1261
int is_multi_name_manager() const { e4_assert(this); return spec.level & ED4_L_MULTI_NAME; }
1262
int is_name_manager() const { e4_assert(this); return spec.level & ED4_L_NAME_MANAGER; }
1263
int is_multi_species_manager() const { e4_assert(this); return spec.level & ED4_L_MULTI_SPECIES; }
1264
int is_multi_sequence_manager() const { e4_assert(this); return spec.level & ED4_L_MULTI_SEQUENCE; }
1265
int is_device_manager() const { e4_assert(this); return spec.level & ED4_L_DEVICE; }
1267
int is_group_manager() const { e4_assert(this); return spec.level & ED4_L_GROUP; }
1268
int is_root_group_manager() const { e4_assert(this); return spec.level & ED4_L_ROOTGROUP; }
1269
int is_abstract_group_manager() const { e4_assert(this); return spec.level & (ED4_L_GROUP|ED4_L_ROOTGROUP); }
1271
int is_species_manager() const { e4_assert(this); return spec.level & ED4_L_SPECIES; }
1272
int is_area_manager() const { e4_assert(this); return spec.level & ED4_L_AREA; }
860
1274
// use the following functions to cast ED4_base to derived classes:
862
ED4_base *to_base() const { e4_assert(is_terminal() || is_manager()); return (ED4_base *)this; }
864
ED4_terminal *to_terminal() const { e4_assert(is_terminal()); return (ED4_terminal *)this; }
866
ED4_text_terminal *to_text_terminal() const { e4_assert(is_text_terminal()); return (ED4_text_terminal *)this; }
868
ED4_species_name_terminal *to_species_name_terminal() const { e4_assert(is_species_name_terminal()); return (ED4_species_name_terminal *)this; }
869
ED4_sequence_info_terminal *to_sequence_info_terminal() const { e4_assert(is_sequence_info_terminal()); return (ED4_sequence_info_terminal*)this; }
870
ED4_sequence_terminal *to_sequence_terminal() const { e4_assert(is_sequence_terminal()); return (ED4_sequence_terminal*)this; }
871
ED4_AA_sequence_terminal *to_aa_sequence_terminal() const { e4_assert(is_aa_sequence_terminal()); return (ED4_AA_sequence_terminal*)this; } //ykadi
872
ED4_pure_text_terminal *to_pure_text_terminal() const { e4_assert(is_pure_text_terminal()); return (ED4_pure_text_terminal*)this; }
873
ED4_columnStat_terminal *to_columnStat_terminal() const { e4_assert(is_columnStat_terminal()); return (ED4_columnStat_terminal*)this; }
875
ED4_bracket_terminal *to_bracket_terminal() const { e4_assert(is_bracket_terminal()); return (ED4_bracket_terminal*)this; }
876
ED4_spacer_terminal *to_spacer_terminal() const { e4_assert(is_spacer_terminal()); return (ED4_spacer_terminal*)this; }
877
ED4_line_terminal *to_line_terminal() const { e4_assert(is_line_terminal()); return (ED4_line_terminal*)this; }
879
ED4_manager *to_manager() const { e4_assert(is_manager()); return (ED4_manager *)this; }
881
ED4_sequence_manager *to_sequence_manager() const { e4_assert(is_sequence_manager()); return (ED4_sequence_manager*)this; }
882
ED4_multi_name_manager *to_multi_name_manager() const { e4_assert(is_multi_name_manager()); return (ED4_multi_name_manager *)this; }
883
ED4_name_manager *to_name_manager() const { e4_assert(is_name_manager()); return (ED4_name_manager *)this; }
884
ED4_multi_species_manager *to_multi_species_manager() const { e4_assert(is_multi_species_manager()); return (ED4_multi_species_manager *)this; }
885
ED4_multi_sequence_manager *to_multi_sequence_manager() const { e4_assert(is_multi_sequence_manager()); return (ED4_multi_sequence_manager *)this; }
886
ED4_device_manager *to_device_manager() const { e4_assert(is_device_manager()); return (ED4_device_manager *)this; }
887
ED4_group_manager *to_group_manager() const { e4_assert(is_group_manager()); return (ED4_group_manager *)this; }
888
ED4_species_manager *to_species_manager() const { e4_assert(is_species_manager()); return (ED4_species_manager *)this; }
889
ED4_area_manager *to_area_manager() const { e4_assert(is_area_manager()); return (ED4_area_manager *)this; }
1276
#define E4B_DECL_CASTOP_helper(Class,toName) \
1277
inline const Class *toName() const; \
1278
inline Class *toName();
1280
#define E4B_AVOID_CAST__helper(Class,toName,isName) \
1281
const Class *toName() const; \
1285
#define E4B_IMPL_CASTOP_helper(Class,toName,isName) \
1286
const Class *ED4_base::toName() const { \
1287
e4_assert(isName()); \
1288
return DOWNCAST(const Class*, this); \
1290
Class *ED4_base::toName() { \
1291
return const_cast<Class*>(const_cast<const ED4_base*>(this)->toName()); \
1294
#define E4B_DECL_CASTOP(name) E4B_DECL_CASTOP_helper(concat(ED4_,name), concat(to_,name))
1295
#define E4B_AVOID_UNNEEDED_CASTS(name) E4B_AVOID_CAST__helper(concat(ED4_,name), concat(to_,name), concat(is_,name))
1296
#define E4B_IMPL_CASTOP(name) E4B_IMPL_CASTOP_helper(concat(ED4_,name), concat(to_,name), concat(is_,name))
1298
E4B_DECL_CASTOP(area_manager); // to_area_manager
1299
E4B_DECL_CASTOP(abstract_group_manager); // to_abstract_group_manager
1300
E4B_DECL_CASTOP(bracket_terminal); // to_bracket_terminal
1301
E4B_DECL_CASTOP(columnStat_terminal); // to_columnStat_terminal
1302
E4B_DECL_CASTOP(device_manager); // to_device_manager
1303
E4B_DECL_CASTOP(group_manager); // to_group_manager
1304
E4B_DECL_CASTOP(line_terminal); // to_line_terminal
1305
E4B_DECL_CASTOP(manager); // to_manager
1306
E4B_DECL_CASTOP(multi_name_manager); // to_multi_name_manager
1307
E4B_DECL_CASTOP(multi_sequence_manager); // to_multi_sequence_manager
1308
E4B_DECL_CASTOP(multi_species_manager); // to_multi_species_manager
1309
E4B_DECL_CASTOP(name_manager); // to_name_manager
1310
E4B_DECL_CASTOP(orf_terminal); // to_orf_terminal
1311
E4B_DECL_CASTOP(pure_text_terminal); // to_pure_text_terminal
1312
E4B_DECL_CASTOP(root_group_manager); // to_root_group_manager
1313
E4B_DECL_CASTOP(sequence_info_terminal); // to_sequence_info_terminal
1314
E4B_DECL_CASTOP(sequence_manager); // to_sequence_manager
1315
E4B_DECL_CASTOP(sequence_terminal); // to_sequence_terminal
1316
E4B_DECL_CASTOP(spacer_terminal); // to_spacer_terminal
1317
E4B_DECL_CASTOP(species_manager); // to_species_manager
1318
E4B_DECL_CASTOP(species_name_terminal); // to_species_name_terminal
1319
E4B_DECL_CASTOP(terminal); // to_terminal
1320
E4B_DECL_CASTOP(text_terminal); // to_text_terminal
1322
// simple access to containing managers
1323
inline ED4_species_manager *containing_species_manager() const;
1325
// discriminate between different sequence managers:
1327
inline bool is_consensus_manager() const;
1328
inline bool is_SAI_manager() const;
1329
inline bool is_species_seq_manager() const;
1331
inline ED4_species_type get_species_type() const; // works for all items (recursively) contained in ED4_species_manager
1333
inline bool inside_consensus_manager() const;
1334
inline bool inside_SAI_manager() const;
1335
inline bool inside_species_seq_manager() const;
1337
inline bool is_consensus_terminal() const;
1338
inline bool is_SAI_terminal() const;
1339
inline bool is_species_seq_terminal() const;
892
// --------------------------------------------------------------------------------
893
// class ED4_manager : public ED4_base
894
// --------------------------------------------------------------------------------
895
class ED4_manager : public ED4_base
897
ED4_manager(const ED4_manager&); // copy-constructor not allowed
1342
struct ED4_manager : public ED4_base { // derived from a Noncopyable
900
1343
ED4_members *children;
903
#if defined(IMPLEMENT_DUMP)
904
virtual void dump(size_t indent) const;
905
#endif // IMPLEMENT_DUMP
1345
E4B_AVOID_UNNEEDED_CASTS(manager);
1346
DECLARE_DUMP_FOR_BASECLASS(ED4_manager, ED4_base);
907
1348
int refresh_flag_ok();
909
virtual void changed_by_database();
910
virtual void deleted_from_database();
912
virtual bool remove_deleted_childs();
914
//functions concerned with graphics
915
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
916
virtual ED4_returncode Resize();
917
virtual short calc_bounding_box(void);
918
virtual ED4_returncode distribute_children();
920
//top-down functions, means travelling down the hierarchy
921
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww);
922
virtual ED4_returncode set_refresh(int clear=1);
923
ED4_returncode clear_refresh(void);
924
virtual ED4_returncode resize_requested_by_parent( void );
926
virtual ED4_returncode delete_requested_by_parent(void);
927
virtual ED4_returncode delete_requested_childs(void);
929
virtual ED4_returncode calc_size_requested_by_parent( void );
930
virtual ED4_returncode move_requested_by_parent( ED4_move_info *mi );
931
void create_consensus(ED4_group_manager *upper_group_manager);
932
virtual ED4_returncode route_down_hierarchy(void **arg1, void **arg2, ED4_returncode (*function) (void **, void **, ED4_base *));
934
virtual ED4_base* find_first_that(ED4_level level, int (*condition)(ED4_base *to_test, AW_CL arg), AW_CL arg);
935
virtual ED4_base* find_first_that(ED4_level level, int (*condition)(ED4_base *to_test));
937
// bottom-up functions
938
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo);
939
virtual ED4_returncode resize_requested_by_child(void);
940
virtual ED4_returncode refresh_requested_by_child(void);
941
ED4_base *get_defined_level(ED4_level lev) const;
943
// functions refering the consensus
945
ED4_returncode create_group( ED4_group_manager **group_manager, GB_CSTR group_name);
947
virtual ED4_returncode update_consensus(ED4_manager *old_parent, ED4_manager *new_parent, ED4_base *sequence, int start_pos = 0, int end_pos = -1);
948
virtual ED4_returncode rebuild_consensi( ED4_base *start_species, ED4_update_flag update_flag);
950
virtual ED4_returncode check_in_bases(ED4_base *added_base, int start_pos=0, int end_pos=-1);
951
virtual ED4_returncode check_out_bases(ED4_base *subbed_base, int start_pos=0, int end_pos=-1);
952
virtual ED4_returncode check_bases(const ED4_base *old_base, const ED4_base *new_base, int start_pos=0, int end_pos=-1);
953
virtual ED4_returncode check_bases(const char *old_seq, int old_len, const char *new_seq, int new_len, int start_pos=0, int end_pos=-1);
954
virtual ED4_returncode check_bases(const char *old_seq, int old_len, const ED4_base *new_base, int start_pos=0, int end_pos=-1);
955
virtual ED4_returncode check_bases(const ED4_char_table *old_table, const ED4_char_table *new_table, int start_pos=0, int end_pos=-1);
957
virtual ED4_returncode check_bases_and_rebuild_consensi(const char *old_seq, int old_len, ED4_base *species, ED4_update_flag update_flag, int start_pos=0, int end_pos=-1);
959
void generate_id_for_groups();
1350
virtual void changed_by_database() OVERRIDE;
1351
virtual void deleted_from_database() OVERRIDE;
1353
// functions concerned with graphics
1354
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
1355
virtual bool calc_bounding_box() OVERRIDE;
1357
ED4_returncode distribute_children();
1359
// top-down functions, means travelling down the hierarchy
1360
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) OVERRIDE;
1362
virtual void request_refresh(int clear=1) OVERRIDE;
1363
ED4_returncode clear_refresh();
1365
virtual void resize_requested_children() OVERRIDE;
1367
virtual void update_requested_children() OVERRIDE;
1369
virtual void delete_requested_children() OVERRIDE;
1370
virtual void Delete() OVERRIDE;
1372
virtual ED4_returncode move_requested_by_parent(ED4_move_info *mi) OVERRIDE;
1374
void create_consensus(ED4_abstract_group_manager *upper_group_manager, arb_progress *progress);
1376
virtual ARB_ERROR route_down_hierarchy(ED4_cb cb, AW_CL cd1, AW_CL cd2) OVERRIDE;
1377
virtual ARB_ERROR route_down_hierarchy(ED4_cb1 cb, AW_CL cd) OVERRIDE { return route_down_hierarchy(ED4_cb(cb), cd, 0); }
1378
virtual ARB_ERROR route_down_hierarchy(ED4_cb0 cb) OVERRIDE { return route_down_hierarchy(ED4_cb(cb), 0, 0); }
1380
ED4_base* find_first_that(ED4_level level, bool (*condition)(ED4_base *to_test, AW_CL arg), AW_CL arg);
1381
ED4_base* find_first_that(ED4_level level, bool (*condition)(ED4_base *to_test)) {
1382
return find_first_that(level, (bool(*)(ED4_base*, AW_CL))condition, (AW_CL)0);
1385
// bottom-up functions
1386
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo) OVERRIDE;
1387
inline void resize_requested_by_child();
1388
ED4_returncode refresh_requested_by_child();
1389
void delete_requested_by_child();
1390
void update_requested_by_child();
1392
ED4_base *get_defined_level(ED4_level lev) const;
1394
// functions referring the consensus
1396
ED4_returncode create_group(ED4_group_manager **group_manager, GB_CSTR group_name);
1398
void update_consensus(ED4_manager *old_parent, ED4_manager *new_parent, ED4_base *sequence);
1399
ED4_returncode rebuild_consensi(ED4_base *start_species, ED4_update_flag update_flag);
1401
ED4_returncode check_in_bases(ED4_base *added_base);
1402
ED4_returncode check_out_bases(ED4_base *subbed_base);
1404
ED4_returncode update_bases(const ED4_base *old_base, const ED4_base *new_base, PosRange range = PosRange::whole());
1405
ED4_returncode update_bases(const char *old_seq, int old_len, const char *new_seq, int new_len, PosRange range = PosRange::whole());
1406
ED4_returncode update_bases(const char *old_seq, int old_len, const ED4_base *new_base, PosRange range = PosRange::whole());
1407
ED4_returncode update_bases(const ED4_char_table *old_table, const ED4_char_table *new_table, PosRange range = PosRange::whole());
1409
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());
961
1411
// handle moves across the hierarchy
962
virtual ED4_returncode handle_move(ED4_move_info *moveinfo);
963
virtual ED4_base *get_competent_child( AW_pos x, AW_pos y, ED4_properties relevant_prop);
964
virtual ED4_base *get_competent_clicked_child( AW_pos x, AW_pos y, ED4_properties relevant_prop);
965
virtual ED4_base *search_spec_child_rek( ED4_level level ); //recursive search for level
967
//general purpose functions
968
virtual ED4_base *search_ID(const char *id);
969
virtual ED4_returncode remove_callbacks();
1412
virtual ED4_returncode handle_move(ED4_move_info *moveinfo) OVERRIDE;
1414
virtual ED4_base *get_competent_child(AW_pos x, AW_pos y, ED4_properties relevant_prop) OVERRIDE;
1415
virtual ED4_base *get_competent_clicked_child(AW_pos x, AW_pos y, ED4_properties relevant_prop) OVERRIDE;
1416
virtual ED4_base *search_spec_child_rek(ED4_level level) OVERRIDE; // recursive search for level
1418
// general purpose functions
1419
virtual ED4_base *search_ID(const char *id) OVERRIDE;
1420
virtual ED4_returncode remove_callbacks() OVERRIDE;
971
1422
ED4_terminal *get_first_terminal(int start_index=0) const;
972
1423
ED4_terminal *get_last_terminal(int start_index=-1) const;
974
//general folding functions
975
virtual ED4_returncode unfold_group(char *bracketID_to_unfold);
976
virtual ED4_returncode fold_group(char *bracketID_to_fold);
977
virtual ED4_returncode make_children_visible(void);
978
virtual ED4_returncode hide_children(void);
980
ED4_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0);
981
virtual ~ED4_manager();
1425
void hide_children();
1426
void unhide_children();
1428
bool is_hidden() const OVERRIDE {
1429
if (flag.hidden) return true;
1430
if (!parent) return false;
1431
return parent->is_hidden();
1434
ED4_manager(const ED4_objspec& spec_, const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1435
virtual ~ED4_manager() OVERRIDE;
985
// --------------------------------------------------------------------------------
986
// class ED4_terminal : public ED4_base
987
// --------------------------------------------------------------------------------
988
class ED4_terminal : public ED4_base
990
ED4_terminal(const ED4_terminal&); // copy-constructor not allowed
993
unsigned int selected:1; //Flag for 'Object selected'
994
unsigned int dragged:1; //Flag for 'Object dragged'
995
unsigned int deleted:1;
997
// unsigned int has_callback:1;
998
ED4_selection_entry *selection_info; //Info about i.e. Position
999
long actual_timestamp;
1001
#if defined(IMPLEMENT_DUMP)
1002
virtual void dump(size_t indent) const;
1003
#endif // IMPLEMENT_DUMP
1438
struct ED4_terminal : public ED4_base { // derived from a Noncopyable
1439
E4B_AVOID_UNNEEDED_CASTS(terminal);
1441
struct { unsigned int deleted : 1; } tflag; // @@@ go bool
1443
long curr_timestamp;
1445
DECLARE_DUMP_FOR_BASECLASS(ED4_terminal,ED4_base);
1007
virtual void changed_by_database(void);
1008
virtual void deleted_from_database(void);
1010
virtual bool remove_deleted_childs();
1012
//functions concerning graphic output
1013
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) = 0;
1014
virtual ED4_returncode Resize();
1015
virtual ED4_returncode draw( int only_text = 0 ) = 0;
1017
virtual int adjust_clipping_rectangle(void);
1018
virtual short calc_bounding_box(void);
1019
virtual ED4_returncode calc_size_requested_by_parent( void );
1021
virtual ED4_returncode draw_drag_box( AW_pos x, AW_pos y, GB_CSTR text = NULL, int cursor_y=-1 );
1023
//functions which concern the object as a child
1024
virtual ED4_returncode set_refresh(int clear=1);
1025
virtual ED4_returncode resize_requested_by_child(void);
1026
virtual ED4_returncode resize_requested_by_parent(void);
1028
virtual ED4_returncode delete_requested_by_parent(void);
1029
virtual ED4_returncode delete_requested_childs(void);
1031
virtual ED4_returncode move_requested_by_parent( ED4_move_info *mi );
1032
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww);
1033
virtual ED4_base *get_competent_child( AW_pos x, AW_pos y, ED4_properties relevant_prop);
1034
virtual ED4_base *get_competent_clicked_child( AW_pos x, AW_pos y, ED4_properties relevant_prop);
1035
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo);
1036
virtual ED4_returncode handle_move(ED4_move_info *moveinfo);
1037
virtual ED4_returncode kill_object();
1039
//general purpose functions
1040
virtual ED4_base *search_ID(const char *id);
1041
virtual char *resolve_pointer_to_string_copy(int *str_len = 0) const; // concerning terminal and database
1042
virtual const char *resolve_pointer_to_char_pntr(int *str_len = 0) const; // concerning terminal and database
1043
virtual ED4_ERROR *write_sequence(const char *seq, int seq_len);
1044
virtual ED4_returncode remove_callbacks();
1046
void scroll_into_view(AW_window *aww);
1449
virtual void changed_by_database() OVERRIDE;
1450
virtual void deleted_from_database() OVERRIDE;
1452
// functions concerning graphic output
1453
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE = 0;
1454
virtual ED4_returncode draw() = 0;
1456
virtual bool calc_bounding_box() OVERRIDE;
1458
ED4_returncode draw_drag_box(AW_pos x, AW_pos y, GB_CSTR text = NULL, int cursor_y=-1);
1460
// functions which concern the object as a child
1461
virtual void request_refresh(int clear=1) OVERRIDE;
1463
virtual void resize_requested_children() OVERRIDE;
1465
virtual void update_requested_children() OVERRIDE;
1466
virtual void delete_requested_children() OVERRIDE;
1467
virtual void Delete() OVERRIDE;
1469
virtual ED4_returncode move_requested_by_parent(ED4_move_info *mi) OVERRIDE;
1470
virtual ED4_returncode event_sent_by_parent(AW_event *event, AW_window *aww) OVERRIDE;
1471
virtual ED4_base *get_competent_child(AW_pos x, AW_pos y, ED4_properties relevant_prop) OVERRIDE;
1472
virtual ED4_base *get_competent_clicked_child(AW_pos x, AW_pos y, ED4_properties relevant_prop) OVERRIDE;
1473
virtual ED4_returncode move_requested_by_child(ED4_move_info *moveinfo) OVERRIDE;
1474
virtual ED4_returncode handle_move(ED4_move_info *moveinfo) OVERRIDE;
1476
ED4_returncode kill_object();
1478
// general purpose functions
1479
virtual ED4_base *search_ID(const char *id) OVERRIDE;
1480
virtual char *resolve_pointer_to_string_copy(int *str_len = 0) const OVERRIDE;
1481
virtual const char *resolve_pointer_to_char_pntr(int *str_len = 0) const OVERRIDE;
1482
virtual ED4_returncode remove_callbacks() OVERRIDE;
1484
GB_ERROR write_sequence(const char *seq, int seq_len);
1486
void scroll_into_view(ED4_window *ed4w);
1047
1487
inline bool setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfoldGroups, ED4_CursorJumpType jump_type);
1049
ED4_terminal(GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1050
virtual ~ED4_terminal();
1489
bool is_hidden() const OVERRIDE { return parent && parent->is_hidden(); }
1491
ED4_terminal(const ED4_objspec& spec_, GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1492
virtual ~ED4_terminal() OVERRIDE;
1495
enum ED4_species_mode {
1059
// --------------------------------------------------------------------------------
1060
// class ED4_reference_terminals
1061
// --------------------------------------------------------------------------------
1062
class ED4_reference_terminals
1501
class ED4_reference_terminals : virtual Noncopyable {
1064
1502
ED4_sequence_info_terminal *ref_sequence_info;
1065
1503
ED4_sequence_terminal *ref_sequence;
1066
1504
ED4_sequence_info_terminal *ref_column_stat_info;
1067
ED4_columnStat_terminal *ref_column_stat;
1505
ED4_columnStat_terminal *ref_column_stat;
1069
1507
void null() { ref_sequence_info = 0; ref_sequence = 0; ref_column_stat = 0; ref_column_stat_info = 0; }
1072
1510
void init(ED4_sequence_info_terminal *, ED4_sequence_terminal *, ED4_sequence_info_terminal *, ED4_columnStat_terminal *);
1074
ED4_sequence_info_terminal *get_ref_sequence_info() { return ref_sequence_info; }
1075
ED4_sequence_terminal *get_ref_sequence() { return ref_sequence; }
1076
ED4_sequence_info_terminal *get_ref_column_stat_info() { return ref_column_stat_info; }
1077
ED4_columnStat_terminal *get_ref_column_stat() { return ref_column_stat; }
1512
ED4_sequence_info_terminal *get_ref_sequence_info() { return ref_sequence_info; }
1513
ED4_sequence_terminal *get_ref_sequence() { return ref_sequence; }
1514
ED4_sequence_info_terminal *get_ref_column_stat_info() { return ref_column_stat_info; }
1515
ED4_columnStat_terminal *get_ref_column_stat() { return ref_column_stat; }
1079
1517
ED4_reference_terminals() { null(); }
1080
1518
~ED4_reference_terminals() { clear(); }
1083
// --------------------------------------------------------------------------------
1085
// --------------------------------------------------------------------------------
1089
ED4_root(const ED4_root&); // copy-constructor not allowed
1091
AW_root *aw_root; // Points to 'AW-Window-Controller'
1092
AW_default db; // Default Properties database
1093
const char *db_name; // name of Default Properties database
1094
ED4_window *first_window; // Points to List of Main Windows of ED4
1095
ED4_main_manager *main_manager; // Points to Main manager of ED4
1096
ED4_area_manager *middle_area_man; // Points to middle area
1521
class ED4_WinContext {
1525
bool is_set() const { return ed4w; }
1526
void init(ED4_window *ew) {
1529
device = ed4w->get_device();
1532
void warn_missing_context() const;
1533
void expect_context() const { if (!is_set()) warn_missing_context(); }
1536
ED4_WinContext() : ed4w(0), device(0) {}
1537
static ED4_WinContext current_context;
1540
inline ED4_WinContext(AW_window *aww_);
1541
ED4_WinContext(ED4_window *ed4w_) { init(ed4w_); }
1543
AW_device *get_device() const { expect_context(); return device; }
1544
ED4_window *get_ed4w() const { expect_context(); return ed4w; }
1546
static const ED4_WinContext& get_current_context() { return current_context; }
1547
static bool have_context() { return current_context.is_set(); }
1550
// accessors for current context (see also ED4_WinContextFree)
1551
inline AW_device *current_device() { return ED4_WinContext::get_current_context().get_device(); }
1552
inline ED4_window *current_ed4w() { return ED4_WinContext::get_current_context().get_ed4w(); }
1553
inline AW_window *current_aww() { return current_ed4w()->aww; }
1554
inline ED4_cursor& current_cursor() { return current_ed4w()->cursor; }
1557
class ED4_root : virtual Noncopyable {
1558
void ED4_ROOT() const { e4_assert(0); } // avoid ED4_root-members use global ED4_ROOT
1560
void refresh_window_simple(bool redraw);
1561
void handle_update_requests(bool& redraw);
1563
ED4_window *most_recently_used_window;
1566
char *db_name; // name of Default Properties database (complete path)
1567
AW_root *aw_root; // Points to 'AW-Window-Controller'
1568
AW_default props_db; // Default Properties database
1570
ED4_window *first_window; // Points to List of Main Windows of ED4
1571
ED4_main_manager *main_manager; // Points to Main manager of ED4
1572
ED4_area_manager *middle_area_man; // Points to middle area
1097
1573
ED4_area_manager *top_area_man;
1098
1574
ED4_root_group_manager *root_group_man;
1099
EDB_root_bact *database; // Points to Object which controls Data
1100
ED4_list selected_objects;
1575
EDB_root_bact *database; // Points to Object which controls Data
1576
ED4_selected_list *selected_objects;
1101
1577
ED4_scroll_links scroll_links;
1102
bool folding_action; // flag tells whether action was folding action or not
1103
// ED4_cursor has_cursor[MAXWINDOWS]; // class for cursor handling
1578
bool folding_action; // flag tells whether action was folding action or not
1104
1579
ED4_reference_terminals ref_terminals;
1105
1580
ED4_species_mode species_mode;
1106
1581
ED4_scroll_picture scroll_picture;
1109
1584
GB_alignment_type alignment_type;
1110
1585
AWT_reference *reference;
1111
1586
AWT_seq_colors *sequence_colors;
1112
AW_gc_manager aw_gc_manager;
1587
AW_gc_manager gc_manager;
1114
1589
AW_helix *helix;
1115
1590
int helix_spacing;
1116
1591
long helix_add_spacing;
1117
1592
long terminal_add_spacing;
1118
char *protstruct; // protein structure summary
1119
long protstruct_len; // protein structure summary
1593
char *protstruct; // protein structure summary
1594
long protstruct_len; // protein structure summary
1121
1596
ED4_Edit_String *edit_string;
1122
int column_stat_activated;
1123
int column_stat_initialized;
1125
int visualizeSAI_allSpecies;
1129
ED4_window *tmp_ed4w;
1130
AW_device *tmp_device;
1133
void use_window(AW_window *aww) {
1134
if (aww != tmp_aww) {
1137
tmp_device = aww->get_device(AW_MIDDLE_AREA);
1138
e4_assert(tmp_device);
1139
tmp_ed4w = first_window->get_matching_ed4w(aww);
1140
e4_assert(tmp_ed4w);
1143
void use_window(ED4_window *ed4w) {
1146
tmp_aww = ed4w->aww;
1147
tmp_device = tmp_aww->get_device(AW_MIDDLE_AREA);
1148
e4_assert(tmp_device);
1150
void use_first_window() { use_window(first_window); }
1152
AW_window *get_aww() const { e4_assert(tmp_aww); return tmp_aww; }
1153
AW_device *get_device() const { e4_assert(tmp_device); return tmp_device; }
1154
ED4_window *get_ed4w() const { e4_assert(tmp_ed4w); return tmp_ed4w; }
1157
AW_font_group font_group;
1159
//Initializing functions
1160
ED4_returncode create_hierarchy(char *area_string_middle, char *area_string_top); // flag only needed for loading a new configuration
1598
bool column_stat_activated;
1599
bool column_stat_initialized;
1601
bool visualizeSAI_allSpecies;
1604
AW_font_group font_group;
1606
void announce_useraction_in(AW_window *aww);
1607
ED4_window *get_most_recently_used_window() const {
1608
e4_assert(most_recently_used_window);
1609
return most_recently_used_window;
1612
inline ED4_device_manager *get_device_manager();
1614
// Initializing functions
1615
ED4_returncode create_hierarchy(char *area_string_middle, char *area_string_top);
1161
1616
ED4_returncode init_alignment();
1162
1617
void recalc_font_group();
1164
AW_window *create_new_window(void);
1165
ED4_returncode generate_window( AW_device **device, ED4_window **new_window);
1166
void copy_window_struct( ED4_window *source , ED4_window *destination );
1168
//functions concerned with global refresh and resize
1169
ED4_returncode resize_all( void );
1172
ED4_returncode refresh_window_simple(int redraw);
1174
ED4_returncode refresh_window(int redraw);
1175
ED4_returncode refresh_all_windows(int redraw);
1177
void announce_deletion(ED4_base *object); // before deleting an object, announce here
1179
// functions concerned with list of selected objects
1180
ED4_returncode add_to_selected( ED4_terminal *object );
1181
ED4_returncode remove_from_selected( ED4_terminal *object);
1182
short is_primary_selection( ED4_terminal *object);
1183
ED4_returncode deselect_all( void );
1185
//functions concerning coordinate transformation
1186
ED4_returncode world_to_win_coords(AW_window *aww, AW_pos *x, AW_pos *y);
1187
ED4_returncode win_to_world_coords( AW_window *aww, AW_pos *x, AW_pos *y );
1188
ED4_returncode get_area_rectangle(AW_rectangle *rect, AW_pos x, AW_pos y);
1619
AW_window *create_new_window();
1620
ED4_returncode generate_window(AW_device **device, ED4_window **new_window);
1621
void copy_window_struct(ED4_window *source, ED4_window *destination);
1623
// functions concerned with global refresh and resize
1626
void special_window_refresh(bool handle_updates);
1627
ED4_returncode refresh_all_windows(bool redraw);
1629
void request_refresh_for_all_terminals();
1630
void request_refresh_for_specific_terminals(ED4_level lev);
1631
void request_refresh_for_consensus_terminals();
1632
void request_refresh_for_sequence_terminals();
1634
inline void announce_deletion(ED4_base *object); // before deleting an object, use this to announce
1636
// functions concerned with list of selected objects
1637
ED4_returncode add_to_selected(ED4_species_name_terminal *object);
1638
void remove_from_selected(ED4_species_name_terminal *object);
1639
ED4_returncode deselect_all();
1641
ED4_returncode get_area_rectangle(AW_screen_area *rect, AW_pos x, AW_pos y);
1190
1643
ED4_index pixel2pos(AW_pos click_x);
1645
void remove_all_callbacks();
1647
ED4_root(int *argc, char*** argv);
1196
//***************************************
1197
//* Manager specifications beginning *
1198
//***************************************
1199
// All manager class only differ in their static properties. This kind of construction was chosen for using a minimum of RAM
1201
// --------------------------------------------------------------------------------
1202
// class ED4_main_manager : public ED4_manager
1203
// --------------------------------------------------------------------------------
1204
class ED4_main_manager : public ED4_manager // first in hierarchy
1651
ED4_WinContext::ED4_WinContext(AW_window *aww_) { init(ED4_ROOT->first_window->get_matching_ed4w(aww_)); }
1653
struct ED4_LocalWinContext : private ED4_WinContext {
1654
ED4_LocalWinContext(AW_window *aww) : ED4_WinContext(current_context) { current_context = ED4_WinContext(aww); }
1655
ED4_LocalWinContext(ED4_window *ew) : ED4_WinContext(current_context) { current_context = ED4_WinContext(ew); }
1656
~ED4_LocalWinContext() { current_context = *this; }
1659
class ED4_MostRecentWinContext : virtual Noncopyable {
1660
ED4_LocalWinContext *most_recent;
1662
ED4_MostRecentWinContext() : most_recent(0) {
1663
if (!ED4_WinContext::have_context()) {
1664
most_recent = new ED4_LocalWinContext(ED4_ROOT->get_most_recently_used_window());
1667
~ED4_MostRecentWinContext() {
1672
inline void ED4_root::announce_deletion(ED4_base *object) {
1673
if (object->is_terminal()) {
1674
ED4_terminal *term = object->to_terminal();
1675
for (ED4_window *win = first_window; win; win = win->next) {
1676
ED4_LocalWinContext uses(win);
1677
win->announce_deletion(term);
1682
// ------------------------
1685
// All manager classes only differ in their static properties.
1686
// This kind of construction was chosen for using a minimum of RAM
1688
class ED4_main_manager : public ED4_manager { // derived from a Noncopyable
1689
// first in hierarchy
1691
E4B_AVOID_UNNEEDED_CASTS(main_manager);
1206
1693
// these terminals are redrawn after refresh (with increase clipping area)
1207
1694
// to revert text from middle area drawn into top area:
1208
1695
ED4_terminal *top_middle_line;
1209
1696
ED4_terminal *top_middle_spacer;
1211
ED4_main_manager(const ED4_main_manager&); // copy-constructor not allowed
1213
ED4_main_manager( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1214
~ED4_main_manager();
1699
ED4_main_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1216
1701
void set_top_middle_spacer_terminal(ED4_terminal *top_middle_spacer_) { top_middle_spacer = top_middle_spacer_; }
1217
1702
void set_top_middle_line_terminal(ED4_terminal *top_middle_line_) { top_middle_line = top_middle_line_; }
1270
1741
void update_species_counters();
1272
ED4_multi_species_manager(const ED4_multi_species_manager&); // copy-constructor not allowed
1275
ED4_multi_species_manager( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1276
~ED4_multi_species_manager();
1278
#if defined(IMPLEMENT_DUMP)
1279
virtual void dump(size_t indent) const;
1280
#endif // IMPLEMENT_DUMP
1282
int count_visible_children(); // is called by a multi_species_manager
1283
int count_all_children_and_set_group_id(); // counts all children of a parent
1284
ED4_terminal *get_consensus_terminal(); // returns the consensus-terminal or 0
1285
ED4_species_manager *get_consensus_manager() const; // returns the consensus-manager or 0
1744
ED4_multi_species_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1746
DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1748
virtual void update_requested_children() OVERRIDE;
1749
virtual void delete_requested_children() OVERRIDE;
1751
int count_visible_children(); // is called by a multi_species_manager
1753
ED4_species_manager *get_consensus_manager() const; // returns the consensus-manager or NULL
1754
ED4_species_name_terminal *get_consensus_name_terminal() const; // returns the consensus-name-terminal or NULL
1287
1756
// functions concerned with selection
1288
int get_no_of_selected_species();
1289
int get_no_of_species();
1291
void invalidate_species_counters();
1292
int has_valid_counters() const { return species!=-1 && selected_species!=-1; }
1294
void select_all_species();
1295
void deselect_all_species();
1296
void invert_selection_of_all_species();
1297
void select_marked_species(int select);
1298
void mark_selected_species(int mark);
1757
int get_no_of_selected_species();
1758
int get_no_of_species();
1760
void update_group_id();
1762
void invalidate_species_counters();
1763
int has_valid_counters() const { return species != -1 && selected_species!=-1; }
1764
bool all_are_selected() const { e4_assert(has_valid_counters()); return species == selected_species; }
1766
void select_all(bool only_species);
1767
void deselect_all_species_and_SAI();
1768
void invert_selection_of_all_species();
1769
void marked_species_select(bool select);
1770
void selected_species_mark(bool mark);
1772
void toggle_selected_species();
1301
// --------------------------------------------------------------------------------
1302
// class ED4_group_manager : public ED4_manager
1303
// --------------------------------------------------------------------------------
1304
class ED4_group_manager : public ED4_manager
1306
ED4_group_manager(const ED4_group_manager&); // copy-constructor not allowed
1775
class ED4_abstract_group_manager : public ED4_manager {
1776
E4B_AVOID_UNNEEDED_CASTS(abstract_group_manager);
1310
1778
ED4_char_table my_table; // table concerning Consensusfunction
1314
ED4_group_manager( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1315
virtual ~ED4_group_manager();
1317
#if defined(IMPLEMENT_DUMP)
1318
virtual void dump(size_t indent) const;
1319
#endif // IMPLEMENT_DUMP
1781
ED4_abstract_group_manager(const ED4_objspec& spec_, const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1783
DECLARE_DUMP_FOR_BASECLASS(ED4_abstract_group_manager, ED4_manager);
1321
1785
ED4_char_table& table() { return my_table; }
1322
1786
const ED4_char_table& table() const { return my_table; }
1324
ED4_bases_table& table(unsigned char c) {return table().table(c);}
1325
const ED4_bases_table& table(unsigned char c) const {return table().table(c);}
1788
ED4_bases_table& table(unsigned char c) { return table().table(c); }
1789
const ED4_bases_table& table(unsigned char c) const { return table().table(c); }
1791
ED4_multi_species_manager *get_multi_species_manager() const {
1792
return get_defined_level(ED4_L_MULTI_SPECIES)->to_multi_species_manager();
1796
struct ED4_group_manager : public ED4_abstract_group_manager {
1797
E4B_AVOID_UNNEEDED_CASTS(group_manager);
1798
ED4_group_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1799
DECLARE_DUMP_FOR_LEAFCLASS(ED4_abstract_group_manager);
1327
1800
void reinit_char_table();
1332
ED4_RM_NONE, // no remapping (normal mode)
1333
ED4_RM_SHOW_ABOVE, // Show all positions, where xxx% of all edited sequences have any base
1334
ED4_RM_MAX_ALIGN, // ------------------------- any edited sequence has a base
1335
ED4_RM_MAX_EDIT, // like ED4_RM_MAX_ALIGN, but bases are pushed OVER remapped gaps (not INTO)
1336
ED4_RM_DYNAMIC_GAPS, // gaps shown as spaces (more gaps => more spaces)
1342
// --------------------------------------------------------------------------------
1344
// --------------------------------------------------------------------------------
1803
enum ED4_remap_mode {
1804
ED4_RM_NONE, // no remapping (normal mode)
1805
ED4_RM_SHOW_ABOVE, // Show all positions, where xxx% of all edited sequences have any base
1806
ED4_RM_MAX_ALIGN, // ------------------------- any edited sequence has a base
1807
ED4_RM_MAX_EDIT, // like ED4_RM_MAX_ALIGN, but bases are pushed OVER remapped gaps (not INTO)
1808
ED4_RM_DYNAMIC_GAPS, // gaps shown as spaces (more gaps => more spaces)
1814
class ED4_remap : virtual Noncopyable {
1347
1816
ED4_remap_mode mode;
1348
1817
int show_above_percent; // used only for ED4_RM_SHOW_ABOVE
1474
1956
void remove_all_callbacks();
1476
1958
void do_callbacks();
1479
// --------------------------------------------------------------------------------
1480
// class ED4_multi_sequence_manager : public ED4_manager
1481
// --------------------------------------------------------------------------------
1482
class ED4_multi_sequence_manager : public ED4_manager
1484
ED4_multi_sequence_manager(const ED4_multi_sequence_manager&); // copy-constructor not allowed
1486
ED4_multi_sequence_manager( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1487
~ED4_multi_sequence_manager();
1489
#if defined(IMPLEMENT_DUMP)
1490
virtual void dump(size_t indent) const;
1491
#endif // IMPLEMENT_DUMP
1494
// --------------------------------------------------------------------------------
1495
// class ED4_sequence_manager : public ED4_manager
1496
// --------------------------------------------------------------------------------
1497
class ED4_sequence_manager : public ED4_manager
1499
ED4_sequence_manager(const ED4_sequence_manager&); // copy-constructor not allowed
1501
ED4_sequence_manager ( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1502
~ED4_sequence_manager ();
1504
#if defined(IMPLEMENT_DUMP)
1505
virtual void dump(size_t indent) const;
1506
#endif // IMPLEMENT_DUMP
1509
// --------------------------------------------------------------------------------
1510
// class ED4_multi_name_manager : public ED4_manager // contains info concerning the species; it's linked into speciesmanager
1511
// --------------------------------------------------------------------------------
1512
class ED4_multi_name_manager : public ED4_manager // contains info concerning the species; it's linked into speciesmanager
1514
ED4_multi_name_manager(const ED4_multi_name_manager&); // copy-constructor not allowed
1516
ED4_multi_name_manager ( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1517
virtual ~ED4_multi_name_manager ();
1519
#if defined(IMPLEMENT_DUMP)
1520
virtual void dump(size_t indent) const;
1521
#endif // IMPLEMENT_DUMP
1525
// --------------------------------------------------------------------------------
1526
// class ED4_name_manager : public ED4_manager // contains speciesname and other info concerning the species; it's linked into speciesmanager
1527
// --------------------------------------------------------------------------------
1528
class ED4_name_manager : public ED4_manager // contains speciesname and other info concerning the species; it's linked into speciesmanager
1530
ED4_name_manager(const ED4_name_manager&); // copy-constructor not allowed
1532
ED4_name_manager( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool temp_is_group = 0 );
1533
~ED4_name_manager();
1535
#if defined(IMPLEMENT_DUMP)
1536
virtual void dump(size_t indent) const;
1537
#endif // IMPLEMENT_DUMP
1540
//***************************************
1541
//* Manager specifications end *
1542
//***************************************
1546
//***************************************
1547
//* Terminal specifications beginning *
1548
//***************************************
1550
// --------------------------------------------------------------------------------
1551
// class ED4_tree_terminal : public ED4_terminal
1552
// --------------------------------------------------------------------------------
1553
class ED4_tree_terminal : public ED4_terminal
1555
ED4_tree_terminal(const ED4_tree_terminal&); // copy-constructor not allowed
1557
virtual ED4_returncode draw(int only_text=0);
1558
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
1560
ED4_tree_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1561
~ED4_tree_terminal();
1563
#if defined(IMPLEMENT_DUMP)
1564
virtual void dump(size_t indent) const;
1565
#endif // IMPLEMENT_DUMP
1568
// --------------------------------------------------------------------------------
1569
// class ED4_bracket_terminal : public ED4_terminal
1570
// --------------------------------------------------------------------------------
1571
class ED4_bracket_terminal : public ED4_terminal
1573
ED4_bracket_terminal(const ED4_bracket_terminal&); // copy-constructor not allowed
1575
virtual ED4_returncode draw( int only_text = 0 );
1576
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
1578
ED4_bracket_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1579
~ED4_bracket_terminal();
1581
#if defined(IMPLEMENT_DUMP)
1582
virtual void dump(size_t indent) const;
1583
#endif // IMPLEMENT_DUMP
1586
// --------------------------------------------------------------------------------
1587
// class ED4_text_terminal : public ED4_terminal
1588
// --------------------------------------------------------------------------------
1589
class ED4_text_terminal : public ED4_terminal
1591
ED4_text_terminal(const ED4_text_terminal&); // copy-constructor not allowed
1593
//functions concerning graphic output
1594
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
1595
virtual ED4_returncode draw(int only_text=0);
1960
ED4_species_name_terminal *get_name_terminal() const { return children->member(0)->to_species_name_terminal(); }
1963
inline ED4_species_manager *ED4_base::containing_species_manager() const {
1964
ED4_base *sman = get_parent(ED4_L_SPECIES);
1965
return sman ? sman->to_species_manager() : NULL;
1968
inline bool ED4_base::is_consensus_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_CONSENSUS; }
1969
inline bool ED4_base::is_SAI_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_SAI; }
1970
inline bool ED4_base::is_species_seq_manager() const { return is_species_manager() && to_species_manager()->get_type() == ED4_SP_SPECIES; }
1972
inline ED4_species_type ED4_base::get_species_type() const {
1973
ED4_species_manager *sman = containing_species_manager();
1974
return sman ? sman->get_type() : ED4_SP_NONE;
1977
inline bool ED4_base::inside_consensus_manager() const { return get_species_type() == ED4_SP_CONSENSUS; }
1978
inline bool ED4_base::inside_SAI_manager() const { return get_species_type() == ED4_SP_SAI; }
1979
inline bool ED4_base::inside_species_seq_manager() const { return get_species_type() == ED4_SP_SPECIES; }
1981
inline bool ED4_base::is_consensus_terminal() const { return is_sequence_terminal() && inside_consensus_manager(); }
1982
inline bool ED4_base::is_SAI_terminal() const { return is_sequence_terminal() && inside_SAI_manager(); }
1983
inline bool ED4_base::is_species_seq_terminal() const { return is_sequence_terminal() && inside_species_seq_manager(); }
1985
inline bool ED4_cursor::in_species_seq_terminal() const { return owner_of_cursor && owner_of_cursor->is_species_seq_terminal(); }
1986
inline bool ED4_cursor::in_consensus_terminal() const { return owner_of_cursor && owner_of_cursor->is_consensus_terminal(); }
1987
inline bool ED4_cursor::in_SAI_terminal() const { return owner_of_cursor && owner_of_cursor->is_SAI_terminal(); }
1990
struct ED4_multi_sequence_manager : public ED4_manager {
1991
E4B_AVOID_UNNEEDED_CASTS(multi_sequence_manager);
1992
ED4_multi_sequence_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1993
DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
1996
struct ED4_sequence_manager : public ED4_manager {
1997
E4B_AVOID_UNNEEDED_CASTS(sequence_manager);
1998
ED4_sequence_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1999
DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
2002
struct ED4_multi_name_manager : public ED4_manager {
2003
E4B_AVOID_UNNEEDED_CASTS(multi_name_manager);
2004
// member of ED4_species_manager (contains ED4_name_manager for name and info)
2005
ED4_multi_name_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2006
DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
2010
struct ED4_name_manager : public ED4_manager {
2011
E4B_AVOID_UNNEEDED_CASTS(name_manager);
2012
// member of ED4_multi_name_manager (contains speciesname or other info concerning the species)
2013
ED4_name_manager(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2014
DECLARE_DUMP_FOR_LEAFCLASS(ED4_manager);
2018
// -------------------------
2022
struct ED4_tree_terminal : public ED4_terminal {
2023
E4B_AVOID_UNNEEDED_CASTS(tree_terminal);
2025
virtual ED4_returncode draw() OVERRIDE;
2026
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
2028
ED4_tree_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2030
DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
2033
struct ED4_bracket_terminal : public ED4_terminal {
2034
E4B_AVOID_UNNEEDED_CASTS(bracket_terminal);
2036
virtual ED4_returncode draw() OVERRIDE;
2037
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
2042
ED4_bracket_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2044
DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
2047
struct ED4_text_terminal : public ED4_terminal {
2048
E4B_AVOID_UNNEEDED_CASTS(text_terminal);
2050
// functions concerning graphic output
2051
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
2052
virtual ED4_returncode draw() OVERRIDE;
1597
2054
virtual int get_length() const = 0;
1598
virtual void deleted_from_database();
1600
ED4_text_terminal(GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1601
virtual ~ED4_text_terminal();
1603
#if defined(IMPLEMENT_DUMP)
1604
virtual void dump(size_t indent) const;
1605
#endif // IMPLEMENT_DUMP
1610
class Beispiel : public ED4_terminal
1617
Beispiel(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent); // Construktorparameter an parents weitergeben
1623
// --------------------------------------------------------------------------------
1624
// class ED4_sequence_terminal_basic: public ED4_text_terminal
1625
// --------------------------------------------------------------------------------
1626
class ED4_sequence_terminal_basic: public ED4_text_terminal
1632
ED4_sequence_terminal_basic( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1633
virtual ~ED4_sequence_terminal_basic();
2055
virtual void deleted_from_database() OVERRIDE;
2057
ED4_text_terminal(const ED4_objspec& spec_, GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2058
virtual ~ED4_text_terminal() OVERRIDE {}
2060
DECLARE_DUMP_FOR_BASECLASS(ED4_text_terminal, ED4_terminal);
2063
class ED4_abstract_sequence_terminal : public ED4_text_terminal { // derived from a Noncopyable
2065
PosRange pixel2index(PosRange pixel_range);
2067
E4B_AVOID_UNNEEDED_CASTS(abstract_sequence_terminal);
2069
char *species_name; // @@@ wrong place (may be member of ED4_sequence_manager)
2072
ED4_abstract_sequence_terminal(const ED4_objspec& spec_, const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2073
virtual ~ED4_abstract_sequence_terminal() OVERRIDE;
1635
2075
virtual GB_alignment_type GetAliType() = 0;
1636
virtual int get_length() const { int len; resolve_pointer_to_char_pntr(&len); return len; }
2076
virtual int get_length() const OVERRIDE { int len; resolve_pointer_to_char_pntr(&len); return len; }
1638
2078
ED4_species_name_terminal *corresponding_species_name_terminal() const {
1639
2079
return get_parent(ED4_L_SPECIES)->search_spec_child_rek(ED4_L_SPECIES_NAME)->to_species_name_terminal();
1641
void calc_intervall_displayed_in_rectangle(AW_rectangle *area_rect, long *left_index, long *right_index );
1642
void calc_update_intervall(long *left_index, long *right_index );
2081
PosRange calc_interval_displayed_in_rectangle(AW_screen_area *area_rect);
2082
PosRange calc_update_interval();
2084
DECLARE_DUMP_FOR_BASECLASS(ED4_abstract_sequence_terminal, ED4_text_terminal);
1646
// -----------------------------------------------------------------------------------------------------
1647
// class ED4_AA_sequence_terminal: public ED4_sequence_terminal_basic
1648
// -----------------------------------------------------------------------------------------------------
1649
// NOTE: ED4_AA_sequence_terminal is a separte terminal class used to Open Reading Frames (ORFs)
1650
// for the corresponding gene (DNA) sequence. It is used in ProteinViewer Module and should not be
1651
// used for drawing aminoacid sequence alone as in protien alignment. Aminoacid sequences are
1652
// handled by the standard "ED4_sequence_terminal" class.
1653
// ------------------------------------------------------------------------------------------------------
1655
class ED4_AA_sequence_terminal: public ED4_sequence_terminal_basic
1657
virtual ED4_returncode draw( int only_text = 0 );
1658
ED4_AA_sequence_terminal(const ED4_AA_sequence_terminal&);
1660
ED4_AA_sequence_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1661
virtual ~ED4_AA_sequence_terminal();
2087
class ED4_orf_terminal : public ED4_abstract_sequence_terminal { // derived from a Noncopyable
2088
// NOTE: ED4_orf_terminal is a separate terminal class used to display Open Reading Frames (ORFs)
2089
// for the corresponding gene (DNA) sequence. It is used in ProteinViewer Module and should not be
2090
// used for drawing aminoacid sequence alone as in protein alignment. Aminoacid sequences are
2091
// handled by the standard "ED4_sequence_terminal" class.
1663
2093
char *aaSequence;
1667
virtual GB_alignment_type GetAliType();
1668
void SET_aaSeqFlags (int startPos, int strandType) { aaStartPos = startPos; aaStrandType = strandType;}
1669
int GET_aaStartPos (){ return aaStartPos;}
1670
int GET_aaStrandType (){ return aaStrandType;}
1671
void SET_aaSequence_pointer(char *aaSeq) { aaSequence = new char[strlen(aaSeq)]; aaSequence = aaSeq;}
2099
virtual ED4_returncode draw() OVERRIDE;
2100
E4B_AVOID_UNNEEDED_CASTS(orf_terminal);
2102
ED4_orf_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2103
virtual ~ED4_orf_terminal() OVERRIDE;
2105
virtual GB_alignment_type GetAliType() OVERRIDE;
2107
void SET_aaSeqFlags (int startPos, int strandType) { aaStartPos = startPos; aaStrandType = strandType; }
2108
void SET_aaSequence(const char *aaSeq) { freedup(aaSequence, aaSeq); aaSeqLen = strlen(aaSequence); }
2109
void SET_aaColor(const char *aaSeq) { freedup(aaColor, aaSeq); }
2111
int GET_aaStartPos () { return aaStartPos; }
2112
int GET_aaStrandType () { return aaStrandType; }
2114
DECLARE_DUMP_FOR_LEAFCLASS(ED4_abstract_sequence_terminal);
1674
// --------------------------------------------------------------------------------
1675
// class ED4_sequence_terminal : public ED4_text_terminal
1676
// --------------------------------------------------------------------------------
1677
class ED4_sequence_terminal : public ED4_sequence_terminal_basic
2117
class ED4_sequence_terminal : public ED4_abstract_sequence_terminal { // derived from a Noncopyable
1679
2118
mutable ED4_SearchResults searchResults;
1681
virtual ED4_returncode draw( int only_text = 0 );
1682
ED4_sequence_terminal(const ED4_sequence_terminal&); // copy-constructor not allowed
2119
bool shall_display_secstruct_info; // helix or protstruct
2121
virtual ED4_returncode draw() OVERRIDE;
2123
E4B_AVOID_UNNEEDED_CASTS(sequence_terminal);
1686
2127
AP_tree *st_ml_node;
1688
ED4_sequence_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1689
virtual ~ED4_sequence_terminal();
1691
virtual GB_alignment_type GetAliType();
1693
virtual void deleted_from_database();
1694
virtual int get_length() const { return ED4_sequence_terminal_basic::get_length(); }
2129
ED4_sequence_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent, bool shall_display_secstruct_info_);
2131
virtual GB_alignment_type GetAliType() OVERRIDE;
2133
virtual void deleted_from_database() OVERRIDE;
2134
virtual int get_length() const OVERRIDE { return ED4_abstract_sequence_terminal::get_length(); }
2136
void set_secstruct_display(bool show) { shall_display_secstruct_info = show; }
1696
2138
ED4_SearchResults& results() const { return searchResults; }
1698
2140
ED4_columnStat_terminal *corresponding_columnStat_terminal() const {
1699
2141
ED4_base *col_term = get_parent(ED4_L_MULTI_SEQUENCE)->search_spec_child_rek(ED4_L_COL_STAT);
1700
2142
return col_term ? col_term->to_columnStat_terminal() : 0;
1703
#if defined(IMPLEMENT_DUMP)
1704
virtual void dump(size_t indent) const;
1705
#endif // IMPLEMENT_DUMP
2145
DECLARE_DUMP_FOR_MIDCLASS(ED4_sequence_terminal,ED4_abstract_sequence_terminal);
1708
// --------------------------------------------------------------------------------
1709
// class ED4_columnStat_terminal : public ED4_text_terminal
1710
// --------------------------------------------------------------------------------
1711
class ED4_columnStat_terminal : public ED4_text_terminal
2148
class ED4_columnStat_terminal : public ED4_text_terminal { // derived from a Noncopyable
1713
2149
char *likelihood[4]; // likelihood-array for each base (ACGU) [length of array = alignment_length]
1714
2150
int latest_update;
1731
2168
ED4_sequence_terminal *corresponding_sequence_terminal() const { return get_parent(ED4_L_MULTI_SEQUENCE)->search_spec_child_rek(ED4_L_SEQUENCE_STRING)->to_sequence_terminal(); }
1733
GB_CSTR build_probe_match_string(int start_pos, int end_pos) const;
2170
GB_CSTR build_probe_match_string(PosRange range) const;
1735
2172
ED4_columnStat_terminal(GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1736
~ED4_columnStat_terminal();
2173
~ED4_columnStat_terminal() OVERRIDE;
1738
#if defined(IMPLEMENT_DUMP)
1739
virtual void dump(size_t indent) const;
1740
#endif // IMPLEMENT_DUMP
2175
DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
1743
// --------------------------------------------------------------------------------
1744
// class ED4_species_name_terminal : public ED4_text_terminal
1745
// --------------------------------------------------------------------------------
1746
class ED4_species_name_terminal : public ED4_text_terminal
1748
ED4_species_name_terminal(const ED4_species_name_terminal&); // copy-constructor not allowed
1750
//functions concerning graphic output
1752
ED4_species_name_terminal( GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1753
~ED4_species_name_terminal();
2178
struct ED4_species_name_terminal : public ED4_text_terminal { // derived from a Noncopyable
2179
ED4_species_name_terminal(GB_CSTR id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2180
~ED4_species_name_terminal() OVERRIDE { delete selection_info; }
2182
E4B_AVOID_UNNEEDED_CASTS(species_name_terminal);
2184
ED4_selection_entry *selection_info; // Info about i.e. Position
1755
2187
GB_CSTR get_displayed_text() const;
1756
virtual int get_length() const { return strlen(get_displayed_text()); }
2188
virtual int get_length() const OVERRIDE { return strlen(get_displayed_text()); }
1758
2190
ED4_sequence_terminal *corresponding_sequence_terminal() const {
1759
2191
ED4_base *seq_term = get_parent(ED4_L_SPECIES)->search_spec_child_rek(ED4_L_SEQUENCE_STRING);
1760
2192
return seq_term ? seq_term->to_sequence_terminal() : 0;
1763
#if defined(IMPLEMENT_DUMP)
1764
virtual void dump(size_t indent) const;
1765
#endif // IMPLEMENT_DUMP
2195
DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
1768
// --------------------------------------------------------------------------------
1769
// class ED4_sequence_info_terminal : public ED4_text_terminal
1770
// --------------------------------------------------------------------------------
1771
class ED4_sequence_info_terminal : public ED4_text_terminal
1773
// now handled via ED4_species_pointer // GBDATA *gbdata;
1774
ED4_sequence_info_terminal(const ED4_sequence_info_terminal&); // copy-constructor not allowed
1776
ED4_sequence_info_terminal( const char *id, /*GBDATA *gbd,*/ AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1777
virtual ~ED4_sequence_info_terminal();
2198
struct ED4_sequence_info_terminal : public ED4_text_terminal {
2199
E4B_AVOID_UNNEEDED_CASTS(sequence_info_terminal);
2201
ED4_sequence_info_terminal(const char *id, /* GBDATA *gbd, */ AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1779
2203
ED4_species_name_terminal *corresponding_species_name_terminal() const {
1780
2204
return get_parent(ED4_L_SPECIES)->search_spec_child_rek(ED4_L_SPECIES_NAME)->to_species_name_terminal();
1783
virtual ED4_returncode draw( int only_text = 0);
2207
virtual ED4_returncode draw() OVERRIDE;
1785
GBDATA *data() { return get_species_pointer(); }
2209
GBDATA *data() { return get_species_pointer(); } // DB-entry ("ali_xxx/data")
1786
2210
const GBDATA *data() const { return get_species_pointer(); }
1788
virtual int get_length() const { return 1+strlen(id); }
1790
virtual bool remove_deleted_childs();
1792
#if defined(IMPLEMENT_DUMP)
1793
virtual void dump(size_t indent) const;
1794
#endif // IMPLEMENT_DUMP
2212
virtual int get_length() const OVERRIDE { return 1+strlen(id); }
2214
DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
1797
// --------------------------------------------------------------------------------
1798
// class ED4_pure_text_terminal : public ED4_text_terminal
1799
// --------------------------------------------------------------------------------
1800
class ED4_pure_text_terminal : public ED4_text_terminal
1802
ED4_pure_text_terminal(const ED4_pure_text_terminal&); // copy-constructor not allowed
2217
struct ED4_pure_text_terminal : public ED4_text_terminal {
2218
E4B_AVOID_UNNEEDED_CASTS(pure_text_terminal);
1804
2220
ED4_pure_text_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
1805
~ED4_pure_text_terminal();
1807
virtual int get_length() const { int len; resolve_pointer_to_char_pntr(&len); return len; }
1809
#if defined(IMPLEMENT_DUMP)
1810
virtual void dump(size_t indent) const;
1811
#endif // IMPLEMENT_DUMP
1814
// --------------------------------------------------------------------------------
1815
// class ED4_consensus_sequence_terminal : public ED4_sequence_terminal
1816
// --------------------------------------------------------------------------------
1817
class ED4_consensus_sequence_terminal : public ED4_sequence_terminal
1819
virtual ED4_returncode draw( int only_text = 0 );
1820
ED4_consensus_sequence_terminal(const ED4_consensus_sequence_terminal&); // copy-constructor not allowed
1822
ED4_char_table& get_char_table() const { return get_parent( ED4_L_GROUP )->to_group_manager()->table(); }
1824
ED4_consensus_sequence_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1825
virtual ~ED4_consensus_sequence_terminal();
1827
virtual int get_length() const;
1829
#if defined(IMPLEMENT_DUMP)
1830
virtual void dump(size_t indent) const;
1831
#endif // IMPLEMENT_DUMP
1834
// --------------------------------------------------------------------------------
1835
// class ED4_spacer_terminal : public ED4_terminal
1836
// --------------------------------------------------------------------------------
1837
class ED4_spacer_terminal : public ED4_terminal
1839
ED4_spacer_terminal(const ED4_spacer_terminal&); // copy-constructor not allowed
1841
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
1842
virtual ED4_returncode draw(int only_text = 0);
1844
ED4_spacer_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1845
~ED4_spacer_terminal();
1847
#if defined(IMPLEMENT_DUMP)
1848
virtual void dump(size_t indent) const;
1849
#endif // IMPLEMENT_DUMP
1852
// --------------------------------------------------------------------------------
1853
// class ED4_line_terminal : public ED4_terminal
1854
// --------------------------------------------------------------------------------
1855
class ED4_line_terminal : public ED4_terminal
1857
ED4_line_terminal(const ED4_line_terminal&); // copy-constructor not allowed
1859
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0);
1860
virtual ED4_returncode draw(int only_text = 0);
1862
ED4_line_terminal( const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent );
1863
~ED4_line_terminal();
1865
#if defined(IMPLEMENT_DUMP)
1866
virtual void dump(size_t indent) const;
1867
#endif // IMPLEMENT_DUMP
1870
//***************************************
1871
//* Terminal specifications end *
1872
//***************************************
1874
//**************************************************
1875
//* inline expansion which need complete classdefs *
1876
//**************************************************
2222
virtual int get_length() const OVERRIDE { int len; resolve_pointer_to_char_pntr(&len); return len; }
2224
DECLARE_DUMP_FOR_LEAFCLASS(ED4_text_terminal);
2227
class ED4_consensus_sequence_terminal : public ED4_sequence_terminal {
2228
E4B_AVOID_UNNEEDED_CASTS(consensus_sequence_terminal);
2230
virtual ED4_returncode draw() OVERRIDE;
2231
ED4_char_table& get_char_table() const { return get_parent(ED4_L_GROUP)->to_group_manager()->table(); }
2233
ED4_consensus_sequence_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2235
virtual int get_length() const OVERRIDE;
2237
DECLARE_DUMP_FOR_LEAFCLASS(ED4_sequence_terminal);
2240
class ED4_spacer_terminal : public ED4_terminal {
2241
E4B_AVOID_UNNEEDED_CASTS(spacer_terminal);
2242
bool shallDraw; // true -> spacer is really drawn (otherwise it's only a placeholder)
2245
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
2246
virtual ED4_returncode draw() OVERRIDE;
2248
ED4_spacer_terminal(const char *id, bool shallDraw_, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2250
DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
2253
struct ED4_line_terminal : public ED4_terminal {
2254
E4B_AVOID_UNNEEDED_CASTS(line_terminal);
2256
virtual ED4_returncode Show(int refresh_all=0, int is_cleared=0) OVERRIDE;
2257
virtual ED4_returncode draw() OVERRIDE;
2259
ED4_line_terminal(const char *id, AW_pos x, AW_pos y, AW_pos width, AW_pos height, ED4_manager *parent);
2261
DECLARE_DUMP_FOR_LEAFCLASS(ED4_terminal);
2265
// ----------------------------------------------
2266
// inlines which need complete classdefs
2268
inline void ED4_base::set_update() { // @@@ rename into request_update
2269
if (!update_info.update_requested) {
2270
update_info.update_requested = 1;
2271
if (parent) parent->update_requested_by_child();
2275
inline void ED4_base::request_resize() {
2276
update_info.set_resize(1);
2277
if (parent) parent->resize_requested_by_child();
2280
void ED4_manager::resize_requested_by_child() {
2281
if (!update_info.resize) request_resize();
1878
2285
inline bool ED4_terminal::setCursorTo(ED4_cursor *cursor, int seq_pos, bool unfoldGroups, ED4_CursorJumpType jump_type) {
1879
2286
ED4_species_manager *sm = get_parent(ED4_L_SPECIES)->to_species_manager();
1880
2287
return sm->setCursorTo(cursor, seq_pos, unfoldGroups, jump_type);
1883
//***************************************
1884
//* Prototype functions without a class *
1885
//***************************************
2290
E4B_IMPL_CASTOP(area_manager); // to_area_manager
2291
E4B_IMPL_CASTOP(abstract_group_manager); // to_abstract_group_manager
2292
E4B_IMPL_CASTOP(bracket_terminal); // to_bracket_terminal
2293
E4B_IMPL_CASTOP(columnStat_terminal); // to_columnStat_terminal
2294
E4B_IMPL_CASTOP(device_manager); // to_device_manager
2295
E4B_IMPL_CASTOP(group_manager); // to_group_manager
2296
E4B_IMPL_CASTOP(line_terminal); // to_line_terminal
2297
E4B_IMPL_CASTOP(manager); // to_manager
2298
E4B_IMPL_CASTOP(multi_name_manager); // to_multi_name_manager
2299
E4B_IMPL_CASTOP(multi_sequence_manager); // to_multi_sequence_manager
2300
E4B_IMPL_CASTOP(multi_species_manager); // to_multi_species_manager
2301
E4B_IMPL_CASTOP(name_manager); // to_name_manager
2302
E4B_IMPL_CASTOP(orf_terminal); // to_orf_terminal
2303
E4B_IMPL_CASTOP(pure_text_terminal); // to_pure_text_terminal
2304
E4B_IMPL_CASTOP(root_group_manager); // to_root_group_manager
2305
E4B_IMPL_CASTOP(sequence_info_terminal); // to_sequence_info_terminal
2306
E4B_IMPL_CASTOP(sequence_manager); // to_sequence_manager
2307
E4B_IMPL_CASTOP(sequence_terminal); // to_sequence_terminal
2308
E4B_IMPL_CASTOP(spacer_terminal); // to_spacer_terminal
2309
E4B_IMPL_CASTOP(species_manager); // to_species_manager
2310
E4B_IMPL_CASTOP(species_name_terminal); // to_species_name_terminal
2311
E4B_IMPL_CASTOP(terminal); // to_terminal
2312
E4B_IMPL_CASTOP(text_terminal); // to_text_terminal
2314
inline ED4_device_manager *ED4_root::get_device_manager() {
2315
return main_manager->search_spec_child_rek(ED4_L_DEVICE)->to_device_manager();
2318
inline ED4_species_name_terminal *ED4_multi_species_manager::get_consensus_name_terminal() const {
2319
ED4_species_manager *consensus_man = get_consensus_manager();
2320
return consensus_man ? consensus_man->get_name_terminal() : NULL;
2323
// --------------------------------------------
2324
// Prototype functions without a class
1887
2326
extern ST_ML *st_ml;
1889
void ED4_expose_cb(AW_window *aww,AW_CL cd1, AW_CL cd2);
1890
void ED4_expose_all_windows();
1892
void ED4_calc_terminal_extentions();
1894
void ED4_input_cb (AW_window *aww,AW_CL cd1, AW_CL cd2);
1895
void ED4_resize_cb (AW_window *aww,AW_CL cd1, AW_CL cd2);
1897
void ED4_gc_is_modified (AW_window *aww,AW_CL cd1, AW_CL cd2);
1898
void ED4_quit (AW_window *aww,AW_CL cd1, AW_CL cd2);
1900
void ED4_motion_cb (AW_window *aww,AW_CL cd1, AW_CL cd2);
1901
void ED4_vertical_change_cb (AW_window *aww,AW_CL cd1, AW_CL cd2);
1902
void ED4_horizontal_change_cb (AW_window *aww,AW_CL cd1, AW_CL cd2);
1903
void ED4_scrollbar_change_cb (AW_window *aww, AW_CL cd1, AW_CL cd2);
1905
void ED4_no_dangerous_modes (void);
2328
void ED4_with_all_edit_windows(void (*cb)(ED4_window *));
2330
void ED4_expose_recalculations();
2331
void ED4_calc_terminal_extentions();
2333
void ED4_input_cb (AW_window *aww);
2335
void ED4_remote_event(AW_event *faked_event);
2337
void ED4_quit (AW_window *aww, AW_CL cd1, AW_CL cd2);
2338
void ED4_motion_cb (AW_window *aww);
2339
void ED4_vertical_change_cb (AW_window *aww);
2340
void ED4_horizontal_change_cb (AW_window *aww);
2341
void ED4_scrollbar_change_cb (AW_window *aww);
2343
void ED4_no_dangerous_modes ();
1906
2344
void group_species_cb (AW_window *aww, AW_CL cd1, AW_CL cd2);
1907
AW_window *ED4_create_group_species_by_field_window( AW_root *aw_root);
1909
void ED4_timer (AW_root *ar , AW_CL cd1, AW_CL cd2 );
1910
void ED4_timer_refresh ();
1912
ED4_returncode update_terminal_extension (void **arg1, void **arg2, ED4_base *this_object );
1914
void ED4_load_new_config (char *string);
1915
void ED4_start_editor_on_configuration (AW_window *aww);
1916
AW_window *ED4_start_editor_on_old_configuration (AW_root *awr);
1917
void ED4_restart_editor (AW_window *aww, AW_CL,AW_CL);
1918
void ED4_save_configuration (AW_window *aww,AW_CL close_flag);
1919
AW_window *ED4_save_configuration_as_open_window (AW_root *awr);
2345
AW_window *ED4_create_group_species_by_field_window(AW_root *aw_root);
2347
void ED4_trigger_instant_refresh();
2348
void ED4_request_relayout();
2349
void ED4_request_full_refresh();
2350
void ED4_request_full_instant_refresh();
2352
AW_window *ED4_start_editor_on_old_configuration (AW_root *awr);
2353
void ED4_restart_editor (AW_window *aww, AW_CL, AW_CL);
2354
void ED4_save_configuration(AW_window *aww, bool hide_aww);
2355
AW_window *ED4_save_configuration_as_open_window (AW_root *awr);
1921
2357
void ED4_set_iupac (AW_window *aww, char *awar_name, bool callback_flag);
1922
2358
void ED4_set_helixnr (AW_window *aww, char *awar_name, bool callback_flag);
1923
2359
void ed4_changesecurity (AW_root *root, AW_CL cd1);
1924
2360
void ed4_change_edit_mode (AW_root *root, AW_CL cd1);
1926
ED4_returncode call_edit (void **error, void **work_info, ED4_base *object ); // function for editing sequences
1927
ED4_returncode rebuild_consensus (void **arg1, void **arg2, ED4_base *object);
2362
ARB_ERROR rebuild_consensus(ED4_base *object);
1929
2364
void ED4_exit() __ATTR__NORETURN;
1931
void ED4_quit_editor (AW_window *aww, AW_CL cd1, AW_CL cd2 ); //Be Careful: Is this the last window?
1932
void ED4_load_data (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1933
void ED4_save_data (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1934
void ED4_refresh_window (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1936
void ED4_store_curpos (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1937
void ED4_restore_curpos (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1938
void ED4_clear_stored_curpos (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1939
void ED4_helix_jump_opposite (AW_window *aww, AW_CL /*cd1*/, AW_CL /*cd2*/);
1940
void ED4_jump_to_cursor_position (AW_window *aww, char *awar_name, bool callback_flag);
1941
void ED4_remote_set_cursor_cb (AW_root *awr, AW_CL, AW_CL);
1942
void ED4_change_cursor (AW_window */*aww*/, AW_CL /*cd1*/, AW_CL /*cd2*/);
1943
void ED4_set_reference_species (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1945
void ED4_show_detailed_column_stats (AW_window *aww, AW_CL, AW_CL);
1946
void ED4_set_col_stat_threshold (AW_window *aww, AW_CL, AW_CL);
1948
void ED4_new_editor_window (AW_window *aww, AW_CL cd1, AW_CL cd2 );
1950
AW_window *ED4_create_consensus_definition_window (AW_root *root);
1951
void ED4_create_consensus_awars (AW_root *aw_root);
1952
void ED4_consensus_definition_changed (AW_root*, AW_CL,AW_CL);
1953
void ED4_consensus_display_changed (AW_root*, AW_CL,AW_CL);
2366
void ED4_quit_editor (AW_window *aww); // Be Careful: Is this the last window?
2368
void ED4_store_curpos (AW_window *aww);
2369
void ED4_restore_curpos (AW_window *aww);
2370
void ED4_clear_stored_curpos ();
2371
void ED4_helix_jump_opposite (AW_window *aww);
2372
void ED4_jump_to_cursor_position (AW_window *aww, AW_CL cl_awar_name, AW_CL cl_pos_type);
2373
void ED4_remote_set_cursor_cb (AW_root *awr);
2374
void ED4_change_cursor (AW_window *aww);
2375
void ED4_set_reference_species (AW_window *aww, AW_CL cd1, AW_CL cd2);
2377
void ED4_new_editor_window (AW_window *aww);
2379
AW_window *ED4_create_consensus_definition_window(AW_root *root);
2380
void ED4_create_consensus_awars(AW_root *aw_root);
2381
void ED4_consensus_definition_changed(AW_root*);
2382
void ED4_consensus_display_changed(AW_root *root);
1955
2384
AW_window *ED4_create_level_1_options_window (AW_root *root);
1956
2385
void ED4_compression_toggle_changed_cb (AW_root *root, AW_CL cd1, AW_CL cd2);
1958
AW_window *ED4_create_new_seq_window (AW_root *root, AW_CL cl_creation_mode);
2387
enum SpeciesCreationMode {
2389
CREATE_FROM_CONSENSUS, // create new species from group consensus (of surrounding group)
2390
COPY_SPECIES, // copy current species
2393
#if defined(ASSERTION_USED)
2394
CONSTEXPR_RETURN inline bool valid(SpeciesCreationMode m) { return m>=CREATE_NEW_SPECIES && m<=COPY_SPECIES; }
2397
AW_window *ED4_create_new_seq_window(AW_root *root, SpeciesCreationMode creation_mode);
1960
2399
void ED4_jump_to_current_species (AW_window *, AW_CL);
1961
void ED4_get_and_jump_to_actual (AW_window *, AW_CL);
1962
void ED4_get_and_jump_to_actual_from_menu (AW_window *aw, AW_CL cl, AW_CL);
2400
void ED4_get_and_jump_to_current (AW_window *, AW_CL);
2401
void ED4_get_and_jump_to_current_from_menu (AW_window *aw, AW_CL cl, AW_CL);
1963
2402
void ED4_get_and_jump_to_species (GB_CSTR species_name);
1964
2403
void ED4_get_marked_from_menu (AW_window *, AW_CL, AW_CL);
1965
2404
void ED4_selected_species_changed_cb (AW_root *aw_root);