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

261 Commits

Author SHA1 Message Date
Christophe CURIS
5770e53c50 Fixed a few improper macro usages
Added compiler checks for some improper macro usage and fixed the problems
pointed by gcc.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:13:33 +00:00
Christophe CURIS
23ac316d1e utils: Added a few missing attributes to local variables
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:07 +00:00
Christophe CURIS
e106d88a42 Code refactoring: replaced macro 'XINERAMA' by 'USE_XINERAMA' for consistency
The usual way to define a macro in is to name macro with 'USE_xxx' when
they are used to enable a feature 'xxx'

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:06 +00:00
Christophe CURIS
f8b6871371 util: Added noreturn attribute to appropriate functions
clang is a bit more strict on the attribute usage, so let's comply.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
7491f5479b util: Removed unused procedure that caused a compilation warning
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:05 +00:00
Christophe CURIS
59f5aeeec5 util: Use the macro 'wlengthof' to get the number of element in an array
The new macro 'wlengthof' from WUtil makes code easier to read than the
previous [sizeof() / sizeof([0]) ] construct.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:03 +00:00
Christophe CURIS
452fe4dc89 util: Removed argument that is not used
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:11 -02:00
Christophe CURIS
cd78f11abc util: Marked args as unused for compiler in X Error handlers
When an error occurs in X, the Xlib is using a callback mechanism to
execute application code to handle the problem, which means having a
fixed argument list for that application function.

It is then correct to not use all the arguments, so this patch adds the
appropriate stuff to avoid a false report from compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:10 -02:00
Christophe CURIS
85cef4e2d9 util: Fixed possible off-by-one issue when generating filename
(as reported by LLVM / clang)
2013-10-12 15:57:21 +01:00
Christophe CURIS
549cefc47b util: Added a few missing 'static' attributes for functions 2013-05-12 01:01:20 +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
5d03c455fc util: Added 'const' attribute to function parameters 2013-05-12 01:01:19 +01:00
Christophe CURIS
d44aa97243 util: Created header to define functions that may be used in more that one place
Using local function prototype redefinition is dangerous, now the
prototype is seen in all concerned files.
2013-05-12 01:01:19 +01:00
Christophe CURIS
80a59696e5 Fixed improper variables definition in header file
Some header were creating variable, this is a bad practice which
is likely to not behave as expected. This creates one distinct
variable in each object file that used the header, and:

 - on well behaved compiler, this ends up in a link error (see
commit 39fdb451ba for an example)

 - on bad behaving compiler, this can be linked as multiple local
variable, thus having strange effects when running program

 - on insouciant compiler (who said gcc?) the variables are
silently merged, hiding portability issues
2013-05-11 00:17:27 +01:00
Christophe CURIS
90d24a1648 Unified usage of the 'inline' attribute for functions
Autoconf provides the necessary stuff to detect if inline keyword
is supported, and to detect special syntaxes, so let's use this
and remove the multiple local definitions, this makes code simpler.
2013-05-11 00:17:27 +01:00
Christophe CURIS
7f6699ffca Changed formula for getting the number of elements in a static array
When using the formula [sizeof(array) / sizeof( x )] to get the number
of element in a static array, it is better to use array[0] for 'x'
instead of the base type of array:
 - in case the base type would change someday;
 - if the compiler were deciding to insert padding somewhere
2013-05-11 00:17:27 +01:00
Christophe CURIS
7c320447fb Added missing include guards in a few headers
Considering the number of headers we have, it is a good idea to
avoid possible problems. For details, you may read:
  http://en.wikipedia.org/wiki/Include_guard

