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

100 Commits

Author SHA1 Message Date
Christophe CURIS
18d77de91c WPrefs: grouped items related to the texture selection in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

By merging everything in a single struct array it is a lot easier to
maintain this list.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
2925e54bc1 WPrefs: grouped items related to the color selection in a single place
Having all these information spread in different places makes it error
prone when wanting to add/remove/change something in the list are there are
many unrelated places to keep in sync.

By merging everything in a single struct array it is a lot easier to
maintain this list.

Took the opportunity to properly document a little hack which is used to
avoid complex handling for a special case.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-07-06 01:07:55 +01:00
Christophe CURIS
a772f2797d wrlib: add explicit type definition in API to allow compiler Type Checks (3/3)
When defining enums as types instead of simple enums allows to use these
types at the places where the corresponding enum values are expected, then
allowing the compiler to check that, potentially reporting incorrect use
of values to the user.

This patch adds the type for the gradient style for RRender*Gradient.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-15 19:45:20 +01:00
Doug Torrance
137a571fec WPrefs: set IconTitleColor, IconTitleBack, ClipTitleColor, and CClipTitleColor
This patch adds the ability to set the colors for IconTitleColor, IconTitleBack,
ClipTitleColor, and CClipTitleColor, the only four colors set by setstyle which
previously were not configurable using WPrefs.

