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

3609 Commits

Author SHA1 Message Date
Amadeusz Sławiński
2cb3119e08 WPrefs: Value stored to 'timage' is never read
three times in a row

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-18 23:00:15 +01:00
Doug Torrance
4b744d517b add util/wmiv to .gitignore 2014-05-18 23:00:15 +01:00
Doug Torrance
96c9ec185a WPrefs: fix segfault when image not found
Previously, when an image could not be loaded by WPrefs when rendering textures
for the Appearances panel, a segfault would occur.  This could happen, e.g., if
a user moved or deleted an image file without editing their ~/GNUstep/Defaults/
WindowMaker file.

This patch first checks if a texture contains an image, and if it does, it
checks to see if that image can be loaded.  If it can't, a solid black texture
is loaded instead.

The patch also has the added benefit of combining some of the code used for
rendering both pixmap and textured gradient textures.
2014-05-18 23:00:15 +01:00
Amadeusz Sławiński
3b71662011 WINGs: actually assign variable
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
c1031965e9 WINGs: Value stored to 'pos'|'_w'|'done' is never read
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
f41880cf05 WINGs: Value stored to 'scroll' is never read
it is assigned after doing switch() {}
so values assigned in switch() are dropped anyway

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
b857bafc88 WINGs: Called function pointer is null (null dereference)
make sure that we have function to call

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
fb4cd10519 wrlib: wrong type in sizeof
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
7b413ff07f wrlib: wrong type in sizeof
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Amadeusz Sławiński
56772f792c wrlib: potentially incorrect sizeof in malloc
Result of 'malloc' is converted to a pointer of type 'unsigned char',
which is incompatible with sizeof operand type 'char'

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:48 +01:00
Christophe CURIS
bb7d9b48bd wmlib: remove wrong free highlighted by commit 65dc99d805
It is really unlikely that the free(menu) was the correct thing, it is more
likely that it was a typo instead of the appropriate 'free(menu)':
It would be excessive behaviour to free the complete menu only because an
entry cannot be added, and even if it were the case that would not be the
right way to do it because it would leak all the entries already allocated
for it.
(This fixes Coverity #50154 and #50155)

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-17 15:59:47 +01:00
Amadeusz Sławiński
ff1e6f8273 wmlib: Potential leak of memory pointed to by 'entry'
two similar ones, if we return then free allocated memory

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:47 +01:00
Amadeusz Sławiński
3187f95278 wrlib: Potential leak of memory pointed to by 'tmpp'
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-17 15:59:47 +01:00
David Maciejak
7783c2258b clean wDockFindFreeSlot function
it appears that a sx var is set but not used
2014-05-17 15:59:47 +01:00
David Maciejak
0c151a55f4 util/wmiv: an image viewer using wrlib
This patch brings wmiv, a fast image viewer using wrlib.
2014-05-17 15:59:47 +01:00
Doug Torrance
66556c421d WPrefs: Set workspace background
This patch enables users to set the workspace background (WorkspaceBack) in the
Appearance Preferences section of WPrefs.  It appears as a new item in the
popup menu in the Texture tab, in the list of textures below, and a preview
appears in the background of the preview panel on the left.
2014-05-17 15:59:47 +01:00
Doug Torrance
a325624b4a WINGs: Option for decimal or hexadecimal RGB colors
The RGB panel of the WINGs color panel lists the red, green, and blue values as
base 10 numbers.  However, hexadecimal numbers are very common when dealing with
RGB colors.  This patch adds two radio buttons at the bottom of the RGB panel
to allow users to choose their preferred number system.

For version 2 of the patch:

Based on Cristophe's suggestions regarding the new decimal/hexadecimal RGB color
feature introduced in commit 83d8ad6, this patch changes rgbState from an int
to an enum, converts some if statements to switches, and changes from atoi to
strtol for the base 10 string conversion.

In addition, the "hexadecimal" text was too wide for the default size of its
radio button for some fonts, so both radio buttons are now resized to fit the
width of the panel.
2014-05-17 15:59:47 +01:00
Doug Torrance
d9b15a2311 WPrefs: WINGs font configuration
This patch allows users to edit the two fonts (SystemFont and BoldSystemFont)
used in WINGs widgets using WPrefs.  Note that changes will not take effect for
WINGs applications which are currently running.
2014-05-17 15:59:47 +01:00
Doug Torrance
0a30d42eaa Restore wprogressindicator.c declarations to WINGs/WINGs.h
In commit b4cb488, wprogressindicator.c was removed.  It was restored in commit
d435ea7, but the corresponding declarations in WINGs/WINGs.h were not.  This
patch fixes this oversight.
2014-05-11 22:06:14 +01:00
David Maciejak
8708b62cea wrlib: add a function to draw rectangles
it appears that such kind of function was missing from the lib
2014-05-11 15:47:39 +01:00
Doug Torrance
b764a766bf Add keyboard shortcut to run application.
A common feature in several desktop environments is the ability to bring up
a "run application" dialog via a keyboard shortcut (frequently Mod1+F2).  This
feature has been available to Window Maker users only through the root menu.

This patch adds the ability for a user to set up a keyboard shortcut to
accomplish this, either via WPrefs or by editing ~/GNUstep/Defaults/WindowMaker,
e.g., with
 RunKey = "Mod1+F2";

Code from the execCommand function in rootmenu.c has been copied almost directly
into the handleKeyPress function in misc.c to accomplish this.
2014-05-10 10:01:51 +01:00
Christophe CURIS
ab348c6dc8 Add attribute 'noreturn' to a few functions pointed by clang
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:44:38 +01:00
Christophe CURIS
7caadb48de WPrefs: Updated translation source strings against source code
Some strings have been changed in the source code, this patch is updating
the corresponding 'msgid' in the 'po' files so that the translated words
will be found, and will not be lost in case of an automatic update on the
file.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:44:38 +01:00
Christophe CURIS
d6dc62649b WPrefs: Make Opaque Move/Resize less cramped in the Window Handling panel
The icons were too tightly packed into their buttons and were not even
fully displayed, and the label of the checkbox could be split on 2 lines
unnecessarily.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:44:38 +01:00
Christophe CURIS
9f8363dc14 WMaker: rationalised the use of flags for window icons in the switchpanel
The flags were stored as 'char' but it is more logical to use int which is
"the natural size for integer on the host" and may help future evolution
if new flags are added;

The array is created with an initial size consistent with the number of
element we feed it with in 'makeWindowFlagsArray', this avoids a bunch
of realloc;

Fixed the type conversion that was not right, as pointed by clang.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:44:38 +01:00
Christophe CURIS
51ad8b7dc1 WINGs: Removed checks for code that can't fail
In the function 'wdefaultspathfordomain' there was a check to make sure the
generated path would fit in the allocated area, but this allocated area is
sized precisely to fit the path, so it cannot fail.

In the function 'getCurrentFileName' there were checks to make sure the
generated result string would fit in the allocated area, but this allocated
area is sized precisely to fit the path, so it cannot fail.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:42:34 +01:00
Christophe CURIS
546c148ac0 WINGs: safer cleanup in the 'WMReleaseApplication' function
The function would not behave correctly if called twice, and the
library may re-use de-allocated pointers if calling WINGs functions
after calling this function.

The goal is for our library to behave as cleanly as possible, so
that users may have a clearer hint in case of misuse on their side
to debug the problem.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:42:34 +01:00
Christophe CURIS
9ee94f8777 WINGs: removed unused variable in syslog messaging code
As pointed by the commpiler, the variable 'syslog_prefix' is not used
in the code, so it is removed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:42:34 +01:00
Christophe CURIS
f5167ae12d WUtil: Aligned msgid for error message translations against latest code
Due to some old and recent patches, the msgid used for translating the
error messages were not in line with the source code, now they are.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:42:34 +01:00
Christophe CURIS
a2328d9842 WINGs: Fix crash on exit while trying to save user config changes
Recent patches has introduced the ability to exit cleanly from the WINGs
library, but this introduced some side effects because a function is
registered with 'atexit' to save user config on exit, which may not work
anymore because WMReleaseApplication frees some stuff needed for that task.

This patch handles this so that both method works, in case user of the lib
would forget to call the clean exit function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 09:47:42 +01:00
David Maciejak
1b2e8a6491 wrlib: Added clean-up of library internals in 'RShutdown'
The library uses internally a cache of tables to convert image to different
depths, there is now an internal function 'r_destroy_conversion_tables' to
free them.
2014-05-09 01:11:31 +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
David Maciejak
283286e0cd wrlib: Implemented functions to allow clean-up of Contexts
The function 'RDestroyContext' have been defined in the API for a long time
but did not have an implementation, this patch fixes it.
2014-05-09 01:11:30 +01:00
David Maciejak
64e4019614 wmaker: minor improvements to labels in the info panel
The goal is to make them shorter/more correct
2014-05-08 20:14:22 +01:00
Christophe CURIS
2eaac2a5d7 wrlib: add detection for ImageMagick using pkg-config
We rely on pkg-config first, because that is the traditional way to
query configs and because that's how the MagickWand API suggests to do.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
f1a36b4c07 wrlib: do not initialize/release ImageMagick unnecessarily
Instead of calling 'MagickWandGenesis' every time an image is loaded, only
call it the first time, and similarly do not call 'MagickWandTerminus' if
the library has not been used before.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +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
Christophe CURIS
8e0ec489a8 wrlib: changed the function used to detecting MagickWand
It looks like that the function 'MagickGetImagePixels' is part of
the "deprecate.h" header, at least in ImageMagick 6.8.8. As it is not
used in WRaster's code, it is safer to actually check for 'NewMagickWand'
that is being used and which is not yet deprecated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
698cffacc5 wrlib: grouped the detection of ImageMagick in the CHECK_MAGICK macro
Took the opportunity to expand the WM_LIB_CHECK macro because it is not
suited for the case where compilation flags can be queried but was meant
for the case when they have to be guessed

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:22 +01:00
Christophe CURIS
9a0c3ab737 wrlib: light changes to the code for ImageMagick
- changed header used for MagickWand to the one specified in the online
documentation

- changed a comparison to 'MagickTrue' because its value does not allow a
compiler optimisation that would be expected in present case

- fixed potential crash, if loading with Magick fails it could return a
pointer to a de-allocated area

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:14:21 +01:00
Christophe CURIS
f17ec34cce wrlib: fixed compilation to use the flags detected by configure for MagickWand
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-08 20:13:17 +01:00
Christophe CURIS
79bad0d14c wrlib: renamed compilation flags variables with a name less prone to clash 2014-05-08 20:13:17 +01:00
Christophe CURIS
c3139e9d0c wrlib: fixed prototype for 'RShutdown' in the public API header
Took opportunity to move it closer to the beginning of the file to improve
its visibility to users of the lib
2014-05-08 20:13:17 +01:00
Doug Torrance
177fb22126 Debian: Added wrlib.pc to libwraster3-dev package.
In order for users to use pkg-config to compile programs using libwraster,
wrlib.pc should be installed in /usr/lib/pkgconfig, which had not been
happening.  This patch fixes this issue.
2014-05-03 23:24:37 +01:00
Doug Torrance
139382380f Added missing files to distribution tarball.
A number of files have been added to the Window Maker source tree but are not
included in the tarball produced by "make dist" because they have not been added
to EXTRA_DIST in the appropriate Makefile.am.  They are:
- Dutch translation files (commit afc90)
- email-clients.txt (commit 385db)
- WPrefs source files removed from WPrefs_SOURCES (commit 21dfd)

This patch adds these missing files.
2014-05-03 23:24:37 +01:00
Christophe CURIS
9ad35c440f wmaker: Updated Armenian translation against changes in Info Panel
Only the 'msgid' was updated, to make sure gettext can still find
the old translation, but I am not fluent in Armenian and google
translate is not helpful here, so I can't do better for the
translated string.
2014-04-29 10:43:49 +01:00
Christophe CURIS
bcc85e51c6 wmaker: Updated Dutch translation against changes in Info Panel
Only the 'msgid' was updated, to make sure gettext can still find
the old translation, but I am not fluent in Dutch so I can't do
better for the translated string.
2014-04-29 10:43:37 +01:00
Christophe CURIS
f2201f45cf wmaker: update translations following string changes from previous commit
The 'msgid' were updated to ensure gettext will find them, and the
translation have been updated too to stay in line with the message
(within the limits of google translate's help, because I don't speak all
these languages).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-04-29 10:43:17 +01:00
Christophe CURIS
ed072cd578 wrlib: revert addition of an internal ImgFormat for ImageMagick
IM_MAGICK is not a file format, and in the current implementation it is
a special case for handling IM_UNKNOWN.
2014-04-29 10:15:27 +01:00
Doug Torrance
058e0a0ebd Added pkg-config file for WUtil.
Currently, there is no WUtil.pc file so that WINGs developers can use
pkg-config to compile programs using the WINGs utility library.  This patch
fixes this, and such a file is created by make, just like WINGs.pc and
wrlib.pc.

In addition, the WUtil.pc file has been added to .gitignore and included in
the debian libwings-dev package.
2014-04-29 10:15:27 +01:00