All headers should be ok now.
2013-05-10 19:37:47 +01:00
Christophe CURIS
7c98f7cfc4 Added proper legal notice at beginning of header files
Some header were missing the notice; used git blame to find the
original date and author (without guarantee.
2013-05-10 19:37:47 +01:00
Christophe CURIS
e7c2a3dc69 util: removed deprecated file 'directjpeg.c'
The content is not used anywhere, and this is probably mostly due
to the fact that the behaviour is provided by the WRaster library
in a better way.
2013-05-10 19:37:47 +01:00
Christophe CURIS
a18fd7cd69 Fixed const correctness in functions using 'wusergnusteppath'
The change introduced in previous commit for const correctness has
a small impact on WindowMaker's code, this patch fixes all the new
warnings.
2013-05-04 16:25:44 +01:00
Iain Patterson
2affd6d484 Make window border size configurable.
Use the new preference FrameBorderWidth to configure the width of frame
window borders.
2013-03-26 23:19:39 +00:00
Iain Patterson
dee30d06ac Make window border colours configurable.
Use the new preferences FrameBorderColor and FrameSelectedBorderColor to
set the border colour of frame windows and selected frame windows
respectively.
2013-03-26 23:19:39 +00:00
Carlos R. Mafra
a23e42639a wmgenmenu: Add XBMC entry 2013-01-31 01:00:42 +00:00
Andreas Bierfert
085224973a Fix incorrect FSF address 2013-01-07 21:19:40 +00:00
Kamil Rytarowski
0706471a10 Fix build with automake-1.13 and modernize .am files.
The following macro: AM_CONFIG_HEADER is deprecated and replaced with AC_CONFIG_HEADERS. INCLUDES is an old version of AM_CPPLAGS.
2013-01-03 23:27:31 +00:00
Carlos R. Mafra
5795bb5638 wmaker.inst: Remove test for LITE and KDE message
LITE was removed in fe736e849c ("Remove LITE config option"), but
the check for it in wmaker.inst was missed.

Furthermore, remove confusing message about wmaker being configured for KDE.
2012-06-24 23:07:39 +01:00
Alexey I. Froloff
d53b43608a wmmenugen: properly skip NoDispaly entries
Last group from a desktop file is always added to menu regardless of
NoDisplay property.  Properly handle the NoDisplay and Hidden properties
at the end of file.

Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
2012-06-18 23:34:46 +01:00
Amadeusz Sławiński
fc5c0fe1a4 Add fill screen scale to wmsetbg
I noticed that I can have different background with wmmsetbg for each
desktop and wanted to use it, but it was missing option to fill the
screen with proportionally scaled image, so here it is.
2012-06-03 17:02:30 +01:00
Tobias Stoeckmann
cc30444dda No need to call memset after wmalloc
memset is the last function call in wmalloc, just before it returns the
newly allocated memory.  Therefore it is not needed to call it again
after wmalloc call.  Although I would prefer to switch wmalloc to a
calloc-based wcalloc function, the compatibility of WINGs for old apps
should be kept.
2012-05-04 18:41:01 -03:00
Christoph Soehngen
42a78ee73f wmgenmenu: Add more apps to our nice menu 2012-04-02 17:52:14 +01:00
Carlos R. Mafra
99aad55425 wmgenmenu: Fix name for FSViewer 2012-02-27 02:11:14 +00:00
Leandro Vital
e46f2b3e79 wmgenmenu: Add Portuguese translation 2012-02-22 08:11:12 +00:00
Carlos R. Mafra
9e8e4625ab Small update on wmgenmenu list of apps 2012-02-19 14:08:18 +00:00
Rodolfo García Peñas (kix)
f2585dc1f7 utils: Include the SHEXEC in the wm-oldmenu2new script
The script wm-oldmenu2new can now convert the SHEXEC lines.

Requested-by: Doug Barton <dougb@FreeBSD.org>
2012-02-18 15:56:16 +00:00
Carlos R. Mafra
119507d541 wmgenmenu: Update mrxvt options
The old mrxvt I had in my previous distro is gone. The options
need to be updated.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2012-02-12 20:08:33 +00:00
Carlos R. Mafra
3bc2535968 Fix getstyle, again
As reported by Paul Seelig, it used to be the case that

getstyle -t ~/GNUstep/Library/WindowMaker/Themes/somefile

would save the current theme, and all old menus (WMRootMenu) were
relying on this.

The problem was that the following piece (from commit 6bf79945)

	if (style_file && !make_pack)
		print_help(0, 1);

would allow a style_file to be specified and saved to only with the
option -p (which implies make_pack), therefore saving a theme with
-t like the root menu used to do no longer worked.

Now things work fine:

[mafra@Pilar:~]$ ls GNUstep/
Applications/  Apps/  Defaults/  Library/
[mafra@Pilar:~]$ getstyle -t ~/GNUstep/theme
[mafra@Pilar:~]$ ls GNUstep/
Applications/  Apps/  Defaults/  Library/  theme

But also note that trying to save a theme outside of GNUstep/
is not allowed and it prints no error message - perhaps it should...
2012-02-03 01:42:17 +00:00
Carlos R. Mafra
85b4dba721 Revert "getstyle: Remove dead code"
This reverts commit e06b3005e8.
2012-02-02 23:47:54 +00:00
Carlos R. Mafra
e1453087f5 WINGs: Rename copy_file() to wcopy_file()
...in order to avoid clashes that happen during compilation of
wmakerconf.

This is a new function in WINGs, so renaming it at this point is
not a big deal.

Thanks to Rodolfo García for the heads up.
2012-01-31 12:23:54 +00:00
Carlos R. Mafra
e06b3005e8 getstyle: Remove dead code
The statement under "if (style_file)" in the else branch of
"if (make_pack)" will never be executed because getstyle already
prints out a help message and exits before that.

So remove that code.
2012-01-16 00:09:14 +00:00
Carlos R. Mafra
e4d0ea5373 getstyle: Get rid of abortar()
Instead of using a temporary buffer to store a "reason" string
which is later printf()'ed by abortar(), use wwarning() directly
and do the small cleanup done by abortar() on the spot.

As this was the only call site for abortar() it can now be removed.
The resulting object code gets smaller as a side effect.

Thanks to Christophe <christophe.curis@free.fr> for finding a mistake
in the first version of this patch.
2012-01-16 00:09:14 +00:00
Carlos R. Mafra
7e4a3ae57f getstyle: Use new copy_file() from libWUtil and delete copyFile()
Now both getstyle.c and wcolorpanel.c use the same copy_file() function
from libWUtil, and their similar private copies are gone.
2012-01-15 14:33:11 +00:00
Carlos R. Mafra
6bf5f947a9 wmgenmenu: Fix "Save Theme"
Dario Niedermann reported on 27.11.2011:

       Selecting "Save Theme" from WMaker's root menu results in dialog box
       asking for theme name, but then nothing is saved.

       This feature used to work in 0.92.0.

and the reason for it (if he uses a WMRootMenu generated by wmgenmenu) is
the incorrect use of the option "-t" instead of "-p" to getstyle.

Furthermore, let the invocation of getstyle reflect the new default location
for the themes.
2012-01-15 04:12:14 +00:00
Carlos R. Mafra
ac8a493ed9 getstyle: Save theme pack in Themes dir
When invoked as

getstyle -p NewTheme

Instead of saving the theme inside the topdir ~/GNUstep let's save it
insinde their proper directory ~/GNUstep/Library/WindowMaker/Themes.
2012-01-15 04:12:14 +00:00
Carlos R. Mafra
5ef03b2a3a getstyle: Fix output to stdout
There is a problem with getstyle invoked with no arguments:

[mafra@Pilar:util]$ ./getstyle
Usage: getstyle [-t] [-p] [-h] [-v] [file]

or with -t:

[mafra@Pilar:util]$ ./getstyle -t
Usage: getstyle [-t] [-p] [-h] [-v] [file]

In both cases it is supposed to write to the standard output:

[mafra@Pilar:wmaker.git]$ getstyle -h
Usage: getstyle [-t] [-p] [-h] [-v] [file]
Retrieves style/theme configuration and output to FILE or to stdout

This regression was caused by commit 6bf7994520 ("style Stuff up").
When that commit did

       argc -= optind;

       if (argc != 1)
               print_help(0,1);

it excluded the output to stdout as valid, because in this case
argc - optind is zero (see the manpage of getopt(3)).

The correct handling is to set the style_file only when there is
one non-option ARGV-element (argc - optind == 1) and print the
help message when there are more than one non-option element.
2012-01-15 02:45:00 +00:00
Rodolfo García Peñas (kix)
a9e136ec41 util: po files reports warning with fuzzy 2011-10-28 15:57:07 +01:00
Brad Jorsch
a06b0673d8 Fix some "'var' may be used uninitialized" warnings
The one in WPrefs.app/Appearance.c is indirect: the function might
be inlined and might return an uninitialized value, which causes gcc to
complain that the caller might use that uninitialized return value.
2011-08-09 23:45:34 +02:00
Brad Jorsch
d9296ff9a4 Remove warning in wmagnify.c (correctly)
The problem with f65b99e615 was that it removed the call to
newWindow() along with the unused variable, without considering that
newWindow() has side effects that need to happen even if the return
value is ignored. So as long as we keep the newWindow() call, we can
safely remove the (unused) variable.
2011-08-09 23:45:34 +02:00
Carlos R. Mafra
8fe18de926 Use wmgenmenu to create WMRootMenu during installation
Instead of using _old_ and hard-coded predefined menus as the
source for the user's WMRootMenu during installation, generate
the menu automatically using wmgenmenu.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
2011-08-08 19:11:22 +02:00
Carlos R. Mafra
e95f886e06 util: Fix wmagnify
wmagnify stopped working after f65b99e615 ("Remove warnings").
So revert that change in util/wmagnify.c, as it turns out that the
gcc warning was bogus there.
2011-08-01 22:40:55 +02:00
Tamas TEVESZ
5fa8b979b9 Amend recent wmgenmenu changes
Raise MAX_NR_APPS to account for the more menu entries
2011-04-10 22:13:29 -07:00