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

785 Commits

Author SHA1 Message Date
Rodolfo García Peñas (kix)
b9caaa8729 WINGs: New function W_setconf_doubleClickDelay
The new function W_setconf_doubleClickDelay() sets the value for
WPreferences.W_setconf_doubleClickDelay(), therefore the private
data of WPreferences struct is not used.

This call is used at defaults.c to set the doubleClickDelay().
2013-01-12 14:45:29 +00:00
Rodolfo García Peñas (kix)
cba94da2cf WINGs: Functions to read the Mouse Wheel conf
These new functions:

unsigned W_getconf_mouseWheelUp(void);
unsigned W_getconf_mouseWheelDown(void);

returns the WINGs configuration for the Mouse Wheel Up and Down
values.
2013-01-12 14:45:29 +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
18437e0309 WINGs: Enable cursor blinking in text fields
This code was commented out but enabling it leads to no issues AFAICS
and improves the usability of WINGs applications.

The motivation for this patch comes from the need of distinguishing
where the cursor is in the WINGs-based application which handles the
database of my comics collection.

This changes the behavior in all parts of wmaker where there is
a text field entry, e.g. in the settings panel of dockapps. There should
be no issues with a blinking cursor in such cases though...
2012-12-22 20:15:47 +00:00
Christophe CURIS
27d55b3e33 Added option to 'configure' to control debug information for compilation
As reported by Amadeusz Sławiński, there were a number of debug-only
information printed by the menu parser, which had no reason to be
in a user package.

This patch removes all the hard-coded DEBUG definitions pointed
by Amadeusz and adds a new (standard-like) option '--enable-debug'
to the configure script, which activates debug stuff for the devs.
The default behaviour is now to not have them.
As a side effect, the option also disable optimisation, which are
generally annoying when trying to run a debugger.
2012-11-16 08:06:19 +00:00
Christophe CURIS
5a3cab3cef Changed handling of quoted strings in the menu parser for consistency
As reported by Amadeusz Sławiński, the support for (d)quoted string
in the menu file was not exactly the same as in previous versions
of WindowMaker, so we had a regression which is not acceptable.

This patch propose a consistent handling for (d)quoted text instead
of the previous on-the-title-only code; now all (d)quoted strings
are still kept as-is (as expected) but the (d)quotes are always
removed.
As a side note, it also improve the support for \escaped character
to work correctly as mentioned in the example of the default menu.