The icon in the preview window appears as a miniwindow if IconTitleColor or
IconTitleBack are being configured and as the clip if ClipTitleColor or
CClipTitleColor are being configured.
2014-06-02 21:28:54 +01:00
Christophe CURIS
9b65f55f53 WPrefs: add warning when renderTexture encounters some unknow settings
Having the warning displayed will help devs to understand what is going
on and where to look at for a fix.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-01 20:35:07 +01:00
Christophe CURIS
c54bb11ee9 WPrefs: fix memory leak in loadRImage (Coverity #50107)
As pointed by Coverity, if there is a problem when reading the binary data
of an RImage from a file, the area allocated to store it would not be
freed.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-06-01 20:35:06 +01:00
Amadeusz Sławiński
c6991fb991 Allow setting "FrameFocusedBorderColor" from WPrefs
Adds separate entry in menu and draws border around focused window.

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-19 21:37:26 +01:00
Amadeusz Sławiński
9d503d2abc Fix segfault in Wprefs when background is set to fpixmap (wmsetbg --fillscale)
Long time ago I added this option so I could have wallpaper filling my
screen while preserving aspect ratio.
Seems like I didn't add it to WPrefs

Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
2014-05-19 20:58:20 +01:00
Christophe CURIS
8c6525a2b7 WPrefs: changed renderTexture to always fallback to solid black when image can't be loaded
As raised by Carlos R. Mafra and Doug Torrance, when an image is used in a
texture but the image cannot be loaded, there are some case where WPrefs
misbehaves.
This patch display a warning in every case where the image could not be
loaded, and always switch to black texture as a fallback, which was not the
case previously.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-19 19:02:10 +01:00
Doug Torrance
13a9ebedcf WPrefs: updates to FrameBorderColor/FrameSelectedBorderColor options
In response to Amadeusz's comments regarding my patch "WPrefs: Add ability to
edit FrameBorderColor/FrameSelectedBorderColor", this new patch attempts to
reduce the confusion between focused and selected windows.  In particular,
only the frame border color for non-selected windows appears in the preview.
The frame border color for selected window colors can still be changed, but it
does not appear in the preview.  In addition, the hand icon has been removed
from the preview for these two options.

I also looked into the possibility of adding a new border color for focused
windows.  This appears to be nontrivial, as the border color belongs to
WFrameWindow, but the state of being focused belongs to WWindow.
2014-05-19 14:13:24 +01:00
Doug Torrance
963b4b2b78 WPrefs: Add ability to edit FrameBorderColor/FrameSelectedBorderColor.
As part of the process, some #defines were turned into enums.  Also, the *_COL
when needed.

This brings the code for colors in line with the code for textures, and
allows us to use them as array indices to improve readability, e.g.,
colorOptions[MTITLE_COL] instead of colorOptions[3].
2014-05-18 23:00:15 +01:00
Doug Torrance
5182b32fe9 WPrefs: new enum in Appearances.c for tab identifiers to increase readability 2014-05-18 23:00:15 +01:00
Doug Torrance
82e857a49e WPrefs: remove unfinished background tab from appearances panel code
WPrefs.app/Appearances.c contained code for an unfinished feature
in the appearances panel of WPrefs, a tab for setting the background.

Since this feature has now been implemented as part of the texture
tab (see commit c2aca1a ("WPrefs: Set workspace background")), there
is no reason to keep this code.
2014-05-18 23:00:15 +01:00
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
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
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
David Maciejak
aa890c8868 WPrefs: Fixed compiler warnings
This patch is used to catch some return function value, to make the
compiler happy.
2014-04-24 10:47:44 +01:00
Rodolfo García Peñas (kix)
3919363aa3 Arguments not used in SetButtonAlphaImage
The arguments for SetButtonAlphaImage() are not used, so can be removed to
avoid compiler warnings.

This patch removes these arguments, so the code in SetButtonAlphaImage(), not
used, can be removed too.
2014-01-31 19:38:18 +00:00
Christophe CURIS
8d7db5d744 WPrefs: Make the label internationalised for the texture option in dialog window
As this label is being displayed in the window, it is a good idea to make
it translatable to the user's locale.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
d2faac6333 WPrefs: Changed array of strings 'textureOptions' into a struct for explicitness
The parameters for the textures were stored all together in an array
which made its usage error prone; now there a struct to clearly identify
which string is what, so it is clear in the source what's being done.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
aa24e862c4 WPrefs: Changed array of strings 'colorOptions' into a struct for explicitness
The parameters for the theme colors were stored all together in an array
which made its usage error prone; now there a struct to clearly identify
which string is what, so it the source is clearer on what's being done.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
01c7390be1 WPrefs: 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
34da09a0a3 WPrefs: Removed unused argument to function 'OpenExtractPanelFor'
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:11 -02:00
Christophe CURIS
ce1513f89f WPrefs: Removed unused Screen argument to the 'Init*' functions
The functions that create the different configuration panels were taking
the screen structure as argument, but it turns out that none of them
actually need it.

We just remove the argument to make code simpler and easier to maintain.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-11-01 15:27:11 -02:00
Christophe CURIS
066d0cdef7 WPrefs: Marked args as unused for compiler in WINGs callback code
The WINGs toolkit dispatch events on widgets using callbacks, which means
having a fixed argument list for the handling 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
bc5985e824 WPrefs: Marked args as unused for compiler in event callback code
The WINGs toolkit dispatch events on widgets using callbacks, which means
having a fixed argument list for the handling 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
66f6817966 WPrefs: Marked args as unused for compiler in Notification callback code
The mechanism of Notifications in the WINGs toolkit is relying on
callbacks to dispatch notifications, which means having a fixed argument
list for the handling 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
5a65dbeb3d WPrefs: Cleaned dangerous function prototype usage
- remove extern declaration in source file, use header instead

- add inclusion of header defining the functions of the file to
get the compiler to cross-check them

- marked static the functions that should not be visible ouside
their file
2013-05-12 01:01:20 +01:00
Christophe CURIS
b5101fc8ae WPrefs: Added 'const' attribute to function parameters 2013-05-12 01:01:19 +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
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
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
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
Andrea Gelmini
7c14c0b14a Remove duplicated #includes 2010-11-29 11:59:22 +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
7859e2d59f Silence a few warnings
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:31 +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
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
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
5cfc565bbd Fixed paths, because mr Alex "Big Mouth" Perez was unable to get them right
in the first place in his trivial 10 line patch which only attempted to
replace one path with another.
He must be a big time user of his own patch, to not have noticed where the
paths pointed after his change.
2005-03-11 22:57:40 +00:00
kojima
3301b57d4b applied patch to use more gnustepish paths for some internal data files 2005-03-11 01:56:06 +00:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +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
4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan
90e8cfc5b8 - Properly fixed the color change in the Appearance panel preview box
in WPrefs.app. Also uses less resources.
2002-12-03 04:49:37 +00:00
dan
00638fa5d3 - Fixed a problem with image artifacts in the Appearance preview box
when color is changed and antialiased fonts are used.
2002-12-02 01:22:14 +00:00
dan
1e92274495 - Updated WINGs/NEWS with info about hw the API changed how how things
are affected. Fixes for old code too.
- Double buffering in WMList. All widgets or apps using WMList and
  having user drawing porcedures in place will inherit this double
  buffering automatically too.
- New functions in WINGs: WMGetColorAlpha(), WMIsAAFont()
- Misc code cleanups in WINGs and src/dialog.c
2002-10-16 04:05:45 +00:00
dan
a2b404b5b3 - API change in WINGs for WMDraw*String().
WMDrawString() and WMDrawImageString() now take WMColor instead of GC as
  arguments. WMDrawImageString() receives 2 colors (text & background).
  This is to allow easy extension for Xft/Xrender and hide X low level details
- Added alpha channel to WMColor. 2 new functions also:
  WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Removed obsoleted acconfig.h and implemented its functionality using
  AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
  This will definitely enforce the need to use autoconf 2.5x
2002-10-08 08:26:06 +00:00
dan
92b012e800 patch to add binary mode on opening files (for Windows+Cygwin compatibility). 2002-09-15 20:37:41 +00:00