1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00
Commit Graph

31 Commits

Author SHA1 Message Date
Christophe CURIS
19202fd2db WRaster: Create header for i18n helper functions
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>
2021-05-18 17:49:17 +01:00
Christophe CURIS
ba8cd2abe4 Handle NULL pointer as good as possible (Coverity #50099)
As pointed by Coverity, in the "Configuration" panel of WPrefs there are
some images loaded, but if the images cannot be loaded correctly then the
returned NULL pointer can crash the application as it is dereferenced in
further function calls.

To solve this case, this patch is adding a NULL pointer check in the
functions RScaleImage (wrlib) and WMCreatePixmapFromRImage (WINGs), so both
can accept that NULL pointer to also return NULL, which means the existing
check for "icon == NULL" in the WPrefs code will be useful.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2015-04-25 07:53:06 -04:00
Christophe CURIS
4799df5506 replaced all local definitions of PI by a single one
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>
2014-12-10 10:19:19 +00:00
Christophe CURIS
eb3f0b12f8 wrlib: add explicit type definition in API to allow compiler Type Checks (1/3)
When defining enums as types instead of simple enums allows to use these
types at the places where the corresponding enum values are expected, then
allowing the compiler to check that, potentially reporting incorrect use
of values to the user.

This patch adds types for the configuration fields in the RContextAttributes
structure.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
Christophe CURIS
96a6e4da1e wrlib: new headers to contain definition of internal stuff
Using local function prototype redefinition is dangerous, now a single
prototype is seen in all the files that are concerned.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
Christophe CURIS
8ef38e9910 WRaster: Changed equality/inequality comparison on floating point number
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.
2013-05-11 00:17:27 +01:00
Andreas Bierfert
085224973a Fix incorrect FSF address 2013-01-07 21:19:40 +00:00
Christophe CURIS
806784e194 Fixed wrong count to release temporary memory
As found by Rodolfo, it looks like there could be memory leak in the
function 'RSmoothScaleImage' because it reserveda given number of
memory blocs but used another count to free them after use.

This patch uses the same count for release as it seems this variable
is not modified in between. Took the opportunity as Rodolfo proposed
to convert a global variable to a local variable - this global
definition seems incorrect.
2012-11-15 12:38:25 +00:00
Brad Jorsch
5eebb8bc3c Fix some warnings
Non-obvious fixes:

WINGs/wfilepanel.c: Cast to void to avoid an unused calculated value
warning.

WINGs/wtabview.c: Test tab<0 to avoid a warning from the next condition
about signed overflow in an inlined invocation of the function.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-08 22:00:23 +02:00
Tamas TEVESZ
28cbda550a Remove dead code from wrlib 2010-03-26 21:08:17 +01:00
Martin Frydl
1f3adb0ea5 Patch for WINGs buffer overflow
I've found a buffer overflow problem in RSmoothScaleImage. There are
some scaling calculations involving floats which are finally converted
to integers. Since such conversion does not round the number, just
truncates the decimal part, sometimes the number is smaller than it
should be. As a result, smaller buffer is allocated for picture
scaling and thus buffer overflow occurs.

Strange thing is that this bug has not appeared earlier so it probably
has something to do with newer gcc or glibc (I switch from
"prehistoric" Fedora Core 5 to Fedora 12).

<What about the symptoms?>

There were several ones, probably depending on application version and
compilation flags. First, it just stopped responding. Looking at the
process with strace I saw it locked in some FUTEX wait (unfortunately
I don't have the logs). Second, it just crashed. And last I got
complaint from glibc about double free or corrupted heap before
malloc. I've found the bug through wmweather+ dockapp, versions 2.9
and 2.11 (http://sourceforge.net/projects/wmweatherplus/), I've never
encountered it in WindowMaker itself.
2010-02-26 13:15:18 +01:00
Nicolas Bonifas
ad853b386e Removed unused version of RScaleImage() in wrlib/scale.c
... as the "broken_code" preprocessor symbol appears nowhere else.
2010-02-26 13:08:42 +01:00
Tamas TEVESZ
9af6316d1d k&r->ansi some stuff
ansify and "fix" function pointer declarations
2009-08-29 21:49:22 +02:00
Carlos R. Mafra
688a56e8ab Change to the linux kernel coding style
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 :-)
2009-08-20 00:59:40 +02:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +00:00
dan
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan
cab71ba6a1 - Fixed text in info panel for multibyte (Seiichi SATO <ssato@sh.rim.or.jp>)
- 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
2002-01-04 07:32:37 +00:00
dan
36e46831e0 For libwraster:
---------------

- 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.
2001-04-21 07:12:21 +00:00
dan
648d75c299 - put back wmksize(), wmkrange() and wmkpoint() as functions instead of macros
- fixed some compilation warnings with -Wall
- some code cleanup
2001-04-19 01:04:48 +00:00
dan
c720860ed3 Fixed crashes in 24 and 32bpp after introduction of hermeslib support 2001-02-26 00:43:44 +00:00
kojima
a0ebed9cb2 *** empty log message *** 2000-02-16 18:22:46 +00:00
dan
b7296cff16 Fixed a bug in scaling code. 2000-01-15 22:11:18 +00:00
kojima
f316df83c9 #ifdefe'd #include bench,h 2000-01-14 23:48:13 +00:00
kojima
a30475fc0f changed format of RImage, added x86 speicfic optimized code 2000-01-14 16:39:15 +00:00
kojima
5e4625dafe many bug fixes, finished some delegate code, updated menu file bug from EXEC
to SHEXEC, updated french translations
1999-05-29 21:41:25 +00:00
dan
99e67c8ed0 Small bug fix, and updated for some #defines that were removed. 1999-04-30 02:36:33 +00:00
kojima
8f68cfd8cd bug fixes, performance enhancement for image rendering 1999-04-29 23:05:16 +00:00
kojima
e50b7e9ca9 bug fix in wbutton.c, made mouse pointer go invisible when typing in
textfield, added option to Smooth workspaceBack
1999-04-28 23:50:52 +00:00
kojima
aac9a006d0 smoothed scaling 1999-04-28 20:37:39 +00:00
kojima
bc0b869ba9 fixed bug in texture panel 1999-04-19 00:27:47 +00:00
scottc
9d2e6ef9f1 Initial revision 1998-09-29 22:36:29 +00:00