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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
Use the new preferences FrameBorderColor and FrameSelectedBorderColor to
set the border colour of frame windows and selected frame windows
respectively.
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...
...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.
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.
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.
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.
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.
* 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)
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>
Initialized variables that are conditionally set. In particular, this
construct is dangerous:
void *p;
if (something) p = couldReturnNull();
if (!p) p = fallbackFunction();
- 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()
- 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
- 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)
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.
- 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]
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*.
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 :-)
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.
- 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
for font options while parsing the xlfd. now all processing is done using
the original xlfd string only.
- removed memleaks introduced by previous commit.
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.