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

58 Commits

Author SHA1 Message Date
John D Pell
a079544647 WINGs: Properly mark 'const' some 'char*' in the public API
Update all the callers in our code to deal with the const qualifier
where the compiler reports an issue.
2021-08-10 09:42:43 +01:00
Alwin
a5a23f966e WINGs: trivial fix in text string
Fix a typo in an error message.
2014-12-24 15:24:41 +00:00
Christophe CURIS
28ce91a901 WINGs: fix check for NULL pointer in WMFilePanel (Coverity #50195)
As pointed by Coverity, there is a NULL pointer check at the end of the
function 'deleteFile' (which happens to not be necessary because wfree was
made to accept NULL pointers), however there are many things done before
that assumes the pointer is not NULL. The check is moved to where it
matters.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-18 23:01:43 +01:00
Christophe CURIS
51ad8b7dc1 WINGs: Removed checks for code that can't fail
In the function 'wdefaultspathfordomain' there was a check to make sure the
generated path would fit in the allocated area, but this allocated area is
sized precisely to fit the path, so it cannot fail.

In the function 'getCurrentFileName' there were checks to make sure the
generated result string would fit in the allocated area, but this allocated
area is sized precisely to fit the path, so it cannot fail.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2014-05-09 20:42:34 +01:00
Rodolfo García Peñas (kix)
3b97d33d0a WINGS: removed compiler warnings.
This patch removes compiler warnings.
2014-02-13 08:55:47 +00:00
Christophe CURIS
62565b42f6 WINGs: Do not allocate memory for a fixed-size short-lived buffer
Allocating memory with 'malloc' has a cost and participate to memory
fragmentation, so for a temporary buffer that has a fixed size let's
prefer allocating it on the stack.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
d25631016e WINGs: Minor improvments in 'closestListItem' function
The check on length of string before comparing is not necessary
because this will be checked as part of strcmp; the check won't
save time and may actually cost.

As the number of element in the array is not going to change during
the loop, took the call to 'WMGetArrayItemCount' outside the loop
to be faster (and ease compiler's optimisation work).

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
2013-12-30 18:11:04 +00:00
Christophe CURIS
ea74fe8871 WINGs: 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-10-19 18:01:36 -03:00
Christophe CURIS
bab90b2168 WINGs: Added explicit parameter list to function prototypes (Complex case)
It is dangerous to let the compiler know about a function without
letting him know the arguments because he won't be able to report
invalid calls.

This patch concern the cases where adding the arguments led to
problems because the functions were used as call-back. As it is
dangerous to have parameter mismatchs in call-back, setup the
args as expected by prototype and added explicit conversion inside
the concerned function, so the compiler will know and be able to
do what may be necessary.
2013-05-12 01:01:20 +01:00
Christophe CURIS
52b8aabccc WINGs: Fixed incorrect return type for internal function
The function did return a boolean actually as would be expectable
from such function, but its prototype did not use the proper type.
2013-05-09 18:08:12 +01:00
Christophe CURIS
05a3eadd65 WINGs: Fixed incorrect allocation size, missing room for '\0' 2013-05-09 18:08:12 +01:00
Christophe CURIS
a1119f8dd3 WINGs: Added 'const' attribute to functions in wbrowser, wcolorpanel, wfilepanel and wfontpanel
This makes both the API and local function const-correct on their
input parameters.
2013-05-09 16:56:28 +01: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
14863cd3b1 WINGs: Bounded string ops
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:31 +02:00
Tamas TEVESZ
02de600ecd WINGs: Simplify and rationalize createDir() and deleteFile()
Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:29 +02:00
Tamas TEVESZ
a8813b2eae WINGs: Add normalizePath()
Removes multiple consecutive and any trailing slashes from
a path-looking string

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:29 +02:00
Tamas TEVESZ
a71a604ab1 WINGs: Make wmalloc() intialize allocated memory to 0
- Accordingly remove individual memsets, for now from WINGs only.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
2010-10-07 12:04:29 +02:00
Carlos R. Mafra
513a509096 Fix the use of uinptr_t
Remove the additional cast to (int), as that makes no sense.
2009-09-14 16:51:26 +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
Carlos R. Mafra
06f59b9928 wmaker: Fix compiler warnings about pointer <--> integer conversion
There may be issues with running applications in 64-bit mode when
they were written with tacit assumptions about 32-bit platforms.
For example,

    * Assuming that a pointer can be cast back and forth to an integer

The reason is that the size of the integer and pointer may be different.
See the description of "[PATCH] Warn when casting a pointer (constant)
to an integer of different size." in the gcc mailing list

http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html

where it was also suggested the use of casts to uintptr_t. This is
what this patch does.

As a result the following warnings are fixed, leaving us with an
almost warning-free compilation in 64-bit platforms:

defaults.c:1446: warning: cast to pointer from integer of different size
defaults.c:1457: warning: cast to pointer from integer of different size
defaults.c:1471: warning: cast to pointer from integer of different size
defaults.c:1486: warning: cast to pointer from integer of different size
icon.c:67: warning: cast from pointer to integer of different size
menu.c:112: warning: cast from pointer to integer of different size
switchmenu.c:452: warning: cast from pointer to integer of different size
window.c:140: warning: cast from pointer to integer of different size
window.c:2217: warning: cast to pointer from integer of different size
workspace.c:135: warning: cast to pointer from integer of different size
workspace.c:214: warning: cast to pointer from integer of different size
workspace.c:634: warning: cast to pointer from integer of different size
workspace.c:1330: warning: cast to pointer from integer of different size
workspace.c:1514: warning: cast to pointer from integer of different size
wfilepanel.c:135: warning: cast from pointer to integer of different size
wfilepanel.c:171: warning: cast from pointer to integer of different size
wfontpanel.c:499: warning: cast to pointer from integer of different size
wfontpanel.c:500: warning: cast to pointer from integer of different size
wfontpanel.c:505: warning: cast to pointer from integer of different size
wfontpanel.c:506: warning: cast to pointer from integer of different size
wfontpanel.c:776: warning: cast from pointer to integer of different size
wfontpanel.c:777: warning: cast from pointer to integer of different size
wfontpanel.c:877: warning: cast from pointer to integer of different size
wfontpanel.c:878: warning: cast from pointer to integer of different size
wpanel.c:363: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:90: warning: cast to pointer from integer of different size
puzzle.c:138: warning: cast from pointer to integer of different size
puzzle.c:225: warning: cast to pointer from integer of different size
wtableview.c:1031: warning: cast to pointer from integer of different size
wtableview.c:1067: warning: cast to pointer from integer of different size
wtableview.c:1069: warning: cast to pointer from integer of different size
wtableview.c:1074: warning: cast to pointer from integer of different size
wtabledelegates.c:234: warning: cast from pointer to integer of different size
wtabledelegates.c:250: warning: cast from pointer to integer of different size
wtabledelegates.c:265: warning: cast from pointer to integer of different size
wtabledelegates.c:287: warning: cast to pointer from integer of different size
wtabledelegates.c:351: warning: cast from pointer to integer of different size
wtabledelegates.c:372: warning: cast from pointer to integer of different size
wtabledelegates.c:393: warning: cast from pointer to integer of different size
wtabledelegates.c:410: warning: cast to pointer from integer of different size
test.c:44: warning: cast from pointer to integer of different size
test.c:47: warning: cast to pointer from integer of different size
test.c:55: warning: cast from pointer to integer of different size
test.c:58: warning: cast from pointer to integer of different size
2008-11-06 09:07:50 +01:00
dan
6830b05716 changed indentation to use spaces only 2004-10-12 21:28:27 +00:00
dan
f058fdf72c - Fixed small memory leak in the WINGs' font panel code.
- Fixed call to qsort in WMSortArray.
- Fixed a memleak in the WINGs' file panel.
2003-04-02 11:37:04 +00:00
dan
e4a53ba71e fixed some Bool flags passed to WINgs functions to always set 1 or 0 values internally 2002-03-28 04:20:30 +00:00
kojima
882b9a8e1c - s/sprintf/snprintf
- updated some po's
- fixed crash bug when removing WINDOWS_MENU or WORKSPACE_MENU from rootmenu
- some other stuff i forgot
2001-07-23 20:31:32 +00:00
dan
2eb1f26644 Renamed WMGetApplicationIconBlendedPixmap() to
WMCreateApplicationIconBlendedPixmap() to avoid confusion.
This is because this function does generate a new WMPixmap from the
available icon image by combining it with the specified color and you
need to call WMReleasePixmap() on the generated pixmap after you're
done with it.
This is unlike the case of WMGetApplicationIconPixmap() where it just
returns a pointer to the existing application icon pixmap that was set
before and where you don't need to release it after you're done working
with it.
To avoid this confusion about when you need to release and when not,
one is using Get (get existing, no release needed), while the other is
now using Create (generate a new pixmap, release required) in their
name.

Since this change was made to a function that was just added to the API
in the previous commit, no modification is needed to the existing
applications that use WINGs.
2001-04-24 03:35:02 +00:00
dan
36e46831e0 For libwraster:
---------------

- Added retain/release mechanism to RImage by adding RRetainImage() and
  RReleaseImage(). RDestroyImage() is an alias to RReleaseImage() now, but
  will be removed in a future release because it no longer fits with the
  semantics. Will be kept for a while to allow a smoother transition.
  More about in wrlib/NEWS


For WINGs:
----------

- Small API change:
  1. Renamed WMSetApplicationIconImage(), WMGetApplicationIconImage() and
     WMSetWindowMiniwindowImage() to respectively WMSetApplicationIconPixmap(),
     WMGetApplicationIconPixmap() and WMSetWindowMiniwindowPixmap()
     They operate on a WMPixmap which is practically an X Pixmap with no alpha
     channel information and the new name is more suggestive and also leaves
     room for the new functions added for operating on images with alpha info.
  2. Added WMSetApplicationIconImage() and WMGetApplicationIconImage() which
     operate on an RImage and store alpha information too.
  3. Added WMGetApplicationIconBlendedPixmap() which will take the image with
     alpha set by WMSetApplicationIconImage() and will blend it with a color.
     If color is NULL it will blend using the default panel color (#aeaaae)
  All these changes will allow WINGs to handle images with alpha blending
  correctly in panels and wherever else needed. More about in WINGs/NEWS.
- updated panels to use the newly available RImages if present and fallback
  to old WMPixmaps if not, to properly show alpha blended images.
- replaced some still left malloc's with wmalloc's.


For Window Maker:
-----------------
- Fixed wrong mapping position of the "Docked Applications Panel" for some
  icons.
- Smoother animation for the smiley =)
- Made images with alpha blending be shown correctly in the panels and the
  icon chooser.
- The icon image set to be shown in panels ("Logo.WMPanel") will be
  automatically updated if its entry in WMWindowAttributes changes (without
  a need to restart as until now).


*** Note!!! ***

If you are developing applications with one of libwraster or libWINGs
then you should look to wrlib/NEWS and WINGs/NEWS to see what changed
and how should you update your code.
2001-04-21 07:12:21 +00:00
dan
648d75c299 - put back wmksize(), wmkrange() and wmkpoint() as functions instead of macros
- fixed some compilation warnings with -Wall
- some code cleanup
2001-04-19 01:04:48 +00:00
dan
1b41d56ad0 - updated code to use the new runmodal loop where necessary.
- made the WMRunModalLoop() reentrant (a modal panel can have its own
  modal panel and so on) by saving the modal related information when
  entering the modal loop and restoring it after.
2001-01-10 04:24:11 +00:00
dan
de99155948 - Fixed some issues with WMBrowser and the file panel that were
introduced by the latest changes in the WMList code (multiple and empty
  selection).
- added WMSetBrowserAllowMultipleSelection(), WMSetBrowserAllowEmptySelection()
  WMBrowserAllowsMultipleSelection() and WMBrowserAllowsEmptySelection().
2000-10-02 06:59:18 +00:00
dan
41ff127444 - Fixed WMArray.
- Changed WMList to use WMArray instead of WMBag
- Fixed compilation problems in WPrefs.app
2000-09-23 03:49:58 +00:00
dan
0ae1ecc05f Made the floppy path in the file panel be configurable via the FloppyPath
key in the WMGLOBAL file, instead of the '/floppy' hardcoded value.
2000-05-10 12:30:34 +00:00
kojima
9e45e85dc6 bag tree finished.. updated code to new bags 2000-03-29 02:17:39 +00:00
kojima
94f4483dbd multiview and vertical splitview
some bug fixes
configurable default font size
etc
1999-10-27 22:32:12 +00:00
dan
597b04f5f7 - Fixed name completion problem in file panel.
- fixed a problem about how notifications were sent for textfield events.
1999-10-23 21:06:11 +00:00
dan
6dd37d5972 Syncing the code for discussing it. 1999-10-22 23:39:39 +00:00
kojima
80fb09a74e replaced free() with wfree() everywhere
fixed bug in wlist that caused colorpanel to crash
1999-10-09 20:07:23 +00:00
kojima
e82c30b205 replaced linked list with WMBag in WMList
replaced WMAddSorted*** with WMSort***
fixed crash bug in icon chooser
1999-10-03 03:47:21 +00:00
dan
dfe360e5c0 - Fixed the PPosition/PSize code (I hope) --Dan
- removed "Ignore PPosition/PSize hints" user options, and reverted to
  the old "Keep Inside Screen"
1999-09-17 23:52:59 +00:00
dan
4dabd2ec8c - Fixed function naming problem in WINGs. 1999-09-17 16:42:36 +00:00
kojima
052ab01c84 replaced linked lists with WMBag, added progress indicator 1999-09-16 02:55:56 +00:00
id
7cc53d5134 Buttons in filepanel. 1999-06-09 20:22:44 +00:00
id
f1fff3180f Buttons! 1999-06-06 13:53:19 +00:00
dan
b9c1aba415 Fixed some problems in 0.60.0 1999-06-04 20:13:40 +00:00
id
3c503eac88 Add floppy button. 1999-06-03 10:48:13 +00:00
id
2958e72f1a Logan points this out to me. 1999-06-03 00:49:16 +00:00
id
ba5279276f Delete button in file panel. 1999-06-03 00:24:03 +00:00
dan
55d51e546d Some cleanup after the notification removal in textfields. 1999-05-16 00:45:34 +00:00
kojima
dd2d71fc9b started Appearance update in WPrefs
added tabbed view
changed some callbacks to delegate like stuff (textfield and browser)
1999-05-15 17:38:05 +00:00
kojima
5298849122 WPrefs appearance stuff update (shows preview) 1999-03-16 11:27:01 +00:00
dan
ea5d3bcde3 Some fixes over 0.51.2-pre2, in WINGs, wwindow.c, and FAQ 1999-03-10 15:47:10 +00:00