Changeset 8342
- Timestamp:
- 26/01/12 17:18:07 (4 months ago)
- Location:
- branches/e4fix/EDIT4
- Files:
-
- 10 modified
-
ED4_cursor.cxx (modified) (9 diffs)
-
ED4_dump.cxx (modified) (1 diff)
-
ED4_edit_string.cxx (modified) (1 diff)
-
ED4_main.cxx (modified) (3 diffs)
-
ED4_manager.cxx (modified) (6 diffs)
-
ED4_no_class.cxx (modified) (3 diffs)
-
ED4_root.cxx (modified) (11 diffs)
-
ED4_text_terminals.cxx (modified) (1 diff)
-
ed4_class.hxx (modified) (3 diffs)
-
ed4_defs.hxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/e4fix/EDIT4/ED4_cursor.cxx
r8341 r8342 361 361 #define EXPAND_SIZE 0 362 362 if (window()->get_device()->reduceClipBorders(ymin-EXPAND_SIZE, ymax+1+EXPAND_SIZE, xmin-EXPAND_SIZE, xmax+1+EXPAND_SIZE)) { 363 // refresh terminal 364 int old_allowed_to_draw= allowed_to_draw;365 allowed_to_draw = 0;366 ED4_ROOT-> refresh_window(1);367 allowed_to_draw = old_allowed_to_draw;363 // refresh terminal to hide cursor 364 bool previous = allowed_to_draw; 365 allowed_to_draw = false; 366 ED4_ROOT->special_window_refresh(); 367 allowed_to_draw = previous; 368 368 } 369 369 dev->pop_clip_scale(); … … 375 375 ED4_cursor::ED4_cursor(ED4_window *win_) : win(win_) { 376 376 init(); 377 allowed_to_draw = 1;377 allowed_to_draw = true; 378 378 cursor_shape = 0; 379 379 … … 801 801 } 802 802 803 intED4_update_global_cursor_awars_allowed = true;803 bool ED4_update_global_cursor_awars_allowed = true; 804 804 805 805 void ED4_cursor::updateAwars() … … 1013 1013 delete_cursor(cursor_abs_x, owner_of_cursor); 1014 1014 1015 int old_allowed_to_draw= allowed_to_draw;1015 bool previous = allowed_to_draw; 1016 1016 if (scroll_new_to >= 0) { // scroll 1017 1017 int rel_x_new = abs_x_new-coords->window_left_clip_point; … … 1028 1028 printf("jump_screen_pos auto-scrolls %i\n", scroll_amount); 1029 1029 #endif 1030 allowed_to_draw = 0;1030 allowed_to_draw = false; 1031 1031 ED4_horizontal_change_cb(aww, 0, 0); 1032 1032 } 1033 1033 } 1034 1034 1035 allowed_to_draw = 1;1035 allowed_to_draw = true; 1036 1036 if (cursor_diff >= 0) { 1037 1037 ShowCursor(cursor_diff*length_of_char, ED4_C_RIGHT, ABS(cursor_diff)); … … 1040 1040 ShowCursor(cursor_diff*length_of_char, ED4_C_LEFT, ABS(cursor_diff)); 1041 1041 } 1042 allowed_to_draw = old_allowed_to_draw;1042 allowed_to_draw = previous; 1043 1043 } 1044 1044 … … 1214 1214 1215 1215 1216 ED4_returncode ED4_cursor::ShowCursor(ED4_index offset_x, ED4_cursor_move move, int move_pos) 1217 { 1216 ED4_returncode ED4_cursor::ShowCursor(ED4_index offset_x, ED4_cursor_move move, int move_pos) { 1218 1217 AW_pos x=0, y=0, x_help = 0, y_help; 1219 1218 1220 1219 owner_of_cursor->calc_world_coords(&x, &y); 1221 1220 1222 switch (move)1223 {1224 case ED4_C_RIGHT: 1225 screen_position += move_pos;1226 break;1227 case ED4_C_LEFT: 1228 screen_position -= move_pos; 1229 break;1230 case ED4_C_NONE:1221 int old_allow = ED4_update_global_cursor_awars_allowed; 1222 ED4_update_global_cursor_awars_allowed = true; 1223 1224 switch (move) { 1225 case ED4_C_RIGHT: screen_position += move_pos; break; 1226 case ED4_C_LEFT: screen_position -= move_pos; break; 1227 1228 case ED4_C_NONE: // no move - only redisplay 1229 ED4_update_global_cursor_awars_allowed = false; // dont update here, otherwise refresh will disable cursor movement! 1231 1230 break; 1232 1231 default: … … 1236 1235 1237 1236 updateAwars(); 1237 ED4_update_global_cursor_awars_allowed = old_allow; 1238 1238 1239 1239 x_help = cursor_abs_x + offset_x; … … 1391 1391 owner_of_cursor->request_refresh(); // we have to refresh old owner of cursor 1392 1392 owner_of_cursor = NULL; 1393 ED4_ROOT->refresh_window(0);1394 1393 DRAW = 1; 1395 1394 } -
branches/e4fix/EDIT4/ED4_dump.cxx
r8155 r8342 261 261 print_indented(NEXT_INDENT, GBS_global_string("refresh_horizontal_scrolling = %u", refresh_horizontal_scrolling)); 262 262 print_indented(NEXT_INDENT, GBS_global_string("delete_requested = %u", delete_requested)); 263 print_indented(NEXT_INDENT, GBS_global_string("update_requested = %u", update_requested)); 263 264 closeDump(indent); 264 265 } -
branches/e4fix/EDIT4/ED4_edit_string.cxx
r8333 r8342 772 772 } 773 773 case 'L': { // CTRL-L = Refresh 774 ED4_re fresh_window(current_aww());774 ED4_request_full_refresh(); 775 775 cursor_jump = ED4_JUMP_CENTERED; 776 776 break; -
branches/e4fix/EDIT4/ED4_main.cxx
r8304 r8342 66 66 bool move_cursor; // only needed for editing in consensus 67 67 bool DRAW; 68 bool last_window_reached; // needed for refreshing all windows (if TRUE refresh/...-flags will be cleared)69 68 70 69 void ED4_config_change_cb(AW_root *) … … 499 498 ED4_ROOT->announce_useraction_in(aww); 500 499 } 500 static void seq_colors_changed_cb(AW_window *) { 501 ED4_ROOT->request_refresh_for_sequence_terminals(); 502 } 501 503 502 504 int ARB_main(int argc, const char *argv[]) { … … 562 564 563 565 ED4_ROOT->st_ml = STAT_create_ST_ML(GLOBAL_gb_main); 564 ED4_ROOT->sequence_colors = new AWT_seq_colors(AW_ROOT_DEFAULT, ED4_G_SEQUENCES, (AW_CB) ED4_refresh_window, 0, 0);566 ED4_ROOT->sequence_colors = new AWT_seq_colors(AW_ROOT_DEFAULT, ED4_G_SEQUENCES, (AW_CB)seq_colors_changed_cb, 0, 0); 565 567 566 568 ED4_ROOT->edk = new ed_key; -
branches/e4fix/EDIT4/ED4_manager.cxx
r8341 r8342 936 936 AW_device *device = current_device(); 937 937 938 if (flag.hidden) { 939 if (last_window_reached && update_info.refresh) { 940 clear_refresh(); 941 } 942 } 943 else if (refresh_all || update_info.refresh) { 938 if (!flag.hidden && (refresh_all || update_info.refresh)) { 944 939 const AW_screen_area& area_rect = device->get_area_size(); 945 940 … … 959 954 int x1, y1, x2, y2; 960 955 ED4_window& win = *current_ed4w(); 961 int old_last_window_reached = last_window_reached;962 963 last_window_reached = 0;964 956 x1 = area_rect.l; 965 957 for (const ED4_folding_line *flv = win.get_vertical_folding(); ; flv = flv->get_next()) { 966 int lastColumn = 0;967 968 958 if (flv) { 969 959 x2 = int(flv->get_pos()); // @@@ use AW_INT ? 970 if (!flv->get_next() && x2==area_rect.r) {971 lastColumn = 1;972 }973 960 } 974 961 else { 975 962 x2 = area_rect.r; 976 lastColumn = 1; 977 if (x1==x2) { 978 break; // do not draw last range, if it's only 1 pixel width 979 } 963 if (x1==x2) break; // do not draw last range, if it's only 1 pixel width 980 964 } 981 965 982 966 y1 = area_rect.t; 983 967 for (const ED4_folding_line *flh = win.get_horizontal_folding(); ; flh = flh->get_next()) { 984 int lastRow = 0;985 986 968 if (flh) { 987 969 y2 = int(flh->get_pos()); // @@@ use AW_INT ? 988 if (!flh->get_next() && y2==area_rect.b) {989 lastRow = 1;990 }991 970 } 992 971 else { 993 972 y2 = area_rect.b; 994 lastRow = 1; 995 if (y1==y2) { 996 break; // do not draw last range, if it's only 1 pixel high 997 } 998 } 999 1000 if (lastRow && lastColumn) { 1001 last_window_reached = old_last_window_reached; 973 if (y1==y2) break; // do not draw last range, if it's only 1 pixel high 1002 974 } 1003 975 … … 1007 979 } 1008 980 device->pop_clip_scale(); 1009 1010 if (last_window_reached) {1011 update_info.set_refresh(0);1012 update_info.set_clear_at_refresh(0);1013 }1014 981 1015 982 if (!flh) break; // break out after drawing lowest range … … 1059 1026 #endif 1060 1027 1061 if (flag.hidden) {1062 if (last_window_reached && update_info.refresh) {1063 clear_refresh();1064 }1065 }1066 1028 if (!flag.hidden && (refresh_all || update_info.refresh)) { 1067 1029 if (update_info.clear_at_refresh && !is_cleared) { … … 1183 1145 } 1184 1146 } 1185 1186 if (last_window_reached) {1187 if (!flags_cleared && child->is_manager() && child->update_info.refresh) {1188 // if we didn't show a manager we must clear its children's refresh flags1189 child->to_manager()->clear_refresh();1190 }1191 else {1192 child->update_info.set_refresh(0);1193 child->update_info.set_clear_at_refresh(0);1194 }1195 }1196 1147 } 1197 1148 } … … 1222 1173 1223 1174 update_info.set_refresh(0); 1175 update_info.set_clear_at_refresh(0); 1224 1176 1225 1177 return ED4_R_OK; -
branches/e4fix/EDIT4/ED4_no_class.cxx
r8341 r8342 144 144 145 145 current_device()->reset(); 146 ED4_ROOT-> refresh_window(1);146 ED4_ROOT->special_window_refresh(); 147 147 148 148 GB_pop_transaction(GLOBAL_gb_main); … … 851 851 } 852 852 853 void ED4_refresh_window(AW_window *aww) { 854 ED4_main_manager *mainman = ED4_ROOT->main_manager; 855 if (mainman) { // during startup we have no mainman 856 GB_transaction ta(GLOBAL_gb_main); 857 ED4_LocalWinContext uses(aww); 858 859 if (mainman->update_info.delete_requested) { 860 mainman->delete_requested_children(); 861 } 862 863 mainman->update_info.set_clear_at_refresh(1); 864 mainman->Show(1); 865 } 866 } 853 void ED4_request_full_refresh() { ED4_ROOT->main_manager->request_refresh(); } 867 854 868 855 void ED4_set_reference_species(AW_window *aww, AW_CL disable, AW_CL ) { … … 908 895 } 909 896 910 ED4_ refresh_window(aww);897 ED4_ROOT->request_refresh_for_sequence_terminals(); 911 898 } 912 899 -
branches/e4fix/EDIT4/ED4_root.cxx
r8341 r8342 90 90 91 91 ED4_returncode ED4_root::refresh_window_simple(bool redraw) { 92 e4_assert(!main_manager->update_info.delete_requested); 93 e4_assert(!main_manager->update_info.update_requested); 94 e4_assert(!main_manager->update_info.resize); 95 92 // if 'redraw' -> update everything (ignoring refresh flag) 96 93 int refresh_all = 0; 97 94 if (redraw) { … … 100 97 } 101 98 main_manager->Show(refresh_all, 0); 99 if (redraw) { 100 main_manager->update_info.set_clear_at_refresh(0); 101 } 102 102 return (ED4_R_OK); 103 103 } … … 118 118 redraw = true; 119 119 } 120 } 121 122 ED4_returncode ED4_root::refresh_window(bool redraw) { 120 121 // make sure all update request have been handled: 122 e4_assert(!main_manager->update_info.delete_requested); 123 e4_assert(!main_manager->update_info.update_requested); 124 e4_assert(!main_manager->update_info.resize); 125 } 126 127 ED4_returncode ED4_root::special_window_refresh() { 123 128 // this function should only be used for window specific updates (i.e. cursor placement) 124 handle_update_requests(redraw); // @@@ problematic (causes refresh w/o win-context, clears flags w/o handling all windows) 129 bool redraw = true; 130 handle_update_requests(redraw); // @@@ problematic (causes refresh w/o win-context) 125 131 return refresh_window_simple(redraw); 132 // do NOT clear_refresh_requests here!! this is no full refresh! 126 133 } 127 134 128 135 ED4_returncode ED4_root::refresh_all_windows(bool redraw) { 136 // if 'redraw' -> update everything (ignoring refresh flag) 129 137 GB_transaction dummy(GLOBAL_gb_main); 130 last_window_reached = 0;131 138 132 139 handle_update_requests(redraw); … … 134 141 ED4_window *window = first_window; 135 142 while (window) { 136 if (!window->next) last_window_reached = 1;137 143 ED4_LocalWinContext uses(window); 138 144 refresh_window_simple(redraw); … … 140 146 } 141 147 148 if (main_manager->update_info.refresh) main_manager->clear_refresh(); 149 142 150 return (ED4_R_OK); 143 151 } 144 145 152 146 153 void ED4_foldable::win_to_world_coords(AW_pos *xPtr, AW_pos *yPtr) { … … 827 834 828 835 829 void ED4_reload_helix_cb(AW_window *aww) { 836 static void reload_helix_cb() { 830 837 const char *err = ED4_ROOT->helix->init(GLOBAL_gb_main); 831 838 if (err) aw_message(err); 832 ED4_re fresh_window(aww);833 } 834 835 836 void ED4_reload_ecoli_cb(AW_window *aww) {839 ED4_request_full_refresh(); 840 } 841 842 843 static void reload_ecoli_cb() { 837 844 const char *err = ED4_ROOT->ecoli_ref->init(GLOBAL_gb_main); 838 845 if (err) aw_message(err); 839 ED4_re fresh_window(aww);846 ED4_request_full_refresh(); 840 847 } 841 848 … … 1284 1291 } 1285 1292 1286 ED4_re fresh_window(aww);1293 ED4_request_full_refresh(); 1287 1294 } 1288 1295 … … 1476 1483 1477 1484 awmm->create_menu("Edit", "E", AWM_ALL); 1478 awmm->insert_menu_topic("refresh", "Refresh [Ctrl-L]", "f", 0, AWM_ALL, (AW_CB)ED4_re fresh_window,0, 0);1485 awmm->insert_menu_topic("refresh", "Refresh [Ctrl-L]", "f", 0, AWM_ALL, (AW_CB)ED4_request_full_refresh, 0, 0); 1479 1486 awmm->insert_menu_topic("load_current", "Load current species [GET]", "G", 0, AWM_ALL, ED4_get_and_jump_to_current_from_menu, 0, 0); 1480 awmm->insert_menu_topic("load_marked", "Load marked species", "m", 0, AWM_ALL, ED4_get_marked_from_menu, 0, 0);1481 SEP________________________SEP; 1482 awmm->insert_menu_topic("refresh_ecoli", "Reload Ecoli sequence", "E", "ecoliref.hlp", AWM_ALL, (AW_CB) ED4_reload_ecoli_cb, 0, 0);1483 awmm->insert_menu_topic("refresh_helix", "Reload Helix", "H", "helix.hlp", AWM_ALL, (AW_CB) ED4_reload_helix_cb, 0, 0);1487 awmm->insert_menu_topic("load_marked", "Load marked species", "m", 0, AWM_ALL, ED4_get_marked_from_menu, 0, 0); 1488 SEP________________________SEP; 1489 awmm->insert_menu_topic("refresh_ecoli", "Reload Ecoli sequence", "E", "ecoliref.hlp", AWM_ALL, (AW_CB)reload_ecoli_cb, 0, 0); 1490 awmm->insert_menu_topic("refresh_helix", "Reload Helix", "H", "helix.hlp", AWM_ALL, (AW_CB)reload_helix_cb, 0, 0); 1484 1491 awmm->insert_menu_topic("helix_jump_opposite", "Jump helix opposite [Ctrl-J]", "J", 0, AWM_ALL, ED4_helix_jump_opposite, 0, 0); 1485 1492 SEP________________________SEP; … … 1935 1942 } 1936 1943 1937 AW_window *ED4_root::create_new_window() // only the first time, other cases: generate_window1938 { 1944 AW_window *ED4_root::create_new_window() { 1945 // only the first window, other windows are generated by generate_window 1939 1946 AW_device *device = NULL; 1940 1947 ED4_window *new_window = NULL; … … 1946 1953 ED4_calc_terminal_extentions(); 1947 1954 1948 last_window_reached = 1;1949 1955 DRAW = 1; 1950 1956 move_cursor = 0; … … 1953 1959 ED4_init_notFoundMessage(); 1954 1960 1955 return (new_window->aww);1961 return new_window->aww; 1956 1962 } 1957 1963 -
branches/e4fix/EDIT4/ED4_text_terminals.cxx
r8290 r8342 611 611 current_device()->pop_clip_scale(); 612 612 613 // @@@ only request refresh of cursor and draw it at end of window-refresh ? might fix missing parts of cursor 614 // maybe do this check at top-level 613 615 ED4_cursor *cursor = ¤t_cursor(); 614 616 if (this == cursor->owner_of_cursor) { -
branches/e4fix/EDIT4/ed4_class.hxx
r8341 r8342 610 610 }; 611 611 612 extern int ED4_update_global_cursor_awars_allowed;612 extern bool ED4_update_global_cursor_awars_allowed; // update selected species/SAI/cursor position 613 613 614 614 struct ED4_TerminalPredicate { … … 1523 1523 ED4_returncode resize_all(); 1524 1524 1525 ED4_returncode refresh_window(bool redraw);1525 ED4_returncode special_window_refresh(); 1526 1526 ED4_returncode refresh_all_windows(bool redraw); 1527 1527 … … 2223 2223 2224 2224 void ED4_quit_editor (AW_window *aww, AW_CL cd1, AW_CL cd2); // Be Careful: Is this the last window? 2225 void ED4_re fresh_window (AW_window *aww);2225 void ED4_request_full_refresh(); 2226 2226 2227 2227 void ED4_store_curpos (AW_window *aww, AW_CL cd1, AW_CL cd2); -
branches/e4fix/EDIT4/ed4_defs.hxx
r8338 r8342 52 52 extern bool move_cursor; // only needed for editing in consensus 53 53 extern bool DRAW; 54 extern bool last_window_reached; // only needed for refreshing all windows55 54 56 55 // globally used defines and flags
