wrlib: add image flip functions

This patch adds RVerticalFlipImage and RHorizontalFlipImage functions.
util/wmiv: correct errors and warnings

This patch is correcting all errors and almost all warnings reported
by checkpatch.
wrlib: RRotateImage function not fully implemented

when the rotation angle value passed to RRotateImage is a modulo of 90,
the function is working well but in other cases the rotateImage()
function is called. That last function is half implemented but
the half already implemented part is also segfaulting (use the testrot.c
to replay the crash).
So the patch is moving the 'not implemented' msg to disable the whole
rotateImage() function and comment it out.
wmaker: raise shaded window when alt tabbing

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
wmaker: alt-tab to shaded windows when "SwitchPanelImages = None" is set

Reported-by: Josip Deanovic <djosip+news@linuxpages.net>
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
wrlib: fixed transformation functions

With a set of images i was able to detect that
the flip functions was shifting the image by 1px.

The 90 and 270 degrees rotation were not working as
the functions were also mirroring the img.

The patch is also fixing the C style based on checkpatch.
wmgenmenu: Do not force command line options upon everybody

There are other ways to obtain the same result, e.g. setting the
options in ~/mrxvtrc.
WINGs: fix duplicate if/else branch in W_LookupString

cppcheck is reporting the msg below:

[../WINGs/winputmethod.c:215] -> [../WINGs/winputmethod.c:209]:
(style) Found duplicate branches for 'if' and 'else'.

The patch is fixing it by setting a default return call.
WPrefs: make fall-back value look like a fall-back value in Texture Panel (Coverity #50031)

As pointed by Coverity, the return value of 'sscanf' is not checked, which
may not be a problem because the fall-back value for 'i' is provided before.

However, if sscanf fails there is no guarantee that all implementation would
leave 'i' untouched in case of parsing error, and for convenience it is more
logical to write the code is such a way that the value assignment looks like
the fall-back value it is.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix NULL pointer dereference in the Pixmap/Icon path panel (Coverity #50073 + #50150)

As pointed by Coverity, it is possible to dereference the NULL pointer in
the function 'browseForFile'.
This should have been reported by the compiler ("possible use of
uninitialised variable") but the assignation of a default value to the
variable 'lPtr' hides this, but as the default value is not a good one then
the code could crash.
This patch removes the default value, so we may have some info from the
compiler and handles the case smoothly.

It also fixes a potential memory leak pointed also by Coverity in the
case where the string returned by WMGetFilePanelFileName would be a 0
length non-null string.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)

As pointed by Coverity, there is a possible NULL pointer dereference in the
code that extracts the selected modifier (from a popup button list).

The code assumes that there is always a space between the core name of the
modifier (which is used for saving) and the more user friendly name. This
is true if the list could be successfully generated in fillModifierPopUp,
but it may not be the case if that function has to fall-back to the
default list (XGetModifierMaping failure).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak in buildPLFromMenu (Coverity #50105)

As pointed by Coverity, the PLArray that is created to store the return
value of the function 'processData' can be left allocated if some case
handling decide to return NULL instead.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak in loadRImage (Coverity #50107)

As pointed by Coverity, if there is a problem when reading the binary data
of an RImage from a file, the area allocated to store it would not be
freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak when editing the label of a menu (Coverity #50130)

As pointed by Coverity, the function 'WMGetTextFieldText' already allocates
memory for its return string, so it is not necessary to wstrdup it.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak when saving settings (Coverity #50140 + #50157 + #50159)

As pointed by Coverity, the string returned by 'WMGetTextFieldText' is
allocated dynamically, so it must be freed when not needed anymore.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak when editing a delay for the dock (Coverity #50156)

As reported by Coverity, the return string of WMGetTextFieldText is
malloced so it needs to be freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix memory leak when saving window handling settings (Coverity #50158)

As pointed by Coverity, the functions WMCreatePLString return a newly
allocated WMPropList, which must be released when not needed anymore.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: fix NULL pointer handling when getting the Modifiers (Coverity #50200)

As pointed by Coverity, the allocated value returned by XGetModifierMapping
is assumed to be non-NULL everywhere except when releasing it.
Removed this last check (useless) and added a little check at the beginning
to avoid an (improbable) crash.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WPrefs: add warning when renderTexture encounters some unknow settings

Having the warning displayed will help devs to understand what is going
on and where to look at for a fix.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
util/wmiv: add image auto orientation detection

Based on libexif feature, this patch is adding orientation
detection and provides 2 more shortcuts for live
right/left rotation. Internal version was bumped to 0.7.