1 | |
---|
2 | #define AWAR_CURSER_POS_REF_ECOLI "tmp/edit/curser_ref_ecoli" |
---|
3 | #define AWAR_SPECIES_DEST "tmp/edit/species_name_dest" |
---|
4 | #define AWAR_LINE_SPACING "edit/line_spacing" |
---|
5 | #define AWAR_CENTER_SPACING "edit/center_spacing" |
---|
6 | #define AWAR_HELIX_AT_SAIS "edit/helix_at_extendeds" |
---|
7 | #define AWAR_EDIT_MODE "tmp/edit/edit_mode" |
---|
8 | #define AWAR_EDIT_DIRECTION "tmp/edit/edit_direction" |
---|
9 | #define AWAR_EDIT_MULTI_SEQ "tmp/edit/edit_multi" |
---|
10 | |
---|
11 | #define AED_LINE_SPACING ((int)aed_root.line_spacing) |
---|
12 | #define AED_CENTER_SPACING ((int)aed_root.center_spacing) |
---|
13 | #define AED_TOP_LINE 2 |
---|
14 | |
---|
15 | const long AED_MAX_SPECIES=100; |
---|
16 | |
---|
17 | |
---|
18 | enum { |
---|
19 | AED_GC_NAME, |
---|
20 | AED_GC_SELECTED, |
---|
21 | AED_GC_SEQUENCE, |
---|
22 | AED_GC_HELIX, |
---|
23 | |
---|
24 | AED_GC_0, // @@@ |
---|
25 | AED_GC_1, |
---|
26 | AED_GC_2, |
---|
27 | AED_GC_3, |
---|
28 | AED_GC_4, |
---|
29 | AED_GC_5, |
---|
30 | AED_GC_6, |
---|
31 | AED_GC_7, |
---|
32 | AED_GC_8, |
---|
33 | AED_GC_9, |
---|
34 | |
---|
35 | AED_GC_NAME_DRAG, |
---|
36 | AED_GC_SELECTED_DRAG, |
---|
37 | AED_GC_SEQUENCE_DRAG, |
---|
38 | AED_GC_HELIX_DRAG |
---|
39 | }; |
---|
40 | |
---|
41 | |
---|
42 | typedef enum { |
---|
43 | AED_F_ALLWAYS = 0, |
---|
44 | AED_F_NAME = 1, |
---|
45 | AED_F_NAME_SELECTED = 2, |
---|
46 | AED_F_SEQUENCE = 4, |
---|
47 | AED_F_SEQUENCE_SELECTED = 8, |
---|
48 | AED_F_INFO = 16, |
---|
49 | AED_F_INFO_SEPARATOR = 32, |
---|
50 | AED_F_WINFO = 64, |
---|
51 | AED_F_CURSOR = 128, |
---|
52 | AED_F_HELIX = 256, |
---|
53 | AED_F_TEXT_1 = 512, |
---|
54 | AED_F_TEXT_2 = 1024, |
---|
55 | AED_F_TEXT_3 = 2048, |
---|
56 | AED_F_FRAME = 4096, |
---|
57 | AED_F_ALL = -1 |
---|
58 | } AED_filters; |
---|
59 | |
---|
60 | |
---|
61 | extern class AED_root { |
---|
62 | public: |
---|
63 | AD_MAIN *ad_main; |
---|
64 | AW_root *aw_root; |
---|
65 | AED_root(void); |
---|
66 | |
---|
67 | AW_default db; |
---|
68 | long center_spacing; |
---|
69 | long line_spacing; |
---|
70 | long helix_at_extendeds; |
---|
71 | } aed_root; |
---|
72 | |
---|
73 | |
---|
74 | typedef enum { |
---|
75 | AED_ALIGN = 0, |
---|
76 | AED_INSERT = 1, |
---|
77 | AED_REPLACE = 2 |
---|
78 | } AED_modi; |
---|
79 | |
---|
80 | class AED_dlist; |
---|
81 | class AED_area_entry { |
---|
82 | public: |
---|
83 | |
---|
84 | AD_SPECIES *ad_species; |
---|
85 | AD_SAI *ad_extended; |
---|
86 | AD_CONT *ad_container; |
---|
87 | ADT_SEQUENCE *adt_sequence; |
---|
88 | AD_STAT *ad_stat; |
---|
89 | |
---|
90 | AW_BOOL is_selected; |
---|
91 | AW_pos in_line; |
---|
92 | AW_pos absolut_x; |
---|
93 | AW_pos absolut_y; |
---|
94 | AED_area_entry *previous; |
---|
95 | AED_area_entry *next; |
---|
96 | class AED_dlist *in_area; |
---|
97 | |
---|
98 | AED_area_entry() { is_selected = AW_FALSE; |
---|
99 | previous = NULL; next = NULL;}; |
---|
100 | ~AED_area_entry() {}; |
---|
101 | }; |
---|
102 | |
---|
103 | class AED_window; |
---|
104 | class AED_dummy { class AED_window *dummy; }; |
---|
105 | |
---|
106 | |
---|
107 | class AED_dlist { |
---|
108 | GB_HASH *hash; |
---|
109 | GBDATA *gb_main; |
---|
110 | char *hash_awar; |
---|
111 | int hash_level; |
---|
112 | public: |
---|
113 | int size; |
---|
114 | AED_area_entry *first; |
---|
115 | AED_area_entry *last; |
---|
116 | AED_area_entry *current; |
---|
117 | AED_dlist(); |
---|
118 | ~AED_dlist() {}; |
---|
119 | void create_hash(GBDATA *gb_main,const char *awar_suffix); |
---|
120 | void insert_hash(const char *name); |
---|
121 | void remove_hash(const char *name); |
---|
122 | long read_hash(const char *name); |
---|
123 | void optimize_hash(void); |
---|
124 | |
---|
125 | void remove_entry(AED_area_entry *to_be_removed); |
---|
126 | void append(AED_area_entry *to_be_inserted); |
---|
127 | void insert_after_entry(AED_area_entry *add_after_this, AED_area_entry *to_be_inserted); |
---|
128 | void insert_before_entry(AED_area_entry *add_before_this, AED_area_entry *to_be_inserted); |
---|
129 | }; |
---|
130 | |
---|
131 | class AED_window; |
---|
132 | class AED_dlist_left_side; |
---|
133 | |
---|
134 | class AED_left_side { |
---|
135 | public: |
---|
136 | char *text; |
---|
137 | char text_for_dragging[100]; |
---|
138 | void (*make_text)( class AED_window *aedw, AED_area_entry *area_entry, char *text ); |
---|
139 | AW_BOOL is_selected; |
---|
140 | AW_pos absolut_x; |
---|
141 | AW_pos absolut_y; |
---|
142 | AED_left_side *previous; |
---|
143 | AED_left_side *next; |
---|
144 | class AED_dlist_left_side *in_side; |
---|
145 | |
---|
146 | AED_left_side( void(*f)(class AED_window *aedw,AED_area_entry *area_entry, char *text), const char *string ); |
---|
147 | ~AED_left_side(); |
---|
148 | }; |
---|
149 | |
---|
150 | |
---|
151 | class AED_dlist_left_side { |
---|
152 | public: |
---|
153 | int size; |
---|
154 | AED_left_side *first; |
---|
155 | AED_left_side *last; |
---|
156 | AED_left_side *current; |
---|
157 | AED_dlist_left_side() {size = 0; first = NULL; last = NULL; current = NULL;}; |
---|
158 | ~AED_dlist_left_side() {}; |
---|
159 | void remove_entry( AED_left_side *to_be_removed ); |
---|
160 | void append( AED_left_side *to_be_inserted ); |
---|
161 | void insert_after_entry( AED_left_side *add_after_this, AED_left_side *to_be_inserted ); |
---|
162 | void insert_before_entry( AED_left_side *add_before_this, AED_left_side *to_be_inserted ); |
---|
163 | }; |
---|
164 | |
---|
165 | |
---|
166 | |
---|
167 | typedef struct { |
---|
168 | AW_BOOL clear; |
---|
169 | AW_BOOL calc_size; |
---|
170 | AW_BOOL visible_control; |
---|
171 | int top_indent; |
---|
172 | int bottom_indent; |
---|
173 | int left_indent; |
---|
174 | int slider_pos_horizontal; |
---|
175 | int slider_pos_vertical; |
---|
176 | int picture_l; |
---|
177 | int picture_t; |
---|
178 | |
---|
179 | } AED_area_display_struct; |
---|
180 | |
---|
181 | |
---|
182 | class AED_window { |
---|
183 | public: |
---|
184 | |
---|
185 | AW_BOOL config_window_created; |
---|
186 | AW_window_menu *config_window; |
---|
187 | |
---|
188 | AED_dlist_left_side *show_dlist_left_side; |
---|
189 | AED_dlist_left_side *hide_dlist_left_side; |
---|
190 | AED_left_side *selected_entry_of_dlist_left_side; |
---|
191 | AW_BOOL one_entry_dlist_left_side_is_selected; |
---|
192 | |
---|
193 | AED_root *root; |
---|
194 | AW_window *aww; |
---|
195 | ADT_ALI *alignment; |
---|
196 | |
---|
197 | AW_BOOL global_focus_use; |
---|
198 | |
---|
199 | AED_dlist *area_top; |
---|
200 | AED_dlist *area_middle; |
---|
201 | AED_dlist *area_bottom; |
---|
202 | AED_area_entry *selected_area_entry; |
---|
203 | AW_BOOL one_area_entry_is_selected; |
---|
204 | AW_BOOL selected_area_entry_is_visible; |
---|
205 | |
---|
206 | int selected_info_area_text; |
---|
207 | int info_area_height; |
---|
208 | AW_BOOL edit_info_area; |
---|
209 | |
---|
210 | AW_world size_information; |
---|
211 | int last_slider_position; |
---|
212 | AW_BOOL quickdraw; |
---|
213 | int quickdraw_left_indent; |
---|
214 | int quickdraw_right_indent; |
---|
215 | AW_cursor_type cursor_type; |
---|
216 | int cursor; |
---|
217 | AW_BOOL cursor_is_managed; |
---|
218 | AW_BOOL drag; |
---|
219 | int drag_x, drag_y; |
---|
220 | AW_pos drag_x_correcting, drag_y_correcting; |
---|
221 | |
---|
222 | long edit_modus; |
---|
223 | long edit_direction; |
---|
224 | int owntimestamp; |
---|
225 | |
---|
226 | |
---|
227 | |
---|
228 | // modes .... |
---|
229 | AED_window( void ); |
---|
230 | ~AED_window( void ); |
---|
231 | int load_data( void ); |
---|
232 | void show_data( AW_device *device, AW_window *awmm, AW_BOOL visibility_control ); |
---|
233 | void show_top_data( AW_device *device, AW_window *awmm, AED_area_display_struct& display_struct ); |
---|
234 | void show_single_top_data(AW_device *device, AW_window *awmm, AED_area_entry *area_entry, AED_area_display_struct& display_struct, AW_pos *y ); |
---|
235 | void show_middle_data( AW_device *device, AW_window *awmm, AED_area_display_struct& display_struct ); |
---|
236 | void show_single_middle_data(AW_device *device, AW_window *awmm, AED_area_entry *area_entry, AED_area_display_struct& display_struct, AW_pos *y ); |
---|
237 | void show_bottom_data( AW_device *device, AW_window *awmm, AED_area_display_struct& display_struct ); |
---|
238 | void show_single_bottom_data(AW_device *device, AW_window *awmm, AED_area_entry *area_entry, AED_area_display_struct& display_struct, AW_pos *y ); |
---|
239 | void hide_cursor( AW_device *device, AW_window *awmm ); |
---|
240 | void show_cursor( AW_device *device, AW_window *awmm ); |
---|
241 | AW_BOOL manage_cursor( AW_device *device, AW_window *awmm, AW_BOOL use_last_slider_position ); |
---|
242 | void show_single_area_entry( AW_device *device, AW_window *awmm, AED_area_entry *area_entry ); |
---|
243 | void calculate_size(AW_window *awmm); |
---|
244 | void expose(AW_window *awmm); |
---|
245 | |
---|
246 | void init( AED_root *rootin ); |
---|
247 | void select_area_entry( AED_area_entry *area_entry, AW_pos cursor_position ); |
---|
248 | void deselect_area_entry( void ); |
---|
249 | void make_left_text( char *string, AED_area_entry *area_entry ); |
---|
250 | }; |
---|
251 | |
---|
252 | void aed_create_window(AED_root *aedr); |
---|
253 | void aed_initialize_device(AW_device *device); |
---|
254 | void drag_box(AW_device *device, int gc, AW_pos x, AW_pos y, AW_pos width, AW_pos height, char *str); |
---|
255 | void aed_expose(AW_window *aw, AW_CL cd1, AW_CL cd2); |
---|
256 | void aed_clear_expose(AW_window *aw, AW_CL cd1, AW_CL cd2); |
---|
257 | void aed_resize(AW_window *aw, AW_CL cd1, AW_CL cd2); |
---|
258 | |
---|
259 | |
---|
260 | AW_window *create_naligner_window( AW_root *root, AW_CL cd2 ); |
---|
261 | void create_naligner_variables(AW_root *root,AW_default db1); |
---|
262 | |
---|
263 | void create_tool_variables(AW_root *root,AW_default db1); |
---|
264 | //void create_submission_variables(AW_root *root,AW_default db1); |
---|
265 | |
---|
266 | AW_window *create_tool_search( AW_root *root, AED_window *aedwindow ); |
---|
267 | AW_window *create_tool_replace( AW_root *root, AED_window *aedwindow ); |
---|
268 | AW_window *create_tool_complement( AW_root *root, AED_window *aedwindow ); |
---|
269 | AW_window *create_tool_speaker( AW_root *root, AED_window *aedwindow ); |
---|
270 | AW_window *create_tool_consensus( AW_root *root, AED_window *aedwindow ); |
---|
271 | //AW_window *create_submission_window( AW_root *root ); |
---|
272 | void set_cursor_to( AED_window *aedw, long cursor,class AED_area_entry *aed ); |
---|