Note: This reverts b2e7620868 which
was an incomplete solution to the problem.
2012-11-15 12:37:16 +00:00
Carlos R. Mafra
141b046c33 Remove last QUIET hack from Makefiles
They somehow were missed in 5c8eb580b3 ("configure:
Remove --disable-verbose-compile hack")
2012-11-12 22:44:33 +00:00
Rodolfo García Peñas (kix)
5fe4160025 menuparser.c code clean
This patch do this changes:

1. Change (add/remove) blank lines
2. Join some if's in only one
3. Change c++ comments to c comments (// -> /* */)
4. Add / remove curly brackets if needed
5. Change spaces (add/remove) & set correct indentation
2012-07-28 18:39:40 +01:00
Christophe CURIS
b2e7620868 Menu parser: remove d-quotes around title of entry
When a menu entry contains a space, it is necessary to enclose it
in simple or double quotes; these were not removed and so would
appear in the menu.
2012-07-19 11:23:29 +01:00
Christophe CURIS
9ad278ddf8 Menu parser: added boundary checks in the path-gen for #include file search
When generating the full path+name of file to search for a file
being #included, it was generated in a buffer that's supposedly
large enough (MAXLINE > 2*PATH_MAX). However, this limit has a few
issues (PATH_MAX seem to be able to be bigger, and worse: we can't
be sure we're given longer args).

The code was rewrote to natively include boundary checks so we're
sure we won't overflow the buffer. A few strncpy have been removed
because in this case they tend to make things harder to write.
2012-07-19 11:23:29 +01:00
Christophe CURIS
ac52d4de65 Menu parser: fix possible infinite loop when loading menu file
When a #include is used, the file is searched in many places; when
the file was searched in the ':'-separated list of path it could
led to infinite loop if the list contained more than one path and
that the file was not found in the first path, the ':' separator
was not properly passed over.
2012-07-19 11:23:29 +01:00
Rodolfo García Peñas (kix)
fae81bf518 Format string bug in WMenuParserError
There is a format string (FS) bug in the function WMenuParserError.

It is the tipical FS bug, like printf(a) instead of printf("%s", a);

See http://en.wikipedia.org/wiki/Uncontrolled_format_string for more info.
2012-07-16 22:45:25 +01:00
Christophe CURIS
4658f4f9a1 Remove dependency to CPP: add support for conditional directives
It is now possible to use #ifdef/#ifndef to exclude some part of the
file. The implementation uses a stack to track conditionals so it is
possible to use nested constructs.
2012-07-14 20:22:20 +02:00
Christophe CURIS
9b792369cb Remove dependency to CPP: added pre-defined macros
A number of macros are pre-defined by WindowMaker for CPP in the
function 'MakeCPPArgs', they are now available in the internal
parser too. CPP also had some predefined macros, a subset of them
have been added.
The definition have been split in two parts:
 - the macro that are dependant on WindowMaker parameters are
defined by WindowMaker (src/rootmenu.c)
 - those that are independant, which can be defined by the parser
itself (WINGs/menuparser_macros.c)
2012-07-14 20:22:20 +02:00
Christophe CURIS
aaa4517df7 Remove dependency to CPP: support for #define macros
This adds support for defining new macros, with or without parameters, which
when found afterwards in the text are replaced by their definition.
The complex analysis for arguments replacement is done at macro definition
time, so it is done only once and the macro expansion will be fast.
The macro-related functions have been placed in their own file because it is
quite a complex task and we do not want filesize to explode, it is always
better to keep things human-sized.
2012-07-14 20:22:20 +02:00
Christophe CURIS
88a82ab8df Remove dependency to CPP: support for #include directive
The parser is prepared to handle '#' directives, starting with file
inclusion. The search path for the file are taken from what was
actually given to CPP. There is an arbitrary limit to the inclusion
nesting, which is actually not a design limitation but a security
to avoid infinite include loops.
2012-07-14 20:22:20 +02:00
Christophe CURIS
ed9482b626 Remove dependency to CPP: new parser that handles comments
Wrote a new parsing code that is able to skip over comments.
Note that because CPP is still active, you will not see any
effect unless you disable CPP pre-processing.
2012-07-14 20:22:20 +02:00
Christophe CURIS
7d74648fc3 Remove dependency to CPP: add function to report problems while parsing
The default function used so far provides informations not so useful
to user, like wmaker's source file, line number and function; it
also cannot provide the line number from the parsed file because cpp
messes this information.

With this dedicated function we try to provide useful things which
are being tracked by the parser internally, like valid line number
and the name of the file being read (which can be convenient in the
case of #include, for which we may also be able to provide the
inclusion tree!)
2012-07-14 20:22:20 +02:00
Christophe CURIS
42cccb2313 Remove dependency to CPP: merged 'getLine' and 'separateline' into a single function call
From caller point of view, the two function have been merged into a
single function in the API. This will be needed by the advanced
parser that will have to not separate the concept of a 'line' and
the concept of 'content' (due to empty/comment lines, multi-line
comments, long lines split with '\')
2012-07-14 20:22:20 +02:00
Christophe CURIS
19f0998cd1 Remove dependency to CPP: create structure to keep info of file being parsed
All the information related to the file being parsed are stored in
a single place. The content of this structure is not visible to
caller to avoid messing the content; the parsing will be handled as
methods to this object.

Please note that all functions visible as part of the parser's API
are using the CamelCaseNotation to be consistent with the rest of
the API; however all internal functions use the non_camel_case_syntax
to follow the coding style set by Carlos for the project.
2012-07-14 20:22:20 +02:00
Christophe CURIS
f0e8b76c03 Remove dependency to CPP: Moving parser functions to a dedicated file
Due to the tasks to take in charge, the internal parser will grow in
size to support basic CPP feature, so it is a good idea to start by
moving the current functions into a dedicated file.
2012-07-14 20:22:20 +02:00
Alexey I. Froloff
2be53e92e6 WMPopFromArray(): avoid underflow
Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
2012-06-20 14:02:39 +01:00
Tobias Stoeckmann
9e2d1b3ecf Don't fail with assert() in string functions if both strings are NULL.
wstrconcat and wstrappend already support situations in which first OR
second string are NULL, but not if BOTH are NULL.  Fixed that.
2012-05-07 20:47:22 -03: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
Tobias Stoeckmann
e83eeb15cc Include assert.h to avoid linker issues if -DDEBUG was not supplied. 2012-04-30 14:48:20 -03:00
Tobias Stoeckmann
f25464c792 Avoid GNUism in Makefiles for *BSD support
Variable abs_srcdir will always point to proper source location.
With this patch, there is no need to call gmake on OpenBSD anymore.
2012-04-30 14:46:54 -03:00
Christophe CURIS
39fdb451ba Fixed wrong structure declaration
The declaration of the structure actually also created an unused variable. This
variable was not used anywhere, and lead to symbol defined in multiple objects.
These symbol are silently merged by GCC, thus no problem was reported.

The issue was raised by Yves de Champlain when trying to compile with LLVM/clang
which is a bit stricter there.
2012-04-21 09:33:27 -03:00
Carlos R. Mafra
a568686b39 WINGs: Do not call exit()
WMCreateFont() was calling exit() if it could not create the
font, and was trying too hard not to return NULL.

Just return NULL if the font could not be created instead of exit()ing
and let callers decide what to do upon failure.

Thanks to Christian <chris@computersalat.de> for reporting this.
2012-02-18 00:10:48 +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
Rodolfo García Peñas (kix)
809c536879 WINGs: Remove proplist-compat.h
It is not needed to compile Window Maker and it is not used by other
applications (tested in Debian). Therefore the file should be removed.
2012-01-20 21:49:53 +00:00
Carlos R. Mafra
89bf263410 WINGs: Replace fetchFile() by copy_file() in wcolorpanel.c
Now that copy_file() is in libWUtil, use it instead of fetchFile(),
which can be removed from wcolorpanel.c.
2012-01-15 14:31:52 +00:00
Carlos R. Mafra
7a180b0ef8 WINGs: Add copy_file() to libWUtil
This is essentially the fetchFile() from wcolorpanel.c from the last
commit, but renamed to a better name.

This patch just adds the function to the lib. Nobody uses it yet.
2012-01-15 14:25:07 +00:00
Carlos R. Mafra
14643408e8 WINGs: Make fetchFile() more similar to copyFile() from getstyle.c
The idea is to use the fetchFile() in getstyle.c and in wcolorpanel.c
instead of using two very similar functions.

In order to do that, let's move the most generic one (fetchFile()) to
libWUtils, and this is the first step.
2012-01-15 14:23:12 +00:00
Rodolfo García Peñas (kix)
9a67c55fa0 WINGs: removed prev_y variable not used 2011-10-28 15:55:58 +01:00
Carlos R. Mafra
d435ea7468 WINGs: Add back wprogressindicator.c
The examples inside WINGs/Tests fail to compile otherwise.
2011-08-25 00:06:58 +02:00
Carlos R. Mafra
f43aa47d68 Revert "WINGs: Remove wruler and wtext"
This reverts commit f4890b17e6.

It turns out that I needed some functions from wtext.c to develop
a WINGs front-end to my comic book collection MySQL database.

Conflicts:

	WINGs/Makefile.am
	WINGs/WINGs/WINGs.h
2011-08-24 19:18:06 +02:00
Christophe CURIS
e01d14abe4 Fix possible missing NUL at end of string
There are were a few uses of 'strncpy' that could lead to a missing NUL,
resulting in possible garbage being displayed. As suggested by Tamas,
use 'wstrlcpy' instead
2011-08-08 19:11:22 +02:00
Ambrus Szabo
8fd4821155 Fix makefiles bug.
FreeBSD make vs gmake
in FreeBSD: $(dir $<@) => ''
in gmake: $(dir $<@) => './'
2011-03-27 10:47:40 +02: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
Szabó Ambrus
7feb59251e Fix compilation in FreeBSD
In FreeBSD make doesn`t work, only gmake.
2011-03-15 00:27:01 +01:00
Andreas Metzler
1b2745fad8 Update documentation of ABI/API changes again.
Update documentation of ABI/API changes in NEWS files (up to date GIT
next as of 2010-10-30).
2010-11-01 09:35:29 +01:00
Andreas Metzler
1060f49366 pkgconfig - minimize direct linking
Use Libs.private to avoid unnecesary direct linking.

Signed-off-by: Andreas Metzler <ametzler@downhill.at.eu.org>
2010-10-18 10:25:49 +02:00
Andreas Metzler
614eb4c9e8 Simplify/fix pkgconfig installation
Patch "Fix path substitutions" moved generation of pkgconfig files from
./configure to Makefiles. However the generation is not triggered since
the pkgconfig files are not listed as dependency. Fix by conversion to a
straightforward automake rule.

Acked-by: Brad Jorsch <anomie@users.sourceforge.net>
Signed-off-by: Andreas Metzler <ametzler@downhill.at.eu.org>
2010-10-18 10:24:45 +02:00
Tamas TEVESZ
b5ed9841bc WINGs: Add wshellquote()
Transforms its argument so that the result is safe to pass to the shell
as an argument.

With very heavy inspirations from NetBSD's shquote(3),
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/gen/shquote.c?annotate
http://man.netbsd.org/cgi-bin/man-cgi?shquote

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-12 23:24:45 +02:00
Brad Jorsch
5eebb8bc3c Fix some warnings
Non-obvious fixes:

WINGs/wfilepanel.c: Cast to void to avoid an unused calculated value
warning.

WINGs/wtabview.c: Test tab<0 to avoid a warning from the next condition
about signed overflow in an inlined invocation of the function.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
2010-10-08 22:00:23 +02: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
210bcec4de WINGs: tree enhancements
- add WMFindInTreeWithDepthLimit, which is like WMFindInTree, but
  does not descend down more than a set limit.

- add WMTreeWalk, which will walk a WMTreeNode, running a callback
  function on each node.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 00:11:44 +02:00
Tamas TEVESZ
9a2732a4c3 Add back WINGs/tree.c that was removed in c9d0c7c
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-08 00:11:36 +02:00
Adam Hoka
7cc64627cc WINGs: fts() -> nftw() in wrmdirhier()
Plus reorganize headers a bit.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:31 +02:00