<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font size="+1">Hi Luca,<br>
<br>
Nice to see some new Compiz code here. :)<br>
The rulers are a good idea and a useful, nice addition to Compiz'
mouse-related capabilities.<br>
<br>
You should be rewarded with a review.<br>
<br>
Regarding your question about putting this functionality into a
new plugin:<br>
<br>
After all it fits into Showmouse as it does exactly that, but then
the visual style does not have much in common with the particle-fx
this plugin usually uses and I doubt many people will use both
effects (particles and rulers) at the same time...<br>
I suggest adding shortcuts to be able to toggle the rulers
independently from the particles and to optimize the "wrapped"
paint functions (preparePaint (), glPaintOutput () and donePaint
()) to not do any redundant calculations.<br>
<br>
Regarding your code and possible optimizations:<br>
<br>
You are doing redundant type conversions from float to double,
then back to GLfloat again, drawLine () should use floats/GLfloats
as arguments instead.<br>
<br>
In drawGuides () you are also wasting some CPU as you are ignoring
the types of variables you use - CompRegion () expects ints, while
drawLine () and glLineWidth () (should) expect floats - your
optionGet* () return types are int and mousePos.x ()/.y () also.
You should try to have this method do the least amount of type
conversions.<br>
Also you could save the int return values of screen->width ()
and screen->height () to not have to call them twice in this
one method.<br>
Setting thickness to 20 for damaging is not necessary at all -
simply use the actual int thickness optionGetGuideThickness ()
gives you - do not always damage the maximum paint region, simply
damage the actual paint region instead, which will also improve
performance. Hint: You can use the showrepaint plugin for damage
region visualization and debugging.<br>
You could also check if glIsEnabled (GL_BLEND) and only toggle
blending if it is not activated, as this global state might have
been activated already by some other plugin.<br>
<br>
In preparePaint () you are still calling ps.updateParticles () and
updating the rotation member variable, in donePaint () you are
still damaging/redrawing the particle area, even if there are no
particle emitters.<br>
<br>
Ideas for improvements:<br>
<br>
The rulers should be separated more from the particles, code-wise
and control-wise - triggering rulers should not depend on
triggering the particle emitters.<br>
The rulers could gently fade in/out, not pop in/out like they
currently do - when disabling showmouse with particle emitters
enabled the rulers currently wait for the particles to fully
disappear...<br>
There should be a possibility to configure a maximum length for
the rulers, maybe an option to show them only on the output device
the cursor is on as well - some users might not like the from one
screen end to the other screen's end approach (multimonitor users
for example).<br>
The rulers could optionally be stippled, animated or use some
color-cycling effects, which should of course be configurable.<br>
<br>
As your other questions regarding sourcecode and repos have
already been answered by Stephen and others, I will not reiterate
this.<br>
<br>
I'll take a look at your mouse cursor theme setting plugin soon,
as finally getting this missing core mouse functionality for
Compiz is awesome, but you might want to post a merge request
against lp:compiz [1] so more people will notice your work.<br>
<br>
Greetinx,<br>
<br>
MC Return<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="https://code.launchpad.net/~compiz-team/compiz/0.9.12/+activereviews">https://code.launchpad.net/~compiz-team/compiz/0.9.12/+activereviews</a><br>
</font>
</body>
</html>