On Fri, 9 Nov 2001, Daniel Secrieru wrote:

> >    You should know that data, after all, you're the one who set it.
> > That's why there are no functions to retrieve that or any other GC state.
> > There is a copy of that info in the library but it's private to the
> > library.  Xlib only keeps that info around so that it doesn't have
> > to call the X-server every time you change something.  It buffers
> > up state changes and then only flushes them when the GC is next
> > used for something.  Its cache isn't end-user accessible.
>     Glad to finally found someone who knows X11 up and down.
>     Ok, here's the thing: I'm trying to port a GUI from Win32 GDI to X11.
> Don't ask... ;-)
>     I had a lot of problems with incompatibilities between the two and this
> clipbox stuff is the latest. In Win32 there is a function called GetClipBox,
> that does the following (quote from MSDN):
> 
>     'The GetClipBox function retrieves the dimensions of the tightest
> bounding rectangle that can be drawn around the current visible area on the
> device. The visible area is defined by the current clipping region or clip
> path, as well as any overlapping windows.'

   The GC cliplist would be the "clipping region or clip path" but
will not include any overlapping windows.  Hardly anybody sets the
GC clip so you're probably OK to always return the size of the window
for this.

> 
>     Is there anything similar in X11? I mean some way to retrieve the
> bounding rectangle of the region that must be updated/repainted/refreshed
> after, let's say some window was moved from atop another and the later must
> be redraw? (I hope this makes sense)

   This is in response to WM_PAINT events?  Basically X doesn't work
this way.  The dirty rects are sent to the client when it gets the
Expose events.

  The exact area renderable isn't definitely known by the X-client.
You can figure out (with alot of querying and math) the portion
of the window visible, but with things like overlay planes that's
not equal to the area that is renderable, and with things like
backing store there are even larger discrepancies.

   If you are trying to make WM_PAINT events out of X Expose
events then you should probably throw away all Expose events
that have non-zero counts and only respond to zero-count
Expose events.  And your GetClipBox function should probably
return the whole window size.   Alternatively you might be
able to collect the bounds of all the Expose events, treat
the non-zero event as the WM_PAINT event and return the bounds
that you've collected up to the non-zero count event as the 
response to GetClipBox.


                        Mark.

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to