[compiz] Annotate, guiding line patches with questions

David Reveman davidr at novell.com
Wed Jan 3 10:21:19 PST 2007


On Wed, 2007-01-03 at 02:30 +0000, Mike Dransfield wrote:
> Attached are my first draft for annotate to add the
> guiding lines.

I see that you're using OpenGL geometry for drawing the guiding lines.
That's good enough for now but eventually I think we want the guiding
lines to match the final geometry rendered by cairo. This can easily be
done using glitz.

> 
> I have added them for line, circle and rectangle
> so far.
> 
> I have also added an action to quickly change the tool.
> 
> I have some questions about them.
> 
> 1) I used an enum for the tool type but if it is
> changed by the tool_next action then it does not 
> update in the settings, Is there an easy way to
> do this other than a couple of conversion functions?
> Does this look like the best way to avoid all the
> sring comparisons?

hm.. looks like you should add "Brush", "Rectangle" and those strings to
the restrictions for ANNO_DISPLAY_OPTION_TOOL option and NextTool,
PrevTool action functions should update the ANNO_DISPLAY_OPTION_TOOL
option instead of changing currentTool directly.

> 
> 2) It seems like adding text with cairo/opengl would
> lead to lots of headaches, limitations and bloat.
> My idea is that a seperate helper app could be written
> which could provide a palette as well as text entering
> functionality.  I could add an extra action to launch 
> it, and it could launch the app via dbus to enter text.
> Does this sound like a good idea?

I'm not sure. How advanced does the text need to be in the annotate
plugin? If the toy text API in cairo is good enough, then using it to
render text would be very easy.

> 
> 3) In the annoHandleMotionEvent I have added a
> damageScreen call.  I suspect this should be
> damageScreenRegion but in the case of the rectangle
> is there much benefit in damaging 4 small rectangles 
> rather than the whole thing?

Yes, that should be damageScreenRegion instead. I think it might be
worth doing 4 small rectangles instead of a large one.

> 
> I still need to add onscreen feedback when the tool
> changes and I want to add SVG and different line 
> endings and tidy things up a bit.  Does everything 
> look OK so far?

Sure.

-David




More information about the compiz mailing list