This patch is just adding a single header, but because it also modifies
all the C files to add the #include, it was made as a patch on its own to
ease review.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
To preserve the accuracy of the operation, the C standard request that the
mathematical operation is performed using double precision, but in many
case this is not necessary so this patch fixes a few constants to avoid
that conversion.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
For code maintainability, it is better to have a single definition of the
constant than many ones dispatched in many places. In addition, we try to
count on the constant M_PI that can be defined by the header <math.h> if
possible because it may have the best accuracy for the platform.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The function RRotateImage contains code to handle efficiently the 4 simple
angles 0, 90, 180 and 270 degrees, which makes it a long function.
This patch separate the code for the different cases into dedicated
functions so the main function's code ends up being simple (aka: easier to
understand/review/maintain).
As a side effect, the function for the 180 degree function is not static
because it can be reused to flip an image both horizontally and vertically.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
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.
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.
There is a dedicaded floating point modulo operator that does a
better job (faster, no precision loss), so we use it instead of the
complicated formula that uses type conversions.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The equality comparison (a == b) is known to be a dangerous trap
when floating-point arithmetics are involved. This patch changes
all the cases which try to do this to a safer check.
for arq in `git ls-files *.c`; do
echo $arq;
indent -linux -l115 $arq;
done
The different line break at 115 columns is because
I use a widescreen monitor :-)
- Separated the font caches for normal fonts and fontsets in WINGs (they can
have the same names and collide in the cache giving unwanted results)
- Updated the years in the copyright notices
---------------
- Added retain/release mechanism to RImage by adding RRetainImage() and
RReleaseImage(). RDestroyImage() is an alias to RReleaseImage() now, but
will be removed in a future release because it no longer fits with the
semantics. Will be kept for a while to allow a smoother transition.
More about in wrlib/NEWS
For WINGs:
----------
- Small API change:
1. Renamed WMSetApplicationIconImage(), WMGetApplicationIconImage() and
WMSetWindowMiniwindowImage() to respectively WMSetApplicationIconPixmap(),
WMGetApplicationIconPixmap() and WMSetWindowMiniwindowPixmap()
They operate on a WMPixmap which is practically an X Pixmap with no alpha
channel information and the new name is more suggestive and also leaves
room for the new functions added for operating on images with alpha info.
2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
operate on an RImage and store alpha information too.
3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
alpha set by WMSetApplicationIconImage() and will blend it with a color.
If color is NULL it will blend using the default panel color (#aeaaae)
All these changes will allow WINGs to handle images with alpha blending
correctly in panels and wherever else needed. More about in WINGs/NEWS.
- updated panels to use the newly available RImages if present and fallback
to old WMPixmaps if not, to properly show alpha blended images.
- replaced some still left malloc's with wmalloc's.
For Window Maker:
-----------------
- Fixed wrong mapping position of the "Docked Applications Panel" for some
icons.
- Smoother animation for the smiley =)
- Made images with alpha blending be shown correctly in the panels and the
icon chooser.
- The icon image set to be shown in panels ("Logo.WMPanel") will be
automatically updated if its entry in WMWindowAttributes changes (without
a need to restart as until now).
*** Note!!! ***
If you are developing applications with one of libwraster or libWINGs
then you should look to wrlib/NEWS and WINGs/NEWS to see what changed
and how should you update your code.