1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

72 Commits

Author SHA1 Message Date
Christophe CURIS
9f9ef6417e Utils: Use the constants added in config-paths.h for paths
Replace hard-coded directory names by the constants that have been
previously added to the common header.
2021-08-10 09:42:43 +01:00
John D Pell
bd38778bef Use wuserdatapath() everytime it is applicable
Replace calls to wusergnusteppath() which just append "/Library" by calls
to wuserdatapath().
Take opportunity to replace hardcoded "/WindowMaker" directories with
the existing PACKAGE_TARNAME macro (which comes from autotools).

The choice of 'TARNAME' is because it meant to be used in filename, thus
less likely to have problematic characters than PACKAGE_NAME (meant for
display purpose) and PACKAGE which is there for historical reason.
2021-08-10 09:42:43 +01:00
Alexandru Lazar
b7a1528833 getstyle: fix wcopy_file paths
Some (presumably stale) calls to wcopy_file used what appears to
be an incorrect destination which did not always exist. This patch
forces assets to be copied under <themedir>/<asset>, rather than
<themedir><absolute path of asset>. It works by first getting the
"new" path (i.e. the one that will be inserted in the property
list), which is relative to <themedir> (and appears to be always
in the root directory, too); it then copies the file to that path.

This *may* have been the original intended behaviour, as the one
it replaces clutters the path and leaks configuration data. In
addition, the style file seems to store only the file's name, not
the path relative to <themedir>, even when the file is copied with
its full hierarchy.

