Re: 3.0 refactoring issues



On Sat, 2010-10-09 at 13:18 -0400, Matthias Clasen wrote:
> On Sat, Oct 9, 2010 at 2:56 AM, Tristan Van Berkom
[...]
> > And... please, please... if removing the expose completely
> > is acceptable... can we then go ahead and remove ->size_request()
> > as well ?
> 
> That is a fair question, I'd say, and we should consider it. One
> question is how straightforward the conversion is.

The conversion is as simple as:

  a.) If you care about writing clean code, you break the request into
      two separate APIs get_preferred_width & get_preferred_height

  b.) If you are in a hurry, you take your old size_request() vfunc
      and invoke it for both calls to 
      get_preferred_width() & get_preferred_height()

Option 'a' has the advantage of not calling the size_request twice
and running a few extra calculations during requests (which is what
happens now anyway for widgets that are not yet converted; ever since 
we removed the ->requisition cache).

All in all I'd say, much more straightforward than converting old 
expose functions to use new cairo drawing APIs.

Cheers,
    -Tristan

PS: Sorry if my mail sounded over-dramatic.

I did find gdk_window_set_background_pattern() which 
led me to cairo_pattern_create_for_surface()... however
it was not clear to me from the cairo API docs if
cairo_pattern_create_for_surface() was going to:

  a.) create a pattern from the surface (which would
      in my case be created from a pixbuf)

or

  b.) create a pattern that is safe to use while
      painting to the said surface it was created for

Even looking at the cairo docs again right now, it looks
to me that the pattern is created *for* use with the 
surface and not *from* the image data in the said surface.




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