Re: [gtk-list] Re: GraphicsExpose (was Re: About the About Box)




> > Tim Janik writes:

> ok, after carefully reading up on this in the Xlib - C Language X Interface
> manual, i'd say we implement the following:
> 
> 1) change Gdk's current event handling:
> >    case GraphicsExpose:
> >      event->expose.type = GDK_EXPOSE;
> 			    ^^^^^^^^^^
> we need an own GDK_GRAPHICS_EXPOSE event type.

Do we? That was my initial thought, but if we prevent accidental
GraphicsExpose's (by changing the default) and handle the
GraphicsExpose/NoExpose counting ourselves (either by providing a 
separate call to get these events, or using Raph's solution) then
the application writer probably doesn't need to care about the
difference.
 
> >      event->expose.window = window;
> >      event->expose.area.x = xevent->xgraphicsexpose.x;
> >      event->expose.area.y = xevent->xgraphicsexpose.y;
> >      event->expose.area.width = xevent->xgraphicsexpose.width;
> >      event->expose.area.height = xevent->xgraphicsexpose.height;
> >      event->expose.count = xevent->xexpose.count;
> >
> >      return_val = window_private && !window_private->destroyed;
> >      break;
> >
> >    case NoExpose:
> and GDK_NOEXPOSE...
> 
> >      /* Not currently handled */
> >      break;
> 
> then we have a function like
> gdk_window_prepare_graphics_expose (window, rectangle, new_origin)
> (i'm not too good at function names ;), that will be called after
> *all* XCopyArea and XCopyPlane calls, and register the rectangles along
                      ^^^^^^^^^^
GDK doesn't have it, it isn't useful window=>window (I suspect) and
it doesn't generate GraphicsExpose events anyways.

> with their new origins on a per window basis.
> later, when we receive GDK_GRAPHICS_EXPOSE or GDK_NOEXPOSE events,
> gdk_window_graphics_expose_adjust (window, GdkEvent) will be called
> which will then split/offset the events rectangle if more than
> one rectangle/origin pair is queued. on both event types GDK_NOEXPOSE and
> GDK_GRAPHICS_EXPOSE events if count==0, the first rectangle/origin pair
> will be removed from the queue.
> 
> this ok for the wizards?
> we can then right go to implememnt it...

Well, your two functions shouldn't be public - as part of an
implementation and defined in gdkprivate.h, those names would be
OK. But the neat thing about Raph's method is that it does everything
behind-the-scenes and produces the correct result. If the user
has to worry about the details, then it is much less appealing.

(I'm a bit concerned that some server could decide to reorder
the GraphicsExpose events from the various XCopyArea's, which
would invalidate an asynchronous method)

Regards,
                                        Owen



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