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

33 Commits

Author SHA1 Message Date
Christophe CURIS
e5f7ef23a6 WRaster: Made a few messages translatable
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
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
f2cd2c9f03 WRaster: Properly set file's mtime in the cache when loading an image
The library maintains a cache to not reload a file that was previously
loaded. In order to still reload an image in case its file would have
changed in the meantime, the cache saves the file's modification time.

As reported by Coverity (CID #331576) the 'stat' function was not on the
execution path the first time an image is loaded, which means the cache
information is populated with junk data. This could lead to an image not
being reloaded for example.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2021-05-18 17:49:17 +01:00
Christophe CURIS
907dd97e45 wrlib: added a limit to the image cache size (Coverity #50223)
As pointed by Coverity, environment variables cannot be considered
trustworthy ("tainted"), so we need to make sure the values provided are
within reasonable bounds for safe operations.

Seized the opportunity to try to provide clearer name for the constants
defining the default value.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
Christophe CURIS
6623c27f4e wrlib: removed macro RETRY that does not does what is expected (Coverity #50160)
As pointed by Coverity, the behaviour of fopen/fread/fclose in case of
error is not really what the macro RETRY assumes. So the macro is removed
and appropriate action is implemented.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
David Maciejak
cb5076794a wrlib: load.c clean coding style
just some code cleaning stuff.
2014-06-15 19:45:20 +01:00
David Maciejak
e237ec15a0 wrlib: Added clean-up of image cache in 'RShutdown'
The library maintains a cache of the images loaded, which is now
emptyed when the lib is asked to shutdown.
2014-05-09 01:11:30 +01:00
Christophe CURIS
ebe7673bf6 wrlib: moved 'RShutdown' from 'load.c' to 'misc.c' for consistency
The cleanup function is actually not specific to loading images and could
do a lot more, so it is probably better placed in 'misc.c'
2014-05-08 20:14:22 +01:00
David Maciejak
bb69682b88 wrlib: added support for imagemagick third-party lib
It uses to provide some missing common image format
like SVG, BMP, PICT, ...
2014-04-29 10:15:27 +01:00
David Maciejak
050cae3bd2 wrlib: Added support for webp image
This patch is adding support for google webp image format, if you
don't know it a quick recap is to say that according to their tests
they claim it is better than png and jpeg.

Follow the link below for some more details:
https://developers.google.com/speed/webp/

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:51 +01:00
Christophe CURIS
8b73356c4f wrlib: Improved file format detection
- remove header not needed anymore
- revert change for XPM to stay in line with the standard
- changed PNG to stuck to the standard
- increased GIF to the complete signature

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:51 +01:00
David Maciejak
92b803bbdf wrlib: Improved file format detection
load.c is used to identify the file format, I rebased some checks on
what is defined in the spec of the format.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:51 +01:00
Christophe CURIS
34ca63c59f wrlib: Improved NETPBM support
- re-add PPM to the list of supported format, because legacy apps may
expect to find it from the list;

- add the copyright notice related to the code that have been borrowed
from Netpbm;

- fixed a small error in PPM format check in the loading procedure;

- and a few minor code improvements

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:50 +01:00
David Maciejak
5c96c69cb5 wrlib: Improved NETPBM support, file format detection
1) according to that checks i was able to see that some netpbm support
   type are missing (exactly: ascii graymap (PGM files) and pixmap (PPM)
   and ascii/binary bitmap (PBM))

See the link below for more details.
http://en.wikipedia.org/wiki/Netpbm_format

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2014-04-24 10:56:50 +01:00
Rodolfo García Peñas (kix)
82aea844d0 Removed context argument in jpeg files
The context argumetn is now not used, so can be removed.
2013-09-05 22:44:36 +01:00
Christophe CURIS
a622197faa Added explicit 'void' to function that takes no argument
This is the correct way to tell that a function takes no
arguments, because an empty parameter list tells the compiler
that it is not yet defined, and is tolerated only for
compatibility with very old C compilers for whom prototypes
were not yet a defined language element.
2013-05-12 01:01:20 +01:00
Christophe CURIS
d1e1c13fa3 Added 'const' attribute to the file name parameter to load/save
This name is not modified by the callee functions (and it should
not be anyway), so let's make it official in the internal functions
2013-05-02 20:48:45 +01:00
Christophe CURIS
225c99a6ca Converted #define into an Enum for image format number
An enum is always a better idea as it allows the compiler to do
some checks, and as this info is internal only to the WRLib it
will not change the API.
2013-05-02 20:48:45 +01:00
Christophe CURIS
883cda48e3 Moved declaration of format-specific image Load functions to dedicated header
The functions are declared in different files but they were called
in another file which re-declared the prototypes. This is dangerous
as it can lead to misaligned prototypes when functions changes.

They are now grouped in the library internal header 'imgformat.h'
2013-05-02 20:48:45 +01:00
Andreas Bierfert
085224973a Fix incorrect FSF address 2013-01-07 21:19:40 +00:00
Tamas TEVESZ
241e66ff0a Tidy
- Kill unused vars in wrlib
- Add missing initializers to defaults.c:staticOptionList
- Re-format it slightly
- Kill some dead code
- Kill stupid "if (const op var)"
2010-04-08 15:53:50 +02:00
Tamas TEVESZ
7b9b7de172 Fix png 1.4+ builds
- png_check_sig was removed from png 1.4, use replacement fun, which is
  already present in 1.2.0 (cca. 2001)
2010-03-29 21:18:37 +02:00
Tamas TEVESZ
71aa4f2884 Switch file ops to stdio
- Does away with the O_BINARY abomination
- as a byproduct, plugs an fd leak in wcolorpanel.c:fetchFile()
- sprinkle some fsync()s to files that have been written to (this
  needs to be done everywhere)

+ fix brown paper bag thinko in configure.ac
2010-03-27 10:31:13 +01: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
92b012e800 patch to add binary mode on opening files (for Windows+Cygwin compatibility). 2002-09-15 20:37:41 +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
088c0ac230 Update for 0.51.2-pre2 1999-03-09 14:58:01 +00:00
dan
e7495baff7 0.51.1 pre snapshot. Be careful, it may be buggy. It fixes some bugs though. 1999-02-17 11:06:40 +00:00
dan
9af1c6c415 Updating to version 0.20.2
Many bug fixes.
1998-10-21 14:43:47 +00:00
scottc
9d2e6ef9f1 Initial revision 1998-09-29 22:36:29 +00:00