Re: [g-a-devel] gnome-mag: I don't understand some variables in zoom_region_calculate_scroll_rects



Carlos Eduardo Rodrigues Diogenes wrote:

Hi Bill,

Can you explain what data the variables *scroll_rect*, *expose_rect_h* and *expose_rect_v *hold? And where/why these variables are used?

As you see in the code, these are GdkRectangles. Consider the general case of "scrolling" a viewport or window; in the general case, where dx and dy are the relative motion in two dimensions, the affected region can be divided into three parts. One part (scroll_rect) is the rectangular region which was "already" onscreen in the previous view, and is still onscreen in the new view; in other words, the part of the viewport that gets "scrolled" or moved. The other two parts (expose_rect_h and expose_rect_v) represent the vertical and horizontal bands which have "moved into" the new view, which were not part of the old view.

In order to place the "newly-exposed" areas on screen, an "expose" event must be emitted to tell Gdk to repaint those onscreen areas. The "scrolled" area, which was already onscreen, can be moved in one of two ways. It can either have its own "expose" event emitted, just as with the newly-exposed areas (via gdk_window_invalidate_rect), or the old pixels can be copied from their old location to a new location, via gdk_window_scroll. Since Xlib doesn't support 'scrolling' of pixmaps, the Xlib call 'XCopyArea' must be used in the implementation inside Gdk. Although you might think that "moving" the area already onscreen should be much faster than invalidating the whole window, in practice it doesn't really make much difference, and using "expose" may give a little smoother result. That's why there are two different implementations of "scroll" in zoom-region.c, zoom_region_scroll_fast and zoom_region_scroll_smooth. Depending on the zoom region and magnifier user preferences, either "smooth" or "fast" scrolling is used. As I said, the "fast" method isn't currently much faster than the "smooth" one, so there is little advantage to it.

regards

Bill


Thanks,
Carlos.
_______________________________________________
Gnome-accessibility-devel mailing list
Gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]