Exposing, panning, and obscured window


I'm working on an image display widget that has interaction and speed
similar to that of gimp's excellent image display. I hope that this
widget may be the bases of several image display programs, e.g. the
fax viewing program, and some scientific visualization programs that
I need at work.

My problem has to do with panning and exposing. They way the widget
works is as follows:

The illustration below shows a panning of the widget in the y-direction.

     0  +------------------------------------+
        |				     |  
     dy	|====================================|
	|				     |
	|				     |
	|				     |
	|				     |
     h	+------------------------------------+
The widget has just received a motion event of dy in the y-direction
with the middle mouse button pressed. The image needs to be panned
which is done in two steps:

    1. A gdk_draw_pixmap() call with the source and the destination
       pixmaps being the window. The y-coordinates for source and
       destination are:
          source:   0, h-dy
	  dest:     dy, h
    2. Rendering the rectangle between 0 and h and then writing it to
       to the window through gdk_pixbuf_render_to_drawable() .
This all works fine. The problem happens when part of the window is 

     0  +-----------------------------|   Obscuring 
        |			      |   window
     dy	|=============================|
	|			      +-------------
	|				     |
	|				     |
	|				     |
     h	+------------------------------------+

The problem now is that the gdk_draw_pixmap step will partly take
information that is behind the obscuring window. The result is 
that below the obscuring window will be a grey stripe that is dy

Is there any way of getting a list of all the rectangles that are
obscuring the image widget? Or is there any other way of how to
avoid this problem? Of course it would be possible to render the
whole image periodically, but it seems that this is a waste of
resources. Is there any other way?

Note that you don't get an exposure event in this case as all
changes take place within the image widget.

                                                        ___   ___
                                                      /  o  \   o \
Dov Grobgeld                                         ( o  o  ) o   |
The Weizmann Institute of Science, Israel             \  o  /o  o /
"Where the tree of wisdom carries oranges"              | |   | |
                                                       _| |_ _| |_

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