Changeset 8295 for branches

Show
Ignore:
Timestamp:
10/12/11 13:58:51 (6 months ago)
Author:
westram
Message:
  • fixed ED4_compression_changed_cb
    • now updates all windows when compression changes
  • made several functions context independent (as needed by above change)
    • ED4_calc_terminal_extentions uses any device (that of first window)
    • ED4_expose_recalculations no longer does update_scrolled_rectangle (now performed by caller; caller knows the context)
    • always use own context in
      • ED4_window::update_scrolled_rectangle
      • ED4_cursor::draw_cursor, ED4_cursor::get_screen_relative_pos
Location:
branches/e4fix
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/e4fix/EDIT4/ED4_cursor.cxx

    r8293 r8295  
    279279                                       !awar_edit_direction); 
    280280 
    281     cursor_shape->draw(current_device(), int(x), int(y)); 
     281    cursor_shape->draw(window()->get_device(), int(x), int(y)); 
    282282 
    283283#if defined(DEBUG) && 0 
     
    927927} 
    928928 
    929 int ED4_cursor::get_screen_relative_pos() { 
    930     ED4_coords *coords = &current_ed4w()->coords; 
    931     return cursor_abs_x - coords->window_left_clip_point; 
     929int ED4_cursor::get_screen_relative_pos() const { 
     930    const ED4_coords& coords = window()->coords; 
     931    return cursor_abs_x - coords.window_left_clip_point; 
    932932} 
    933933void ED4_cursor::set_screen_relative_pos(int scroll_to_relpos) { 
  • branches/e4fix/EDIT4/ED4_no_class.cxx

    r8293 r8295  
    3535#include <limits.h> 
    3636 
     37#include <vector> 
     38 
     39using namespace std; 
    3740 
    3841void ED4_calc_terminal_extentions() { 
    39     AW_device *device = current_device(); 
     42    AW_device *device = ED4_ROOT->first_window->get_device(); // any device 
    4043 
    4144    const AW_font_limits& seq_font_limits  = device->get_font_limits(ED4_G_SEQUENCES, 0); 
     
    121124        screenwidth = new_screenwidth; 
    122125    } 
    123  
    124     current_ed4w()->update_scrolled_rectangle(); // @@@ do for all windows ? 
    125126} 
    126127 
     
    137138    else { 
    138139        ED4_expose_recalculations(); // this case is needed every time, except the first 
     140        current_ed4w()->update_scrolled_rectangle(); 
    139141    } 
    140142 
     
    14211423} 
    14221424 
     1425struct cursorpos { 
     1426    ED4_cursor& cursor; 
     1427    int screen_rel; 
     1428    int seq; 
     1429 
     1430    cursorpos(ED4_window *win) 
     1431        : cursor(win->cursor), 
     1432          screen_rel(cursor.get_screen_relative_pos()), 
     1433          seq(cursor.get_sequence_pos()) 
     1434    {} 
     1435    cursorpos(const cursorpos& other) 
     1436        : cursor(other.cursor), 
     1437          screen_rel(other.screen_rel), 
     1438          seq(other.seq) 
     1439    {} 
     1440    DECLARE_ASSIGNMENT_OPERATOR(cursorpos); 
     1441}; 
     1442 
     1443 
    14231444void ED4_compression_changed_cb(AW_root *awr) { 
    14241445    ED4_remap_mode mode    = (ED4_remap_mode)awr->awar(ED4_AWAR_COMPRESS_SEQUENCE_TYPE)->read_int(); 
     
    14271448 
    14281449    if (ED4_ROOT->root_group_man) { 
    1429         ED4_cursor& cursor  = current_cursor(); // @@@ should be done for all windows (all cursors) 
    1430         int         rel_pos = cursor.get_screen_relative_pos(); 
    1431         int         seq_pos = cursor.get_sequence_pos(); 
    1432  
    1433         AW_window *aww    = current_aww(); 
    1434         AW_device *device = current_device(); 
    1435  
    1436         ED4_remap *remap = ED4_ROOT->root_group_man->remap(); 
    1437         remap->set_mode(mode, percent); 
    1438  
    1439         device->push_clip_scale(); 
    1440         device->set_clipall();     // draw nothing 
    1441  
    1442         ED4_expose_recalculations(); // @@@ do not perform for all windows 
    1443  
    1444         cursor.jump_sequence_pos(seq_pos, ED4_JUMP_KEEP_POSITION); 
    1445         cursor.set_screen_relative_pos(rel_pos); 
    1446  
    1447         ED4_expose_cb(aww, 0, 0); // does pop_clip_scale + refresh 
     1450        vector<cursorpos> pos; 
     1451 
     1452        for (ED4_window *win = ED4_ROOT->first_window; win; win = win->next) { 
     1453            pos.push_back(cursorpos(win)); 
     1454             
     1455            AW_device *device = win->get_device(); 
     1456            device->push_clip_scale(); 
     1457            device->set_clipall();     // draw nothing 
     1458        } 
     1459 
     1460        ED4_ROOT->root_group_man->remap()->set_mode(mode, percent); 
     1461        ED4_expose_recalculations(); 
     1462 
     1463        for (vector<cursorpos>::const_iterator i = pos.begin(); i != pos.end(); ++i) { 
     1464            ED4_cursor&  cursor = const_cast<ED4_cursor&>(i->cursor); 
     1465            ED4_window  *win    = cursor.window(); 
     1466 
     1467            win->update_scrolled_rectangle(); 
     1468 
     1469            cursor.jump_sequence_pos(i->seq, ED4_JUMP_KEEP_POSITION); 
     1470            cursor.set_screen_relative_pos(i->screen_rel); 
     1471 
     1472            ED4_expose_cb(win->aww, 0, 0); // does pop_clip_scale + refresh 
     1473        } 
    14481474    } 
    14491475} 
  • branches/e4fix/EDIT4/ED4_window.cxx

    r8293 r8295  
    158158    } 
    159159 
    160     const AW_screen_area& area_size = current_device()->get_area_size(); 
     160    const AW_screen_area& area_size = get_device()->get_area_size(); 
    161161    scrolled_rect.calc_bottomRight_folding_dimensions(area_size.r, area_size.b); 
    162162 
  • branches/e4fix/EDIT4/ed4_class.hxx

    r8293 r8295  
    654654    void jump_base_pos(int base_pos, ED4_CursorJumpType jump_type); 
    655655 
    656     int get_screen_relative_pos(); 
     656    int get_screen_relative_pos() const; 
    657657    void set_screen_relative_pos(int scroll_to_relpos); 
    658658 
  • branches/e4fix/WINDOW/aw_device.hxx

    r7931 r8295  
    440440    AW_bitset get_filter() const { return filter; } 
    441441 
    442     void reset(); 
     442    void reset(); // pops all clip_scales 
    443443 
    444444    const AW_screen_area& get_area_size() const;