Signed-off-by: Alexandru Lazar <alazar@startmail.com>
2016-04-24 19:11:08 -04:00
Christophe CURIS
0e884f793a util: remove local constants GLOBAL_DEFAULTS_SUBDIR that are not used
As pointed by gcc, this macro is not used anywhere in the 2 files. Because
the code also suggests that they should be inherited from any other place
anyway, remove them from the file to prevent them from being used in the
future.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-12-10 10:19:20 +00:00
Christophe CURIS
a24efec61f util: use wfree instead of free for consistency
The memory was allocated with wmalloc, so for consistency it should be
freed using wfree. This could be a problem if the user compiled with
support for Boehm GC, or if we later decide to add support for other malloc
libraries.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS
6397f3403a util: return from 'findCopyFile' if the source file could not be found (Coverity #50075)
As pointed by Coverity, the function handles the case where the file to be
copied is not found by properly warning the user and the deleting the
currently built theme directory, but then it continued executing the file
copy that would crash on the null pointer.

This patch just adds the missing return that will avoid the crash.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-29 18:44:48 +00:00
Christophe CURIS
3de5b8fb42 util: removed usage of external '__progname' because it is not portable
As reported by Milan Čermák, using this variable breaks compilation on
Solaris, because it is a hack which is not standard. To ensure portability,
we now rely on main's argv[0] which is always available.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-11-02 13:08:59 +01:00
Christophe CURIS
ecbee34f3a Removed definitions of dangerous macro RETRY that does not work as expected
This macro supposes that the called lib function clears the 'errno'
variable on success which is not the case. The macro was (luckily) not
used in these file yet, by removing it we make sure it won't happen.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
35b912dd25 util: rewrote path building in makeThemePack
Use a better name for local variable and allocate the (almost) correct
number of characters for the path instead of a fixed offset that could be
a problem if the constant part of the path were to be updated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Christophe CURIS
1a9ece0438 util: fix leak in getstyle's makeThemePack (Coverity #50164)
As pointed by Coverity, the function is creating a temporary array with
the list of keys of the Style dictionnary, but it was not freed in the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-16 20:00:09 +01:00
Amadeusz Sławiński
bc8ccee72f Allow setting separate border color for focused windows
This patch adds "FrameFocusedBorderColor" option for theming,
It should allow having borders better matching titlebar colors.
By default it's set to black.

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-19 21:37:26 +01:00
Doug Torrance
1a01ac103f Removed references to obsolete DisplayFont
According to NEWS, the DisplayFont option was removed in version 0.62.0 and
replaced by the WINGs system font.  However, it was still referenced in a large
number of style files, as well as the utils getstyle, setstyle, convertfonts,
and the manpages for getstyle and setstyle.  This patch removes all of these
references.

In addition, it updates the Czech, Slovak, and Russian translations of these
manpages to match the English versions.  Note that I relied on Google translate, and it appears I may have re-encoded some characters when I saved the Czech
and Slovak files -- if you speak these languages, please take a look!

A few minor spelling errors were corrected in the English manpages.
2014-05-19 18:18:56 +01:00
Doug Torrance
763491f3ff doc: Update getstyle and setstyle manpages.
The manpages for getstyle and setstyle have not been updated and were missing
some options.  This patch brings them up to date.

In addition, the *TitleExtendSpace options were appearing twice in getstyle.c.
One of the unnecessary sets was removed.
2014-05-18 23:00:15 +01: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
549cefc47b util: Added a few missing 'static' attributes for functions 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
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
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
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
Tamas TEVESZ
f65b99e615 Remove warnings
* Remove assigned but not used variables (GCC 4.6)
* Bump _XOPEN_SOURCE to 600, ridding of FreeBSD warnings (this probably need
  to be tweaked on a per-implementation basis as problems arise)
2011-03-24 16:19:52 +01:00
Tamas TEVESZ
3c408fa179 Update local copy of GPLv2 and FSF address in copyrights
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 18:13:56 +02:00
Tamas TEVESZ
1f21919809 Remove wsyserrorwithcode, rename wsyserror to werror
wsyserrorwithcode - Not used, no point either.
wsyserror->werror - qualifying "error" with a "type" hardly makes
sense if there are not at least two "type"s. There are not. Safe trip.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:30 +02:00
Brad Jorsch
12de2f319e Fix uninitialized vars
Initialized variables that are conditionally set. In particular, this
construct is dangerous:
  void *p;
  if (something) p = couldReturnNull();
  if (!p) p = fallbackFunction();
2010-04-12 09:58:36 +02:00
Tamas TEVESZ
e7a46d5cdf Attach utils versions to WM version 2010-04-02 08:38:39 +02:00
Tamas TEVESZ
7dc767ae78 Convert to getopt, continued
plus some assorted fixes:
 - sort headers, remove some unneeded ones
 - small bits of formatting and the like
2010-04-02 08:38:23 +02:00
Tamas TEVESZ
6bf7994520 Style stuff up
- convert hand-rolled arg parsers to getopt_long
- sort headers, get rid of some duplicates in the process
- in fontconv, replace magic numbers with constants (there's
  little practical value to this here, but it's much nicer)
- slightly redo fontconv.c:strToInt()
2010-04-01 11:24:46 +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
Tamas TEVESZ
118a93808a Idle fixes
- add new wglobaldefaultspathfordomain() to wings (replaces several
  hand-rolled individual implementations in utils/)
- make all of 'em handle -h|--help, -v|--version
- try making them not to nothing silently
- change various ways of knowing thyselves to using __progname
- generally try to make them feel similar (NOT right, similar --
  right is a completely different matter)
2010-03-23 21:50:17 +01:00
Tamas TEVESZ
5f02b1b5f4 Feet protector for getstyle
Since getstyle now saves the theme pack in $GUR instead of
the cwd, there's a slight possibility you can specify a theme
pack name that will do Bad Things to your existing stuff.

To that end, specified theme pack name is "sanitised" a bit, as in
forward slashes in it are replaced by an underscore.

Oh yes, i forgot to mention. getstyle now saves the theme pack
in $GNUSTEP_USER_ROOT, not in cwd.
2010-03-23 21:50:17 +01:00
Tamas TEVESZ
9f7aaa8aed Some rework on getstyle
- make it use wings functions, remove duplicated code from getstyle
- de-static necessary functions in wings
- add new wrmdirhier to wings
- rename WMMkDirHier to wmkdirhier (fits better)
- remove calling shell from getstyle (what were they thinking?)

i couldn't quite test getstyle (no idea about themes), but it still
basically works.

do back your ~/G dir up... wrmdirhier might eat it!

definitely needs testing, especially by people who have any idea
how themes work.

Some more getstyle

- missed a shell invocation
- maybe copyFile should be in wutils too...?

[crmafra: Folded second patch into the first]
2010-03-23 21:50:17 +01:00
Tamas TEVESZ
badecc244b simplify WMWritePropListToFile()
remove the choice of atomic/non-atomic writes. firstly, the only users
of non-atomic writes were getstyle and geticonset; secondly, who in their
right minds would ever want non-atomic writes; thirdly, the file system
will screw you anyway *G*.
2010-03-17 11:12:53 +01:00
Martin Dietze
3f6ae395ce Add GLOBAL_DEFAULTS_SUBDIR and fix a syntax error in wmlib/Makefile.am 2009-08-24 11:55:20 +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
6cfad0b10f - Removed obsoleted options from WMGLOBAL and from the WINGs internal
structures (no longer needed with xft)
- Fixed default system font names (converted from xlfd to fontconfig names)
- A bit of code cleanups related to xft
- Replaced harcoded xlfd font names in wmaker and WPrefs with fontconfig
  names.
2004-10-17 06:27:51 +00:00
kojima
7055530895 - Added support for NET_WM_NAME/NET_WM_ICON_NAME
- moved out font name conversion code from getstyle/setstyle/convertfonts and made it support fontsets
2004-10-16 22:05:04 +00:00
dan
9aca0d5f6e - Check whether libXft is at least version 2.1.2 else refuse to compile.
- Fixed bug in icon chooser dialog that could cause a segmentation fault
  in some cases (Pascal Hofstee <caelian@gmail.com>)
- Fixed crash in asm code in wrlib, with new versions of gcc.
- Fixed bug in the x86_PseudoColor_32_to_8() function which incorrectly
  used the r, g, b fields in the conversion.
- Fixed x86 ASM code in wrlib to work on 64 bit architectures.
- Fixed the focus flicker seen with some apps (notably gtk2)
  (Alexey Spiridonov <snarkmaster@gmail.com>)
- Fixed all crashing bugs that were generated by wmaker starting with the
  WMState file missing.
- Added NetWM support (a modified version of the patch originaly written
  by Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied patch to enhance the Virtual Desktop behaviour, and to integrate
  it with the NetWM code (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Applied a few xinerama and placement fixes (Peter Zijlstra
    <a.p.zijlstra@chello.nl>)
- Fixed memory leak in dock code.
- Fixed and enhanced the text wrapping in WINGs.
- Fixed the layout of some elements in WPrefs.app
- Added workaround for aplications that don't set the required hints on the
  client leader window, but they set them on normal windows (observer with
  KDE 3.3.0 mainly). This will allow these apps to get an appicon again.
  (they should be fixed still)
- Added workaround for applications that do not set a command with
  XSetCommand(), but instead they set the _NET_WM_PID property. This works
  with operating systems that offer a /proc interface similar to what linux
  has. (This also is to fix problems with KDE 3.3.0 apps, but not only them).
- Fixed bug with autostart and exit scripts not being executed if user
  GNUstep path was different from ~/GNUstep (when setting GNUSTEP_USER_ROOT)
- Added utf8 support in WINGs (removed old X core font code)
- Added utility to convert old font names to new font names in style files
2004-10-12 01:34:32 +00:00
dan
474c4caf94 reverted the last test commit (duh) 2004-07-16 18:50:58 +00:00
dan
109bb540ec another test for cvs notifications 2004-07-16 18:18:36 +00:00
dan
6d02fe98f2 - rewrote the font conversion routines to avoid the need to allocate memory
for font options while parsing the xlfd. now all processing is done using
  the original xlfd string only.
- removed memleaks introduced by previous commit.
2004-04-13 03:49:38 +00:00
vlaad
500d569c79 style property is supposed to override weight and slant, unfortunately it doesn't do it cleanly, and you might end up with italic fonts. this fixes the issue by not making the assumption. 2004-04-10 19:27:54 +00:00
vlaad
f54b0de7b4 To ease transition from XLFD fontnames to fontconfig fontnames setstyle
now converts all *Font keys in the style files before merging them with
G/D/WindowMaker and (vice-versa) getstyle converts the keys from G/D/WindowMaker
before it does anything else whether its stdout printing or themepacks.
enabling quick theme conversions to new font system.
2004-04-10 14:55:55 +00:00