Re: Virtualizing paint functions



On Mon, 2006-04-10 at 00:28 +0200, Anders Carlsson wrote:
> Owen Taylor skrev:
> > On Tue, 2006-04-04 at 00:12 +0200, Anders Carlsson wrote:
> >   
> >> Owen Taylor skrev:
> >>     
> >>> So:
> >>>
> >>>  if (GDK_IS_PAINTABLE(window)->impl)) 
> >>>    {
> >>>      GDK_PAINTABLE(impl)->invalidate_region(region);
> >>>      return;
> >>>    }
> >>>
> >>>  [ Current implementation ]
> >>>
> >>>   
> >>> That *is* another way of doing backend customization from what we have
> >>> as well, but at least it's a way that fits into the general GObject
> >>> patterns. 
> >>>
> >>>   
> >>>       
> >> Ah, that looks way better that the hack I had. When I was looking at 
> >> inheritance, I was concerned with not being able to provide a default 
> >> implementation.
> >>
> >> I guess the remaining issue now is how to override 
> >> gdk_window_process_all_updates, without requiring copies of the function 
> >> in the different backend implementations.
> >>     
> >
> > Can you explain the issue here more?
> > 						Owen
> >   
> The problem was that I wanted to override 
> gdk_window_process_all_updates, which is a void function.

Do you mean you want to *optionally* override it? That is, allow a
backend to override gdk_window_process_updates() but not 
process_all_updates()?

Probably the easy thing to do would be have a default implementation
_gdk_window_process_all_updates() that backends could chain to, but
I'm not quite sure how maintenance of the list of dirty windows
would work if the backend has overridden invalidate_region() and
process_updates()

> +      (* GDK_PAINTABLE_GET_IFACE (private->impl)->begin_paint_region) ((GdkPaintable *)private->impl, region);

Nit - can simply write:

         GDK_PAINTABLE_GET_IFACE (private->impl)->begin_paint_region ((GdkPaintable *)private->impl, region);

And we normally do this - there is no reason for the extra dereference
clutter. Also, the style is generally to write the cast here as GDK_PAINTABLE() - 
the cast checks aren't compiled in in production code.

Regards,
						Owen





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