[Cairo] mouse pointer and cairo

Thomas Hunger info at teh-web.de
Tue Oct 14 02:04:43 PDT 2003

> I don't think so. What I am trying to avoid is that in OpenGL you typically
> have to make an array of pointers to all the objects so you can easily turn
> their index numbers back into objects. If the index numbers were guaranteed
> to be large enough to hold a void* this would not be needed.

while I like the idea very much I wonder where I could plug into the cairo 
source? I think I'd need to use the set_target_surface function and use some 
new cairo_surface_backend which records drawing onto the surface. But then 
font-intersection would not be handled.

> This is needed for points and lines, in case two objects are inside the hit
> area, to try to get a better guess which one the user hit.

You mention objects. There would (the array in opengl) need to be some way to 
map between points and lines in the cairo_r and the application if you want 
the surface to "collect" intersecting objects. I think a better way would be 
to move the object model to a higher level and not have it in cairo, that 
means every time a user-distinguishable object is drawn, the programm calls 
stoke or fill, then test if intersection was true or not for this single 
operation. So each stroke(fill) operation would be on user-object.


More information about the cairo mailing list