On Thu, 16 Feb 2012, Rodolfo García Peñas wrote:
The function setDoubleClick has an extern that don't needs and comments
about the function. Because the variable
WINGsConfiguration.doubleClickDelay can be accesed without problems, we
can remove the externs. About the comments, in the file window.c, we can
find
event->xbutton.button == WINGsConfiguration.mouseWheelUp
accessing directly to the configuration structure.
We can add some functions like setConfiguration, getConfiguration to
WINGs, but is not needed.
If the P in WINGsP.h stands for Private then no files outside of WINGs
should include it. If WINGsConfiguration is an internal structure of WINGs
then only accessor methods should be used outside of WINGs. (On the other
hand if it's intended to be made public then it should have been declared
in WINGs.h.)
Of course it also works if you just include the WINGsP.h and access the
structure directly but it breaks the intended separation between WINGs and
Window Maker code. WPrefs also uses this variable in MouseSettings.c and
double.c so adding accessor methods is probably the cleaner way to solve
this.
About mouseWheelUp/mouseWheelDown, they are only used in window.c in
Window Maker but since it is only defined in WINGs they should not be
accessed directly either. Also there seems to be no way of setting these
configuration items other than editing the config file, so most probably
they are set to Button4/Button5 anyway. The other buttons are not
configurable and are hard coded as Button1/2/3 (but their actions can be
set elsewhere). One soulution might be to just remove these configuration
items and hard code mouse wheel to be Button4 and Button5 or maybe change
them to be a compile time option via a #define instead.
Regards,
BALATON Zoltan