/[hurd]/hurd/libcons/file-changed.c
ViewVC logotype

Diff of /hurd/libcons/file-changed.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by marcus, Thu Aug 22 19:24:19 2002 UTC revision 1.2 by marcus, Wed Aug 28 17:28:36 2002 UTC
# Line 87  cons_S_file_changed (cons_notify_t notif Line 87  cons_S_file_changed (cons_notify_t notif
87                  }                  }
88                if (change.what.screen_cur_line)                if (change.what.screen_cur_line)
89                  {                  {
                   off_t size = vcons->state.screen.width  
                     * vcons->state.screen.lines;  
                   off_t vis_start;  
90                    uint32_t new_cur_line;                    uint32_t new_cur_line;
                   int scrolling;  
                   off_t start;  
                   off_t end;  
91                                        
92                    new_cur_line = vcons->display->screen.cur_line;                    new_cur_line = vcons->display->screen.cur_line;
93                    scrolling = new_cur_line - vcons->state.screen.cur_line;                    if (new_cur_line != vcons->state.screen.cur_line)
94                    if (scrolling < 0)                      {
95                      scrolling += vcons->state.screen.lines;                        off_t size = vcons->state.screen.width
96                    cons_vcons_scroll (vcons, scrolling);                          * vcons->state.screen.lines;
97                    vis_start = vcons->state.screen.width * new_cur_line;                        off_t vis_start;
98                    start = ((new_cur_line + vcons->state.screen.height                        uint32_t scrolling;
99                              - scrolling) * vcons->state.screen.width) % size;                        off_t start;
100                    end = start + scrolling * vcons->state.screen.width - 1;                        off_t end;
101                    cons_vcons_write (vcons, vcons->state.screen.matrix + start,                        
102                                      end < size                        if (new_cur_line > vcons->state.screen.cur_line)
103                                      ? end - start + 1                          scrolling = new_cur_line
104                                      : size - start,                            - vcons->state.screen.cur_line;
105                                      (start - vis_start)                        else
106                                      % vcons->state.screen.width,                          scrolling = UINT32_MAX - vcons->state.screen.cur_line
107                                      (start - vis_start)                            + 1 + new_cur_line;
108                                      / vcons->state.screen.width);                        if (scrolling > vcons->state.screen.height)
109                    if (end >= size)                          scrolling = vcons->state.screen.height;
110                      cons_vcons_write (vcons,                        if (scrolling < vcons->state.screen.height)
111                                        vcons->state.screen.matrix,                          cons_vcons_scroll (vcons, scrolling);
112                                        end - size + 1,                        vis_start = vcons->state.screen.width
113                                        (size - vis_start)                          * (new_cur_line % vcons->state.screen.lines);
114                                        % vcons->state.screen.width,                        start = (((new_cur_line % vcons->state.screen.lines)
115                                        (size - vis_start)                                  + vcons->state.screen.height - scrolling)
116                                        / vcons->state.screen.width);                                 * vcons->state.screen.width) % size;
117                    cons_vcons_update (vcons);                        end = start + scrolling * vcons->state.screen.width - 1;
118                    vcons->state.screen.cur_line = new_cur_line;                        cons_vcons_write (vcons,
119                                            vcons->state.screen.matrix + start,
120                                            end < size
121                                            ? end - start + 1
122                                            : size - start,
123                                            0, vcons->state.screen.height
124                                            - scrolling);
125                          if (end >= size)
126                            cons_vcons_write (vcons,
127                                              vcons->state.screen.matrix,
128                                              end - size + 1,
129                                              0, (size - vis_start)
130                                              / vcons->state.screen.width);
131                          cons_vcons_update (vcons);
132                          vcons->state.screen.cur_line = new_cur_line;
133                        }
134                  }                  }
135                if (change.what.screen_scr_lines)                if (change.what.screen_scr_lines)
136                  {                  {
# Line 152  cons_S_file_changed (cons_notify_t notif Line 161  cons_S_file_changed (cons_notify_t notif
161                /* For clipping.  */                /* For clipping.  */
162                off_t size = vcons->state.screen.width*vcons->state.screen.lines;                off_t size = vcons->state.screen.width*vcons->state.screen.lines;
163                off_t rotate = vcons->state.screen.width                off_t rotate = vcons->state.screen.width
164                  * vcons->state.screen.cur_line;                  * (vcons->state.screen.cur_line % vcons->state.screen.lines);
165                off_t vis_end = vcons->state.screen.height                off_t vis_end = vcons->state.screen.height
166                  * vcons->state.screen.width - 1;                  * vcons->state.screen.width - 1;
167                off_t end2 = -1;                off_t end2 = -1;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26