1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-11 12:05:48 +01:00

1 Commits

Author SHA1 Message Date
scottc
d5c88d5afa GNUstep X Window Manager 1998-09-29 22:36:29 +00:00
869 changed files with 105561 additions and 253353 deletions

77
.gitignore vendored
View File

@@ -1,77 +0,0 @@
*.lo
*.o
*Makefile
*Makefile.in
.deps/
.libs/
INSTALL
aclocal.m4
autom4te.cache*
config-paths.h
config.guess
config.h
config.h.in
config.h.in~
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
mkinstalldirs
stamp-h1
contrib/WindowMaker.spec
m4/
src/wconfig.h
src/wmaker
test/wtest
util/convertfonts
util/geticonset
util/getstyle
util/seticons
util/setstyle
util/wdread
util/wdwrite
util/wmagnify
util/wmaker.inst
util/wmgenmenu
util/wmmenugen
util/wmsetbg
util/wmsetup
util/wxcopy
util/wxpaste
wrlib/get-wraster-flags
wrlib/libwraster.la
wrlib/tests/testdraw
wrlib/tests/testgrad
wrlib/tests/testrot
wrlib/tests/view
wrlib/wrlib.pc
WINGs/Examples/colorpick
WINGs/Examples/connect
WINGs/Examples/fontl
WINGs/Examples/puzzle
WINGs/Examples/server
WINGs/Extras/libExtraWINGs.a
WINGs/Extras/libExtraWINGs.la
WINGs/Extras/test
WINGs/Tests/testmywidget
WINGs/Tests/wmfile
WINGs/Tests/wmquery
WINGs/Tests/wtest
WINGs/WINGs.pc
WINGs/get-wings-flags
WINGs/get-wutil-flags
WINGs/libWINGs.a
WINGs/libWINGs.la
WINGs/libWUtil.a
WINGs/libWUtil.la
WPrefs.app/WPrefs
WindowMaker/Defaults/WMRootMenu
WindowMaker/Defaults/WMState
WindowMaker/Defaults/WMWindowAttributes
WindowMaker/Defaults/WindowMaker
WindowMaker/IconSets/Default.iconset

99
AUTHORS
View File

@@ -13,12 +13,9 @@ restart, dock bug fixes
Andrea Arcangeli <arcangeli@mbox.queen.it> Andrea Arcangeli <arcangeli@mbox.queen.it>
Fix for cascade window placement Fix for cascade window placement
Dmitry Astapov <adept@dimail.alpline.mao.kiev.ua> Peter Bentley <peter.bentley@nomura.co.uk>
Fix and some additions on XKB lock language status.
Peter Bentley <pete@sorted.org>
fixed WM_STATE handling bug, fixed some memory leaks, made application menus fixed WM_STATE handling bug, fixed some memory leaks, made application menus
be mapped near the windows for non-click-to-focus modes, timer bug be mapped near the windows for non-click-to-focus modes.
Ulf Betlehem <flu@iki.fi> Ulf Betlehem <flu@iki.fi>
Window resize with Meta-Click3, fixed OpaqueMove to send only 1 synth. Window resize with Meta-Click3, fixed OpaqueMove to send only 1 synth.
@@ -27,20 +24,11 @@ ConfigureNotify
Olly Betts <olly@muscat.co.uk> Olly Betts <olly@muscat.co.uk>
shaded window indication in window list shaded window indication in window list
Tudor Bosman <tudorb@caltech.edu>
autoraise bugfix
Rob Clark <rclark@turing.cs.hmc.edu> Rob Clark <rclark@turing.cs.hmc.edu>
Text input field, 15bpp support Text input field, 15bpp support
George Clernon <clernong@tinet.ie>
bug fix in browser widget
Omar Cornut / Zoop <cornut@capway.com>
SteelBlueSilk theme
Sylvain CORRE <sylvain.corre@wanadoo.fr> Sylvain CORRE <sylvain.corre@wanadoo.fr>
bug fix for MkLinux/PPC bug fix for MkLinux/PPC, bug fix for cpixmap in wmsetbg
Frederic Devernay <devernay@istar.fr> Frederic Devernay <devernay@istar.fr>
dock fix for openwindows, made asclock be friendlier with colorcell impaired dock fix for openwindows, made asclock be friendlier with colorcell impaired
@@ -65,54 +53,36 @@ Documentation help, autoconf cleanup
Mark 'segfault' Guzman <root@lsd.pbx.org> Mark 'segfault' Guzman <root@lsd.pbx.org>
Various bugfixes Various bugfixes
Ullrich Hafner <hafner@bigfoot.de> Ullrich Hafner <hafner@informatik.uni-wuerzburg.de>
Better detection of gfx libraries, added IconTitleColor/IconTitleBack Better detection of gfx libraries
Matthew Hawkins <matt@mh.dropbear.id.au>
former temporary project maintainer
Greg Hayes <sdc@choice.net> Greg Hayes <sdc@choice.net>
Twisted miniaturization animation Twisted miniaturization animation
Alban Hertroys <dalroi@wit401310.student.utwente.nl>
WINGs color panel
HIDEKI Fujimoto <hideki70@osk2.threewebnet.or.jp> HIDEKI Fujimoto <hideki70@osk2.threewebnet.or.jp>
FreeBSD portability, icon arrangement fixes, dock initialization bug fix, FreeBSD portability, icon arrangement fixes, dock initialization bug fix,
some I18N related fixes some I18N related fixes
Pascal Hofstee <daeron@wit401305.student.utwente.nl>
WINGs bug fixes, WINGs color panel
Robert A. Holak <panthar@tradeservices.com> Robert A. Holak <panthar@tradeservices.com>
bug fix bug fix
Michael Hokenson <logan@dct.com>
wkde2menu.pl script
IKARASHI Akira <ikarashi@itlb.te.noda.sut.ac.jp> IKARASHI Akira <ikarashi@itlb.te.noda.sut.ac.jp>
Workspace change bug fix Workspace change bug fix
Sudish Joseph <sj@eng.mindspring.net> Sudish Joseph <sj@eng.mindspring.net>
Modifier binding fix and other bug fixes Modifier binding fix and other bug fixes
Luke Kendall <luke@research.canon.com.au>
menu format converter, various enhancements to wxcopy and wxpaste
Bradley M Keryan <keryan@andrew.cmu.edu> Bradley M Keryan <keryan@andrew.cmu.edu>
EMACS/keypad like cursor movement for WINGs textfield EMACS/keypad like cursor movement for WINGs textfield
Jim Knoble <jmknoble@pobox.com> Jim Knoble <jmknoble@pobox.com>
made autoarrange icons a runtime option, SHADOW_RESIZEBAR c-time option, made autoarrange icons a runtime option, SHADOW_RESIZEBAR c-time option,
no workspace switch to the same workspace, dashed icon selection, no workspace switch to the same workspace, dashed icon selection,
misclellaneous bug fixes, definable cursors, --no-polling command line option. misclellaneous bug fixes
The JED Text Editor <xjed@windowmaker.info> Alfredo K. Kojima <kojima@inf.ufrgs.br>
Project maintainer Project maintainer
Alfredo K. Kojima <kojima@windowmaker.info>
The guy who types random keys to feed JED with the necessary entropy
Jay Kominek <jkominek@xtn.net> Jay Kominek <jkominek@xtn.net>
smart and random placement smart and random placement
@@ -122,20 +92,20 @@ Move/resize code fixes, button press/release fix
Ryan Land <rland@bc1.com> Ryan Land <rland@bc1.com>
workspace "layers" workspace "layers"
Largo <largo@current.nu> Largo <largo@gnu.net>
wm.current.nu maintainer, FAQ co-maintainer wm.gnu.net maintainer, FAQ maintainer
Stuart Luppescu <s-luppescu@uchicago.edu> Stuart Luppescu <s-luppescu@uchicago.edu>
Documentation help Documentation help
Marcelo E. Magallon <mmagallo@efis.ucr.ac.cr> Marcelo E. Magallon <mmagallo@efis.ucr.ac.cr>
CPP search path improvement, man pages, bug fixes CPP search path improvement, man pages
Tim Malone <mrgone@eskimo.com> Tim Malone <mrgone@eskimo.com>
bug fix, jpeg bug fix bug fix
MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp> MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp>
I18N bug fixes and japanese locale, wsetfont script I18N bug fixes and japanese locale
Brian Alexander Martin <brian@goober.wireless.ucsc.edu> Brian Alexander Martin <brian@goober.wireless.ucsc.edu>
PIPE_MENU PIPE_MENU
@@ -146,13 +116,13 @@ Andrea Mistrali <andre@ulmo.aleph.it>
Jeff Meininger <jeffm@boxybutgood.com> Jeff Meininger <jeffm@boxybutgood.com>
Fix for unassociated alpha tiff Fix for unassociated alpha tiff
Craig Nellist <crn@ozemail.com.au> Dan Pascu <dan@services.iiruc.ro>
selection in textfield
Dan Pascu <dan@windowmaker.info>
dock ghost (superfluous mode) fix, enhancement for scrollable menus, dock ghost (superfluous mode) fix, enhancement for scrollable menus,
clip, numerous other stuff, project maintainer clip, numerous other stuff, project maintainer
Kenneth W. Persinger Jr. <Kenn_Persinger@sector7.com>
tcl/tk dockit
Biagio Pippa <1993s017@educ.disi.unige.it> Biagio Pippa <1993s017@educ.disi.unige.it>
fixed miniaturization with transient window fixed miniaturization with transient window
@@ -164,11 +134,7 @@ Initial code for clip's collapse feature.
Ture Pelsson <ture@lysator.liu.se> Ture Pelsson <ture@lysator.liu.se>
various portability fixes, replaced busy wait with select() in event various portability fixes, replaced busy wait with select() in event
handling code, fixed problem with some misbehaved kids after a fork(), handling code, fixed problem with some misbehaved kids after a fork().
some other bug fixes, support for poll() in event handling code
Toby Sargeant <?>
menu format converter
Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de> Carsten Schaar <nhadcasc@fs-maphy.uni-hannover.de>
SCO portability, german locale, autoconf enhancements SCO portability, german locale, autoconf enhancements
@@ -179,14 +145,8 @@ REDUCE_APPICON/single-icon
Chong Shang Shan <chongsha@sps.nus.edu.sg> Chong Shang Shan <chongsha@sps.nus.edu.sg>
flipping iconification animation flipping iconification animation
Daniel Skarda <0rfelyus@atrey.karlin.mff.cuni.cz>
SGI "black dialogs" bug fix
Paul D. Smith <psmith@BayNetworks.COM>
SunOS portability, configure fixes
Phillip Smith <teknix@alloy.net> Phillip Smith <teknix@alloy.net>
FTP, WWW, mailing list site provider/maintainer (Net logistics) FTP and WWW site provider/maintainer
Lauri Tarkkala <ltarkkal@cs.hut.fi> Lauri Tarkkala <ltarkkal@cs.hut.fi>
SIGHUP unblock bug fix SIGHUP unblock bug fix
@@ -195,19 +155,10 @@ Sam Varner <varner@nmr.physics.wm.edu>
many fixes and enhancements for move, resize and window placement code. many fixes and enhancements for move, resize and window placement code.
Marco van Hylckama Vlieg <fatal@global.uibk.ac.at> Marco van Hylckama Vlieg <fatal@global.uibk.ac.at>
house icon for WINGs file dialogs, defaultAppIcon and Clip xpm tchX.tiff house icon for WINGs file dialogs, defaullAppIcon and Clip xpm icon
Plus the following icons:
DefaultAppIcon.tiff GNUterm.tiff clip2.tiff defaultterm.tiff draw.tiff
linuxterm.tiff mixer.tiff notepad.tiff pdf.tiff ps.tiff real.tiff sgiterm.tiff
sound.tiff staroffice2.tiff timer.tiff wilber.tiff write.tiff xdvi.tiff
xv.tiff
David Wang <dwang@cisco.com> David Wang <dwang@cisco.com>
edge resistance, 8bpp balloon bug fix, other 8bpp related fixes edge resistance
Franck Wolff <frawolff@club-internet.fr>
various fixes/enhancements to WINGs
Yoav Yerushalmi <yoav@mit.edu> Yoav Yerushalmi <yoav@mit.edu>
Fixed -visualid for screens that can do multiple depths. Another fix in Fixed -visualid for screens that can do multiple depths. Another fix in
@@ -216,17 +167,11 @@ libproplist. Chooses best depth in screen.
FRBall <frb@umr.edu> FRBall <frb@umr.edu>
dgradient fix dgradient fix
"]d" <mhz@gpf.or.th>
"]d" <id@windowmaker.info> Window list menu miniaturized/hidden hints
Window list menu miniaturized/hidden hints, XDE support, XKB lock
language status, WINGs enhancements, bug fixes, window commands menu
enhancement, window move/resize by keyboard. GNUstepGlow.tiff icon,
WINGs color panel, Appearance section icon(s)
Trae Mc Combs <x@themes.org> Trae Mc Combs <x@themes.org>
BlueWaves.jpeg background image in BlueWaves theme. BlueWaves.jpeg background image in BlueWaves theme.
And a special thanks to Martin Eskildsen for giving me his And a special thanks to Martin Eskildsen for giving me his
copy of NEXTSTEP :-) copy of NEXTSTEP :-)

14
BUGFORM
View File

@@ -4,11 +4,9 @@
If you find a bug please fill this form and send it to If you find a bug please fill this form and send it to
wmaker-dev@lists.windowmaker.org Please, USE THIS FORM!!! developers@windowmaker.org
You can also report a bug in the WWW bug tracker at You can also report a bug in the WWW bug tracker at
http://bugs.windowmaker.org/projects/wmaker/issues or by sending this report to http://windowmaker.org/cgi-bin/bugs
bugs@windowmaker.org
0. Before reporting this bug I already: 0. Before reporting this bug I already:
@@ -34,8 +32,10 @@ bugs@windowmaker.org
4. Configure time options you specified: 4. Configure time options you specified:
[ ] --enable-kanji [ ] --enable-kanji
[ ] --disable-shape [ ] --disable-shape
[ ] --disable-xpm
[ ] --disable-tiff
[ ] --disable-png
[ ] --enable-single-icon [ ] --enable-single-icon
[ ] --enable-modelock
[ ] Others: ....................... [ ] Others: .......................
@@ -68,8 +68,4 @@ X Server Vendor: ...................... Color Depth: .................
WindowMaker Version (run "wmaker -version"): ......................... WindowMaker Version (run "wmaker -version"): .........................
11. backtrace if the bug made Window Maker crash. PLEASE SEND THE
BACKTRACE. Your bug report might be of not much use without one.
strace/truss outputs are usually not usefull for crashes, so you can
skip it. The README file has instructions to make one.

30
BUGS
View File

@@ -1,24 +1,10 @@
Newly added - the app menu does not update after a style/theme change without restart.
- after a crash, wmaker will forget the hidden state of the apps and just - the animation of shade puts ImageMagick/display in a weird state
show their windows minimized. normal restart is unaffected - during startup, transient windows should be miniaturized with their owners
- after a crash, wmaker will completely mess the window's saved geometries not in their own icons
and maximizing will have weird results. restart is unaffected - shaped windows don't resize very well
- wmaker will not stop managing a screen even if another window manager
requests that, through the ICCCM 2.0 manager selection stuff
- stacking code is buggy (or XFree is buggy) - stacking code is buggy (or XFree is buggy)
- WINGs has problems in some platforms (SGI, Sun etc.) Anyone on these
systems want to fix it?
- save session doesnt work on some platforms (Alpha and Sparc) - save session doesnt work on some platforms (Alpha and Sparc)
- texture pixmaps are being incorrectly freed somewhere. Either - GNUSTEP_WM_ATTR in WINGs has problems on Alpha boxes
fix bug (to support broken MetroX servers) or remove all useless references
to the Pixmap (to save memory and drop bug compatibility).
- host information is not saved/honored by the dock or save session stuff.
It should at least check if the host is the local machine and only save it
in the session/allow docking it if yes.
- the SHELL environment variable support in the apps menu was removed
because of a problem with tcsh. If ~/.tcshrc contains "stty erase ^H",
it will block and the cmd will not be executed.
- mouse grab being done in client window (in wWindowResetMouseGrabs())
instead of the frame window. If grab is done in frame, titlebar buttons
dont work well
- mysterious mess in dock icons (specially netscape)

31
COPYING
View File

@@ -1,8 +1,9 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@@ -15,7 +16,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to the GNU Library General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
@@ -55,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -110,7 +111,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on does not normally print such an announcement, your work based on
the Program is not required to print an announcement.) the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program, identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in and can be reasonably considered independent and separate works in
@@ -168,7 +169,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not distribution of the source code, even though third parties are not
compelled to copy the source along with the object code. compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +226,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License. be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License original copyright holder who places the Program under this License
@@ -278,8 +279,8 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it possible use to the public, the best way to achieve this is to make it
@@ -291,7 +292,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found. the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.> <one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author> Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -303,16 +304,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License
with this program; if not, write to the Free Software Foundation, Inc., along with this program; if not, write to the Free Software
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this If the program is interactive, make it output a short notice like this
when it starts in an interactive mode: when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.
@@ -335,5 +336,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General library. If this is what you want to do, use the GNU Library General
Public License instead of this License. Public License instead of this License.

View File

@@ -1,54 +0,0 @@
The following artwork were created by Banlu Kemiyatorn and
are distributed through the license in this file:
GNUstepGlow.tiff
GNUstepGlow.xpm
Magnify.tiff
Magnify.xpm
Terminal.tiff
Terminal.xpm
TerminalGNUstep.tiff
TerminalGNUstep.xpm
TerminalLinux.tiff
TerminalLinux.xpm
tiff/msty1.tiff
tiff/msty2.tiff
tiff/msty3.tiff
xpm/msty1.xpm
xpm/msty2.xpm
xpm/msty3.xpm
WPrefs.tiff
WPrefs.xpm
tiff/tdel.tiff
tiff/tedit.tiff
tiff/textr.tiff
tiff/tnew.tiff
xpm/tdel.xpm
xpm/tedit.xpm
xpm/textr.xpm
xpm/tnew.xpm
inside Resources/Images.tiff "the little house", "the trash can",
"the folder", "the floppies"
Ear.png
Ftp.png
ICQ.png
Jabber.png
Mozilla.png
Pen.png
Pencil.png
Shell.png
Speaker.png
XChat.png
do What The Fuck you want to Public License
Version 1.0, March 2000
Copyright (C) 2000 Banlu Kemiyatorn (]d).
136 Nives 7 Jangwattana 14 Laksi Bangkok
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Ok, the purpose of this license is simple
and you just
DO WHAT THE FUCK YOU WANT TO.

1119
ChangeLog

File diff suppressed because it is too large Load Diff

1408
FAQ

File diff suppressed because it is too large Load Diff

View File

@@ -8,13 +8,6 @@ If I18N support does not work for you, check these:
can check if your locale is supported by X's locale emulation. can check if your locale is supported by X's locale emulation.
See "/usr/X11R6/lib/X11/locale/locale.alias" See "/usr/X11R6/lib/X11/locale/locale.alias"
- Check if you're using appropriate fonts for the locale you
chose. If you're using a font set that has a different
encoding than the one used by Xlib or libc, bad things can
happen. Try specifically putting the encoding in the LANG
variable, like ru_RU.KOI8-R. Again, see
"/usr/X11R6/lib/X11/locale/locale.alias"
- if your OS doesn't support any locale or if your OS doesn't - if your OS doesn't support any locale or if your OS doesn't
support a locale for your language, you can use X Window System's support a locale for your language, you can use X Window System's
locale emulation feature instead of OS's locale. To use this locale emulation feature instead of OS's locale. To use this
@@ -32,35 +25,24 @@ If I18N support does not work for you, check these:
here: here:
ftp://ftp.linux.or.jp/pub/RPM/glibc ftp://ftp.linux.or.jp/pub/RPM/glibc
- if you'd like to display multibyte characters, wmaker have to
be compiled with multibyte character support. Add this option
to the configure, "--enable-kanji".
- the fonts you're using support your locale. if your font - the fonts you're using support your locale. if your font
setting on $HOME/GNUstep/Defaults/WindowMaker is like.. setting on $HOME/GNUstep/Defaults/WindowMaker is like..
WindowTitleFont = "Trebuchet MS:bold:pixelsize=12"; WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*";
MenuTitleFont = "Trebuchet MS:bold:pixelsize=12"; MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*";
...................................................... ......................................................
then you can't display asian language (ja,ko,ch) characters using then you can't display non iso8859-x charcters by helvetica.
Trebuchet MS. A font that is guaranteed to work for any language is so quick way to display various languages' font is to change
sans (or sans-serif). sans is not a font itself, but an alias which all the font settings into:
points to multiple fonts and will load the first in that list that
has the ability to show glyphs in your language. If you don't know
a font that is suited for you language you can always set all your
fonts to something like:
"sans:pixelsize=12" "-*-*-medium-r-normal-*-14-*-*-*-*-*-*-*"
However, please note that if your font is something like: and also you need to change font settings in style files in
"Trebuchet MS,sans serif:pixelsize=12"
this will not be able to display asian languages if any of the
previous fonts before sans are installed. This is because unlike
the proper font pickup that sans guarantees for your language,
this construct only allows a font fallback mechanism, which tries
all the fonts in the list in order, until it finds one that is
available, even if it doesn't support your language.
Also you need to change font settings in style files in
the "$HOME/Library/WindowMaker/Style" directory. the "$HOME/Library/WindowMaker/Style" directory.
- the LC_CTYPE environment variable is unset or it has the correct - the LC_CTYPE environment variable is unset or it has the correct

455
INSTALL Normal file
View File

@@ -0,0 +1,455 @@
Installation Instructions for WindowMaker
SUPPORTED PLATFORMS
===================
(ie: I've heard someone has compiled it on...)
- Intel/Linux RedHat 4.2 (primary platform)
- Intel/Linux other distributions
- Sparc/Linux RedHat 5.1
- PowerPC/MkLinux
- Alpha/Linux RedHat 5.1
- FreeBSD
- Solaris 2.5.1, 2.5.2
- Solaris 2.6.0
- Solaris 2.7beta
- SCO Unix
- SGI Irix
- OSF/1
- HP-UX
- AIX 4.1.4 / IBM PowerPC
- DEC Alpha/Digital UNIX 4.x
- XFree86 / OS/2
Patches to make it work on other platforms are welcome.
REQUIREMENTS:
=============
The following software is required to use WindowMaker
- X11R6.x
WindowMaker can be compiled in older versions of X, like X11R5
(Solaris) or X11R4 (OpenWindows) but it will not work 100% correctly.
In such servers there will not be application icons and you'll have
trouble using the dock.
If you will build WindowMaker, make sure you have gcc and the X header files
installed. Specially for newbie Linux users: you must install all X development
packages and the gcc suite. Otherwise you won't be able to build any X program,
including WindowMaker.
OPTIONAL:
=========
These libraries are not required to make WindowMaker work, but they
are supported in case you want to use them. Version numbers are those
that I have (and therefore, guraranteed to work), but other versions
might work too. Tell me if you made wmaker work with some library
with a version older than the stated here.
- libXPM 4.7
Older versions may not work!!!
Available at ftp://sunsite.unc.edu/pub/Linux/libs/X/
There is builtin support for XPM files, but it will not
load images in some uncommon encodings.
- libpng 0.96 or newer and zlib
For PNG image support.
- libtiff 3.4 or newer
For TIFF image support.
You can get it at ftp://ftp.sgi.com/graphics/tiff
- libjpeg 6.0.1
For JPEG image support
- libgif 2.2 or libungif
For GIF image support
- GNU xgettext
If you want to use translated messages, you will need GNU gettext.
Other versions of gettext are not compatible and will not work.
Get the GNU version from ftp://prep.ai.mit.edu
Most of these can be get from ftp.uu.net/pub/graphics
CONFIGURE OPTIONS:
==================
These options can be passed to the configure script to enable/disable
some WindowMaker features. Example:
./configure --enable-kanji
will configure WindowMaker with kanji characters support compiled in.
--disable-xpm disables use of the XPM library even if it is available on
your system.
--disable-png disables use of PNG library
--disable-tiff disable use of TIFF library
--disable-gif disable use of GIF library
--disable-jpeg disable use of JPEG library
--disable-shape disables shaped windows (for oclock, xeyes etc.)
--enable-debug adds extra debugging information. Do not use it
unless you're debugging WindowMaker.
--enable-kanji support to display Kanji characters, Korean, Chinese
and other languagues that require special characters.
--enable-single-icon enables the collapsing of all appicons of the
WM_CLASS+WM_INSTANCE into a single one. This feature is not
supported at all by the developers. If you have some trouble with it,
contact it's author: Christopher Seawood <cls@seawood.org>
PLATFORM SPECIFIC NOTES:
========================
- SCO Unix - run configure like
CFLAGS="-belf -DANSICPP" ./configure
- SunOS, Solaris
If you have gcc installed, after running configure, edit
src/config.h and change the #define CPP_PATH line to
#define CPP_PATH "gcc -E -x c"
Sun's cpp lacks some features needed by WindowMaker and it can
cause problems when parsing the config files.
- RedHat Linux
Make sure you don't have the LANG and LINGUAS environment variables
set to en_RN. Also, make sure you have /usr/local/bin in your
PATH environment variable, as for some mysterious reason the folks
at RedHat did not include it in the default configuration files
in RH 5.{0,1}.
- PowerPC MkLinux
You will need to have the latest version of Xpmac. Older versions
seem to have bugs that cause the system to hang.
- Debian Linux
If you want JPEG and TIFF support, make sure you have libtiff-dev
and libjpeg-dev installed.
- MetroX (unknown version)
MetroX has a bug that corrupts pixmaps that are set as window
backgrounds. If you use MetroX and has weird problems with
textures, do not use textures in titlebars. Or use a different
X server.
INSTALLATION:
=============
Unpack WindowMaker-data.tar.gz and move the pixmaps directory in it
to /usr/local/share/pixmaps
You can get the file at ftp://ftp.windowmaker.org. This file is not strictly
necessary, but contains some additional nice icons and other things.
autoconf and automake
---------------------
autoconf and automake are not required, but if you have them installed,
make sure you have autoconf 2.12 and automake 1.3 or newer. If you have
an older version, disable them by temporarily renaming them to something
else or uninstalling them from your system.
Build libPropList
-----------------
Note: You only need to build libPropList if you don't have it installed
in your system.
libPropList is included with the distribution, so you don't
need to download it anywhere (some people have asked me this...)
But if you already have libPropList installed on you system you
can skip this step, since configure will detect that and use the
installed version first if available.
To build libPropList, simply type the following at the shell prompt:
gunzip -c libPropList.tar.gz | tar xf -
cd libPropList
./configure
make
then, login as root and type:
make install
Build WindowMaker
-----------------
If this is the first time you're building WindowMaker, you can
simply type:
./configure
make
then, login as root and type:
make install
or if you want to strip the binaries from debugging symbols and make them
smaller, you can instead type:
make install-strip
This will build and install WindowMaker with default parameters.
If you want to customize some compile-time options, you can do the
following.
1. (optional) Look at the CONFIGURE OPTIONS section above for the
options available. Also run:
./configure --help
to get a complete listing of other options that are available.
Note that the WPrefs.app installation path is configured
in a different way. Look at WPrefs/README for information.
2. Run configure with the options you want. For example, if you
want to use the --enable-kanji option, type:
./configure --enable-kanji
3. (optional) Edit src/wconfig.h with your favorite text editor
and browse through it for some options you might want to change.
4. Compile WindowMaker. Just type:
make
5. Login as root (if you can't do that, read the "I don't have the
root password :-(" section) and install WindowMaker in your system.
Again, type:
su root
make install
User specific configuration
---------------------------
These instructions do not need to be followed when upgrading WindowMaker
from an older version, unless stated differently in the NEWS file.
Every user on your system that wishes to run WindowMaker must do the
following:
1. Install WindowMaker configuration files in your home directory.
Type:
wmaker.inst
wmaker.inst will install WindowMaker configuration files and will
setup X to automatically launch WindowMaker at startup.
That's it! The configuration file where you can edit your preferences
is $HOME/GNUstep/Defaults/WindowMaker.
The $HOME/GNUstep/Defaults/WMWindowAttributes file is where you assign
icons to applications and edit some other attributes for windows. This can
be also edited from the "Attributes Panel". To access it, click the titlebar
of the window with the Right mouse button and select "Attributes...".
The $HOME/GNUstep/Library/WindowMaker/menu file is the definition of
the root menu. Edit it according to the applications you have installed.
Read the User Guide for a more in depth explanation of WindowMaker.
The User Guide is avaiable at http://windowmaker.org
You might want to take a look at the FAQ too.
I don't have the root password :(
---------------------------------
If you can't get superuser privileges (can't be root) you can install
wmaker in your own home directory. For that, supply the --prefix option
when running configure in step 2 of building WindowMaker . Example:
./configure --prefix=/home/jshmoe
If you use national language support, you must also supply the --with-nlsdir
option, as:
./configure --prefix=/home/jshmoe --with-nlsdir=/home/jshmoe/lib/locale
Then make /home/jshmoe/bin be included in your search path and run
bin/wmaker.inst
UPGRADING
=========
If you are upgrading from an older version of WindowMaker:
1. Configure and build WindowMaker as always
2. Install WindowMaker (but do not run wmaker.inst)
3. Read the NEWS file and update your configuration files,
if necessary.
TROUBLESHOOTING
===============
When you have some trouble during configuration (while running configure),
like not being able to use a graphic format library you think you have
installed, look at the config.log file for clues of the problem.
== When I try to start X after installing wmaker, I get this:
exec: wmaker: not found
You probably are using a brain-damaged distribution. Add /usr/local/bin
into your path environment variable (editing .cshrc or .profile)
== Error during build of libPropList
make: *** No rule to make target `libPropList.a.c', needed by
`libPropList.a.o'. Stop.
Make sure the autoconf and automake versions you have installed are at
least:
autoconf 2.12
automake 1.3
If you are using the RPM's that come with RedHat 4.x, don't use them.
It is broken. Uninstall the RPM and reinstall a fresh package from
You can get them from ftp://prep.ai.mit.edu or any mirror.
== configure doesn't detect libtiff, or other graphic libraries.
Delete config.cache, then rerun configure adding the following options to
configure (among the other options you use):
--with-gfx-libs="-L/usr/local/lib"
--with-gfx-incs="-I/usr/local/include -I/usr/local/include/tiff"
Put the paths where your graphic libs and their corresponding header files are
located. You can put multiple paths in any of these options, as the example
of --with-gfx-incs shows. Just put a space between them.
== configure doesn't detect libXpm.
* Check if you have a symbolic link from libXpm.so.4.9 to libXpm.so
== Segmentation fault on startup
* Check if the version of libXPM you have is at least 4.7
* Check if you have an updated version of ~/GNUstep/Defaults/WindowMaker
If you're not sure, try renaming ~/GNUstep to ~/GNUtmp and then run wmaker.inst
== "...: your machine is misconfigured. gethostname() returned (none)"
* the hostname of your machine is set to something invalid, that starts
with a parenthesis. Do a man hostname for info about how to set it.
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
* WindowMaker is not finding cpp (the C preprocessor). If your cpp is
not located in /lib/cpp, edit src/config.h and correct the path in
CPP_PATH.
LOCALES/INTERNATIONALIZATION
============================
WindowMaker has national language support.
To enable national language support, you must compile
WindowMaker with some additional parameters.
0 - You must have the GNU gettext package installed. It can be
obtained at ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
Steps 1 to 3 can be skipped if you use the Install script.
1 - You have to select the languages you want to support. Set the
LINGUAS to the list of locales you want. English is always
suported. Example:
setenv LINGUAS "pt ja de"
in csh
or
export LINGUAS;LINGUAS="pt ja de"
in sh
The list of supported locales can be found in po/README.
English is the default language.
Read po/README if you wish to translate and maintain locale files
for other languages.
2 - Additionally, if your language uses multi-byte characters, such
as Japanese or Korean, you must supply the --enable-kanji flag to configure.
3 - Configure, build and install WindowMaker normally.
4 - To select a particular locale at runtime you must set the LANG
environment variable to the locale you want. For example, if you want to set
the portuguese locale, you must run
setenv LANG pt
in csh or
export LANG; LANG=pt
in Bourne sh and similars
Note: If you have the LC_CTYPE environment variable set, you must
unset it before running wmaker.
For menu definition files, WindowMaker searches for them in the
following order (for brazilian portuguese, in this case):
menu.pt_BR
menu.pt
menu
5 - If you chose a language that uses multi-byte characters, you must
configure the fonts appropriately. Read the manual page for XCreateFontSet
to have more details about it. You must change the ~/G/D/WindowMaker file
for fonts used in titlebars, menus and other things. For fonts used in
dialog windows, change ~/G/D/WMGLOBAL. Note that at the moment you can only
supply a single font in WMGLOBAL. The %d in the font names must not be
removed.
For example, you can specify the following in ~/G/D/WindowMaker:
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
MenuTextFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-14-*";
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*,-*-*-medium-r-normal-*-12-*";
ClipTitleFont = "-*-helvetica-bold-r-normal-*-10-*,-*-*-medium-r-normal-*-12-*";
DisplayFont = "-*-helvetica-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-12-*";
and in ~/G/D/WMGLOBAL:
SystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";
BoldSystemFont = "-*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*";

View File

@@ -1,436 +0,0 @@
Installation Instructions for Window Maker
The latest version of Window Maker (-crm) can be found in the
git repository at
http://repo.or.cz/w/wmaker-crm.git
SUPPORTED PLATFORMS
===================
- Intel GNU/Linux Systems in general
Patches to make it work on other platforms are welcome.
REQUIREMENTS:
=============
The following software is required to use Window Maker:
- X11R6.x
Window Maker can be compiled in older versions of X, like X11R5
(Solaris) or X11R4 (OpenWindows) but it will not work 100% correctly.
In such servers there will not be application icons and you'll have
trouble using the dock. Upgrading the client libraries (Xlib, Xt etc)
will help if you can't upgrade the server.
The following is required to build Window Maker:
- Basic obvious stuff
gcc (or some other ANSI C compiler)
glibc development files (usually glibc-devel in Linux distributions)
X development files (XFree86-devel or something similar)
- autoconf, automake and libtool
autoconf 2.54
automake 1.4
libtool 1.4.2
- Xft2
and its dependencies (such as freetype2 and fontconfig)
You will also need the development files for it (xft2-devel)
OPTIONAL:
=========
These libraries are not required to make Window Maker work, but they
are supported in case you want to use them. Version numbers are those
that I have (and therefore, guraranteed to work), but other versions
might work too.
- libXPM 4.7 or newer
Older versions may not work!!!
Available at ftp://sunsite.unc.edu/pub/Linux/libs/X/
There is builtin support for XPM files, but it will not
load images in some uncommon encodings.
- libpng 0.96 or newer and zlib
For PNG image support.
http://www.cdrom.com/pub/png/
- libtiff 3.4 or newer
For TIFF image support.
You can get it at ftp://ftp.sgi.com/graphics/tiff
- libjpeg 6.0.1 or newer
For JPEG image support
http://www.ijg.org/
- libgif 2.2 or libungif
For GIF image support
ftp://prtr-13.ucsc.edu/pub/libungif/
- GNU xgettext
If you want to use translated messages, you will need GNU gettext.
Other versions of gettext are not compatible and will not work.
Get the GNU version from ftp://ftp.gnu.org
CONFIGURE OPTIONS:
==================
If you downloaded the cvs or git versions, type
./autogen.sh
to generate the config files.
These options can be passed to the configure script to enable/disable
some Window Maker features. Example:
./configure --enable-modelock --disable-gif
will configure Window Maker with modelock supported and disable gif support.
Normally, you won't need any of them.
To get a list of other options, run ./configure --help
--with-libs-from
specify additional paths for libraries to be searched.
The -L flag must precede each path, like:
--with-libs-from="-L/opt/libs -L/usr/local/lib"
--with-incs-from
specify additional paths for header files to be searched.
The -I flag must precede each paths, like:
--with-incs-from="-I/opt/headers -I/usr/local/include"
--disable-shm
disable use of the MIT shared memory extension. This will slow down
texture generation a little bit, but in some cases it seems to be
necessary due to a bug that manifests as messed icons and textures.
--disable-motif
disable support for mwm window manager hints
--enable-modelock
XKB language status lock support. If you don't know what it is you
probably don't need it.
--disable-xpm
disables use of the XPM library even if it is available on your
system.
--disable-png
disables use of PNG library
--disable-tiff
disable use of TIFF library
--disable-gif
disable use of GIF library
--disable-jpeg
disable use of JPEG library
--disable-shape
disables shaped windows (for oclock, xeyes etc.)
PLATFORM SPECIFIC NOTES:
========================
- GNU/Linux in general
Make sure you have /usr/local/lib in /etc/ld.so.conf and that you
run ldconfig after installing.
Uninstall any packaged version of Window Maker before installing a new
version.
- RedHat GNU/Linux
RedHat systems have several annoying problems. If you use it,
be sure to follow the steps below or Window Maker will not work:
* if you installed the Window Maker that comes with RedHat, uninstall
it before upgrading;
* make sure you don't have the LANG and LINGUAS environment variables
set to en_RN;
* make sure you have /usr/local/bin in your PATH environment
variable;
* make sure you have /usr/local/lib in /etc/ld.so.conf before running
ldconfig;
- PowerPC MkLinux
You will need to have the latest version of Xpmac. Older versions
seem to have bugs that cause the system to hang.
- Debian GNU/Linux
If you want JPEG and TIFF support, make sure you have libtiff-dev
and libjpeg-dev installed.
- SuSE GNU/Linux
If you installed the Window Maker package from SuSE,
uninstall it before trying to compile wmaker or you
might have problems.
- MetroX (unknown version)
MetroX has a bug that corrupts pixmaps that are set as window
backgrounds. If you use MetroX and has weird problems with
textures, do not use textures in titlebars. Or use a different
X server.
INSTALLATION:
=============
Build Window Maker
------------------
For a quick start, type the following in your shell prompt:
./configure
make
then, login as root and type:
make install
ldconfig
or if you want to strip the debugging symbols from the binaries and make them
smaller, you can instead type:
make install-strip
ldconfig
This will build and install Window Maker with default parameters.
If you want to customize some compile-time options, you can do the
following.
1. (optional) Look at the CONFIGURE OPTIONS section above for the
options available. Also run:
./configure --help
to get a complete listing of other options that are available.
2. Run configure with the options you want. For example, if you
want to use the --enable-modelock option, type:
./configure --enable-modelock
3. (optional) Edit src/wconfig.h with your favorite text editor
and browse through it for some options you might want to change.
4. Compile. Just type:
make
5. Login as root (if you can't do that, read the "I don't have the
root password :-(" section) and install Window Maker in your system:
su root
make install
User specific configuration
---------------------------
These instructions do not need to be followed when upgrading Window Maker
from an older version, unless stated differently in the NEWS file.
Every user on your system that wishes to run Window Maker must do the
following:
1. Install Window Maker configuration files in your home directory.
Type:
wmaker.inst
wmaker.inst will install Window Maker configuration files and will
setup X to automatically launch Window Maker at startup.
That's it!
You can type "man wmaker" to get some general help for configuration
and other stuff.
Read the User Guide for a more in-depth explanation of Window Maker.
You might want to take a look at the FAQ too.
Installing the extras package
-----------------------------
Unpack WindowMaker-extra-<version-number>.tar.gz in /usr/local/share
You can get the file at http://windowmaker.org/pub/source/release/. This file
is optional and only have a few icons, and themes. Look for the latest
<version-number> available. Also there is a WindowMaker-extra.readme to
instruct you where that package should go.
I don't have the root password :(
---------------------------------
If you can't get superuser privileges (can't be root) you can install
wmaker in your own home directory. For that, supply the --prefix option
when running configure in step 2 of building Window Maker. You will
also need to supply the --with-gnustepdir option, to specify the path for
WPrefs.app Example:
./configure --prefix=/home/jshmoe --with-gnustepdir=/home/jshmoe/GNUstep/Applications
Then make /home/jshmoe/bin be included in your search PATH, add
/home/jshmoe/lib to your LD_LIBRARY_PATH environment variable and run
bin/wmaker.inst
Of course, /home/jshmoe is supposed to be replaced with your actual home
directory path.
UPGRADING
=========
If you are upgrading from an older version of Window Maker:
1. Configure and build Window Maker as always
2. Install Window Maker (but do not run wmaker.inst)
3. Read the NEWS file and update your configuration files if necessary.
TROUBLESHOOTING
===============
When you have some trouble during configuration (while running configure),
like not being able to use a graphic format library you think you have
installed, look at the config.log file for clues of the problem.
== Error with loading fonts, even if they exist.
Try rebuilding without NLS support.
== Error when configuring
ltconfig: unrecognized option `--no-reexec'
Try `ltconfig --help' for more information.
configure: error: libtool configure failed
remove the --no-reexec option from aclocal.m4 and reconfigure
Also make sure the autoconf and automake versions you have installed are:
autoconf 2.13
automake 1.4
libtool 1.3
Note that it must not be libtool 1.2b, it must be libtool 1.3,
from the GNU sites.
== configure doesn't detect libtiff, or other graphic libraries.
Delete config.cache, then rerun configure adding the following options to
configure (among the other options you use):
--with-libs-from="-L/usr/local/lib"
--with-incs-from="-I/usr/local/include -I/usr/local/include/tiff"
Put the paths where your graphic libs and their corresponding header files are
located. You can put multiple paths in any of these options, as the example
of --with-incs-from shows. Just put a space between them.
== configure doesn't detect libXpm.
* Check if you have a symbolic link from libXpm.so.4.9 to libXpm.so
== Segmentation fault on startup
* Check if the version of libXPM you have is at least 4.7
* Check if you have an updated version of ~/GNUstep/Defaults/WindowMaker
If you're not sure, try renaming ~/GNUstep to ~/GNUtmp and then run wmaker.inst
== "...: your machine is misconfigured. gethostname() returned (none)"
* the hostname of your machine is set to something invalid, that starts
with a parenthesis. Do a man hostname for info about how to set it.
== The root menu contains only 2 entries. ("XTerm" and "Exit...")
* Window Maker is not finding cpp (the C preprocessor). If your cpp is
not located in /lib/cpp, edit config.h and correct the path in
CPP_PATH.
== checking lex output file root... configure: error: cannot find output from true; giving up
* Read the REQUIREMENTS section of this file.
LOCALES/INTERNATIONALIZATION
============================
Window Maker has national language support. To enable national language
support, you must compile Window Maker with some additional parameters.
0 - You must have the GNU gettext package installed. It can be
obtained at ftp://prep.ai.mit.edu/pub/gnu/gettext-nnn.tar.gz
Steps 1 to 3 can be skipped if you use the Install script.
1 - You have to select the languages you want to support. Set the
LINGUAS to the list of locales you want. English is always
suported. Example:
setenv LINGUAS "pt ja de"
in csh
or
export LINGUAS;LINGUAS="pt ja de"
in sh
The list of supported locales can be found in po/README.
English is the default language.
Read po/README if you wish to translate and maintain locale files
for other languages.
2 - Additionally, if your language uses multi-byte characters, such
as Japanese or Korean, you must set the MultiByteText option to YES
in ~/GNUstep/Defaults/WMGLOBAL
3 - Configure, build and install Window Maker normally.
4 - To select a particular locale at runtime you must set the LANG
environment variable to the locale you want. For example, if you want to set
the portuguese locale, you must run
setenv LANG pt
in csh or
export LANG; LANG=pt
in Bourne sh and similars
Note: If you have the LC_CTYPE environment variable set, you must
unset it before running wmaker.
For menu definition files, Window Maker searches for them in the
following order (for brazilian portuguese, in this case):
menu.pt_BR
menu.pt
menu

210
Install Executable file
View File

@@ -0,0 +1,210 @@
#!/bin/sh
#
# WindowMaker configuration and compilation script.
#
# Copyright (c) 1997, 1998 Alfredo K. Kojima
#
export LINGUAS;LINGUAS=""
if test "$NLSDIR" = ""; then
export NLSDIR;NLSDIR="/usr/lib/locale"
fi
OPTIONS=""
PREFIX="/usr/local"
perai() {
echo "Type <Return> to continue"
read nada
}
echo
echo "========================"
echo "WindowMaker Installation"
echo "========================"
echo
echo "NOTE: If the installation procedure fails, read the INSTALL file and do"
echo "the installation manually."
perai
if test "$USER" != "root"; then
echo "Warning: you must run this script as the root user."
perai
echo
echo "Be sure to specify an installation path where you have"
echo "write persmission."
echo
fi
echo
echo "Option Selection"
echo "================"
######################## Sound
echo
echo "Do you want sound support? Note that you need a module distributed"
echo "separately to make it work. You can get it at:"
echo "http://www.frontiernet.net/~southgat/wmsound"
echo -n "<y/n> [y] "
read SFX
if [ "x$SFX" = "x" -o "$SFX" = "y" -o "$SFX" = "Y" ]; then
OPTIONS="$OPTIONS --enable-sound"
fi
######################## NLS
echo
echo "Do you want National Language Support?"
echo -n "<y/n> [n] "
read NLS
if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
NLS="Y"
echo "The supported locales are:"
ling=` (cd po; /bin/ls *.po) `
ALL_LINGUAS=""
for l in $ling; do
lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
lname=`echo $lname`
lcode=`basename $l .po`
ALL_LINGUAS="$ALL_LINGUAS $lcode"
echo "$lcode $lname"
done
echo "Type in the locales you want [$ALL_LINGUAS]"
read foo
if test "x$foo" = "x"; then
LINGUAS=$ALL_LINGUAS
else
LINGUAS="$foo"
fi
echo "Selected locales are: $LINGUAS"
MB=""
for i in $LINGUAS; do
ok=0
for b in $ALL_LINGUAS; do
if test "$b" = "$i"; then
ok=1
break
fi
done
if test "$ok" = "0"; then
echo
echo "$i is not a supported locale"
perai
continue
fi
if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
echo
echo "A language you selected needs multi-byte character support"
echo "Do you want to enable it?"
echo -n "<y/n> [n] "
read MB
if [ "$MB" = "y" -o "$MB" = "Y" ]; then
OPTIONS="$OPTIONS --enable-kanji"
fi
fi
done
echo
echo "Where do you want to put the message files? [$NLSDIR]"
echo -n "? "
read foo
if test "x$foo" != "x"; then
NLSDIR=$foo
fi
fi
##################### Installation path
done=0
while [ $done = 0 ]; do
echo
echo "Where do you want to install WindowMaker? [$PREFIX]"
echo "Don't change it if you don't know what you're doing."
echo "(The default path will install WindowMaker in "
echo "$PREFIX/bin, $PREFIX/lib etc.)"
echo -n "? "
read foo
if test "x$foo" != "x"; then
if [ "$foo" = "y" -o "$foo" = "n" ]; then
echo
echo "Hmm... I don't think you really want to install WindowMaker into \"$foo\""
echo
else
done=1
PREFIX=$foo
fi
else
done=1
fi
echo
echo "$PREFIX/bin must be in the PATH environment variable of all users who use WindowMaker"
perai
done
OPTIONS="$OPTIONS --prefix=$PREFIX"
###################### Build libPropList
if [ ! -d libPropList ]; then
gzip -d -c libPropList.tar.gz | tar xf -
fi
echo "-----------------------"
echo "Building libPropList..."
echo "-----------------------"
cd libPropList
if [ ! -f config.status ]; then
./configure
fi
make
cd ..
if [ ! -f libPropList/libPropList.a ]; then
echo "Build of libPropList was not successfull. "
exit
fi
##################### Configure
echo "--------------------------"
echo "Configuring WindowMaker..."
echo "--------------------------"
if [ `uname -s` = "SCO_SV" ]; then
echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
CFLAGS="$CFLAGS -belf -DANSICPP" ./configure $OPTIONS
else
echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
CFLAGS="$CFLAGS $GCCFLAGS" ./configure $OPTIONS
fi
#################### Compile
echo "------------------------"
echo "Compiling WindowMaker..."
echo "------------------------"
(cd src; make clean)
make
echo "-------------------------"
echo "Installing WindowMaker..."
echo "-------------------------"
make install
echo
echo "Installation Finished!"
echo
echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
echo "script that was just installed."
if test "$NLS" = "Y"; then
echo "Don't forget to set the LANG environment variable to your locale"
fi

54
MIRRORS Normal file
View File

@@ -0,0 +1,54 @@
WindowMaker FTP Mirror Sites
============================
Official Site (USA):
--------------------
ftp://ftp.windowmaker.org/
Australia:
----------
ftp://ftp.goldweb.com.au/pub/WindowMaker/
Contact: Matthew Hawkins <matt@goldweb.com.au>
France:
-------
ftp://ftp.ensm-ales.fr/pub/mirrors/ftp.windowmaker.org
Contact: Laurent PELLISSIER <Laurent.Pellissier@ensm-ales.fr>
Germany:
--------
ftp://ftp.freenews.de/pub/windowmaker/
Contact: Jonas Luster <jonas@cabal.arnooo.de>
United States of America:
-------------------------
ftp://ftp.io.com/pub/mirror/windowmaker/
Contact: Bobby <bobby@mezaway.org>
http://jgo.local.net/cool_downloads/wm/
Contact: Joshua Go <joshuago@usa.net>
ftp://ftp.cybertrails.com/pub/windowmaker/
Contact: Adam Jacob <adam@cybertrails.com>
Third Party WindowMaker Distribution Packages
=============================================
RedHat/RPM
----------
Contact: Jim Knoble <jmknoble@pobox.com>
Sites:
ftp://ftp.windowmaker.org/pub/beta/compiled/linux/rpms/
ftp://ftp.redhat.com/pub/contrib/SRPMS/
ftp://ftp.redhat.com/pub/contrib/i386/

View File

@@ -1,53 +1,14 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc
BUILT_SOURCES = config-paths.h
DISTCLEANFILES = config-paths.h EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS Install acconfig.h\
libPropList.tar.gz mkpatch
config.h: config-paths.h libPropList.tar.gz:
-(cd libPropList; $(MAKE) distclean)
-rm -f libPropList.tar.gz
tar cf libPropList.tar libPropList
gzip -9 libPropList.tar
config-paths.h: Makefile
@echo "Generating $@"
@echo '/* define to the path to cpp */' > $@
@echo '#define CPP_PATH "$(CPP_PATH)"' >> $@
@echo '' >> $@
@echo '/* gettext domain used for menu translations */' >> $@
@if test -z "$(menutextdomain)"; then \
echo '/* #undef MENU_TEXTDOMAIN "$(menutextdomain)" */' >> $@; \
else \
echo '#define MENU_TEXTDOMAIN "$(menutextdomain)"' >> $@; \
fi
@echo '' >> $@
@echo '/* define an extra path for pixmaps */' >> $@
@echo '#define PIXMAPDIR "$(pixmapdir)"' >> $@
@echo '' >> $@
@echo '/* where shared data is stored */' >> $@
@echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@
@echo '' >> $@
@echo '/* where the configuration is stored */' >> $@
@echo '#define SYSCONFDIR "$(sysconfdir)"' >> $@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = wrlib WINGs src util po WindowMaker WPrefs.app doc
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N INSTALL \
INSTALL-WMAKER README.definable-cursor \
The-perfect-Window-Maker-patch.txt \
README COPYING.WTFPL autogen.sh
if USE_LCOV
coverage-reset:
find . -type f -name '*.gcda' -exec rm -f '{}' ';'
lcov --directory . --zerocounters
coverage:
rm -rf coverage @lcov_output_directory@
-mkdir -p coverage @lcov_output_directory@
lcov --compat-libtool --capture --directory . --output-file coverage/coverage.info
genhtml --output-directory @lcov_output_directory@ coverage/coverage.info
.PHONY: coverage-reset coverage
endif

322
Makefile.in Normal file
View File

@@ -0,0 +1,322 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP_PATH = @CPP_PATH@
DFLAGS = @DFLAGS@
GFXFLAGS = @GFXFLAGS@
GFXLIBS = @GFXLIBS@
I18N = @I18N@
I18N_MB = @I18N_MB@
ICONEXT = @ICONEXT@
INTLIBS = @INTLIBS@
LIBPL_INC_PATH = @LIBPL_INC_PATH@
LIBPL_LIBS = @LIBPL_LIBS@
LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
MOFILES = @MOFILES@
NLSDIR = @NLSDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
REDUCE_APPICONS = @REDUCE_APPICONS@
SHAPE = @SHAPE@
SOUND = @SOUND@
VERSION = @VERSION@
WPMOFILES = @WPMOFILES@
XCFLAGS = @XCFLAGS@
XGETTEXT = @XGETTEXT@
XLFLAGS = @XLFLAGS@
XLIBS = @XLIBS@
XSHM = @XSHM@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LOCALE = @X_LOCALE@
pixmapdir = @pixmapdir@
wprefsdir = @wprefsdir@
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS Install acconfig.h\
libPropList.tar.gz mkpatch
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ./src/config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS TODO aclocal.m4 config.guess config.sub configure \
configure.in install-sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: all-recursive all-am
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
done; \
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) install \
&& $(MAKE) installcheck \
&& $(MAKE) dist
-rm -rf $(distdir)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
$(MAKE) check-recursive
installcheck: installcheck-recursive
all-am: Makefile
install-exec: install-exec-recursive
@$(NORMAL_INSTALL)
install-data: install-data-recursive
@$(NORMAL_INSTALL)
install: install-recursive
@:
uninstall: uninstall-recursive
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs: installdirs-recursive
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-tags mostlyclean-generic
clean-am: clean-tags clean-generic mostlyclean-am
distclean-am: distclean-tags distclean-generic clean-am
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
distclean-am
mostlyclean: mostlyclean-recursive mostlyclean-am
clean: clean-recursive clean-am
distclean: distclean-recursive distclean-am
-rm -f config.status
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-rm -f config.status
.PHONY: install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
installcheck all-am install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
libPropList.tar.gz:
-(cd libPropList; $(MAKE) distclean)
-rm -f libPropList.tar.gz
tar cf libPropList.tar libPropList
gzip -9 libPropList.tar
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1320
NEWS

File diff suppressed because it is too large Load Diff

401
README
View File

@@ -1,327 +1,194 @@
WindowMaker X11 Window Manager
GNU Window Maker
X11 Window Manager
<http://windowmaker.org> <http://windowmaker.org>
<ftp://ftp.windowmaker.org>
by
Alfredo K. Kojima Alfredo K. Kojima
<kojima@windowmaker.org>
Dan Pascu Dan Pascu
<dan@windowmaker.org>
Matthew Hawkins
<matt@windowmaker.org>
Web/FTP Master
Phillip Smith
Congratulations! You have purchased an extremely fine
device that would give you thousands of years of trouble-free
service, except that you undoubtably will destroy it via some
typical bonehead consumer maneuver. Which is why we ask you
to PLEASE FOR GOD'S SAKE READ THIS OWNER'S MANUAL CAREFULLY
BEFORE YOU UNPACK THE DEVICE. YOU ALREADY UNPACKED IT, DIDN'T
YOU? YOU UNPACKED IT AND PLUGGED IT IN AND TURNED IT ON AND
FIDDLED WITH THE KNOBS, AND NOW YOUR CHILD, THE SAME CHILD WHO
ONCE SHOVED A POLISH SAUSAGE INTO YOUR VIDEOCASSETTE RECORDER
AND SET IT ON "FAST FORWARD", THIS CHILD ALSO IS FIDDLING
WITH THE KNOBS, RIGHT? AND YOU'RE JUST NOW STARTING TO READ
THE INSTRUCTIONS, RIGHT??? WE MIGHT AS WELL JUST BREAK THESE
DEVICES RIGHT AT THE FACTORY BEFORE WE SHIP THEM OUT, YOU
KNOW THAT?
-- Dave Barry, "Read This First!"
Description Description
=========== ===========
Window Maker is the GNU window manager for the X Window System. It was designed WindowMaker is a window manager designed to emulate the look and feel of
to emulate the look and feel of part of the NEXTSTEP(tm) GUI. It's supposed to part of the NEXTSTEP(tm) GUI. It's supposed to be relatively fast and small,
be relatively fast and small, feature rich, easy to configure and easy to use, feature rich, easy to configure and easy to use, with a simple and elegant
with a simple and elegant appearance borrowed from NEXTSTEP(tm). appearance borrowed from NEXTSTEP(tm).
Window Maker was designed keeping integration with GNUstep in mind and is the
"official" window manager for it. It is also part of the GNU project
(www.gnu.org) Read more about GNUstep further on this file.
Hints (information given by applications to integrate well with the window
manager) for Motif(tm) and NETWM are also supported (NETWM is used by KDE and
GNOME, so they are automatically supported as a result). So you can replace any
of the window managers for these environments with Window Maker while keeping
most, if not all, of the native window manager functionality.
Window Maker was previously called WindowMaker.
Window Maker has no connection with Windowmaker, the software for making windows
and doors.
Documentation User Guide
============= ==========
Read before asking.
* README files all over the source tree have info related to the stuff
in the directories.
* INSTALL has installation instructions and some troubleshooting tips.
You're meant to read it before installing. it was not written just to fill up
space in the package.
* FAQ: Frequently Asked Questions. READ IT!!! FAQ.I18N is for
internationalization related questions.
* NEWS: list user visible changes from the previous version. Read it if
you are upgrading.
* BUGFORM: use it to send bug reports. Please do use it.
* ChangeLog: what changed from the previous version?
* BUGS: list of known bugs
*** Tutorial
There's a tutorial maintained by Georges Tarbouriech at:
http://www.linuxfocus.org/~georges.t/
*** User Guide
The WindowMaker User's Guide can be downloaded from the official ftp The WindowMaker User's Guide can be downloaded from the official ftp
or web sites. or web sites.
It can also be viewed in HTML format in:
The User Guide explains how to use Window Maker, the configuration files http://people.delphi.com/crc3419/WMUserGuide/index.htm
and options.
*** man pages Directories & Files
===================
Type "man wmaker" in the shell prompt to get general help about Window Maker o INSTALL contains installation instructions and some troubleshooting tips.
o Install is a script for configuring and compiling WindowMaker in a easy
way.
o ChangeLog contains the changes since the last version
o BUGS contains a list of the currently known bugs
o FAQ is a list of frequently asked questions. Read it. I won't answer
questions answered in it.
o NEWS is a list of user visible changes since the last version. Read it if
you are upgrading.
o wmlib/ contains the library necessary to write applications that use
WindowMaker specific features, like application defined menus. This library
will be merged into WINGs in the future.
o WINGs/ contain the WINGs (WINGs Is Not GNUstep) tiny widget library. It is
used by wmaker, but can be used by standalone programs as well.
o test/ contains a simple test program that shows some of the things that can
be done with WindowMaker and wmlib
o wrlib/ contains the library used to do image manipulation (loading,
dithering etc.) in WindowMaker. It can be used in other applications.
o util/ contains various utility programs.
o WPrefs/ contains the source code for the WindowMaker Preferences utility.
Read the WPrefs/README file before using it.
o Configuration options can be found in the ~/GNUstep/Defaults/* files
(after installation). The menus can be configured in
~/GNUstep/Library/WindowMaker/menu
o The default configuration files for the system are installed by default in
/usr/local/share/WindowMaker, along with some other data files.
o src/wconfig.h contains various compile time options you can change to
select some options/features and things like the path for configuration
directory.
o BUGFORM is a form you should fill to send a bugreport. Please use the
form. It makes things easier to me and ensures that you give me a reasonable
amount of information. This form should be sent to developers@windowmaker.org
Mailing List
Directories & Files in the Source Tree ============
======================================
* Install is a script for configuring and compiling Window Maker in a easy
way (not that the normal way is difficult, but...).
* AUTHORS: the credits
* TODO: plans for the future
* contrib/ has some contributed patches that are not supported by Window Maker
because they conflict with design philosophies of the developers or some other
reason.
* util/ has various utility programs.
* WPrefs.app/ is the configuration program.
* src/wconfig.h has compile time options you can change to select some
options/features and other stuff.
* WINGs/ NEXTSTEP lookalike widget library
* wrlib/ image processing library
* po/ has message catalogs wich are the translated versions of the messages
displayed by Window Maker.
* docklib-x.x.tar.gz a library for writing dockapps
HELP ME!!!
==========
There is a mailing list for discussing WindowMaker at There is a mailing list for discussing WindowMaker at
wmaker-user@lists.windowmaker.org To subscribe to it, send a message to wmaker@linuxcenter.com To subscribe to it, send a message containing:
wmaker-user-subscribe@lists.windowmaker.info subscribe
in the subject and the body of the message to wmaker-request@linuxcenter.com
If you got a problem, ask there (after reading the docs, of course). The people If you have some problem installing or using wmaker, it would be advisable
there is more likely to be able to answer your questions than we are. For bug to ask in the mailing list, as the probability of at least one of the 500+
reports use the BUGFORM. users there having the same problem as you (and solving it) is bigger than
the three of us. The developers are subscribed to the mailing list, so we
will read your post anyway (no need for cc:). For bug reports, fill
the BUGFORM and send it to developers@windowmaker.org You can also use
the bug tracker page at http://windowmaker.org/cgi-bin/bugs
If you have a problem with a precompiled version of Window Maker (rpm, deb etc), Important note: when asking for help (in the mailing list or to the
first ask the person who made the package. developerts, directly) always send information about the system you are
using. You can use the system information section at the end of BUGFORM
as a guideline. Another thing: please don't send HTML mail. You will
be risking having your mail deleted before being read. Not everybody
uses a browser to read email, wich makes your message an annoyance.
There should be an option in your mail app to disable it.
IMPORTANT NOTE: when asking for help (in the mailing list or to the developerts,
directly) *always* send information about the system you are using. You can use
the system information section at the end of BUGFORM as a guideline. Another
thing: please don't send HTML mail.
There is also a #windowmaker IRC channel at freenode. To join there, connect
your irc client to irc.freenode.net. irc.windowmaker.org will direct you to the
correct IRC network.
GNUstep
=======
GNUstep is a complete object-oriented development system, based on the OpenStep
specification released by NeXT(tm) (now Apple(tm)) and Sun(tm). It will provide
everything one needs to produce cross-platform, object-oriented, graphical (and
non-graphical) applications; providing among other things, base system
libraries, a high-level GUI application framework that uses a Display
PostScript(tm)-like imaging model (DGS), objects for accessing relational
databases, distributed objects and a graphical development environment, with
tools like interface modeller, a project management system (project center) and
other tools.
The GNUstep development system will be used to create a user environment, with
everything needed for a complete graphical user interface, such as a file
viewer, text editors and other applications. Note that the user environment (or
"desktop environment") is only a small part of the whole GNUstep project and
therefore it does not "compete" with other projects like KDE or GNOME, simply
because they are completely different things.
For more information on the GNUstep project, visit: http://www.gnustep.org
Running multiple instances of WindowMaker Running multiple instances of WindowMaker
========================================== =========================================
It is not a good idea to run more than one instance of WindowMaker It is not a good idea to run more than one instance of WindowMaker
from the same user (so that wmaker will use the same configuration files) at the from the same user (so that wmaker will use the same configuration
same time. You might get unexpected behaviour when Window Maker updates it's files) at the same time. You might get unexpected behaviour when WindowMaker
configuration files. updates it's configuration files.
If you really desire to do this, try running Window Maker with the command line
option --static so that it will not update or change any of the configuration Sound support
files. =============
Sound is supported for Linux and FreeBSD systems with the use of a
separately distributed module. You can download it at:
http://www.frontiernet.net/~southgat/wmsound
Note that you must compile WindowMaker with the --enable-sound configure
flag and set the DisableSound option to NO.
Performance Tuning Performance Tuning
================== ==================
If you want to diminish WindowMaker's memory usage and improve performance, If you want to diminish WindowMaker's memory usage and improve performance,
while keeping a nice appearance and good functionality, follow the items bellow: while keeping a nice appearance and good functionality, follow the items
bellow:
- use solid textures for everything, mainly titlebars and menus. If you want a - use solid textures for everything, mainly titlebars and menus. If you
nice looking desktop, use the Traditional style. want a nice looking desktop, use the Traditional style.
- turn NewStyle and Superfluous off - turn NewStyle and Superfluous off
- do not bind many shortcuts in the menu and keep only the essential items in - turn on DisableAnimations
the menu - do not bind many shortcuts in the menu and keep only the essential items
in the menu
- turn on DisableClip - turn on DisableClip
- edit wconfig.h and disable the NUMLOCK_HACK and the features you don't use - edit wconfig.h and disable the NUMLOCK_HACK and the features you
anyway (keep in mind that some of the #defines might not work, as they are not don't use anyway (keep in mind that some of the #defines might not
fully supported). Make sure to always keep NumLock and ScrollLock turned off. work, as they are not fully supported). Make sure to always keep
- turn on DisableAnimations. You can also #undefine ANIMATIONS in wconfig.h NumLock and ScrollLock turned off.
- strip down the default IconPath and PixmapPath entries to contain only - strip down the default IconPath and PixmapPath entries to contain only
the paths that you really have in your system. the paths that you really have in your system.
- do not use large images in the root background - do not use large images in the root background
- remove support for image formats you don't use - remove support for image formats you don't use
- to reduce memory usage, disable the icon cache, by setting the RIMAGE_CACHE
environment variable to 0. If you want to increase performance at the cost of
memory usage, set it's value to a value like the number of different icons you
use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
Keyboard Mouse Control Copyrights
====================== ==========
Many people ask about adding keyboard control of mouse, like in fvwm, but Window WindowMaker is copyrighted by Alfredo K. Kojima and is licensed through the
Maker will not have such feature. The XKB extension supports mouse simulation GNU General Public License. Read the COPYING file for the complete license.
from the keyboard, in a much more powerfull fashion than any simulation done by
a window manager.
To enable it, hit the Control+Shift+NumLock or Shift+NumLock key combination. NeXT, OpenStep and NEXTSTEP are a trademarks of NeXT Computer, Inc.
You should hear the speaker beeping. To disable it, do the same thing.
To control the mouse the numeric keypad is used as follows:
- 4 (left arrow), 7 (Home), 8 (up arrow), 9 (PgUp), 6 (right arrow),
3 (PgDn), 2 (down arrow) and 1 (End) move the mouse to the corresponding
direction;
- holding one of the above keys and then holding the 5 key will move the
pointer faster;
- / will select the first mouse button (left button);
- * will select the second mouse button (middle button);
- - will select the third mouse button (right button);
- 5 will do a click with the currently selected mouse button;
- + will do a double-click with the currently selected button;
- 0 (Ins) will click and hold the currently selected button;
- . (Del) will release the currently selected button that was previously
clicked with the 0 (Ins) key.
The above key values work in a XFree86 3.2 (X11R6.1) X server but your
milleage may vary.
How to make a gdb backtrace
===========================
Backtraces can help us fix bugs that make Window Maker crash. If you find a bug
that crashes Window Maker, please send a backtrace with your bug report.
To make a usefull backtrace, you need a core file with debugging information
produced by Window Maker when it crashes. It should have been installed without
stripping too.
To compile wmaker with debugging information:
./configure
make CFLAGS=-g
If you get the dialog window telling you that wmaker crashed and asks you what
to do, tell it to "Abort and leave a core file".
script
cd src
gdb .libs/wmaker path_to_the_core_file
Then, in the gdb prompt type "bt". Quit from gdb by typing "quit" and then, in
the shell prompt, type "exit".
The file named typescript will contain the backtrace.
Copyrights & Disclaimers
========================
Window Maker is copyrighted by Alfredo K. Kojima and is licensed through the GNU
General Public License. Read the COPYING file for the complete license.
The icons that are distributed with this program and were made by Marco van
Hylckama Vlieg, are licensed through the GNU General Public License. Read the
COPYING file for the complete license.
The icons listed in COPYING.WTFPL and are distributed in this program and were
made by Banlu Kemiyatorn (]d), are licensed through the "do What The Fuck you
want to Public License". Read the COPYING.WTFPL file for the complete license.
NeXT, OpenStep and NEXTSTEP are a trademarks of NeXT Computer, Inc. All other
trademarks are property of their respective owners.
The authors reserve the right to make changes in the software without prior
notice.
Authors Authors
======= =======
Alfredo K. Kojima <kojima@windowmaker.info>
Dan Pascu <dan@windowmaker.info>
]d <id@windowmaker.info>
Please don't ask us questions before reading the documentation (esp. the FAQ,
this file and INSTALL files) and about "cool" things you see in people's desktop
screenshots.
The AUTHORS file contains a list of the people who have contributed to the The AUTHORS file contains a list of the people who have contributed to the
project. The name of people who have helped with localization (translation) can project. The name of people who have helped with localization (translation)
be found in po/README and Window Maker/README can be found in po/README and WindowMaker/README
If you have any comments, fixes and bug reports (filled BUGFORMs) send them If you have any comments, fixes and bug reports (filled BUGFORMs) send them
to wmaker-dev@lists.windowmaker.org to kojima@windowmaker.org
Musicware
=========
If you use WindowMaker and *really* like it, please consider making my day
by sending me a music CD (or a MiniDisc) of your favorite band, singer,
instrumentist, composer or whatever :^). I like listening to music and would
love to get new CDs, especially from other parts of the world. I like almost
any kind of music, from Ozzy Osbourne to Bach (mas não pagode e sertanejo
pelamordideus :), so I will be happy to receive just about anything.
Snail mail address:
Alfredo Kengi Kojima
Rua Firmino O. Bimbi, 255/25B
Porto Alegre - RS
CEP 91751-330
Brazil

View File

@@ -1,92 +0,0 @@
Definable Mouse Cursors for Window Maker
----------------------------------------
The definable-cursor feature allows user-definable mouse cursors; the
cursors can either be the built-in ones from the X11 cursor font, or
they can be bitmap (XBM) files. User-definable cursors can be useful
for theme-builders, lefthanders, and the visually impaired.
Defining Your Own Cursors
-------------------------
A cursor specification takes one of the following forms in the
~/GNUstep/Defaults/WindowMaker file:
(none)
(builtin, <cursor-name>)
(bitmap, <bitmap-filename>, <mask-filename>)
They have the following meanings:
none The cursor is inherited from the parent window (often,
this means the root window).
builtin Use the cursor named <cursor-name> from X11's set of
built-in cursors. The names are the same as you use
with 'xsetroot -cursor_name'. See the xsetroot(1) man
page for more information.
bitmap Use the bitmap in <bitmap-filename> as the foreground
cursor bitmap, and the one in <mask-filename> as the
background (mask) bitmap. This is pretty much the same
as 'xsetroot -cursor', except that Window Maker searches
for the bitmaps along its PixmapPath.
You can set the following cursor types (they're shown here with their
defaults):
NormalCursor = (builtin, left_ptr);
ArrowCursor = (builtin, top_left_arrow);
MoveCursor = (builtin, fleur);
TopLeftResizeCursor = (builtin, top_left_corner);
TopRightResizeCursor = (builtin, top_right_corner);
BottomLeftResizeCursor = (builtin, bottom_left_corner);
BottomRightResizeCursor = (builtin, bottom_right_corner);
VerticalResizeCursor = (builtin, sb_v_double_arrow);
HorizontalResizeCursor = (builtin, sb_h_double_arrow);
WaitCursor = (builtin, watch);
QuestionCursor = (builtin, question_arrow);
TextCursor = (builtin, xterm);
SelectCursor = (builtin, cross);
The following cursor types are allowed, but they're deprecated (Window
Maker used them in the past, but doesn't use them anymore):
ResizeCursor = (builtin, sizing);
Using Cursors with 'getstyle' and 'setstyle'
--------------------------------------------
The 'getstyle' and 'setstyle' style/theme-management utilities can
handle user-definable cursors. By default, 'getstyle' ignores cursor
definitions; using 'getstyle -t' to get theme-related settings will
also include any cursors you've defined in the resulting stylefile.
However, by default, 'setstyle' does NOT ignore cursor settings. If
you wish to set a style or theme without installing cursor settings,
you can use 'setstyle --no-cursors' to ignore the cursor definitions.
Random Notes
------------
Most X11 cursors are 16x16 bitmaps. Many X servers can actually handle
larger cursors, though. To check, use:
xdpyinfo
and in the resulting output look for a line such as:
largest cursor: 64x64
The example above indicates that my X server can handle cursors up to
64 pixels wide by 64 pixels high.
You can create your own bitmap cursors using the 'bitmap' program that
accompanies most X11 distributions. For example bitmap cursors and
masks, see <http://www.pobox.com/~jmknoble/WindowMaker/cursors/>.

70
TODO
View File

@@ -1,70 +1,50 @@
remake wrlib rule to not compile with -fomit-frame-pointer and stuff
if its added to CFLAGS
Do ASAP: Do ASAP:
======== ========
- fix bestvisual selection code. Broken. - fix bestvisual selection code. Broken.
- add a dialog to let user choose if we should restart, restart twm or continue crashing on crash. Do not forget to check if wmaker is already fully running.
- fix stacking. buggy again
+ ICCCM compliant stuff: find what is missing
- WM_COLORMAP_NOTIFY clientmessage
- fix RemakeStackList() to account for transient windows - fix RemakeStackList() to account for transient windows
- blink border of clients with UrgencyHint set between red and black - change CommitStacking() on AddToStackingList() to more optimized thing
- finish session stuff - differential update of appmenu
- remove colors_per_channel stuff from wmaker after? - make unhide app map windows in the same stacking order they were before
+ finish the ability to browse for files/dirs in the WPrefs menu editor hiding
- check whether window states are being saved/restored properly via netwm
on restart/crash-restart (grep for XXX/TODO)
Need to do: Need to do:
=========== ===========
- figure out a better gnustep path for wprefs.app installation
- impelment a generic pixmap type, which receives attributes
(scaled/maxscaled/centered/tiled, smoothed, size/position, ...)
- allow user to select/restore default root menu from wprefs
- support for X11R6.4 extension for getting extra visual info in wrlib's
automatic best context guessing
- docklet to control AccessX (keyboard accessibility) functions
- rewrite all redundant stuff to use WINGs - rewrite all redundant stuff to use WINGs
- resizebartexture option
- add function to directly make a thumbnail of an image, using the - add function to directly make a thumbnail of an image, using the
functionality provided by the image libraries to load a minimal functionality provided by the image libraries to load a minimal
amount of data. amount of data.
- clickonclientarearaisewindow
- edge resistance (with timer)
- save client supplied icons in ~/GNUstep/.AppInfo/ClientIcons/ and
use them by default
- GNUstepWMAttributes update in propertynotify
+ investigate memory leaks
- make Docked apps with WM_CLIENT_MACHINE be launched from respective
machines (also put a marking showing it's remote launched)
- handle change of CLIENT_LEADER property
- rewrite defaults/wdefaults stuff to use WINGs UD stuff. Search list: - rewrite defaults/wdefaults stuff to use WINGs UD stuff. Search list:
~/G/D/WindowMaker /u/l/s/W/D/WindowMaker built-in-defaults ~/G/D/WindowMaker /u/l/s/W/D/WindowMaker built-in-defaults
- remake internal string processing to use wchar? unicode? - remake internal string processing to use wc?
- add new file for stuff like default commands and dnd commands for - -statefile cmd arg to specify path for WMState file (multiple instance
docked apps, balloons for the dock etc support)
- check whether apps with name.class set to empty strings should be treated
like if name.class is NULL.NULL
- review the defaults handling code (not to reread after we update a
domain if possible, check WINGs apps updating WMWindowAttributes after
start making screen to flash on update)
Maybe some day: Maybe some day:
=============== ===============
- virtual workspace - virtual desktop
- optimize for size - optimize for size
- make dithering in 8bpp better
Never: (so, dont even bother to ask) Never: (so, dont even bother to ask)
====== ======
- different themes for each workspace. Unless you give us a SGI/Power Onyx - different themes for each workspace. Unless you give us a SGI/Power Onyx
with 2 CPUs ;). with 2 CPUs ;). Different workspacebacks for each workspace is being
considered, but don't hold your breath.
- anything that requires the mouse pointer to be jumped by WindowMaker to - anything that requires the mouse pointer to be jumped by WindowMaker to
somewhere. This is *terrible* behaviour. And it's not just IMO. somewhere. This is *terrible* behaviour. And it's not just IMO.
- rewrite to use Gtk... I wont even bother to explain why...
- ICCCM 2.0: ICCCM 2.0 (not 1.0, which is what everybody supports so so) is
a relatively new standard and nobody, AFAIK, complies with it (not even
twm as people tend to think). It has some neat things, but many of the new
stuff is really weird and tricky to implement, not to say unworthy (read the
specs and you'll see). This is not bad, since I think it is very unlikely
that a client that requires it exists... Anyway, if we get an "official"
sample implementation (twm?) it might be supported. Maybe dtwm supports
it? I dont know...
After 1.0.0 is released
=======================
- rework/redesign the appicon/dock/clip concept
- maybe rewrite the main code in obj-c or c++
- major clean up in theming/texturing stuff

View File

@@ -1,87 +0,0 @@
____________
Introduction
------------
This short tutorial is meant to help you help me in the task
of having a maintainable and bug-free Window Maker.
It assumes you have 'git' correctly installed and you have set
the most basic configuration options via 'git config' (or by
editing the $HOME/.gitconfig file yourself). See the end
of this file for an example .gitconfig (which is the one
I use).
You should probably by now have already cloned my repository,
but here is how you can do it just in case:
# this is the preferred method (ie faster, native implementation)
git clone git://repo.or.cz/wmaker-crm.git
# use the http method only if are behind a firewall which blocks git://
git clone http://repo.or.cz/r/wmaker-crm.git
__________________________________
How to submit patches the git way
----------------------------------
Suppose you have a working copy of the git repo and you found
a bug in Window Maker and you know how to fix it. This is
what you can do to submit your patch in a way which will allow
me to apply it quickly.
# Optional: Create a new branch (just to be safe in case you screw up)
git checkout -b my-new-branch
Now you edit and save the files to fix the bug...
# Optional: Check what you did, review etc
git diff
# if it looks good, commit your changes
git commit -a
# git will pop up the editor which you configured in .gitconfig so
# that you will be able to write a commit log. It will use the 'vi'
# editor otherwise.
(write a _good_ and succinct commit log, explaining what you fixed etc)
# Prepare the patch to submit to the mailing-list. This step will create
# a file named 0001-subject-of-your-patch.patch from the last commit
# (use HEAD~2 if you want patches for the last 2 commits etc)
git format-patch HEAD~1
After the above steps, you are ready to send the created .patch file
to the mailing-list: wmaker-dev@lists.windowmaker.org
Just send it as-is, and I will be able to apply it with
# this is how I am going to apply your patch
git am 0001-subject-of-your-patch.patch
and it will automatically append your commit to the repo, with the
proper authorship, date, subject, commit log etc.
___________________
Example .gitconfig
-------------------
[user]
name = Erwin Schrodinger
email = schrodinger@gmail.com
[core]
editor = xjed
[status]
showUntrackedFiles = no
[color]
branch = auto
status = auto
diff = auto
ui = auto
[apply]
whitespace = fix

View File

@@ -1,3 +0,0 @@
- filepanel does not reread / . If you add new files in / they will not be
visible until the program is restarted. Closing and reopening the file
panel does not help.

View File

@@ -1,560 +1,3 @@
Changes since wmaker 0.92.0:
............................
- updated the XDND code in to work with GDK based applications.
WINGs based applications should now work with both KDE and GNOME
applications (Sylvain Reynal <sreynal@nerim.net>)
- better check for the XDND protocol version when interoperating with other
applications. As it seems xdnd version 3 (which WINGs supports) and newer
are not backward compatible with xdnd version 1 and 2. This is why WINGs
applications cannot interoperate with GNUstep applications (which uses
xdnd version 2). Xdnd version 4 and 5 are backwards compatible with
version 3 though. (Sylvain Reynal <sreynal@nerim.net>)
- removed dependency on rgb.txt from X11 and issues with locating it on the
filesystem for different systems/distributions.
- Removed dependency on rgb.txt (from X11) and issues with locating it on the
filesystem for different systems/distributions.
Changes since wmaker 0.80.1:
............................
- Added WMSetConnectionShutdownOnClose()
- Added an extra member to the ConnectionDelegate: canResumeSending
see NEWS for details.
- 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
Read NEWS for details since this will break backward compatibility.
- Added alpha channel to WMColor. 2 new functions also:
WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Added Xft2 support in WINGs (for drawing antialiased fonts with transparency).
- New options in WMGLOBAL: AntialiasedText. Check NEWS for details.
- Fixed some improper calls to snprintf in wfont.c
- Added double buffering when drawing a WMFrame title with an antialiased font
to avoid flickering.
- Added double buffering when drawing WMList items to avoid flickering.
Double buffering for list also works for user drawn lists. Read NEWS for
details and incompatibilities introduced by this change.
- Added WMGetColorAlpha(WMColor *color)
- Better outline when drawing balloons.
- Added WMCreateFontWithAttributes()
- You can now pass "SystemFont", "BoldSystemFont", "SystemFont-##" or
"BoldSystemFont-##", with ## being the font size to any font creating
function to create a font with the (bold) system font font specification.
- Added WMCopyFontWithChanges(). This is a more generic and powerful function
meant to replaces the obsoleted WMEmphasizeFont(), WMNormalizeFont(),
WMStrenghtenFont() and the other similar functions. To get the same effect
you pass some predefined structs to it: WFANormal, WFABold, WFAEmphasized,
etc which are declared in WINGs.h).
- Fixed a bug with empty frame titles (Alexey Voinov <voins@voins.program.ru>)
- Added WMGetWidgetBackgroundColor()
- Code cleanup in wtext.c
- Fixed a memory leak in wfontpanel.c
- Fixed WMGetTextDefaultColor() not to retain the returned color. It returns
only a reference to the internal color, which you shouldn't release
- Added wstrndup()
- Added WMGetFontName()
- Added fontpanel callback
- Added WMSetTableViewHasHorizontalScroller()
- Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
a WINGs textfield widget.
- Fixed small memory leak in the font panel code.
- Fixed call to qsort in WMSortArray.
- Fixed a memleak in the file panel.
- Double/triple-click selection in text widgets
(Vitaly Ovtchinnikov <ov@rbcmail.ru>)
- Fixed bug in tableview (clicked row callback got incorrect row)
(Carlos Torres <vlaadbrain@operamail.com>)
- Fixed bug in resizing a scrollview
- Fixed bug with wrong text wrapping (Alexey Voinov <voins@voins.program.ru>)
- Added wmkrect()
- Added xdnd v3 support (Sylvain Reynal <sreynal@nerim.net>)
- Fixed and enhanced text wrapping.
Changes since wmaker 0.80.0:
............................
- fixed a bug in wfindfile() (rewrote wfindfile() with better logic).
- separated the font caches for normal fonts and fontsets in WINGs (they can
have the same names and collide in the cache giving unwanted results)
- fixed labels not to display '\n' as a character if multiple '\n' are passed
but just skip to the next line.
- better warning when importing non-digit characters in PropList Data.
- rewrote WMBox to use a WMArray for subviews. with this change fixed a bug
about arranging subviews after removing one and a memleak occuring in the
same case.
- Fixed WMGetViewScreenPosition() to consider the window decorations.
- Added ability to enable/disable individual WMTableViewItems.
- Fixed textfields regarding interpretation of special keys with modifiers.
- Fixed some functions that accept a boolean flag as a paramater, to set only
1 or 0 for the flag value, not the flag passed by the user.
- Added 2 functions to retrieve the default system fonts:
WMDefaultSystemFont(WMScreen *scr) and WMDefaultBoldSystemFont(WMScreen *scr)
- Added WMSetButtonImageDimsWhenDisabled() and WMGetButtonEnabled()
- Cleaned-up the header files of functions/vars declared but not implemented
- Added WMGetTextFieldDelegate()
Changes since wmaker 0.70.0:
............................
- added an internal strcasecmp() (only on systems where is not present)
- removed some redundant includes of ../src/config.h when wconfig.h is
included too
- removed a wsyserror() message when reading a property list from file
(the programmer should decide if to give that message or just ignore).
- added a 'Bool recursive' flag to WMMergePLDictionaries()
- added WMSubtractPLDictionaries()
Changes since wmaker 0.65.0:
............................
- fixed problem with WINGs based apps exiting with a "X_RotateProperties"
related error when text was selected in a textfiled.
- moved wstrdup(), wstrconcat() and wstrappend() from memory.c to string.c
- added property list handling code making libPropList unnecessary and
obsolete. Backward compatibility is provided through the
WINGs/proplist-compat.h header file which has #defines from old libPropList
function names to new function names with minimal changes. Read this
header file and the NEWS file for more details about this subject.
- Renamed WMGetUDAllKeys() to WMGetUDKeys()
Changes since wmaker 0.64.0:
............................
- made programmatic scroller changes send notifications
- replaced WMSetBoxExpandsToParent with WMSetViewExpands...
- added WMGetLabelFont()
- added WMAddPersistentTimerHandler()
- Moved all internal handlers (timer, idle and input) to handlers.c
- simplified wevent.c and wutil.c.
- fixed handling of input with poll (was broken)
- fixed mem leak that occured when input handling was done with poll
- simpler and more straightforward event handling for timer, idle, input
and X events (also fixed some problems the old handling logic had)
- moved timer, idle and input handler definitions and prototypes from
WINGs.h to WUtil.h because they're not GUI related.
- better and more robust handling of events (timer, idle, input, X) in
WMMaskEvent(). Also fixed a bug where input and timer events were not
treated for undefined periods of time under some circumstances.
- fixed secure textfields not to allow text selection, to avoid compromising
sensitive information by pasting it to a terminal.
- replaced wmkrange(), wmkpoint() and wmksize() functions with macros.
- added WMRemoveFromArrayMatching(array, match, cdata), which will remove the
first element in the array that is matched by match(item, cdata)==True.
- added WMArrayFirst(), WMArrayLast(), WMArrayNext() and WMArrayPrevious()
functions and also WM_ITERATE_ARRAY() and WM_ETARETI_ARRAY() macros, to make
interfaces to WMBag and WMArray similar and to make life a little simpler
when iterating through all elements of an array.
- replaced bags with arrays wherever appropriate. This will improve
performance a bit.
- replaced some recursive code with iterative code in selection.c
- added WMCreateBlendedPixmapFromRImage()
- 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 WMCreateApplicationIconBlendedPixmap() which will take the image
set by WMSetApplicationIconImage() and will combine 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 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.
- fixed a bug in WMReparentWidget()
- added WMReparentWidget() to WINGs.h
- fixed a bug that made the scroller knob jump backwards when dragged (this
bug had no relation with the behavior that #define STRICT_NEXT_BEHAVIOUR
attempts to accomplish).
- fixed scrolling direction with mouse wheel for horizontal scroller.
changes since wmaker 0.63.1:
............................
- added WMRunModalLoop() and WMBreakModalLoop()
- added WMSetBoxExpandsToParent()
- added WMRemoveBoxSubview()
- moved WINGs headers in a WINGs subdirectory when installed.
use #include <WINGs/header_file_name> in your application from now on.
Also updated get-{wings|wutil}-flags.
- Fixed a mem leak in WMList.
- Fixed a bug that caused sigsegv for a WMList with more than 32767 items.
- Added an example of how to create a server type program with WMConnection.
- added WMOpenScreen()
changes since wmaker 0.62.1:
............................
- added WRuler widget
- added WText widget (rtf multiline text widget)
Nwanua Elumeze <nwanua@colorado.edu>
- added a new AUTO option for the UseMultiByte option
- added WMRaiseWidget()/WMLowerWidget()
- added missing EscapeTextMovement to textfield delegate/notification
- added WMGetLabelText()
- added WMReparentWidget()
- added WMCreateTabViewItem()
- added W_CreateUnmanagedTopView()
- added wtokenjoin(), wtokensplit(), wtokenfree(), wtrimspace()
- added WMWidgetIsMapped()
- added WMSetApplicationIconWindow()
- restructured the directory tree. Added Documentation, Examples and Tests
subdirectories
- removed WMArrayBag and reorganized WMTreeBag to be WMBag.
- added WMArray class.
- added WMSetWindowUserPosition()
- added WMGetListSelectedItems()
- added WMSetListAllowMultipleSelection(), WMListAllowsMultipleSelection().
- added WMSetListAllowEmptySelection(), WMListAllowsEmptySelection().
- WMListSelectionDidChangeNotification passes NULL as the notification
client data (previously passed the selected item row).
- added WMUnselectListItem(), WMSelectAllListItems(), WMUnselectAllListItems()
- better behavior of wheel mices in WMList. Simple mouse wheel events
will scroll by 1/3 of the WMList height. Using Shift as a modifier will
scroll line by line, while using Control as a modifier will scroll page
by page.
- better behavior of WMScroller regarding mouse wheel events. 'Shift' modifier
will scroll line by line, while 'Control' modifier will scroll page by page.
- fixed some buffer overflow allowing bugs.
- added WSDecrementWheel and WSIncrementWheel for handling mouse wheel in
scrollers and scrolled widgets. This should be treated like the WSxxxPage
counterparts, except it should scroll by page_size/3 instead of one full page
- added WMSetBrowserAllowMultipleSelection(), WMSetBrowserAllowEmptySelection()
WMBrowserAllowsMultipleSelection() and WMBrowserAllowsEmptySelection()
- WMBrowser now allows multiple selections.
- Added WMGetBrowserPaths() to retrieve the paths for browsers that allow
multiple selections.
- WMDestroyWidget() now calls WMUnmapWidget() first
- added WMScrollerDidScrollNotification to scroller
- added WMGetScrollViewVisibleRect()
- fixed a mem leak in the browser code.
- renamed wstrappend() to wstrconcat(). wstrconcat(str1, str2) concatenates
str1 with str2 and returns that in a newly malloc'ed string.
Be sure to rename wstrappend with wstrconcat in your code too, else
hazardous things can happen!
- implemented a new wstrappend() function. wstrappend(dst, src) will append
src to dst modifing dst and returning a pointer to it. No new string is
generated, except if dst is NULL, in which case its the same as calling
wstrdup(src).
dst can ONLY be NULL or a dynamically allocated string (obtained from a
call to malloc, realloc, wmalloc, wrealloc, ...). dst CANNOT be a static
or a constant string!
- added wmessage() for printing a variable formatted string to stderr, with
the program name prepended to it. Similar to wwarning(), except that it
doesn't add "warning:" in the output message.
- added WMBox widget
- added WMAddTabViewItemWithView()
- added W_SetViewCursor()
- made Extra widgets library
- added table widget in Extras library
- added WMGetConnectionUnsentData() (WMGetConnectionQueuedData() too as an
alias).
- added WMSetConnectionCloseOnExec() to specify if the socket associated
with a connection survives an exec* call or not. When a new connection is
created using the WMCreate... or WMAcceptConnection() calls, it has the
close on exec flag set automatically to 'True' by the library. Unless
you want to let the socket of some connection to survive across an exec*
call, you need not to call this function.
- removed all the wsyserror() and wwarning() calls from host.c and
connection.c and replaced where appropriate with assertions. If a function
returns some invalid result, you can still get the system error message if
you need, by calling wsyserrorwithcode() and passing WCErrorCode, if
WCErrorCode > 0. If WCErrorCode==0, that is not a system error, and
wsyserrorwithcode() should not be called in this case.
- added WMNextHashEnumeratorKey() to retrieve all keys in some hash enumerator
one by one.
- fixed a bug with mouse wheels scrolling in scrollers even with the widget
fully visible.
- Fixed a memory leak (the destroy function for a view was never called and
as a result the shaded windows didn't go away when closed. The non-shaded
windows were unmapped on close but not destroyed either so they only
apparently went away, but continued to use memory).
- Fixed a bug in the hashtable code which free'd the whole item instead of
just the item key in WMResetHashTable() (possible source of SIGSEGVs)
changes since wmaker 0.62.0:
............................
- added WMSetWidgetDefaultFont(), WMSetWidgetDefaultBoldFont()
changes since wmaker 0.62.0:
............................
- added WM{S,G}etDataFormat()
- added drag and drop
- changed selection code
- added clientdata to WMFindInBag
- removed SetWindowInitialSize()
- added SetWindowAspectRatio()
- added initial timeout when establishing a connection.
- added WMSetConnectionDefaultTimeout() and WMSetConnectionOpenTimeout();
- added WMGetConnectionTimeoutState()
changes since wmaker 0.61.1:
............................
- WARNING: semantic of bags has changed!
An index assigned to an item will always keep that index unless
you insert an item before it.
For example:
bag = WMCreateBag();
WMSetInBag(bag, 10, "bla");
That code will put "bla" in index 10, instead of 0, as it used to be.
- fixed WMInsertInBag(). It ignored index, and always put the new item at end.
- added WMSaveUserDefaults().
- rewrote WMPopUpButton to use WMMenuItem
- added WMGetPopUpButtonMenuItem(WMPopUpButton *bPtr, int index)
- WMSortListItemsWithComparer(WMList *lPtr, (int)(f)(const void*, const void*))
- WMSortBrowserColumnWithComparer()
- fixed bug with sorting list items.
- fixed bug in handling keyboard input associated with selection and
notification sending.
- filepanel puts dirs on top of list (Wolff <wolff@cybercable.fr>)
- added WMReplaceInBag (Wolff <wolff@cybercable.fr>)
- added vertical views and multiple views in WMSplitView (Wolff <wolff@cybercable.fr>)
- changed values of parameter values of WMSplitViewConstrainProc()
- configurable default fontsize patch (Igor P. Roboul <igor@mordor.myip.org>)
- fixed a bug that crashed the programm when a popup button was scrolled.
- fixed a bug that caused incorrect drawing position of the popup indicator.
- fixed a bug that prevented selecting no item (-1) in a popup button.
- an assertion will be raised if the program tries to select a popup button
item that is beyond the total number of items present in the popup button.
- changed names of functions for SplitView to be consistent. Some contained
SubView while other Subview. Now all have Subview.
- fixed a bug in how input events were posted. Establishing 2 or more input
handlers for the same file descriptor, handling different (read/write/except)
events, caused wrong handlers to be called.
- Reimplemented the input and idle handlers with WMBag to avoid a functional
problem with them: inability to remove handlers next to the called one, from
the called handler itself. Trying to do this with the old version caused the
program to crash.
- changed wrealloc behaviour to be like this: new = wrealloc(old, new_size);
1. if old is NULL, return wmalloc(new_size).
2. if new_size is 0, call wfree(old), and return NULL.
3. if both old is a valid pointer and new_size>0, call realloc.
- added wstrerror(int errnum) to return the string associated with errnum.
- new wsyserrorwithcode(int error, const char* fmt, ...), similar to
wsyserror(), but printing the message for the specified error code.
- added 3 new classes: WMData, WMHost and WMConnection
- fixed a big memory leak in the color panel code (from Pascal Hofstee).
- added scrolling to tabview
changes since wmaker 0.61.0:
............................
- added WMGetTextFieldFont()
- escape key in panels (craig nellist <crn@ozemail.com.au>)
- applied patch with fixes and enhancements to textfield
(Franck Wolff <wolff@cybercable.fr>)
- changed WMList to use WMBag internally, instead of a linked list
- replaced WMAddSortedListItem() with WMSortListItems()
- replaced WMAddSortedBrowserItem() with WMSortBrowserColumn()
changes since wmaker 0.60.0:
............................
- added WMScreenWidth() and WMScreenHeight() functions.
- fixed some problems when compiling with non gcc compilers.
- added WMSetTextFieldFont()
- added WMSetButtonImageDefault() (craig nellist <crn@ozemail.com.au>)
- added WMBag (array/list)
- added libWUtil, a library that is a subset of libWINGs. It contains utils
that can be used in writing non-GUI programs. They include: hashes,
notifications, input/idle/timer handlers, user defaults database handling,
memory handling, application resource handling, etc.
All the non-GUI stuff from libWINGs is present.
Still linWINGs contain all this stuff so if you use libWINGs, you don't
need to link against libWUtil too.
One notable aspect of libWUtil is that it has a modified version of the
event handling function. It is named WHandleEvents() and will handle all
input/idle/timer events the app has.
If your app has a permanent input handler (as for example a socket a server
is listening on), then the main loop of the app can be:
while(1) {
WHandleEvents();
}
but if there is no permanent input handler, you need to add some delay to
avoid a too high cpu load by your program:
while(1) {
WHandleEvents();
wusleep(5000);
}
A permanent input handler is one that is established when the program starts
and is present until the program exits.
One that is deleted and later reinstalled, is not considered permanent.
This difference is because if there is some input handler, the function will
block until some event appears, while if there is no input handler the
function will return almost immediately (after handling the timer/idle
stuff).
Except the stuff declared in WUtil.h, the following functions declared in
WINGs.h are also present in libWUtil (you will need to #include <WINGs.h>
if you use one of these):
WMInitializeApplication(char *applicationName, int *argc, char **argv);
WMSetResourcePath(char *path);
WMGetApplicationName();
WMPathForResourceOfType(char *resource, char *ext);
WMAddTimerHandler(int milliseconds, WMCallback *callback, void *cdata);
WMDeleteTimerWithClientData(void *cdata);
WMDeleteTimerHandler(WMHandlerID handlerID);
WMAddIdleHandler(WMCallback *callback, void *cdata);
WMDeleteIdleHandler(WMHandlerID handlerID);
WMAddInputHandler(int fd, int condition, WMInputProc *proc,
void *clientData);
WMDeleteInputHandler(WMHandlerID handlerID);
- added progress indicator widget
- Changed WMSetWindowUPosition() and WMSetWindowUSize() to
WMSetWindowInitialPosition() and WMSetWindowInitialSize() respectively,
for better naming conventions.
changes since wmaker 0.53.0:
............................
- added balloon help
- fixed a bug with setting initial path in browsers.
- added WMSetButtonImageDimsWhenDisabled()
- changed simple callback/notifications to delegate-like stuff. Affected
widgets are:
WMBrowser
- WMSetBrowserFillProc() was replaced with WMSetBrowserDelegate
- WMBrowserDidScrollNotification was replaced with a delegate callback
WMTextField (not completed yet)
The notifications will still work, but using the delegate is preferable
How to convert old code to delegate callbacks:
1 - create a variable (static or dynamic) of the type of the
delegate for the widget type.
2 - Replace the notification observers with the equivalent
delegate callbacks.
3 - Put pointers to the callbacks in the delegate variable.
Take a look in wfilepanel.c to see how it is used there.
- changed W_ViewProcedureTable to delegates
This will only affect user created widgets. If you have a custom
widget, you will need to update the callbacks and the declaration
of the W_ViewProcedureTable variable to be a W_ViewDelegate,
which is declared in WINGsP.h To setup the delegate, assign
the delegate variable to view->delegate.
- WMTextField
Removed all the didChange notifications that were sent when the text
was changed programmatically. Only changes made by user interaction
will be notified now. If you need the old behaviour, send notifications
manually when you change the text.
- added WMTabView
- added WMGetColorPanelColor(WMColorPanel *panel)
- made WMGetUDStringForKey() to only return a reference to the string, not a
wstrdup()'ed copy. DO NOT FREE IT ANYMORE!
- added MultiByteText option to userdefaults file to control use of multibyte
string drawing functions
- renamed WMCreateFont() to WMCreateFontSet()
- renamed WMCreateFontInDefaultEncoding() to WMCreateNormalFont()
- added WMCreateFont() with different semantics
changes since wmaker 0.52.0:
............................
- added int WMGetBrowserMaxVisibleColumns(WMBrowser *bPtr);
changes since wmaker 0.51.2:
............................
- added WMColorWellDidChangeNotification
- added wfindfileinarray()
- fixed bug in window title setting
(MANOME Tomonori <manome@itlb.te.noda.sut.ac.jp>)
changes since wmaker 0.51.1:
............................
- wusergnusteppath() will return a statically allocated string now.
DO NOT FREE IT ANYMORE!!
changes since wmaker 0.51.0:
............................
- applied c++ compat header patch from Martynas Kunigelis <mkunigelis@alna.lt>
- added WMSetTextFieldBeveled()
- removed W_GC() : use WMColorGC() instead
- added WMCreatePixmap()
- changed WMSetTextFieldEnabled() to WMSetTextFieldEditable()
changes since wmaker 0.50.1:
............................
- fixed various bugs
- added patch from Franck Wolff <frawolff@club-internet.fr>, with
many fixes and enhancements
- added notification queues, asynchronous notifications etc.
- added WMSetBrowserDoubleAction()
- fixed list double click action
changes since wmaker 0.50.2:
............................
- added wsetabort() - look WUtil.h
- fixed bug in WMList resize
- added notification sending when changing textfield programatically
- removed WMHideWindow()
- fixed bug in WMCloseWindow()
- added textfield selection patch
- added color panel code
- added auto name completion for the file panel
- added function to select text range, and to set cursor position in text
fields programatically
changes since wmaker 0.20.3:
............................
- added WMSetSliderImage(), WMSetSliderKnobThickness()
- added WMGetListItemHeight()
- added WMListDidScrollNotification
- added WSetColorWellBordered()
- added hacky color dragging in colorwell
- added poll() support in WMNextEvent. WARNING: the stuff needed for
WMAddInputHandler() is not yet implemented for the poll stuff
- added WMSetFilePanelAccessoryView(), WMGetFilePanelAccessoryView()
- added WMSetPopUpButtonEnabled()
- added WMGetLabelImage()
- autoscroll for popup button menus
- added WMDrawPixmap()
- WARNING: changed parameter list for WMListDrawProc
changes since wmaker 0.20.2:
............................
- WMSetBrowserMaxVisibleColumns() - untested
changes since wmaker 0.20.0:
............................
- added generic object field for WMListItem. This is for hanging generic
clientdata
changes since wmaker 0.20.0: changes since wmaker 0.20.0:
............................ ............................

View File

@@ -1,6 +0,0 @@
## automake input file for WINGs - Documentation
AUTOMAKE_OPTIONS =
EXTRA_DIST =

View File

@@ -1,40 +0,0 @@
## automake input file for WINGs - Examples
AUTOMAKE_OPTIONS =
noinst_PROGRAMS = connect server fontl puzzle colorpick
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@
colorpick_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
fontl_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
puzzle_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
connect_DEPENDENCIES = $(top_builddir)/WINGs/libWUtil.la
connect_LDADD = $(top_builddir)/WINGs/libWUtil.la @LIBRARY_SEARCH_PATH@ @INTLIBS@
server_DEPENDENCIES = $(top_builddir)/WINGs/libWUtil.la
server_LDADD = $(top_builddir)/WINGs/libWUtil.la @LIBRARY_SEARCH_PATH@ @INTLIBS@
INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
LIBTOOL = $(QUIET) $(SHELL) $(top_builddir)/libtool $(LIBTOOL_ARG)
.c.o:
$(QUIET)$(COMPILE) -c $<
.c.obj:
$(QUIET)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(QUIET)$(LTCOMPILE) -c -o $@ $<

View File

@@ -1,19 +0,0 @@
Files:
-----
server - server example of using WMConnection. It keeps a database of
timeouts for a group of users, allowing one to add/remove
users and update the timeouts associated with them.
connect - client example of using WMConnection. Works with the server
program above. Just start both without any parameter and
type help in the client to find out how to operate them.
Rest is self explanatory.
puzzle - a nice zuPzel =)
fontl - a map of all characters with their corresponding ascii,
hex, decimal and octal representations.

View File

@@ -1,39 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <WINGs/WINGs.h>
void showSelectedColor(void *self, void *cdata)
{
WMColorPanel *panel = (WMColorPanel *) self;
printf("Selected Color: %s\n", WMGetColorRGBDescription(WMGetColorPanelColor(panel)));
}
int main(int argc, char **argv)
{
Display *dpy;
WMScreen *scr;
WMInitializeApplication("wmcolorpick", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
printf("could not open display\n");
exit(1);
}
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
{
WMColorPanel *panel = WMGetColorPanel(scr);
WMSetColorPanelAction(panel, showSelectedColor, NULL);
WMShowColorPanel(panel);
}
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,97 +0,0 @@
/*
* WINGs demo: font lister
*
* Copyright (c) 1998-2003 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <WINGs/WINGs.h>
#include <WINGs/WUtil.h>
void wAbort()
{
exit(0);
}
void show(WMWidget * self, void *data)
{
char buf[60];
void *d;
WMLabel *l = (WMLabel *) data;
d = WMGetHangedData(self);
sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
WMSetLabelText(l, buf);
}
void quit(WMWidget * self, void *data)
{
exit(0);
}
int main(int argc, char **argv)
{
Display *dpy;
WMWindow *win;
WMScreen *scr;
WMButton *lab, *l0 = NULL;
WMLabel *pos;
int x, y, c;
char buf[20];
WMInitializeApplication("FontView", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
wfatal("cant open display");
exit(0);
}
scr = WMCreateSimpleApplicationScreen(dpy);
win = WMCreateWindow(scr, "main");
WMResizeWidget(win, 20 * 33, 20 + 20 * 9);
WMSetWindowTitle(win, "Font Chars");
WMSetWindowCloseAction(win, quit, NULL);
pos = WMCreateLabel(win);
WMResizeWidget(pos, 20 * 33, 20);
WMMoveWidget(pos, 10, 5);
c = 0;
for (y = 0; y < 8; y++) {
for (x = 0; x < 32; x++, c++) {
lab = WMCreateCustomButton(win, WBBStateLightMask);
WMResizeWidget(lab, 20, 20);
WMMoveWidget(lab, 10 + x * 20, 30 + y * 20);
sprintf(buf, "%c", c);
WMSetButtonText(lab, buf);
WMSetButtonAction(lab, show, pos);
WMHangData(lab, (void *)(uintptr_t) c);
if (c > 0) {
WMGroupButtons(l0, lab);
} else {
l0 = lab;
}
}
}
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,233 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <WINGs/WINGs.h>
#include <stdint.h>
#define MAX_SIZE 10*10
WMWindow *win;
WMButton *Button[MAX_SIZE];
signed char Map[MAX_SIZE];
int Size = 4;
int MoveCount;
#define MAP(x,y) Map[(x)+(y)*Size]
int WinSize = 120;
Bool CheckWin(void)
{
int i;
for (i = 0; i < Size * Size - 1; i++) {
if (Map[i] != i)
return False;
}
return True;
}
void MoveButton(int button, int x, int y)
{
WMMoveWidget(Button[button], x * (WinSize / Size), y * (WinSize / Size));
}
Bool SlideButton(int button)
{
int x = 0, y = 0, done = 0;
/* locate the button */
for (y = 0; y < Size; y++) {
for (x = 0; x < Size; x++) {
if (MAP(x, y) == button) {
done = 1;
break;
}
}
if (done)
break;
}
if (x > 0 && MAP(x - 1, y) < 0) {
MAP(x, y) = -1;
MoveButton(button, x - 1, y);
MAP(x - 1, y) = button;
} else if (x < Size - 1 && MAP(x + 1, y) < 0) {
MAP(x, y) = -1;
MoveButton(button, x + 1, y);
MAP(x + 1, y) = button;
} else if (y > 0 && MAP(x, y - 1) < 0) {
MAP(x, y) = -1;
MoveButton(button, x, y - 1);
MAP(x, y - 1) = button;
} else if (y < Size - 1 && MAP(x, y + 1) < 0) {
MAP(x, y) = -1;
MoveButton(button, x, y + 1);
MAP(x, y + 1) = button;
} else {
return False;
}
return True;
}
#define SWAP(a,b) {int tmp; tmp=a; a=b; b=tmp;}
void ResetGame(void)
{
int i, x, y, ox, oy;
MoveCount = 0;
for (i = 0; i < Size * Size - 1; i++) {
Map[i] = i;
}
Map[i] = -1;
ox = x = Size - 1;
oy = y = Size - 1;
for (i = 0; i < 1000; i++) {
int ok;
ok = 1;
switch (rand() % 4) {
case 0:
if (x > 0)
x--;
else
ok = 0;
break;
case 2:
if (x < Size - 1)
x++;
else
ok = 0;
break;
case 1:
if (y > 0)
y--;
else
ok = 0;
break;
case 3:
if (y < Size - 1)
y++;
else
ok = 0;
break;
}
if (ok) {
MoveButton(MAP(x, y), ox, oy);
SWAP(MAP(ox, oy), MAP(x, y));
while (XPending(WMScreenDisplay(WMWidgetScreen(win)))) {
XEvent ev;
WMNextEvent(WMScreenDisplay(WMWidgetScreen(win)), &ev);
WMHandleEvent(&ev);
}
ox = x;
oy = y;
}
}
}
void buttonClick(WMWidget * w, void *ptr)
{
char buffer[300];
if (SlideButton((uintptr_t)ptr)) {
MoveCount++;
if (CheckWin()) {
sprintf(buffer, "You finished the game in %i moves.", MoveCount);
if (WMRunAlertPanel(WMWidgetScreen(w), win, "You Won!", buffer,
"Wee!", "Gah! Lemme retry!", NULL) == WAPRDefault) {
exit(0);
}
ResetGame();
}
}
}
static void resizeObserver(void *self, WMNotification * notif)
{
WMSize size = WMGetViewSize(WMWidgetView(win));
int x, y;
WinSize = size.width;
for (y = 0; y < Size; y++) {
for (x = 0; x < Size; x++) {
if (MAP(x, y) >= 0) {
WMResizeWidget(Button[(int)MAP(x, y)], WinSize / Size, WinSize / Size);
WMMoveWidget(Button[(int)MAP(x, y)], x * (WinSize / Size), y * (WinSize / Size));
}
}
}
}
int main(int argc, char **argv)
{
Display *dpy;
WMScreen *scr;
int x, y, i;
WMInitializeApplication("Puzzle", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
printf("could not open display\n");
exit(1);
}
scr = WMCreateScreen(dpy, DefaultScreen(dpy));
win = WMCreateWindow(scr, "puzzle");
WMResizeWidget(win, WinSize, WinSize);
WMSetWindowTitle(win, "zuPzel");
WMSetWindowMinSize(win, 80, 80);
WMSetWindowAspectRatio(win, 2, 2, 2, 2);
WMSetWindowResizeIncrements(win, Size, Size);
WMSetViewNotifySizeChanges(WMWidgetView(win), True);
WMAddNotificationObserver(resizeObserver, NULL, WMViewSizeDidChangeNotification, WMWidgetView(win));
for (i = y = 0; y < Size && i < Size * Size - 1; y++) {
for (x = 0; x < Size && i < Size * Size - 1; x++) {
char buf[32];
WMColor *color;
RColor col;
RHSVColor hsv;
hsv.hue = i * 360 / (Size * Size - 1);
hsv.saturation = 120;
hsv.value = 200;
RHSVtoRGB(&hsv, &col);
color = WMCreateRGBColor(scr, col.red << 8, col.green << 8, col.blue << 8, False);
MAP(x, y) = i;
Button[i] = WMCreateButton(win, WBTMomentaryLight);
WMSetWidgetBackgroundColor(Button[i], color);
WMReleaseColor(color);
WMSetButtonAction(Button[i], buttonClick, (void *)(uintptr_t) i);
WMResizeWidget(Button[i], WinSize / Size, WinSize / Size);
WMMoveWidget(Button[i], x * (WinSize / Size), y * (WinSize / Size));
sprintf(buf, "%i", i + 1);
WMSetButtonText(Button[i], buf);
WMSetButtonTextAlignment(Button[i], WACenter);
i++;
}
}
WMMapSubwidgets(win);
WMMapWidget(win);
WMRealizeWidget(win);
ResetGame();
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,30 +0,0 @@
## automake input file for WINGs
AUTOMAKE_OPTIONS =
# is this a kluge? if so, how should i do it?
includedir = @includedir@/WINGs
include_HEADERS = wtableview.h wtabledelegates.h
lib_LTLIBRARIES = libExtraWINGs.la
noinst_PROGRAMS = test
EXTRA_DIST =
libExtraWINGs_la_SOURCES = \
wtableview.c \
wtabledelegates.c \
wtableview.h \
wtabledelegates.h
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@
test_LDADD = wtableview.o wtabledelegates.o $(LDADD)

View File

@@ -1,124 +0,0 @@
#include <WINGs/WINGs.h>
#include <stdio.h>
#include <stdint.h>
#include "wtableview.h"
#include "wtabledelegates.h"
static char *col1[20] = { 0 };
static int col2[20];
static char *options[] = {
"Option1",
"Option2",
"Option3",
"Option4",
"Option5"
};
int numberOfRows(WMTableViewDelegate * self, WMTableView * table)
{
return 20;
}
void *valueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row)
{
/*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column); */
int i;
if (col1[0] == 0) {
for (i = 0; i < 20; i++) {
char buf[128];
sprintf(buf, "Test row %i", i);
col1[i] = wstrdup(buf);
col2[i] = 0;
}
}
if ((uintptr_t)WMGetTableColumnId(column) == 1)
return col1[row];
else
return (void *)(uintptr_t) col2[row];
}
void setValueForCell(WMTableViewDelegate * self, WMTableColumn * column, int row, void *data)
{
if ((uintptr_t)WMGetTableColumnId(column) == 1)
col1[row] = data;
else
col2[row] = (uintptr_t) data;
}
static WMTableViewDelegate delegate = {
NULL,
numberOfRows,
valueForCell,
setValueForCell
};
void clickedTable(WMWidget * w, void *self)
{
int row = WMGetTableViewClickedRow((WMTableView *) self);
WMEditTableViewRow(self, row);
}
int main(int argc, char **argv)
{
WMScreen *scr;
WMWindow *win;
WMTableView *table;
WMTableColumn *col;
WMTableColumnDelegate *colDeleg;
WMInitializeApplication("test", &argc, argv);
scr = WMOpenScreen(NULL);
XSynchronize(WMScreenDisplay(scr), 1);
win = WMCreateWindow(scr, "eweq");
WMResizeWidget(win, 400, 200);
WMMapWidget(win);
table = WMCreateTableView(win);
WMSetTableViewHasHorizontalScroller(table, 0);
WMSetViewExpandsToParent(WMWidgetView(table), 10, 10, 10, 10);
WMSetTableViewBackgroundColor(table, WMWhiteColor(scr));
/*WMSetTableViewGridColor(table, WMGrayColor(scr)); */
WMSetTableViewHeaderHeight(table, 20);
WMSetTableViewDelegate(table, &delegate);
WMSetTableViewAction(table, clickedTable, table);
colDeleg = WTCreateStringEditorDelegate(table);
col = WMCreateTableColumn("Group");
WMSetTableColumnWidth(col, 180);
WMAddTableViewColumn(table, col);
WMSetTableColumnDelegate(col, colDeleg);
WMSetTableColumnId(col, (void *)1);
colDeleg = WTCreateEnumSelectorDelegate(table);
WTSetEnumSelectorOptions(colDeleg, options, 5);
col = WMCreateTableColumn("Package");
WMSetTableColumnWidth(col, 140);
WMAddTableViewColumn(table, col);
WMSetTableColumnDelegate(col, colDeleg);
WMSetTableColumnId(col, (void *)2);
colDeleg = WTCreateBooleanSwitchDelegate(table);
col = WMCreateTableColumn("Bool");
WMSetTableColumnWidth(col, 50);
WMAddTableViewColumn(table, col);
WMSetTableColumnDelegate(col, colDeleg);
WMSetTableColumnId(col, (void *)2);
WMMapWidget(table);
WMRealizeWidget(win);
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,522 +0,0 @@
#include <stdint.h>
#include <WINGs/WINGsP.h>
#include "wtableview.h"
#include "wtabledelegates.h"
typedef struct {
WMTableView *table;
WMFont *font;
GC gc;
GC selGC;
WMColor *textColor;
} StringData;
typedef struct {
WMTableView *table;
GC selGc;
} PixmapData;
typedef struct {
WMTextField *widget;
WMTableView *table;
WMFont *font;
GC gc;
GC selGC;
WMColor *textColor;
} StringEditorData;
typedef struct {
WMPopUpButton *widget;
WMTableView *table;
WMFont *font;
char **options;
int count;
GC gc;
GC selGC;
WMColor *textColor;
} EnumSelectorData;
typedef struct {
WMButton *widget;
WMTableView *table;
Bool state;
GC gc;
GC selGC;
} BooleanSwitchData;
static char *SelectionColor = "#bbbbcc";
static void
stringDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMColor * textColor,
WMFont * font, void *data, WMRect rect, Bool selected)
{
int x, y;
XRectangle rects[1];
Display *dpy = WMScreenDisplay(scr);
x = rect.pos.x + 5;
y = rect.pos.y + (rect.size.height - WMFontHeight(font)) / 2;
rects[0].x = rect.pos.x + 1;
rects[0].y = rect.pos.y + 1;
rects[0].width = rect.size.width - 1;
rects[0].height = rect.size.height - 1;
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
if (!selected) {
XFillRectangles(dpy, d, gc, rects, 1);
WMDrawString(scr, d, textColor, font, x, y, data, strlen(data));
} else {
XFillRectangles(dpy, d, sgc, rects, 1);
WMDrawString(scr, d, textColor, font, x, y, data, strlen(data));
}
XSetClipMask(dpy, gc, None);
}
static void pixmapDraw(WMScreen * scr, Drawable d, GC gc, GC sgc, WMPixmap * pixmap, WMRect rect, Bool selected)
{
int x, y;
XRectangle rects[1];
Display *dpy = WMScreenDisplay(scr);
WMSize size;
rects[0].x = rect.pos.x + 1;
rects[0].y = rect.pos.y + 1;
rects[0].width = rect.size.width - 1;
rects[0].height = rect.size.height - 1;
XSetClipRectangles(dpy, gc, 0, 0, rects, 1, YXSorted);
if (!selected) {
XFillRectangles(dpy, d, gc, rects, 1);
if (pixmap) {
size = WMGetPixmapSize(pixmap);
x = rect.pos.x + (rect.size.width - size.width) / 2;
y = rect.pos.y + (rect.size.height - size.height) / 2;
WMDrawPixmap(pixmap, d, x, y);
}
} else {
XFillRectangles(dpy, d, sgc, rects, 1);
if (pixmap) {
size = WMGetPixmapSize(pixmap);
x = rect.pos.x + (rect.size.width - size.width) / 2;
y = rect.pos.y + (rect.size.height - size.height) / 2;
WMDrawPixmap(pixmap, d, x, y);
}
}
XSetClipMask(dpy, gc, None);
}
/* ---------------------------------------------------------------------- */
static void SECellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringEditorData *strdata = (StringEditorData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), False);
}
static void selectedSECellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringEditorData *strdata = (StringEditorData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), True);
}
static void beginSECellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
StringEditorData *strdata = (StringEditorData *) self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
void *data = WMTableViewDataForCell(strdata->table, column, row);
WMSetTextFieldText(strdata->widget, (char *)data);
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
WMResizeWidget(strdata->widget, rect.size.width + 1, rect.size.height + 1);
WMMapWidget(strdata->widget);
}
static void endSECellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
StringEditorData *strdata = (StringEditorData *) self->data;
char *text;
WMUnmapWidget(strdata->widget);
text = WMGetTextFieldText(strdata->widget);
WMSetTableViewDataForCell(strdata->table, column, row, (void *)text);
}
WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView * parent)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent);
StringEditorData *data = wmalloc(sizeof(StringEditorData));
data->widget = WMCreateTextField(parent);
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
data->table = parent;
data->font = WMSystemFontOfSize(scr, 12);
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data;
delegate->drawCell = SECellPainter;
delegate->drawSelectedCell = selectedSECellPainter;
delegate->beginCellEdit = beginSECellEdit;
delegate->endCellEdit = endSECellEdit;
return delegate;
}
/* ---------------------------------------------------------------------- */
static void ESCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], WMTableViewRectForCell(table, column, row), False);
}
static void selectedESCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], WMTableViewRectForCell(table, column, row), True);
}
static void beginESCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
uintptr_t data = (uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
wassertr(data < strdata->count);
WMSetPopUpButtonSelectedItem(strdata->widget, data);
WMMoveWidget(strdata->widget, rect.pos.x, rect.pos.y);
WMResizeWidget(strdata->widget, rect.size.width, rect.size.height + 1);
WMMapWidget(strdata->widget);
}
static void endESCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
EnumSelectorData *strdata = (EnumSelectorData *) self->data;
int option;
WMUnmapWidget(strdata->widget);
option = WMGetPopUpButtonSelectedItem(strdata->widget);
WMSetTableViewDataForCell(strdata->table, column, row, (void *)(uintptr_t) option);
}
WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView * parent)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent);
EnumSelectorData *data = wmalloc(sizeof(EnumSelectorData));
data->widget = WMCreatePopUpButton(parent);
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
data->table = parent;
data->font = WMSystemFontOfSize(scr, 12);
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
data->count = 0;
data->options = NULL;
delegate->data = data;
delegate->drawCell = ESCellPainter;
delegate->drawSelectedCell = selectedESCellPainter;
delegate->beginCellEdit = beginESCellEdit;
delegate->endCellEdit = endESCellEdit;
return delegate;
}
void WTSetEnumSelectorOptions(WMTableColumnDelegate * delegate, char **options, int count)
{
EnumSelectorData *data = (EnumSelectorData *) delegate->data;
int i;
for (i = 0; i < WMGetPopUpButtonNumberOfItems(data->widget); i++) {
WMRemovePopUpButtonItem(data->widget, 0);
}
data->options = options;
data->count = count;
for (i = 0; i < count; i++) {
WMAddPopUpButtonItem(data->widget, options[i]);
}
}
/* ---------------------------------------------------------------------- */
static void BSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
WMScreen *scr = WMWidgetScreen(table);
if (i) {
pixmapDraw(scr, d,
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
WMTableViewRectForCell(table, column, row), False);
} else {
pixmapDraw(scr, d,
strdata->gc, strdata->selGC, NULL, WMTableViewRectForCell(table, column, row), False);
}
}
static void selectedBSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
uintptr_t i = (uintptr_t)WMTableViewDataForCell(table, column, row);
WMScreen *scr = WMWidgetScreen(table);
if (i) {
pixmapDraw(scr, d,
strdata->gc, strdata->selGC, WMGetSystemPixmap(scr, WSICheckMark),
WMTableViewRectForCell(table, column, row), True);
} else {
pixmapDraw(scr, d,
strdata->gc, strdata->selGC, NULL, WMTableViewRectForCell(table, column, row), True);
}
}
static void beginBSCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
uintptr_t data = (uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
WMSetButtonSelected(strdata->widget, data);
WMMoveWidget(strdata->widget, rect.pos.x + 1, rect.pos.y + 1);
WMResizeWidget(strdata->widget, rect.size.width - 1, rect.size.height - 1);
WMMapWidget(strdata->widget);
}
static void endBSCellEdit(WMTableColumnDelegate * self, WMTableColumn * column, int row)
{
BooleanSwitchData *strdata = (BooleanSwitchData *) self->data;
int value;
value = WMGetButtonSelected(strdata->widget);
WMSetTableViewDataForCell(strdata->table, column, row, (void *)(uintptr_t) value);
WMUnmapWidget(strdata->widget);
}
WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView * parent)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent);
BooleanSwitchData *data = wmalloc(sizeof(BooleanSwitchData));
WMColor *color;
data->widget = WMCreateSwitchButton(parent);
W_ReparentView(WMWidgetView(data->widget), WMGetTableViewDocumentView(parent), 0, 0);
WMSetButtonText(data->widget, NULL);
WMSetButtonImagePosition(data->widget, WIPImageOnly);
WMSetButtonImage(data->widget, NULL);
WMSetButtonAltImage(data->widget, WMGetSystemPixmap(scr, WSICheckMark));
data->table = parent;
color = WMCreateNamedColor(scr, SelectionColor, False);
WMSetWidgetBackgroundColor(data->widget, color);
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(color);
delegate->data = data;
delegate->drawCell = BSCellPainter;
delegate->drawSelectedCell = selectedBSCellPainter;
delegate->beginCellEdit = beginBSCellEdit;
delegate->endCellEdit = endBSCellEdit;
return delegate;
}
/* ---------------------------------------------------------------------- */
static void SCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringData *strdata = (StringData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), False);
}
static void selectedSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringData *strdata = (StringData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewRectForCell(table, column, row), True);
}
WMTableColumnDelegate *WTCreateStringDelegate(WMTableView * parent)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent);
StringData *data = wmalloc(sizeof(StringData));
data->table = parent;
data->font = WMSystemFontOfSize(scr, 12);
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data;
delegate->drawCell = SCellPainter;
delegate->drawSelectedCell = selectedSCellPainter;
delegate->beginCellEdit = NULL;
delegate->endCellEdit = NULL;
return delegate;
}
/* ---------------------------------------------------------------------- */
static void PCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringData *strdata = (StringData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
pixmapDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC,
(WMPixmap *) WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), False);
}
static void selectedPCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
StringData *strdata = (StringData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
pixmapDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC,
(WMPixmap *) WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), True);
}
WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView * table)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(table);
StringData *data = wmalloc(sizeof(StringData));
data->table = table;
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
delegate->data = data;
delegate->drawCell = PCellPainter;
delegate->drawSelectedCell = selectedPCellPainter;
delegate->beginCellEdit = NULL;
delegate->endCellEdit = NULL;
return delegate;
}
/* ---------------------------------------------------------------------- */
static void drawPSCell(WMTableColumnDelegate * self, Drawable d, WMTableColumn * column, int row, Bool selected)
{
StringData *strdata = (StringData *) self->data;
WMTableView *table = WMGetTableColumnTableView(column);
void **data;
WMPixmap *pix;
char *str;
WMRect rect;
WMSize size;
data = WMTableViewDataForCell(table, column, row);
str = (char *)data[0];
pix = (WMPixmap *) data[1];
rect = WMTableViewRectForCell(table, column, row);
if (pix) {
int owidth = rect.size.width;
size = WMGetPixmapSize(pix);
rect.size.width = size.width;
pixmapDraw(WMWidgetScreen(table),
WMViewXID(WMGetTableViewDocumentView(table)),
strdata->gc, strdata->selGC, pix, rect, selected);
rect.pos.x += size.width - 1;
rect.size.width = owidth - size.width + 1;
}
stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
strdata->textColor, strdata->font, str, rect, selected);
}
static void PSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
drawPSCell(self, d, column, row, False);
}
static void selectedPSCellPainter(WMTableColumnDelegate * self, WMTableColumn * column, int row, Drawable d)
{
drawPSCell(self, d, column, row, True);
}
WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView * parent)
{
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent);
StringData *data = wmalloc(sizeof(StringData));
data->table = parent;
data->font = WMSystemFontOfSize(scr, 12);
data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data;
delegate->drawCell = PSCellPainter;
delegate->drawSelectedCell = selectedPSCellPainter;
delegate->beginCellEdit = NULL;
delegate->endCellEdit = NULL;
return delegate;
}

View File

@@ -1,25 +0,0 @@
#ifndef _TABLEDELEGATES_H_
#define _TABLEDELEGATES_H_
#ifdef __cplusplus
extern "C" {
#endif
WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table);
WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *table);
WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent);
WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *table);
WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *table);
void WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate,
char **options, int count);
WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView *parent);
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,121 +0,0 @@
#ifndef _WTABLEVIEW_H_
#define _WTABLEVIEW_H_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct W_TableColumn WMTableColumn;
typedef struct W_TableView WMTableView;
extern const char *WMTableViewSelectionDidChangeNotification;
typedef struct WMTableColumnDelegate {
void *data;
void (*drawCell)(struct WMTableColumnDelegate *self,
WMTableColumn *column, int row, Drawable d);
void (*drawSelectedCell)(struct WMTableColumnDelegate *self,
WMTableColumn *column, int row, Drawable d);
void (*beginCellEdit)(struct WMTableColumnDelegate *self, WMTableColumn *column,
int row);
void (*endCellEdit)(struct WMTableColumnDelegate *self, WMTableColumn *column,
int row);
} WMTableColumnDelegate;
typedef struct W_TableViewDelegate {
void *data;
int (*numberOfRows)(struct W_TableViewDelegate *self,
WMTableView *table);
void *(*valueForCell)(struct W_TableViewDelegate *self,
WMTableColumn *column, int row);
void (*setValueForCell)(struct W_TableViewDelegate *self,
WMTableColumn *column, int row, void *value);
} WMTableViewDelegate;
WMTableColumn *WMCreateTableColumn(char *title);
void WMSetTableColumnWidth(WMTableColumn *column, unsigned width);
void WMSetTableColumnConstraints(WMTableColumn *column,
unsigned minWidth, unsigned maxWidth);
void WMSetTableColumnDelegate(WMTableColumn *column,
WMTableColumnDelegate *delegate);
WMTableView *WMGetTableColumnTableView(WMTableColumn *column);
void WMSetTableColumnId(WMTableColumn *column, void *id);
void *WMGetTableColumnId(WMTableColumn *column);
WMTableView *WMCreateTableView(WMWidget *parent);
void WMSetTableViewDataSource(WMTableView *table, void *source);
void *WMGetTableViewDataSource(WMTableView *table);
void WMSetTableViewHeaderHeight(WMTableView *table, unsigned height);
void WMAddTableViewColumn(WMTableView *table, WMTableColumn *column);
void WMSetTableViewDelegate(WMTableView *table, WMTableViewDelegate *delegate);
void WMSetTableViewAction(WMTableView *table, WMAction *action,
void *clientData);
void *WMGetTableViewClickedColumn(WMTableView *table);
int WMGetTableViewClickedRow(WMTableView *table);
WMArray *WMGetTableViewSelectedRows(WMTableView *table);
WMView *WMGetTableViewDocumentView(WMTableView *table);
void WMEditTableViewRow(WMTableView *table, int row);
void WMSelectTableViewRow(WMTableView *table, int row);
void *WMTableViewDataForCell(WMTableView *table, WMTableColumn *column,
int row);
void WMSetTableViewDataForCell(WMTableView *table, WMTableColumn *column,
int row, void *data);
WMRect WMTableViewRectForCell(WMTableView *table, WMTableColumn *column,
int row);
void WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color);
void WMSetTableViewGridColor(WMTableView *table, WMColor *color);
void WMSetTableViewRowHeight(WMTableView *table, int height);
void WMReloadTableView(WMTableView *table);
void WMNoteTableViewNumberOfRowsChanged(WMTableView *table);
void WMScrollTableViewRowToVisible(WMTableView *table, int row);
void WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,123 +1,90 @@
## automake input file for WINGs ## automake input file for WINGs
AUTOMAKE_OPTIONS = AUTOMAKE_OPTIONS = no-dependencies
SUBDIRS = WINGs . po Documentation Resources SUBDIRS = Resources
libWINGs_la_LDFLAGS = -version-info @WINGS_VERSION@
libWUtil_la_LDFLAGS = -version-info @WUTIL_VERSION@
bin_SCRIPTS = get-wings-flags get-wutil-flags
lib_LTLIBRARIES = libWUtil.la libWINGs.la
LDADD= libWUtil.la libWINGs.la $(top_builddir)/wrlib/libwraster.la @INTLIBS@ LIBLIST= -L$(top_builddir)/wrlib -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ \
libWINGs_la_LIBADD = libWUtil.la $(top_builddir)/wrlib/libwraster.la @XLIBS@ @XFTLIBS@ @FCLIBS@ @LIBM@ -lm @LIBPL_LIBS@
libWUtil_la_LIBADD = @LIBBSD@
EXTRA_DIST = BUGS make-rgb Examples Extras Tests get-wings-flags.in get-wutil-flags.in
lib_LIBRARIES = libWINGs.a
include_HEADERS = WINGs.h WUtil.h WINGsP.h
noinst_PROGRAMS = wtest wmquery wmfile fontl testmywidget
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
testmywidget_LDADD = -L. -lWINGs $(LIBLIST)
fontl_SOURCES = fontl.c
fontl_LDADD = -L. -lWINGs $(LIBLIST)
wtest_SOURCES = wtest.c
wtest_LDADD = -L. -lWINGs $(LIBLIST)
wtest_DEPENDENCIES = libWINGs.a
wmfile_SOURCES = wmfile.c
wmfile_LDADD = -L. -lWINGs $(LIBLIST)
wmquery_SOURCES = wmquery.c
wmquery_LDADD = -L. -lWINGs $(LIBLIST)
EXTRA_DIST = logo.xpm
# wbutton.c # wbutton.c
libWINGs_la_SOURCES = \ libWINGs_a_SOURCES = \
WINGs.h \
WINGsP.h \
configuration.c \ configuration.c \
dragcommon.c \ international.c \
dragdestination.c \ notification.c \
dragsource.c \
rgb.h \
selection.c \ selection.c \
wappresource.c \ userdefaults.c \
wballoon.c \ wapplication.c \
wbox.c \
wbrowser.c \ wbrowser.c \
wbutton.c \ wbutton.c \
wcolor.c \ wcolor.c \
wcolorpanel.c \
wcolorwell.c \ wcolorwell.c \
wconfig.h \
wevent.c \ wevent.c \
wfilepanel.c \ wfilepanel.c \
wframe.c \ wframe.c \
wfont.c \ wfont.c \
wfontpanel.c \ wfontpanel.c \
widgets.c \ widgets.c \
winputmethod.c \
wlabel.c \ wlabel.c \
wlist.c \ wlist.c \
wmenuitem.c \
wmisc.c \ wmisc.c \
wpanel.c \ wpanel.c \
wpixmap.c \ wpixmap.c \
wpopupbutton.c \ wpopupbutton.c \
wprogressindicator.c \
wruler.c \
wscroller.c \ wscroller.c \
wscrollview.c \ wscrollview.c \
wslider.c \ wslider.c \
wsplitview.c \ wsplitview.c \
wtabview.c \
wtext.c \
wtextfield.c \ wtextfield.c \
wwindow.c \
wview.c \ wview.c \
wwindow.c
libWUtil_la_SOURCES = \
array.c \
bagtree.c \
data.c \
error.c \ error.c \
findfile.c \ findfile.c \
handlers.c \
hashtable.c \ hashtable.c \
memory.c \ memory.c \
misc.c \ usleep.c
notification.c \
proplist.c \
string.c \
tree.c \
userdefaults.c \
usleep.c \
wapplication.c \
wconfig.h \
wutil.c
##
## Find a better way than $(GFXFLAGS) to inform widgets.c wich of
## tiff or xpm images should be used
AM_CPPFLAGS = -DLOCALEDIR=\"$(NLSDIR)\" -DRESOURCE_PATH=\"$(datadir)/WINGs\" -DDEBUG INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src @XCFLAGS@ \
AM_CFLAGS = -DRESOURCE_PATH=\"$(datadir)/WINGs\" $(GFXFLAGS) -DDEBUG \
@LIBPL_INC_PATH@
INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
@XFTFLAGS@ @HEADER_SEARCH_PATH@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = WINGs.pc
DISTCLEANFILES = $(pkgconfig_DATA) get-wings-flags get-wutil-flags
WINGs.pc: Makefile
@echo "Generating $@"
@echo 'Name: WINGs' > $@
@echo 'Description: Small widget set with the NeXTStep(TM) look and feel' >> $@
@echo 'Version: $(VERSION)' >> $@
@echo 'Requires: wrlib' >> $@
@echo 'Libs: $(lib_search_path) -lWINGs' >> $@
@echo 'Libs.private: $(XFTLIBS) $(XLIBS) -lm $(INTLIBS)' >> $@
@echo 'Cflags: $(inc_search_path)' >> $@
get-wings-flags: get-wings-flags.in Makefile
@echo "Generating $@"
@$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \
-e 's#$${lib_search_path}#$(lib_search_path)#;' \
-e 's#$${GFXLIBS}#$(GFXLIBS)#;' \
-e 's#$${XFTLIBS}#$(XFTLIBS)#;' \
-e 's#$${INTLIBS}#$(INTLIBS)#;' \
-e 's#$${XLIBS}#$(XLIBS)#;' < $(dir $<@)get-wings-flags.in > $@
@chmod 755 $@
get-wutil-flags: get-wutil-flags.in Makefile
@echo "Generating $@"
@$(SED) -e 's#$${includedir}#$(includedir)#;' \
-e 's#$${libdir}#$(libdir)#;' \
-e 's#$${INTLIBS}#$(INTLIBS)#;' < $(dir $<@)get-wutil-flags.in > $@
@chmod 755 $@

513
WINGs/Makefile.in Normal file
View File

@@ -0,0 +1,513 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP_PATH = @CPP_PATH@
DFLAGS = @DFLAGS@
GFXFLAGS = @GFXFLAGS@
GFXLIBS = @GFXLIBS@
I18N = @I18N@
I18N_MB = @I18N_MB@
ICONEXT = @ICONEXT@
INTLIBS = @INTLIBS@
LIBPL_INC_PATH = @LIBPL_INC_PATH@
LIBPL_LIBS = @LIBPL_LIBS@
LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
MOFILES = @MOFILES@
NLSDIR = @NLSDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
REDUCE_APPICONS = @REDUCE_APPICONS@
SHAPE = @SHAPE@
SOUND = @SOUND@
VERSION = @VERSION@
WPMOFILES = @WPMOFILES@
XCFLAGS = @XCFLAGS@
XGETTEXT = @XGETTEXT@
XLFLAGS = @XLFLAGS@
XLIBS = @XLIBS@
XSHM = @XSHM@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LOCALE = @X_LOCALE@
pixmapdir = @pixmapdir@
wprefsdir = @wprefsdir@
AUTOMAKE_OPTIONS = no-dependencies
SUBDIRS = Resources
LIBLIST= -L$(top_builddir)/wrlib -lwraster @XLFLAGS@ @GFXLIBS@ @XLIBS@ \
-lm @LIBPL_LIBS@
lib_LIBRARIES = libWINGs.a
include_HEADERS = WINGs.h WUtil.h WINGsP.h
noinst_PROGRAMS = wtest wmquery wmfile fontl testmywidget
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
testmywidget_LDADD = -L. -lWINGs $(LIBLIST)
fontl_SOURCES = fontl.c
fontl_LDADD = -L. -lWINGs $(LIBLIST)
wtest_SOURCES = wtest.c
wtest_LDADD = -L. -lWINGs $(LIBLIST)
wtest_DEPENDENCIES = libWINGs.a
wmfile_SOURCES = wmfile.c
wmfile_LDADD = -L. -lWINGs $(LIBLIST)
wmquery_SOURCES = wmquery.c
wmquery_LDADD = -L. -lWINGs $(LIBLIST)
EXTRA_DIST = logo.xpm
# wbutton.c
libWINGs_a_SOURCES = \
WINGs.h \
WINGsP.h \
configuration.c \
international.c \
notification.c \
selection.c \
userdefaults.c \
wapplication.c \
wbrowser.c \
wbutton.c \
wcolor.c \
wcolorwell.c \
wevent.c \
wfilepanel.c \
wframe.c \
wfont.c \
wfontpanel.c \
widgets.c \
wlabel.c \
wlist.c \
wmisc.c \
wpanel.c \
wpixmap.c \
wpopupbutton.c \
wscroller.c \
wscrollview.c \
wslider.c \
wsplitview.c \
wtextfield.c \
wwindow.c \
wview.c \
error.c \
findfile.c \
hashtable.c \
memory.c \
usleep.c
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/src @XCFLAGS@ \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" $(GFXFLAGS) -DDEBUG \
@LIBPL_INC_PATH@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../src/config.h
CONFIG_CLEAN_FILES =
LIBRARIES = $(lib_LIBRARIES)
DEFS = @DEFS@ -I. -I$(srcdir) -I../src
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
libWINGs_a_LIBADD =
libWINGs_a_OBJECTS = configuration.o international.o notification.o \
selection.o userdefaults.o wapplication.o wbrowser.o wbutton.o wcolor.o \
wcolorwell.o wevent.o wfilepanel.o wframe.o wfont.o wfontpanel.o \
widgets.o wlabel.o wlist.o wmisc.o wpanel.o wpixmap.o wpopupbutton.o \
wscroller.o wscrollview.o wslider.o wsplitview.o wtextfield.o wwindow.o \
wview.o error.o findfile.o hashtable.o memory.o usleep.o
AR = ar
PROGRAMS = $(noinst_PROGRAMS)
wtest_OBJECTS = wtest.o
wtest_LDFLAGS =
wmquery_OBJECTS = wmquery.o
wmquery_DEPENDENCIES =
wmquery_LDFLAGS =
wmfile_OBJECTS = wmfile.o
wmfile_DEPENDENCIES =
wmfile_LDFLAGS =
fontl_OBJECTS = fontl.o
fontl_DEPENDENCIES =
fontl_LDFLAGS =
testmywidget_OBJECTS = testmywidget.o mywidget.o
testmywidget_DEPENDENCIES =
testmywidget_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
HEADERS = $(include_HEADERS)
DIST_COMMON = README ChangeLog Makefile.am Makefile.in TODO
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
SOURCES = $(libWINGs_a_SOURCES) $(wtest_SOURCES) $(wmquery_SOURCES) $(wmfile_SOURCES) $(fontl_SOURCES) $(testmywidget_SOURCES)
OBJECTS = $(libWINGs_a_OBJECTS) $(wtest_OBJECTS) $(wmquery_OBJECTS) $(wmfile_OBJECTS) $(fontl_OBJECTS) $(testmywidget_OBJECTS)
all: all-recursive all-am
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu WINGs/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-libLIBRARIES:
clean-libLIBRARIES:
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
distclean-libLIBRARIES:
maintainer-clean-libLIBRARIES:
install-libLIBRARIES: $(lib_LIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
@$(POST_INSTALL)
@list='$(lib_LIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
$(RANLIB) $(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
uninstall-libLIBRARIES:
@$(NORMAL_UNINSTALL)
list='$(lib_LIBRARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(libdir)/$$p; \
done
.c.o:
$(COMPILE) -c $<
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
clean-compile:
distclean-compile:
-rm -f *.tab.c
maintainer-clean-compile:
libWINGs.a: $(libWINGs_a_OBJECTS) $(libWINGs_a_DEPENDENCIES)
-rm -f libWINGs.a
$(AR) cru libWINGs.a $(libWINGs_a_OBJECTS) $(libWINGs_a_LIBADD)
$(RANLIB) libWINGs.a
mostlyclean-noinstPROGRAMS:
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
wtest: $(wtest_OBJECTS) $(wtest_DEPENDENCIES)
@rm -f wtest
$(LINK) $(wtest_LDFLAGS) $(wtest_OBJECTS) $(wtest_LDADD) $(LIBS)
wmquery: $(wmquery_OBJECTS) $(wmquery_DEPENDENCIES)
@rm -f wmquery
$(LINK) $(wmquery_LDFLAGS) $(wmquery_OBJECTS) $(wmquery_LDADD) $(LIBS)
wmfile: $(wmfile_OBJECTS) $(wmfile_DEPENDENCIES)
@rm -f wmfile
$(LINK) $(wmfile_LDFLAGS) $(wmfile_OBJECTS) $(wmfile_LDADD) $(LIBS)
fontl: $(fontl_OBJECTS) $(fontl_DEPENDENCIES)
@rm -f fontl
$(LINK) $(fontl_LDFLAGS) $(fontl_OBJECTS) $(fontl_LDADD) $(LIBS)
testmywidget: $(testmywidget_OBJECTS) $(testmywidget_DEPENDENCIES)
@rm -f testmywidget
$(LINK) $(testmywidget_LDFLAGS) $(testmywidget_OBJECTS) $(testmywidget_LDADD) $(LIBS)
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
list='$(include_HEADERS)'; for p in $$list; do \
rm -f $(DESTDIR)$(includedir)/$$p; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
done; \
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WINGs
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
$(MAKE) check-recursive
installcheck: installcheck-recursive
all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
install-exec-am: install-libLIBRARIES
install-data-am: install-includeHEADERS
uninstall-am: uninstall-libLIBRARIES uninstall-includeHEADERS
install-exec: install-exec-recursive install-exec-am
@$(NORMAL_INSTALL)
install-data: install-data-recursive install-data-am
@$(NORMAL_INSTALL)
install: install-recursive install-exec-am install-data-am
@:
uninstall: uninstall-recursive uninstall-am
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs: installdirs-recursive
$(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(includedir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-libLIBRARIES mostlyclean-compile \
mostlyclean-noinstPROGRAMS mostlyclean-tags \
mostlyclean-generic
clean-am: clean-libLIBRARIES clean-compile clean-noinstPROGRAMS \
clean-tags clean-generic mostlyclean-am
distclean-am: distclean-libLIBRARIES distclean-compile \
distclean-noinstPROGRAMS distclean-tags \
distclean-generic clean-am
maintainer-clean-am: maintainer-clean-libLIBRARIES \
maintainer-clean-compile \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
maintainer-clean-generic distclean-am
mostlyclean: mostlyclean-recursive mostlyclean-am
clean: clean-recursive clean-am
distclean: distclean-recursive distclean-am
-rm -f config.status
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: mostlyclean-libLIBRARIES distclean-libLIBRARIES \
clean-libLIBRARIES maintainer-clean-libLIBRARIES uninstall-libLIBRARIES \
install-libLIBRARIES mostlyclean-compile distclean-compile \
clean-compile maintainer-clean-compile mostlyclean-noinstPROGRAMS \
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
maintainer-clean-noinstPROGRAMS uninstall-includeHEADERS \
install-includeHEADERS install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
installcheck all-am install-exec-am install-data-am uninstall-am \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,450 +0,0 @@
** API and ABI modifications since wmaker 0.92.0
** libWINGs **
<WINGsP.h>
struct W_DragDestinationInfo: new members added SIZE CHANGE
<WINGs.h>
WMGetTextFieldCursorPosition ADDED
WC_Matrix REMOVED from enum.
WMCreateProgressIndicator REMOVED
WMSetProgressIndicatorMinValue REMOVED
WMSetProgressIndicatorMaxValue REMOVED
WMSetProgressIndicatorValue REMOVED
WMGetProgressIndicatorMinValue REMOVED
WMGetProgressIndicatorMaxValue REMOVED
WMGetProgressIndicatorValue REMOVED
typedef struct W_Ruler WMRuler REMOVED
typedef struct WMRulerMargins REMOVED
WMAppendTextBlock REMOVED
WMAppendTextStream REMOVED
WMCreateRuler REMOVED
WMCreateTextBlockWithObject REMOVED
WMCreateTextBlockWithPixmap REMOVED
WMCreateTextBlockWithText REMOVED
WMCreateTextForDocumentType REMOVED
WMDestroyTextBlock REMOVED
WMFindInTextStream REMOVED
WMFreezeText REMOVED
WMGetGrabbedRulerMargin REMOVED
WMGetReleasedRulerMargin REMOVED
WMGetRulerMargins REMOVED
WMGetRulerOffset REMOVED
WMGetTextBlockProperties REMOVED
WMGetTextDefaultColor REMOVED
WMGetTextDefaultFont REMOVED
WMGetTextEditable REMOVED
WMGetTextIgnoresNewline REMOVED
WMGetTextInsertType REMOVED
WMGetTextObjects REMOVED
WMGetTextRulerShown REMOVED
WMGetTextSelectedObjects REMOVED
WMGetTextSelectedStream REMOVED
WMGetTextSelectionColor REMOVED
WMGetTextSelectionFont REMOVED
WMGetTextSelectionUnderlined REMOVED
WMGetTextStream REMOVED
WMGetTextUsesMonoFont REMOVED
WMIsMarginEqualToMargin REMOVED
WMPageText REMOVED
WMPrependTextBlock REMOVED
WMPrependTextStream REMOVED
WMRemoveTextBlock REMOVED
WMReplaceTextSelection REMOVED
WMScrollText REMOVED
WMSetRulerMargins REMOVED
WMSetRulerMoveAction REMOVED
WMSetRulerOffset REMOVED
WMSetRulerReleaseAction REMOVED
WMSetTextAlignment REMOVED
WMSetTextBackgroundColor REMOVED
WMSetTextBackgroundPixmap REMOVED
WMSetTextBlockProperties REMOVED
WMSetTextDefaultColor REMOVED
WMSetTextDefaultFont REMOVED
WMSetTextDelegate REMOVED
WMSetTextEditable REMOVED
WMSetTextForegroundColor REMOVED
WMSetTextHasHorizontalScroller REMOVED
WMSetTextHasRuler REMOVED
WMSetTextHasVerticalScroller REMOVED
WMSetTextIgnoresNewline REMOVED
WMSetTextIndentNewLines REMOVED
WMSetTextRelief REMOVED
WMSetTextSelectionColor REMOVED
WMSetTextSelectionFont REMOVED
WMSetTextSelectionUnderlined REMOVED
WMSetTextUsesMonoFont REMOVED
WMShowTextRuler REMOVED
WMThawText REMOVED
WMRefreshText REMOVED
WMCreateText REMOVED
WMClearText REMOVED
** libWutil **
enum WMConnectionState REMOVED
enum WMConnectionTimeoutState REMOVED
struct ConnectionDelegate REMOVED
__wmessage ADDED
wstrerror REMOVED
wmessage converted from function to wrapper macro
wwarning converted from function to wrapper macro
wfatal converted from function to wrapper macro
wsyserror converted from function to wrapper macro
wsyserror REMOVED (use werror instead)
werror macro ADDED (replaces wsyserror)
wsyserrorwithcode removed
wmkdirhier ADDED
wrmdirhier ADDED
wmalloc0 REMOVED
wnew REMOVED
wnew0 REMOVED
wstrlcpy ADDED
wstrlcat ADDED
WMPushInArray REMOVED
WMWritePropListToFile NUMBER OF FUNCTION ARGUMENTS CHANGED
WMGetCurrentHost
WMGetHostWithName
WMGetHostWithAddress
WMRetainHost
WMReleaseHost
WMSetHostCacheEnabled
WMIsHostCacheEnabled
WMFlushHostCache
WMIsHostEqualToHost
WMGetHostName
WMGetHostNames
WMGetHostAddress
WMCreateConnectionAsServerAtAddress REMOVED
WMCreateConnectionToAddress REMOVED
WMCreateConnectionToAddressAndNotify REMOVED
WMCloseConnection REMOVED
WMDestroyConnection REMOVED
WMConnection* WMAcceptConnection REMOVED
WMGetConnectionAvailableData REMOVED
WMSendConnectionData REMOVED
WMEnqueueConnectionData REMOVED
WMFlushConnection REMOVED
WMSetConnectionDelegate REMOVED
WMGetConnectionService REMOVED
WMGetConnectionProtocol REMOVED
WMSetConnectionNonBlocking REMOVED
WMSetConnectionCloseOnExec REMOVED
WMSetConnectionShutdownOnClose REMOVED
WMGetConnectionClientData REMOVED
WMSetConnectionClientData REMOVED
WMGetConnectionFlags REMOVED
WMSetConnectionFlags REMOVED
WMGetConnectionSocket REMOVED
WMGetConnectionState REMOVED
WMGetConnectionTimeoutState REMOVED
WMGetConnectionUnsentData REMOVED
WMGetConnectionQueuedData REMOVED
WMSetConnectionDefaultTimeout REMOVED
WMSetConnectionOpenTimeout REMOVED
WMSetConnectionSendTimeout REMOVED
WMTreeWalkProc ADDED
WMTreeWalk ADDED
wshellquote ADDED
----------------------------------------------------
*** Mon Oct 14 19:42:42 EEST 2002 - Dan
Double buffering
----------------
To avoid flickering caused by redrawing the widgets on Expose events, a
double buffering tehnique was implemented for most of the widgets.
This flickering effect has gotten more vizible with the introduction
of antialiased fonts. If with normal text one can redraw the text over the
old one over and over again without any degradation of the text (new pixels
simply overwrite old pixels), with antialiased text the situation is
different and text gets quickly corrupted. To avoid this corruption, one
needs to first erase the area where the text will go, which can cause the
before mentioned flickering.
The double buffer is implemented to solve this issue.
This is a change that that will be automatically available for any WINGs
applications and will require no change in the existing code.
However there is an exception from this in case of WMList if you delegate
the drawing of items to userspace (read below for the compelte details).
*** Mon Oct 14 22:07:42 EEST 2002 - Dan
WMList change
-------------
In case of WMList there is the posibility to delegate the drawing of the
list items to the application that is linked with WINGs, and this code will
not be inside the WINGs library, but in userland. Since we use the double
buffering tehnique in this case too (to allow all widgets based on WMList
and the ones that draw their list items by themselves to benefit from the
double buffering advantage automatically), we no longer pass the window to
the user code doing item drawing, but instead pass this pixmap in which we
draw before copying to the real window.
Since one cannot use XClearWindow() or XClearArea() on pixmaps, but only on
windows, if the code drawing list items used to call these functions to clear
the item area before drawing it needs to change to using XFillRectangle()
instead.
With this change it also means that there is no longer any need to do any
double buffering in the user code, since it's already done by WINGs.
*** Mon Oct 14 19:28:35 EEST 2002 - Dan
API change
----------
WMDrawString() and WMDrawImageString() no longer take a GC as argument.
Instead WMDrawString() takes a WMColor* as the color for the string to be
drawn, while WMDrawImageString() takes 2 WMColor* arguments in place of the
old GC: first for text color and second for background color.
This change is required to support extending WMFont to allow it to handle
antialiased fonts through the XFree86 Xft2 extension.
This also has the advantage of hiding low level X11 details and use WINGs
internat objects instead.
To fix your old code to work with the new WINGs API you need to replace the
GC passed to WMDraw***String() in your code with a WMColor*.
Most of the old code used to be like this:
WMDrawString(screen, window, WMColorGC(color), font, x, y, txt, len);
for the new API it should be replaced by:
WMDrawString(screen, window, color, font, x, y, txt, len);
However if you used a particular GC created by yourself to suit your special
needs, you need to pass a color which is the same as the foreground color of
that gc.
For WMDrawImageString(), from:
WMDrawImageString(screen, window, gc, font, x, y, txt, len);
becomes
WMDrawImageString(screen, window, textColor, backColor, font, x, y, txt, len);
where textColor and backColor are declared like:
WMColor *textColor, *backColor;
and have the color of the foreground respective the background of the old gc.
*** Wed Oct 9 07:10:04 EEST 2002 - Dan
Antialiased font support
------------------------
With the addition of Xft2 support in the WINGs library, now WINGs can display
antialiased text with TrueType or any scalable fonts.
Antialiased text is enabled by default, but can be disabled by adding
AntialiasedText = NO; in ~/GNUstep/Defaults/WMGLOBAL
This will disable antialiased text for any WINGs based application. If you
only want to disable them for a specific application only, like WindowMaker
for example, then add the same option in the applications configuration file,
in this case ~/GNUstep/Defaults/WindowMaker
Note that bitmapped fonts look much better than TrueType when antialiasing is
disabled.
*** Mon Sep 09 06:58:30 EEST 2002 - Dan
New delegate for the WMConnection class
---------------------------------------
ConnectionDelegate structure has a new member: canResumeSending.
The purpose of this callback is to notify you that you can resume sending
data over a WMConnection.
It works in the following manner:
WMSendConnectionData() can return 3 values: -1, 0, 1
-1 - means that the connection has died. you should stop sending data and
close the connection ASAP.
1 - means that the data was succesfully sent
0 - means that the data (or part of it) was not sent. however, it was saved
in a queue and the library will try to send it later when possible.
if the return value is 1, you can continue to send the next message, and so
on, until the return value of such a send call will be 0.
After it returns 0 you can continue sending, however, the data will not be
sent over the connection because the operating system cannot accept any more
data for the moment. Instead it will be queued inside the library, making your
program's memory footprint increase. If the ammount of data you need to
send is limited and not too big, this shouldn't be a problem, because your
data will be queued and sent when the operating system will notify the
library that sending is possible again.
If this is the case you can just ignore the output of WMSendConnectionData()
and not set a callback for canResumeSending.
However, if the ammount of data you have to send is undetermined and you
also want to keep a small memory footprint for your program (so that it
won't grow until it uses all your available memory ;) ), you will have to
stop sending data over the connection as soon as WMSendConnectionData()
returns with 0. Then you should somehow mark this situation in your program
to avoid it trying to send anymore data until notified that it can resume.
(You should have also set a canResumeSending callback when you initialized
your WMConnection object because else you cannot be notified when to resume.)
Now, when you receive such a 0 from the send operation, your last sent data
is put in a queue inside the library. At a later time when the operating
system notifies the library that sending is possible again, the library will
resume to send the data that is saved in the queue. After it will be able to
send all the data in the queue, the canResumeSending callback will be
called, letting you know that not only you can resume sending because the
operating system is again able to send data, but also that the queue was
completely flushed.
From the canResumeSending callback, you should again update the status of
your program marking that it can send again, and then resume sending the
data from where you were left.
*** Thu Oct 04 06:00:09 EEST 2001 -Dan
Property lists handling code
----------------------------
Code to handle property lists was added to WINGs. It is more robust
than the libPropList code, mostly because some conflicting concepts
borrowed from UserDefaults (which libPropList use) are no longer used in
the WINGs property lists code. These borrowed concepts conflicted with the
retain/release mechanism of property lists and could lead in certain cases
to segmentation faults when executing libPropList based code. But the worse
part was that these libPropList problems were practically unsolvable without
removing one of those conflicting concepts and without a complete redesign.
The new WINGs property lists code is also better integrated with the other
data types from WINGs and is actively maintained.
Practically the things that were removed from the WINGs property list
implementation compared to the old libPropList implementation, are exactly
the UserDefaults borrowed concepts that conflict with the retain/release
mechanism:
- The container of a proplist object and the associated functions are gone.
- The filename associated with a proplist object and the corresponding
functions are gone. Now the saving function needs the filename as a
parameter.
- The synchronization functions are no longer supported. They are part of
the UserDefaults and are implemented there.
- No functions related to domains/registering were implemented in the WINGs
property lists code, because they are also not part of property lists.
They are more in connection with UserDefaults and a central point of access
for domains.
The above 2 concepts: container and filename were added to libPropList just
to let it support synchronization which was borrowed from UserDefaults.
Property lists as defined in the openstep specification are just complex
data structures composed of strings, data, arrays, dictionaries and a mix of
them and are not associated with any file in particular. UserDefaults on the
other hand are property lists read from a specific file and they associate
that property list with that file and allow them to be synchronized.
Old libPropList based code can still be used by linking against the WINGs
library containing the new proplist code with minimal changes which are
described in detail in the comments at the top of the WINGs/proplist-compat.h
header file (the same file carries the #defines for mapping old libPropList
functions to the new WINGs proplist functions).
Our recommendation is to move to the new functions WINGs provide because
they better integrate with other function naming conventions in WINGs.
The proplist-compat.h header file is just a way to have old code up and
running with minimal changes so that we can remove the old and unmaintained
libPropList from systems while keeping to use old libPropList based code
without rewriting it and it should not be used for other purposes.
*** Sat Apr 21 09:12:09 EEST 2001 -Dan
API change
----------
To allow a correct display of icon images with alpha blending in panels and
other places where a WINGs based application may use them the following
changes took place:
1. The following functions were renamed:
- WMSetApplicationIconImage() --> WMSetApplicationIconPixmap()
- WMGetApplicationIconImage() --> WMGetApplicationIconPixmap()
- WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
2. The following functions were added:
- WMSetApplicationIconImage(WMScreen *scr, RImage *image)
- RImage* WMGetApplicationIconImage(WMScreen *scr)
- WMPixmap* WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *col)
As you can see the old functions that operated on WMPixmap images (which are
basically X Pixmaps that lack alpha information) were renamed to ...Pixmap()
to make them more suggestive about what they do and to make room for the
new functions that operate on RImages (that hold alpha information).
Since the corresponding WMGet... functions only retrieve the stored
image/pixmap from the application, I'll outline how the WMSet...
functions operate:
All WM...IconPixmap() functions operate on WMPixmaps
All WM...IconImage() functions operate on RImages
- WMSetApplicationIconImage() will set the RImage to be used in panels
and will also convert the RImage to a WMPixmap with a threshold of 128
and will use that pixmap for the appicon image. If that doesn't satisfy
you, you can make a call to WMSetApplicationIconPixmap() on your own to
set whatever WMPixmap you see fit for the appicon.
- WMSetApplicationIconPixmap() will set the WMPixmap to be used for the
appicon and for the panels
If you use only one of the above functions, the corresponding image/pixmap
will be used everywhere where needed (panels and appicon), but the pixmap
version will not be able to handle alpha blending correctly.
If you use both WMSetApplicationIconImage() and WMSetApplicationIconPixmap()
then the RImage will have priority in panels, and the WMPixmap will only be
used for the appicon. This allows you to better control what icon is
displayed in the appicon, in case the default conversion of the RImage to a
pixmap with a threshold of 128 is not good enough, or in case you want a
different icon to be shown in the appicon than in panels.
Also this new function was added:
- WMCreateApplicationIconBlendedPixmap() will use the RImage set with
WMSetApplicationIconImage() if available and will blend it with the color
you passed. This will make the image show well on a background of that
color. If the RImage was not set it will return NULL. You need to call
WMReleasePixmap() on it after you finish with it. Passing a NULL pointer
instead of a color will make the RImage be blended with the default color
of the WINGs widgets: '#aeaaae' making it suitable to be assigned to any
WINGs widget.
To make your existing code work as before all you need to do is to rename
the following functions:
- WMSetApplicationIconImage() --> WMSetApplicationIconPixmap()
- WMGetApplicationIconImage() --> WMGetApplicationIconPixmap()
- WMSetWindowMiniwindowImage() --> WMSetWindowMiniwindowPixmap()
But if you want to take advantage of the new abilities to show alpha
blended images you need to start using the new functions.

View File

@@ -5,7 +5,7 @@
Alfredo Kengi Kojima Alfredo Kengi Kojima
kojima@windowmaker.info kojima@windowmaker.org
WINGs is a small widget set with the N*XTSTEP look and feel. It's API WINGs is a small widget set with the N*XTSTEP look and feel. It's API
@@ -13,7 +13,7 @@ is inspired in OpenStep and it's implementation borrows some ideas
from Tk. It has a reasonable set of widgets, sufficient for building from Tk. It has a reasonable set of widgets, sufficient for building
small applications (like a CDPlayer or hacking something like rxvt). It small applications (like a CDPlayer or hacking something like rxvt). It
also has other functions that are usefull for applications, like a also has other functions that are usefull for applications, like a
User Defaults alike configuration manager and a notification system. User Defaults like configuration manager and a notification system.
The library is limited and it's design is a little sloppy, The library is limited and it's design is a little sloppy,
so it's not intended to build large or complex applications, like so it's not intended to build large or complex applications, like
@@ -26,7 +26,7 @@ workaround some of it's limitations, although you'll probably be able to
write something like a trivial tic-tac-toe game without knowing much Xlib. write something like a trivial tic-tac-toe game without knowing much Xlib.
Some of it's functions are designed to support the WindowMaker window Some of it's functions are designed to support the WindowMaker window
manager (see http://windowmaker.info) In fact, it's primary role is to manager (see http://windowmaker.org) In fact, it's primary role is to
support WindowMaker. All other uses of it are just an added bonus. support WindowMaker. All other uses of it are just an added bonus.
It will help you to understand the API if you read the ApplicationKit It will help you to understand the API if you read the ApplicationKit
@@ -37,8 +37,9 @@ structs and most of the intrinsics are very close to OpenStep classes.
Internationalization: Internationalization:
--------------------- ---------------------
Change ~/GNUstep/Defaults/WMGLOBAL to set the desired font set and WINGs supports display of multibyte characters (kanji etc) without the
set MultiByteText = YES; to enable support for multibyte text. to specify any flags (ie: there is no way to disable i18n support).
Change ~/GNUstep/Defaults/WMGLOBAL to set the desired font set.
Widgets provided by WINGs: Widgets provided by WINGs:
@@ -56,22 +57,24 @@ Widgets provided by WINGs:
- slider - slider
- scrollable view - scrollable view
- color well - color well
- split view - split view (only 2 subviews)
- tabbed view
- progress indicator
- selection (make pasteboard like?)
- drag&drop
- input box - input box
- file panel - file panel
- color panel
- alert panel - alert panel
- font panel
Planned:
--------
- selection (pasteboard like)
- drag&drop
If you think you can code the following, please do. They are needed by If you think you can code the following, please do. They are needed by
WPrefs.app, but the number of other things I have to do is huge. WPrefs.app, but the number of other things I have to do is huge.
- color panel
- font panel (the UI part is done. Might require a rewrite of the font list
retrievel code. Might also require a WMFontManager)
- input method support (XIM). I have no idea of how to code it. People who use - input method support (XIM). I have no idea of how to code it. People who use
different characters than ASCII will have trouble editing menus without it... different characters than ASCII will have trouble editing menus without it...
@@ -81,7 +84,9 @@ Wish list: (I don't have the know-how or time to do them)
- text (with support for RTF) - text (with support for RTF)
- matrix (like NSMatrix) - matrix (like NSMatrix)
- splitviews with more than 2 subviews
- font manager (like NSFontManager) - font manager (like NSFontManager)
- finish file panel, open/save
- finish other wigets - finish other wigets
- optimize list scrolling (XCopyArea() the area that's already drawn) - optimize list scrolling (XCopyArea() the area that's already drawn)
- InterfaceMaker? - InterfaceMaker?

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

210
WINGs/Resources/Makefile.in Normal file
View File

@@ -0,0 +1,210 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP_PATH = @CPP_PATH@
DFLAGS = @DFLAGS@
GFXFLAGS = @GFXFLAGS@
GFXLIBS = @GFXLIBS@
I18N = @I18N@
I18N_MB = @I18N_MB@
ICONEXT = @ICONEXT@
INTLIBS = @INTLIBS@
LIBPL_INC_PATH = @LIBPL_INC_PATH@
LIBPL_LIBS = @LIBPL_LIBS@
LN_S = @LN_S@
MAKEINFO = @MAKEINFO@
MOFILES = @MOFILES@
NLSDIR = @NLSDIR@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
REDUCE_APPICONS = @REDUCE_APPICONS@
SHAPE = @SHAPE@
SOUND = @SOUND@
VERSION = @VERSION@
WPMOFILES = @WPMOFILES@
XCFLAGS = @XCFLAGS@
XGETTEXT = @XGETTEXT@
XLFLAGS = @XLFLAGS@
XLIBS = @XLIBS@
XSHM = @XSHM@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LOCALE = @X_LOCALE@
pixmapdir = @pixmapdir@
wprefsdir = @wprefsdir@
resdatadir = $(datadir)/WINGs
resdata_DATA = Images.tiff Images.xpm defaultIcon.tiff defaultIcon.xpm
EXTRA_DIST = $(resdata_DATA) Images.xcf
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../../src/config.h
CONFIG_CLEAN_FILES =
DATA = $(resdata_DATA)
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
all: Makefile $(DATA)
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps WINGs/Resources/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
install-resdataDATA: $(resdata_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(resdatadir)
@list='$(resdata_DATA)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(resdatadir)/$$p"; \
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(resdatadir)/$$p; \
else if test -f $$p; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(resdatadir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(resdatadir)/$$p; \
fi; fi; \
done
uninstall-resdataDATA:
@$(NORMAL_UNINSTALL)
list='$(resdata_DATA)'; for p in $$list; do \
rm -f $(DESTDIR)$(resdatadir)/$$p; \
done
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = WINGs/Resources
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec:
@$(NORMAL_INSTALL)
install-data: install-resdataDATA
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-resdataDATA
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(DATADIR)$(resdatadir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-generic
clean: clean-generic mostlyclean
distclean: distclean-generic clean
-rm -f config.status
maintainer-clean: maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: uninstall-resdataDATA install-resdataDATA tags distdir info dvi \
installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,13 +1,4 @@
- move paint to idle handlers - move paint to idle handlers
- check if its useful to add some WMBrowserSelectionDidChangeNotification
(actually a pass-through for WMListSelectionDidChangeNotification).
Or a delegate to be called when the list selection change.
- add some way to modify speed when scrolling WMList, depending on how
far the mouse is moved outside of the list.
- clean up header files of declared but not implemented anywhere functions
- implement a generic WMChangeFontAttribute(WMFont *font, enum attributes)
function
- optimize color allocation for repeated colors - optimize color allocation for repeated colors
- make it work in 8bpp - make it work in 8bpp

View File

@@ -1,22 +0,0 @@
## automake input file for WINGs - Tests
AUTOMAKE_OPTIONS =
noinst_PROGRAMS = wtest wmquery wmfile testmywidget
LDADD= $(top_builddir)/WINGs/libWINGs.la $(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/WINGs/libWUtil.la \
@XFTLIBS@ @INTLIBS@
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
wtest_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.la
EXTRA_DIST = logo.xpm upbtn.xpm wm.html wm.png
INCLUDES = -I$(top_srcdir)/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@ \
-DDEBUG

View File

@@ -1,197 +0,0 @@
/*
* Demo user widget for WINGs
*
* Author: Alfredo K. Kojima
*
* This file is in the public domain.
*
*/
/*
*
* Include the WINGs private data header.
*
*
*/
#include <WINGs/WINGsP.h>
/*
* Our public header.
*/
#include "mywidget.h"
/*
* Define the widget "class"
*/
typedef struct W_MyWidget {
/* these two fields must be present in all your widgets in this
* exact position */
W_Class widgetClass;
WMView *view;
/* put your stuff here */
char *text;
} _MyWidget;
/* some forward declarations */
static void destroyMyWidget(_MyWidget * mPtr);
static void paintMyWidget(_MyWidget * mPtr);
static void handleEvents(XEvent * event, void *data);
static void handleActionEvents(XEvent * event, void *data);
/*
* Delegates
* See the source for the other widgets to see how to use.
* You won't need to use this most of the time.
*/
static W_ViewDelegate _MyWidgetDelegate = {
NULL,
NULL,
NULL,
NULL,
NULL
};
/* our widget class ID */
static W_Class myWidgetClass = 0;
/*
* Initializer for our widget. Must be called before creating any
* instances of the widget.
*/
W_Class InitMyWidget(WMScreen * scr)
{
/* register our widget with WINGs and get our widget class ID */
if (!myWidgetClass) {
myWidgetClass = W_RegisterUserWidget();
}
return myWidgetClass;
}
/*
* Our widget fabrication plant.
*/
MyWidget *CreateMyWidget(WMWidget * parent)
{
MyWidget *mPtr;
/* allocate some storage for our new widget instance */
mPtr = wmalloc(sizeof(MyWidget));
/* initialize it */
memset(mPtr, 0, sizeof(MyWidget));
/* set the class ID */
mPtr->widgetClass = myWidgetClass;
/*
* Create the view for our widget.
* Note: the Window for the view is only created after the view is
* realized with W_RealizeView()
*
* Consider the returned view as read-only.
*/
mPtr->view = W_CreateView(W_VIEW(parent));
if (!mPtr->view) {
wfree(mPtr);
return NULL;
}
/* always do this */
mPtr->view->self = mPtr;
/* setup the delegates for the view */
mPtr->view->delegate = &_MyWidgetDelegate;
/*
* Intercept some events for our widget, so that we can handle them.
*/
WMCreateEventHandler(mPtr->view, ExposureMask /* this allows us to know when we should paint */
| StructureNotifyMask, /* this allows us to know things like when we are destroyed */
handleEvents, mPtr);
/*
* Intercept some other events. This could be merged with the above
* call, but we separate for more organization.
*/
WMCreateEventHandler(mPtr->view, ButtonPressMask, handleActionEvents, mPtr);
return mPtr;
}
/*
* Paint our widget contents.
*/
static void paintMyWidget(_MyWidget * mPtr)
{
W_Screen *scr = mPtr->view->screen;
WMColor *color;
if (mPtr->text) {
color = WMWhiteColor(scr);
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
mPtr->view->size.width, WACenter, color, False, mPtr->text, strlen(mPtr->text));
WMReleaseColor(color);
}
}
static void handleEvents(XEvent * event, void *data)
{
_MyWidget *mPtr = (_MyWidget *) data;
switch (event->type) {
case Expose:
if (event->xexpose.count != 0)
break;
paintMyWidget(mPtr);
break;
case DestroyNotify:
destroyMyWidget(mPtr);
break;
}
}
static void handleActionEvents(XEvent * event, void *data)
{
_MyWidget *mPtr = (_MyWidget *) data;
switch (event->type) {
case ButtonPress:
XBell(mPtr->view->screen->display, 100);
XBell(mPtr->view->screen->display, 100);
break;
}
}
void SetMyWidgetText(MyWidget * mPtr, char *text)
{
CHECK_CLASS(mPtr, myWidgetClass);
if (mPtr->text)
wfree(mPtr->text);
mPtr->text = wstrdup(text);
if (W_VIEW_MAPPED(mPtr->view)) {
paintMyWidget(mPtr);
}
}
static void destroyMyWidget(_MyWidget * mPtr)
{
/*
* Free all data we allocated for our widget.
*/
if (mPtr->text)
wfree(mPtr->text);
wfree(mPtr);
}

View File

@@ -1,46 +0,0 @@
#include <WINGs/WINGs.h>
#include <stdlib.h>
#include "mywidget.h"
void wAbort()
{
exit(1);
}
int main(int argc, char **argv)
{
Display *dpy = XOpenDisplay("");
WMScreen *scr;
WMWindow *win;
MyWidget *thing;
WMInitializeApplication("Test", &argc, argv);
if (!dpy) {
wfatal("could not open display");
exit(1);
}
scr = WMCreateSimpleApplicationScreen(dpy);
/* init our widget */
InitMyWidget(scr);
win = WMCreateWindow(scr, "test");
WMResizeWidget(win, 150, 50);
thing = CreateMyWidget(win);
SetMyWidgetText(thing, "The Test");
WMResizeWidget(thing, 100, 20);
WMMoveWidget(thing, 10, 10);
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,57 +0,0 @@
/* XPM */
static char * upbtn_xpm[] = {
"20 22 32 1",
" c None",
". c #000000",
"+ c #FFFFFF",
"@ c #4A485A",
"# c #524052",
"$ c #4A595A",
"% c #5A596A",
"& c #4A486A",
"* c #5A595A",
"= c #52556A",
"- c #52406A",
"; c #6A556A",
"> c #5A6D6A",
", c #5A597B",
"' c #5A6D7B",
") c #6A557B",
"! c #6A6D7B",
"~ c #6A697B",
"{ c #6A698B",
"] c #7B797B",
"^ c #C5C2C5",
"/ c #6A818B",
"( c #6A7D7B",
"_ c #7B698B",
": c #6A798B",
"< c #7B799C",
"[ c #7B798B",
"} c #7B8D94",
"| c #7B81A4",
"1 c #8B85A4",
"2 c #73899C",
"3 c #7B89A4",
" ",
" .+ ",
" .@#+ ",
" .$%$&+ ",
" .*=*-*-+ ",
" .%%%%%%$%+ ",
" .%=%;%=*=*-+ ",
" .>%>,''>,>%=%+ ",
" .%)>)!~>)>)>=*#+ ",
" .>~'~'{'{'~',>%$@+ ",
" ]+++^{!{!~!)>+++++ ",
" ./{/{({'~+ ",
" ._:_:_!~>+ ",
" ./</</{'~+ ",
" .<<<[_({!+ ",
" .}|}</{(~+ ",
" .12<[_:{'+ ",
" .31}</{'~+ ",
" .12<[_!~>+ ",
" .2</</{''+ ",
" ]+++++++++ ",
" "};

View File

@@ -1,37 +0,0 @@
<HTML><font size=-1>
<center>
<Img src=wm.png></b><p>
<b>GNU Window Maker</B><br>
<i>X11 Window Manager</i><p>
<u>http://windowmaker.info<br>
ftp.windowmaker.info</u></font><Br>
</center>
<b><i>Window Maker</b>
<Img src=upbtn.xpm></i>is the GNU window manager
for the X Window System. It was
designed to emulate the look and feel of part of the NEXTSTEP(tm) GUI. Its
supposed to be relatively fast and small, feature rich, easy to configure and
easy to use, with a simple and elegant appearance borrowed from NEXTSTEP(tm).
<p>
<b>Window Maker</b> was designed keeping integration with GNUstep in
mind and is the
"official" window manager for it. It is also part of the GNU project
(<u>www.gnu.org</u>)
<p>
<b>What is <i>GNUstep?</i></b><p>
<i><b>G</i>NU</b>step is a complete object-oriented development system, based on the
OpenStep specification released by NeXT(tm) (now Apple(tm)) and Sun(tm). It will provide everything one needs to produce cross-platform, object-oriented, graphical (and non-graphical) applications; providing among other things, base system libraries, a high-level GUI application framework that uses a Display PostScript(tm)-like imaging model (DGS), objects for accessing relational databases, distributed objects and a graphical development environment, with tools like interface modeller, a project management system
(project center) and other tools.
<p>
The GNUstep development system will be used to create a user environment,
with everything needed for a complete graphical user interface, such as a
file viewer, text editors and other applications. Note that the user
environment (or "desktop environment") is only a small part of the whole
GNUstep project and therefore it does not "compete" with other projects like
KDE or GNOME, simply because they are completely different things.
<p>
For more information on the GNUstep project, visit:
<u>http://www.gnustep.org</u> and <u>http://gnustep.current.nu</u>
</HTML>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -1,112 +0,0 @@
/*
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
*/
/*
Update: Franck Wolff <frawolff@club-internet.fr>
-----------------------------------------------------------------------
List of updated functions :
- main :
add -s option for a save panel...
-----------------------------------------------------------------------
*/
#include <WINGs/WINGs.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "logo.xpm"
void wAbort()
{
exit(1);
}
char *ProgName;
void usage(void)
{
fprintf(stderr,
"usage:\n"
"\t%s [-options]\n"
"\n"
"options:\n"
" -s\t\tSave panel (default open panel)\n"
" -i <str>\tInitial directory (default /)\n"
" -t <str>\tQuery window title (default none)\n"
"\n"
"information:\n"
"\t%s pops up a WindowMaker style file selection panel.\n"
"\n" "version:\n" "\t%s\n", ProgName, ProgName, __DATE__);
exit(0);
}
#define OPEN_PANEL_TYPE 0
#define SAVE_PANEL_TYPE 1
int main(int argc, char **argv)
{
Display *dpy = XOpenDisplay("");
WMScreen *scr;
WMPixmap *pixmap;
WMOpenPanel *oPanel;
WMSavePanel *sPanel;
/* RImage *image; */
char *title = NULL;
char *initial = "/";
int ch;
int panelType = OPEN_PANEL_TYPE;
extern char *optarg;
extern int optind;
if (!dpy) {
puts("could not open display");
exit(1);
}
WMInitializeApplication("WMFile", &argc, argv);
ProgName = argv[0];
while ((ch = getopt(argc, argv, "si:ht:")) != -1)
switch (ch) {
case 's':
panelType = SAVE_PANEL_TYPE;
break;
case 'i':
initial = optarg;
break;
case 't':
title = optarg;
break;
default:
usage();
}
for (; optind < argc; optind++)
usage();
scr = WMCreateSimpleApplicationScreen(dpy);
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
WMSetApplicationIconPixmap(scr, pixmap);
WMReleasePixmap(pixmap);
if (panelType == SAVE_PANEL_TYPE) {
sPanel = WMGetSavePanel(scr);
if (WMRunModalFilePanelForDirectory(sPanel, NULL, initial,
/*title */ NULL, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(sPanel));
else
printf("\n");
} else {
oPanel = WMGetOpenPanel(scr);
if (WMRunModalFilePanelForDirectory(oPanel, NULL, initial,
/*title */ NULL, NULL) == True)
printf("%s\n", WMGetFilePanelFileName(oPanel));
else
printf("\n");
}
return 0;
}

View File

@@ -1,90 +0,0 @@
/*
* Author: Len Trigg <trigg@cs.waikato.ac.nz>
*/
#include <WINGs/WINGs.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include "logo.xpm"
void wAbort()
{
exit(1);
}
char *ProgName;
void usage(void)
{
fprintf(stderr,
"usage:\n"
"\t%s [-options]\n"
"\n"
"options:\n"
" -i <str>\tInitial entry contents (default none)\n"
" -p <str>\tPrompt message (default none)\n"
" -t <str>\tQuery window title (default none)\n"
"\n"
"information:\n"
"\t%s pops up a WindowMaker style input panel.\n"
"\n" "version:\n" "\t%s\n", ProgName, ProgName, __DATE__);
exit(0);
}
int main(int argc, char **argv)
{
Display *dpy = XOpenDisplay("");
WMScreen *scr;
WMPixmap *pixmap;
char *title = NULL;
char *prompt = NULL;
char *initial = NULL;
char *result = NULL;
int ch;
extern char *optarg;
extern int optind;
WMInitializeApplication("WMQuery", &argc, argv);
ProgName = argv[0];
if (!dpy) {
puts("could not open display");
exit(1);
}
while ((ch = getopt(argc, argv, "i:hp:t:")) != -1)
switch (ch) {
case 'i':
initial = optarg;
break;
case 'p':
prompt = optarg;
break;
case 't':
title = optarg;
break;
default:
usage();
}
for (; optind < argc; optind++)
usage();
scr = WMCreateSimpleApplicationScreen(dpy);
pixmap = WMCreatePixmapFromXPMData(scr, GNUSTEP_XPM);
WMSetApplicationIconPixmap(scr, pixmap);
WMReleasePixmap(pixmap);
if ((result = WMRunInputPanel(scr, NULL, title, prompt, initial, "OK", "Cancel")) != NULL)
printf("%s\n", result);
else
printf("\n");
return 0;
}

File diff suppressed because it is too large Load Diff

1004
WINGs/WINGs.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +0,0 @@
## automake input file for WINGs - Headers subdir
AUTOMAKE_OPTIONS =
# is this a kluge? if so, how should i do it?
includedir = @includedir@/WINGs
include_HEADERS = WINGs.h WUtil.h WINGsP.h proplist-compat.h

File diff suppressed because it is too large Load Diff

View File

@@ -1,639 +0,0 @@
#ifndef _WINGSP_H_
#define _WINGSP_H_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <WINGs/WINGs.h>
#if WINGS_H_VERSION < 20041030
#error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it.
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define DOUBLE_BUFFER 1
#define WC_UserWidget 128
#define SCROLLER_WIDTH 20
#define XDND_VERSION 3
typedef struct W_Application {
char *applicationName;
int argc;
char **argv;
char *resourcePath;
} W_Application;
typedef struct W_Font {
struct W_Screen *screen;
struct _XftFont *font;
short height;
short y;
short refCount;
char *name;
} W_Font;
typedef struct W_Pixmap {
struct W_Screen *screen;
Pixmap pixmap;
Pixmap mask;
unsigned short width;
unsigned short height;
short depth;
short refCount;
} W_Pixmap;
typedef struct W_Color {
struct W_Screen *screen;
XColor color;
unsigned short alpha;
short refCount;
GC gc;
struct {
unsigned int exact:1;
} flags;
} W_Color;
typedef struct W_FocusInfo {
struct W_View *toplevel;
struct W_View *focused; /* view that has the focus in this toplevel */
struct W_FocusInfo *next;
} W_FocusInfo;
typedef void* W_DndState(WMView *destView, XClientMessageEvent *event,
WMDraggingInfo *info);
typedef struct W_DragOperationItem {
WMDragOperationType type;
char* text;
} W_DragOperationItem;
typedef struct W_DragSourceInfo {
WMView *sourceView;
Window destinationWindow;
W_DndState *state;
WMSelectionProcs *selectionProcs;
Window icon;
WMPoint imageLocation;
WMPoint mouseOffset; /* mouse pos in icon */
Cursor dragCursor;
WMRect noPositionMessageZone;
Atom firstThreeTypes[3];
} W_DragSourceInfo;
typedef struct W_DragDestinationInfo {
WMView *destView;
WMView *xdndAwareView;
Window sourceWindow;
W_DndState *state;
Bool sourceActionChanged;
WMArray *sourceTypes;
WMArray *requiredTypes;
Bool typeListAvailable;
WMArray *dropDatas;
} W_DragDestinationInfo;
struct W_DraggingInfo {
unsigned char protocolVersion; /* version supported on the other side */
Time timestamp;
Atom sourceAction;
Atom destinationAction;
W_DragSourceInfo* sourceInfo; /* infos needed by source */
W_DragDestinationInfo* destInfo; /* infos needed by destination */
} W_DraggingInfo;
typedef struct W_Screen {
Display *display;
int screen;
int depth;
Colormap colormap;
Visual *visual;
Time lastEventTime;
Window rootWin;
struct W_View *rootView;
RContext *rcontext;
struct W_IMContext *imctx;
struct _XftDraw *xftdraw; /* shared XftDraw */
/* application related */
W_FocusInfo *focusInfo;
RImage *applicationIconImage; /* image (can have alpha channel) */
struct W_Pixmap *applicationIconPixmap; /* pixmap - no alpha channel */
Window applicationIconWindow;
struct W_Window *windowList; /* list of windows in the app */
Window groupLeader; /* the leader of the application */
/* also used for other things */
struct W_SelectionHandlers *selectionHandlerList;
struct {
unsigned int hasAppIcon:1;
unsigned int simpleApplication:1;
} aflags;
WMOpenPanel *sharedOpenPanel;
WMSavePanel *sharedSavePanel;
struct W_FontPanel *sharedFontPanel;
struct W_ColorPanel *sharedColorPanel;
Pixmap stipple;
struct W_View *dragSourceView;
struct W_DraggingInfo dragInfo;
/* colors */
W_Color *white;
W_Color *black;
W_Color *gray;
W_Color *darkGray;
GC stippleGC;
GC copyGC;
GC clipGC;
GC monoGC; /* GC for 1bpp visuals */
GC xorGC;
GC ixorGC; /* IncludeInferiors XOR */
GC drawStringGC; /* for WMDrawString() */
GC drawImStringGC; /* for WMDrawImageString() */
W_Font *normalFont;
W_Font *boldFont;
WMHashTable *fontCache;
Bool antialiasedText;
unsigned int ignoredModifierMask; /* modifiers to ignore when typing txt */
struct W_Balloon *balloon;
struct W_Pixmap *checkButtonImageOn;
struct W_Pixmap *checkButtonImageOff;
struct W_Pixmap *radioButtonImageOn;
struct W_Pixmap *radioButtonImageOff;
struct W_Pixmap *buttonArrow;
struct W_Pixmap *pushedButtonArrow;
struct W_Pixmap *scrollerDimple;
struct W_Pixmap *upArrow;
struct W_Pixmap *downArrow;
struct W_Pixmap *leftArrow;
struct W_Pixmap *rightArrow;
struct W_Pixmap *hiUpArrow;
struct W_Pixmap *hiDownArrow;
struct W_Pixmap *hiLeftArrow;
struct W_Pixmap *hiRightArrow;
struct W_Pixmap *pullDownIndicator;
struct W_Pixmap *popUpIndicator;
struct W_Pixmap *checkMark;
struct W_Pixmap *homeIcon;
struct W_Pixmap *altHomeIcon;
struct W_Pixmap *trashcanIcon;
struct W_Pixmap *altTrashcanIcon;
struct W_Pixmap *createDirIcon;
struct W_Pixmap *altCreateDirIcon;
struct W_Pixmap *disketteIcon;
struct W_Pixmap *altDisketteIcon;
struct W_Pixmap *unmountIcon;
struct W_Pixmap *altUnmountIcon;
struct W_Pixmap *magnifyIcon;
/*struct W_Pixmap *altMagnifyIcon;*/
struct W_Pixmap *wheelIcon;
struct W_Pixmap *grayIcon;
struct W_Pixmap *rgbIcon;
struct W_Pixmap *cmykIcon;
struct W_Pixmap *hsbIcon;
struct W_Pixmap *customPaletteIcon;
struct W_Pixmap *colorListIcon;
struct W_Pixmap *defaultObjectIcon;
Cursor defaultCursor;
Cursor textCursor;
Cursor invisibleCursor;
Atom attribsAtom; /* GNUstepWindowAttributes */
Atom deleteWindowAtom; /* WM_DELETE_WINDOW */
Atom protocolsAtom; /* _XA_WM_PROTOCOLS */
Atom clipboardAtom; /* CLIPBOARD */
Atom xdndAwareAtom; /* XdndAware */
Atom xdndSelectionAtom;
Atom xdndEnterAtom;
Atom xdndLeaveAtom;
Atom xdndPositionAtom;
Atom xdndDropAtom;
Atom xdndFinishedAtom;
Atom xdndTypeListAtom;
Atom xdndActionListAtom;
Atom xdndActionDescriptionAtom;
Atom xdndStatusAtom;
Atom xdndActionCopy;
Atom xdndActionMove;
Atom xdndActionLink;
Atom xdndActionAsk;
Atom xdndActionPrivate;
Atom wmIconDragOffsetAtom;
Atom wmStateAtom; /* WM_STATE */
Atom utf8String;
Atom netwmName;
Atom netwmIconName;
Atom netwmIcon;
/* stuff for detecting double-clicks */
Time lastClickTime; /* time of last mousedown event */
Window lastClickWindow; /* window of the last mousedown */
struct W_View *modalView;
unsigned modalLoop:1;
unsigned ignoreNextDoubleClick:1;
} W_Screen;
typedef struct W_ViewDelegate {
void *data;
void (*didMove)(struct W_ViewDelegate*, WMView*);
void (*didResize)(struct W_ViewDelegate*, WMView*);
void (*willMove)(struct W_ViewDelegate*, WMView*, int*, int*);
void (*willResize)(struct W_ViewDelegate*, WMView*,
unsigned int*, unsigned int*);
} W_ViewDelegate;
typedef struct W_View {
struct W_Screen *screen;
WMWidget *self; /* must point to the widget the view belongs to */
W_ViewDelegate *delegate;
Window window;
WMSize size;
short topOffs;
short leftOffs;
short bottomOffs;
short rightOffs;
WMPoint pos;
struct W_View *nextFocusChain; /* next/prev in focus chain */
struct W_View *prevFocusChain;
struct W_View *nextResponder; /* next to receive keyboard events */
struct W_View *parent; /* parent WMView */
struct W_View *childrenList; /* first in list of child windows */
struct W_View *nextSister; /* next on parent's children list */
WMArray *eventHandlers; /* event handlers for this window */
unsigned long attribFlags;
XSetWindowAttributes attribs;
void *hangedData; /* data holder for user program */
WMColor *backColor;
Cursor cursor;
Atom *droppableTypes;
struct W_DragSourceProcs *dragSourceProcs;
struct W_DragDestinationProcs *dragDestinationProcs;
WMPixmap *dragImage;
int helpContext;
XIC xic;
struct {
unsigned int realized:1;
unsigned int mapped:1;
unsigned int parentDying:1;
unsigned int dying:1; /* the view is being destroyed */
unsigned int topLevel:1; /* is a top level window */
unsigned int root:1; /* is the root window */
unsigned int mapWhenRealized:1; /* map the view when it's realized */
unsigned int alreadyDead:1; /* view was freed */
unsigned int dontCompressMotion:1; /* motion notify event compress */
unsigned int notifySizeChanged:1;
unsigned int dontCompressExpose:1; /* expose event compress */
/* toplevel only */
unsigned int worksWhenModal:1;
unsigned int pendingRelease1:1;
unsigned int pendingRelease2:1;
unsigned int pendingRelease3:1;
unsigned int pendingRelease4:1;
unsigned int pendingRelease5:1;
unsigned int xdndHintSet:1;
} flags;
int refCount;
} W_View;
typedef struct W_EventHandler {
unsigned long eventMask;
WMEventProc *proc;
void *clientData;
} W_EventHandler;
typedef struct _WINGsConfiguration {
char *systemFont;
char *boldSystemFont;
int defaultFontSize;
Bool antialiasedText;
char *floppyPath;
unsigned doubleClickDelay;
unsigned mouseWheelUp;
unsigned mouseWheelDown;
} _WINGsConfiguration;
extern _WINGsConfiguration WINGsConfiguration;
#define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
#define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
#define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
#define W_VIEW_REALIZED(view) (view)->flags.realized
#define W_VIEW_MAPPED(view) (view)->flags.mapped
#define W_VIEW_DISPLAY(view) (view)->screen->display
#define W_VIEW_SCREEN(view) (view)->screen
#define W_VIEW_DRAWABLE(view) (view)->window
#define W_VIEW_WIDTH(view) (view)->size.width
#define W_VIEW_HEIGHT(view) (view)->size.height
#define W_PIXEL(c) (c)->color.pixel
#define W_FONTID(f) (f)->font->fid
#define W_DRAWABLE(scr) (scr)->rcontext->drawable
W_View *W_GetViewForXWindow(Display *display, Window window);
W_View *W_CreateView(W_View *parent);
W_View *W_CreateTopView(W_Screen *screen);
W_View *W_CreateUnmanagedTopView(W_Screen *screen);
W_View *W_CreateRootView(W_Screen *screen);
void W_DestroyView(W_View *view);
void W_RealizeView(W_View *view);
void W_ReparentView(W_View *view, W_View *newParent, int x, int y);
void W_RaiseView(W_View *view);
void W_LowerView(W_View *view);
void W_MapView(W_View *view);
void W_MapSubviews(W_View *view);
void W_UnmapSubviews(W_View *view);
W_View *W_TopLevelOfView(W_View *view);
void W_UnmapView(W_View *view);
void W_MoveView(W_View *view, int x, int y);
void W_ResizeView(W_View *view, unsigned int width, unsigned int height);
void W_SetViewBackgroundColor(W_View *view, WMColor *color);
void W_SetViewCursor(W_View *view, Cursor cursor);
void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
unsigned int height, WMReliefType relief);
void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
unsigned int width, unsigned int height,
WMReliefType relief,
GC black, GC dark, GC light, GC white);
void W_CallDestroyHandlers(W_View *view);
void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
W_Font *font, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, WMColor *backColor, int ofs);
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
int width, WMAlignment alignment, WMColor *color,
int wrap, char *text, int length);
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
int W_TextWidth(WMFont *font, char *text, int length);
void W_BroadcastMessage(W_View *targetParent, XEvent *event);
void W_DispatchMessage(W_View *target, XEvent *event);
void W_SetFocusOfToplevel(W_View *toplevel, W_View *view);
W_View *W_FocusedViewOfToplevel(W_View *view);
void W_SetFocusOfTopLevel(W_View *toplevel, W_View *view);
void W_ReleaseView(WMView *view);
WMView *W_RetainView(WMView *view);
void W_InitApplication(WMScreen *scr);
void W_InitNotificationCenter(void);
W_Class W_RegisterUserWidget(void);
void W_RedisplayView(WMView *view);
Bool W_ApplicationInitialized(void);
void W_HandleSelectionEvent(XEvent *event);
void W_HandleDNDClientMessage(WMView *toplevel, XClientMessageEvent *event);
void W_FlushASAPNotificationQueue(void);
void W_FlushIdleNotificationQueue(void);
struct W_Balloon *W_CreateBalloon(WMScreen *scr);
void W_BalloonHandleEnterView(WMView *view);
void W_BalloonHandleLeaveView(WMView *view);
Bool W_CheckIdleHandlers(void);
void W_CheckTimerHandlers(void);
Bool W_HandleInputEvents(Bool waitForInput, int inputfd);
/* XDnD */
Atom W_OperationToAction(WMScreen *scr, WMDragOperationType operation);
WMDragOperationType W_ActionToOperation(WMScreen *scr, Atom action);
void W_FreeDragOperationItem(void* item);
Bool W_SendDnDClientMessage(Display *dpy, Window win, Atom message,
unsigned long data1, unsigned long data2,
unsigned long data3, unsigned long data4,
unsigned long data5);
void W_DragSourceStartTimer(WMDraggingInfo *info);
void W_DragSourceStopTimer(void);
void W_DragSourceStateHandler(WMDraggingInfo *info, XClientMessageEvent *event);
void W_DragDestinationStartTimer(WMDraggingInfo *info);
void W_DragDestinationStopTimer(void);
void W_DragDestinationStoreEnterMsgInfo(WMDraggingInfo *info, WMView *toplevel,
XClientMessageEvent *event);
void W_DragDestinationStorePositionMsgInfo(WMDraggingInfo *info,
WMView *toplevel,
XClientMessageEvent *event);
void W_DragDestinationCancelDropOnEnter(WMView *toplevel, WMDraggingInfo *info);
void W_DragDestinationStateHandler(WMDraggingInfo *info,
XClientMessageEvent *event);
void W_DragDestinationInfoClear(WMDraggingInfo *info);
void W_FreeViewXdndPart(WMView *view);
/* XIM */
void W_InitIM(WMScreen *scr);
void W_CreateIC(WMView *view);
void W_DestroyIC(WMView *view);
void W_FocusIC(WMView *view);
void W_UnFocusIC(WMView *view);
void W_SetPreeditPositon(W_View *view, int x, int y);
int W_LookupString(W_View *view, XKeyPressedEvent *event, char *buffer,
int buflen, KeySym *keysym, Status *status);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _WINGSP_H_ */

View File

@@ -1,881 +0,0 @@
#ifndef _WUTIL_H_
#define _WUTIL_H_
#include <X11/Xlib.h>
#include <limits.h>
#include <sys/types.h>
/* SunOS 4.x Blargh.... */
#ifndef NULL
#define NULL ((void*)0)
#endif
#ifndef WMAX
# define WMAX(a,b) ((a)>(b) ? (a) : (b))
#endif
#ifndef WMIN
# define WMIN(a,b) ((a)<(b) ? (a) : (b))
#endif
#ifndef __ASSERT_FUNCTION
# if (!defined (__GNUC__) || (__GNUC__ < 2 && \
__GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)))
# define __ASSERT_FUNCTION ((char *) 0)
# else
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
# endif
#endif
#ifndef __GNUC__
#define __attribute__(x) /*NOTHING*/
#endif
#ifdef NDEBUG
#define wassertr(expr) {}
#define wassertrv(expr, val) {}
#else /* !NDEBUG */
#ifdef DEBUG
#include <assert.h>
#define wassertr(expr) assert(expr)
#define wassertrv(expr, val) assert(expr)
#else /* !DEBUG */
#define wassertr(expr) \
if (!(expr)) { \
wwarning("%s line %i (%s): assertion %s failed",\
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
return;\
}
#define wassertrv(expr, val) \
if (!(expr)) { \
wwarning("%s line %i (%s): assertion %s failed",\
__FILE__, __LINE__, __ASSERT_FUNCTION, #expr);\
return (val);\
}
#endif /* !DEBUG */
#endif /* !NDEBUG */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum {
WMPostWhenIdle = 1,
WMPostASAP = 2,
WMPostNow = 3
} WMPostingStyle;
typedef enum {
WNCNone = 0,
WNCOnName = 1,
WNCOnSender = 2
} WMNotificationCoalescing;
enum {
WBNotFound = INT_MIN, /* element was not found in WMBag */
WANotFound = -1 /* element was not found in WMArray */
};
typedef struct W_Array WMArray;
typedef struct W_Bag WMBag;
typedef struct W_Data WMData;
typedef struct W_TreeNode WMTreeNode;
typedef struct W_HashTable WMHashTable;
typedef struct W_UserDefaults WMUserDefaults;
typedef struct W_Notification WMNotification;
typedef struct W_NotificationQueue WMNotificationQueue;
typedef struct W_Host WMHost;
typedef struct W_Connection WMConnection;
typedef struct W_PropList WMPropList;
/* Some typedefs for the handler stuff */
typedef void *WMHandlerID;
typedef void WMCallback(void *data);
typedef void WMInputProc(int fd, int mask, void *clientData);
typedef int WMCompareDataProc(const void *item1, const void *item2);
typedef void WMTreeWalkProc(WMTreeNode *aNode, void *data);
typedef void WMFreeDataProc(void *data);
/* Used by WMBag or WMArray for matching data */
typedef int WMMatchDataProc(const void *item, const void *cdata);
typedef struct {
int position;
int count;
} WMRange;
/* DO NOT ACCESS THE CONTENTS OF THIS STRUCT */
typedef struct {
void *table;
void *nextItem;
int index;
} WMHashEnumerator;
typedef struct {
/* NULL is pointer hash */
unsigned (*hash)(const void *);
/* NULL is pointer compare */
Bool (*keyIsEqual)(const void *, const void *);
/* NULL does nothing */
void* (*retainKey)(const void *);
/* NULL does nothing */
void (*releaseKey)(const void *);
} WMHashTableCallbacks;
typedef int WMArrayIterator;
typedef void *WMBagIterator;
typedef void WMNotificationObserverAction(void *observerData,
WMNotification *notification);
/* ---[ WINGs/memory.c ]-------------------------------------------------- */
void* wmalloc(size_t size);
void* wrealloc(void *ptr, size_t newsize);
void wfree(void *ptr);
void wrelease(void *ptr);
void* wretain(void *ptr);
typedef void waborthandler(int);
waborthandler* wsetabort(waborthandler* handler);
/* ---[ WINGs/error.c ]--------------------------------------------------- */
enum {
WMESSAGE_TYPE_MESSAGE,
WMESSAGE_TYPE_WARNING,
WMESSAGE_TYPE_ERROR,
WMESSAGE_TYPE_FATAL
};
#define wmessage(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_MESSAGE, fmt, ## args)
#define wwarning(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_WARNING, fmt, ## args)
#define werror(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_ERROR, fmt, ## args)
#define wfatal(fmt, args...) __wmessage( __func__, __FILE__, __LINE__, WMESSAGE_TYPE_FATAL, fmt, ## args)
void __wmessage(const char *func, const char *file, int line, int type, const char *msg, ...)
__attribute__((__format__(printf,5,6)));
/* ---[ WINGs/findfile.c ]------------------------------------------------ */
char* wfindfile(char *paths, char *file);
char* wfindfileinlist(char **path_list, char *file);
char* wfindfileinarray(WMPropList* array, char *file);
char* wexpandpath(char *path);
/* don't free the returned string */
char* wgethomedir(void);
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
int wmkdirhier(const char *path);
int wrmdirhier(const char *path);
/* ---[ WINGs/string.c ]-------------------------------------------------- */
char *wstrdup(const char *str);
char* wstrndup(const char *str, size_t len);
/* Concatenate str1 with str2 and return that in a newly malloc'ed string.
* str1 and str2 can be any strings including static and constant strings.
* str1 and str2 will not be modified.
* Free the returned string when you're done with it. */
char* wstrconcat(char *str1, char *str2);
/* This will append src to dst, and return dst. dst MUST be either NULL
* or a string that was a result of a dynamic allocation (malloc, realloc
* wmalloc, wrealloc, ...). dst CANNOT be a static or a constant string!
* Modifies dst (no new string is created except if dst==NULL in which case
* it is equivalent to calling wstrdup(src) ).
* The returned address may be different from the original address of dst,
* so always assign the returned address to avoid dangling pointers. */
char* wstrappend(char *dst, char *src);
size_t wstrlcpy(char *, const char *, size_t);
size_t wstrlcat(char *, const char *, size_t);
void wtokensplit(char *command, char ***argv, int *argc);
char* wtokennext(char *word, char **next);
char* wtokenjoin(char **list, int count);
void wtokenfree(char **tokens, int count);
char* wtrimspace(const char *s);
/* transform `s' so that the result is safe to pass to the shell as an argument.
* returns a newly allocated string.
* with very heavy inspirations from NetBSD's shquote(3).
*/
char *wshellquote(const char *s);
/* ---[ WINGs/wmisc.c ]--------------------------------------------------- */
WMRange wmkrange(int start, int count);
/* ---[ WINGs/usleep.c ]-------------------------------------------------- */
void wusleep(unsigned int usec);
/* ---[ WINGs/handlers.c ]------------------------------------------------ */
/* Event handlers: timer, idle, input */
WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback *callback,
void *cdata);
WMHandlerID WMAddPersistentTimerHandler(int milliseconds, WMCallback *callback,
void *cdata);
void WMDeleteTimerWithClientData(void *cdata);
void WMDeleteTimerHandler(WMHandlerID handlerID);
WMHandlerID WMAddIdleHandler(WMCallback *callback, void *cdata);
void WMDeleteIdleHandler(WMHandlerID handlerID);
WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc *proc,
void *clientData);
void WMDeleteInputHandler(WMHandlerID handlerID);
/* This function is used _only_ if you create a non-GUI program.
* For GUI based programs use WMNextEvent()/WMHandleEvent() instead.
* This function will handle all input/timer/idle events, then return.
*/
void WHandleEvents(void);
/* ---[ WINGs/hashtable.c ]----------------------------------------------- */
WMHashTable* WMCreateHashTable(WMHashTableCallbacks callbacks);
void WMFreeHashTable(WMHashTable *table);
void WMResetHashTable(WMHashTable *table);
unsigned WMCountHashTable(WMHashTable *table);
void* WMHashGet(WMHashTable *table, const void *key);
/* Returns True if there is a value associated with <key> in the table, in
* which case <retKey> and <retItem> will contain the item's internal key
* address and the item's value respectively.
* If there is no value associated with <key> it will return False and in
* this case <retKey> and <retItem> will be undefined.
* Use this when you need to perform your own custom retain/release mechanism
* which requires access to the keys too.
*/
Bool WMHashGetItemAndKey(WMHashTable *table, const void *key,
void **retItem, void **retKey);
/* put data in table, replacing already existing data and returning
* the old value */
void* WMHashInsert(WMHashTable *table, const void *key, const void *data);
void WMHashRemove(WMHashTable *table, const void *key);
/* warning: do not manipulate the table while using the enumerator functions */
WMHashEnumerator WMEnumerateHashTable(WMHashTable *table);
void* WMNextHashEnumeratorItem(WMHashEnumerator *enumerator);
void* WMNextHashEnumeratorKey(WMHashEnumerator *enumerator);
/* Returns True if there is a next element, in which case key and item
* will contain the next element's key and value respectively.
* If there is no next element available it will return False and in this
* case key and item will be undefined.
*/
Bool WMNextHashEnumeratorItemAndKey(WMHashEnumerator *enumerator,
void **item, void **key);
/* some predefined callback sets */
extern const WMHashTableCallbacks WMIntHashCallbacks;
/* sizeof(keys) are <= sizeof(void*) */
extern const WMHashTableCallbacks WMStringHashCallbacks;
/* keys are strings. Strings will be copied with wstrdup()
* and freed with wfree() */
extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
/* keys are strings, but they are not copied */
/* ---[ WINGs/array.c ]--------------------------------------------------- */
/*
* WMArray use an array to store the elements.
* Item indexes may be only positive integer numbers.
* The array cannot contain holes in it.
*
* Pros:
* Fast [O(1)] access to elements
* Fast [O(1)] push/pop
*
* Cons:
* A little slower [O(n)] for insertion/deletion of elements that
* aren't in the end
*/
WMArray* WMCreateArray(int initialSize);
WMArray* WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc *destructor);
WMArray* WMCreateArrayWithArray(WMArray *array);
#define WMDuplicateArray(array) WMCreateArrayWithArray(array)
void WMEmptyArray(WMArray *array);
void WMFreeArray(WMArray *array);
int WMGetArrayItemCount(WMArray *array);
/* appends other to array. other remains unchanged */
void WMAppendArray(WMArray *array, WMArray *other);
/* add will place the element at the end of the array */
void WMAddToArray(WMArray *array, void *item);
/* insert will increment the index of elements after it by 1 */
void WMInsertInArray(WMArray *array, int index, void *item);
/* replace and set will return the old item WITHOUT calling the
* destructor on it even if its available. Free the returned item yourself.
*/
void* WMReplaceInArray(WMArray *array, int index, void *item);
#define WMSetInArray(array, index, item) WMReplaceInArray(array, index, item)
/* delete and remove will remove the elements and cause the elements
* after them to decrement their indexes by 1. Also will call the
* destructor on the deleted element if there's one available.
*/
int WMDeleteFromArray(WMArray *array, int index);
#define WMRemoveFromArray(array, item) WMRemoveFromArrayMatching(array, NULL, item)
int WMRemoveFromArrayMatching(WMArray *array, WMMatchDataProc *match, void *cdata);
void* WMGetFromArray(WMArray *array, int index);
#define WMGetFirstInArray(array, item) WMFindInArray(array, NULL, item)
/* pop will return the last element from the array, also removing it
* from the array. The destructor is NOT called, even if available.
* Free the returned element if needed by yourself
*/
void* WMPopFromArray(WMArray *array);
int WMFindInArray(WMArray *array, WMMatchDataProc *match, void *cdata);
int WMCountInArray(WMArray *array, void *item);
/* comparer must return:
* < 0 if a < b
* > 0 if a > b
* = 0 if a = b
*/
void WMSortArray(WMArray *array, WMCompareDataProc *comparer);
void WMMapArray(WMArray *array, void (*function)(void*, void*), void *data);
WMArray* WMGetSubarrayWithRange(WMArray* array, WMRange aRange);
void* WMArrayFirst(WMArray *array, WMArrayIterator *iter);
void* WMArrayLast(WMArray *array, WMArrayIterator *iter);
/* The following 2 functions assume that the array doesn't change between calls */
void* WMArrayNext(WMArray *array, WMArrayIterator *iter);
void* WMArrayPrevious(WMArray *array, WMArrayIterator *iter);
/* The following 2 macros assume that the array doesn't change in the for loop */
#define WM_ITERATE_ARRAY(array, var, i) \
for (var = WMArrayFirst(array, &(i)); (i) != WANotFound; \
var = WMArrayNext(array, &(i)))
#define WM_ETARETI_ARRAY(array, var, i) \
for (var = WMArrayLast(array, &(i)); (i) != WANotFound; \
var = WMArrayPrevious(array, &(i)))
/* ---[ WINGs/bagtree.c ]------------------------------------------------- */
/*
* Tree bags use a red-black tree for storage.
* Item indexes may be any integer number.
*
* Pros:
* O(lg n) insertion/deletion/search
* Good for large numbers of elements with sparse indexes
*
* Cons:
* O(lg n) insertion/deletion/search
* Slow for storing small numbers of elements
*/
#define WMCreateBag(size) WMCreateTreeBag()
#define WMCreateBagWithDestructor(size, d) WMCreateTreeBagWithDestructor(d)
WMBag* WMCreateTreeBag(void);
WMBag* WMCreateTreeBagWithDestructor(WMFreeDataProc *destructor);
int WMGetBagItemCount(WMBag *bag);
void WMAppendBag(WMBag *bag, WMBag *other);
void WMPutInBag(WMBag *bag, void *item);
/* insert will increment the index of elements after it by 1 */
void WMInsertInBag(WMBag *bag, int index, void *item);
/* erase will remove the element from the bag,
* but will keep the index of the other elements unchanged */
int WMEraseFromBag(WMBag *bag, int index);
/* delete and remove will remove the elements and cause the elements
* after them to decrement their indexes by 1 */
int WMDeleteFromBag(WMBag *bag, int index);
int WMRemoveFromBag(WMBag *bag, void *item);
void* WMGetFromBag(WMBag *bag, int index);
void* WMReplaceInBag(WMBag *bag, int index, void *item);
#define WMSetInBag(bag, index, item) WMReplaceInBag(bag, index, item)
/* comparer must return:
* < 0 if a < b
* > 0 if a > b
* = 0 if a = b
*/
void WMSortBag(WMBag *bag, WMCompareDataProc *comparer);
void WMEmptyBag(WMBag *bag);
void WMFreeBag(WMBag *bag);
void WMMapBag(WMBag *bag, void (*function)(void*, void*), void *data);
int WMGetFirstInBag(WMBag *bag, void *item);
int WMCountInBag(WMBag *bag, void *item);
int WMFindInBag(WMBag *bag, WMMatchDataProc *match, void *cdata);
void* WMBagFirst(WMBag *bag, WMBagIterator *ptr);
void* WMBagLast(WMBag *bag, WMBagIterator *ptr);
/* The following 4 functions assume that the bag doesn't change between calls */
void* WMBagNext(WMBag *bag, WMBagIterator *ptr);
void* WMBagPrevious(WMBag *bag, WMBagIterator *ptr);
void* WMBagIteratorAtIndex(WMBag *bag, int index, WMBagIterator *ptr);
int WMBagIndexForIterator(WMBag *bag, WMBagIterator ptr);
/* The following 2 macros assume that the bag doesn't change in the for loop */
#define WM_ITERATE_BAG(bag, var, i) \
for (var = WMBagFirst(bag, &(i)); (i) != NULL; \
var = WMBagNext(bag, &(i)))
#define WM_ETARETI_BAG(bag, var, i) \
for (var = WMBagLast(bag, &(i)); (i) != NULL; \
var = WMBagPrevious(bag, &(i)))
/* ---[ WINGs/data.c ]---------------------------------------------------- */
/* WMData handling */
/* Creating/destroying data */
WMData* WMCreateDataWithCapacity(unsigned capacity);
WMData* WMCreateDataWithLength(unsigned length);
WMData* WMCreateDataWithBytes(void *bytes, unsigned length);
/* destructor is a function called to free the data when releasing the data
* object, or NULL if no freeing of data is necesary. */
WMData* WMCreateDataWithBytesNoCopy(void *bytes, unsigned length,
WMFreeDataProc *destructor);
WMData* WMCreateDataWithData(WMData *aData);
WMData* WMRetainData(WMData *aData);
void WMReleaseData(WMData *aData);
/* Adjusting capacity */
void WMSetDataCapacity(WMData *aData, unsigned capacity);
void WMSetDataLength(WMData *aData, unsigned length);
void WMIncreaseDataLengthBy(WMData *aData, unsigned extraLength);
/* Accessing data */
const void* WMDataBytes(WMData *aData);
void WMGetDataBytes(WMData *aData, void *buffer);
void WMGetDataBytesWithLength(WMData *aData, void *buffer, unsigned length);
void WMGetDataBytesWithRange(WMData *aData, void *buffer, WMRange aRange);
WMData* WMGetSubdataWithRange(WMData *aData, WMRange aRange);
/* Testing data */
Bool WMIsDataEqualToData(WMData *aData, WMData *anotherData);
unsigned WMGetDataLength(WMData *aData);
/* Adding data */
void WMAppendDataBytes(WMData *aData, void *bytes, unsigned length);
void WMAppendData(WMData *aData, WMData *anotherData);
/* Modifying data */
void WMReplaceDataBytesInRange(WMData *aData, WMRange aRange, void *bytes);
void WMResetDataBytesInRange(WMData *aData, WMRange aRange);
void WMSetData(WMData *aData, WMData *anotherData);
void WMSetDataFormat(WMData *aData, unsigned format);
unsigned WMGetDataFormat(WMData *aData);
/* Storing data */
/* ---[ WINGs/tree.c ]---------------------------------------------------- */
/* Generic Tree and TreeNode */
WMTreeNode* WMCreateTreeNode(void *data);
WMTreeNode* WMCreateTreeNodeWithDestructor(void *data, WMFreeDataProc *destructor);
WMTreeNode* WMInsertItemInTree(WMTreeNode *parent, int index, void *item);
#define WMAddItemToTree(parent, item) WMInsertItemInTree(parent, -1, item)
WMTreeNode* WMInsertNodeInTree(WMTreeNode *parent, int index, WMTreeNode *aNode);
#define WMAddNodeToTree(parent, aNode) WMInsertNodeInTree(parent, -1, aNode)
void WMDestroyTreeNode(WMTreeNode *aNode);
void WMDeleteLeafForTreeNode(WMTreeNode *aNode, int index);
void WMRemoveLeafForTreeNode(WMTreeNode *aNode, void *leaf);
void* WMReplaceDataForTreeNode(WMTreeNode *aNode, void *newData);
void* WMGetDataForTreeNode(WMTreeNode *aNode);
int WMGetTreeNodeDepth(WMTreeNode *aNode);
WMTreeNode* WMGetParentForTreeNode(WMTreeNode *aNode);
/* Sort only the leaves of the passed node */
void WMSortLeavesForTreeNode(WMTreeNode *aNode, WMCompareDataProc *comparer);
/* Sort all tree recursively starting from the passed node */
void WMSortTree(WMTreeNode *aNode, WMCompareDataProc *comparer);
/* Returns the first node which matches node's data with cdata by 'match' */
WMTreeNode* WMFindInTree(WMTreeNode *aTree, WMMatchDataProc *match, void *cdata);
/* Returns the first node where node's data matches cdata by 'match' and node is
* at most `limit' depths down from `aTree'. */
WMTreeNode *WMFindInTreeWithDepthLimit(WMTreeNode * aTree, WMMatchDataProc * match, void *cdata, int limit);
/* Returns first tree node that has data == cdata */
#define WMGetFirstInTree(aTree, cdata) WMFindInTree(aTree, NULL, cdata)
/* Walk every node of aNode with `walk' */
void WMTreeWalk(WMTreeNode *aNode, WMTreeWalkProc * walk, void *data, Bool DepthFirst);
/* ---[ WINGs/data.c ]---------------------------------------------------- */
WMNotification* WMCreateNotification(const char *name, void *object, void *clientData);
void WMReleaseNotification(WMNotification *notification);
WMNotification* WMRetainNotification(WMNotification *notification);
void* WMGetNotificationClientData(WMNotification *notification);
void* WMGetNotificationObject(WMNotification *notification);
const char* WMGetNotificationName(WMNotification *notification);
void WMAddNotificationObserver(WMNotificationObserverAction *observerAction,
void *observer, const char *name, void *object);
void WMPostNotification(WMNotification *notification);
void WMRemoveNotificationObserver(void *observer);
void WMRemoveNotificationObserverWithName(void *observer, const char *name,
void *object);
void WMPostNotificationName(const char *name, void *object, void *clientData);
WMNotificationQueue* WMGetDefaultNotificationQueue(void);
WMNotificationQueue* WMCreateNotificationQueue(void);
void WMDequeueNotificationMatching(WMNotificationQueue *queue,
WMNotification *notification,
unsigned mask);
void WMEnqueueNotification(WMNotificationQueue *queue,
WMNotification *notification,
WMPostingStyle postingStyle);
void WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
WMNotification *notification,
WMPostingStyle postingStyle,
unsigned coalesceMask);
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
/* Property Lists handling */
void WMPLSetCaseSensitive(Bool caseSensitive);
WMPropList* WMCreatePLString(char *str);
WMPropList* WMCreatePLData(WMData *data);
WMPropList* WMCreatePLDataWithBytes(unsigned char *bytes, unsigned int length);
WMPropList* WMCreatePLDataWithBytesNoCopy(unsigned char *bytes,
unsigned int length,
WMFreeDataProc *destructor);
WMPropList* WMCreatePLArray(WMPropList *elem, ...);
WMPropList* WMCreatePLDictionary(WMPropList *key, WMPropList *value, ...);
WMPropList* WMRetainPropList(WMPropList *plist);
void WMReleasePropList(WMPropList *plist);
/* Objects inserted in arrays and dictionaries will be retained,
* so you can safely release them after insertion.
* For dictionaries both the key and value are retained.
* Objects removed from arrays or dictionaries are released */
void WMInsertInPLArray(WMPropList *plist, int index, WMPropList *item);
void WMAddToPLArray(WMPropList *plist, WMPropList *item);
void WMDeleteFromPLArray(WMPropList *plist, int index);
void WMRemoveFromPLArray(WMPropList *plist, WMPropList *item);
void WMPutInPLDictionary(WMPropList *plist, WMPropList *key, WMPropList *value);
void WMRemoveFromPLDictionary(WMPropList *plist, WMPropList *key);
/* It will insert all key/value pairs from source into dest, overwriting
* the values with the same keys from dest, keeping all values with keys
* only present in dest unchanged */
WMPropList* WMMergePLDictionaries(WMPropList *dest, WMPropList *source,
Bool recursive);
/* It will remove all key/value pairs from dest for which there is an
* identical key/value present in source. Entires only present in dest, or
* which have different values in dest than in source will be preserved. */
WMPropList* WMSubtractPLDictionaries(WMPropList *dest, WMPropList *source,
Bool recursive);
int WMGetPropListItemCount(WMPropList *plist);
Bool WMIsPLString(WMPropList *plist);
Bool WMIsPLData(WMPropList *plist);
Bool WMIsPLArray(WMPropList *plist);
Bool WMIsPLDictionary(WMPropList *plist);
Bool WMIsPropListEqualTo(WMPropList *plist, WMPropList *other);
/* Returns a reference. Do not free it! */
char* WMGetFromPLString(WMPropList *plist);
/* Returns a reference. Do not free it! */
WMData* WMGetFromPLData(WMPropList *plist);
/* Returns a reference. Do not free it! */
const unsigned char* WMGetPLDataBytes(WMPropList *plist);
int WMGetPLDataLength(WMPropList *plist);
/* Returns a reference. */
WMPropList* WMGetFromPLArray(WMPropList *plist, int index);
/* Returns a reference. */
WMPropList* WMGetFromPLDictionary(WMPropList *plist, WMPropList *key);
/* Returns a PropList array with all the dictionary keys. Release it when
* you're done. Keys in array are retained from the original dictionary
* not copied and need NOT to be released individually. */
WMPropList* WMGetPLDictionaryKeys(WMPropList *plist);
/* Creates only the first level deep object. All the elements inside are
* retained from the original */
WMPropList* WMShallowCopyPropList(WMPropList *plist);
/* Makes a completely separate replica of the original proplist */
WMPropList* WMDeepCopyPropList(WMPropList *plist);
WMPropList* WMCreatePropListFromDescription(char *desc);
/* Free the returned string when you no longer need it */
char* WMGetPropListDescription(WMPropList *plist, Bool indented);
WMPropList* WMReadPropListFromFile(char *file);
Bool WMWritePropListToFile(WMPropList *plist, char *path);
/* ---[ WINGs/userdefaults.c ]-------------------------------------------- */
char* wusergnusteppath(void);
char* wdefaultspathfordomain(char *domain);
char* wglobaldefaultspathfordomain(const char *domain);
WMUserDefaults* WMGetStandardUserDefaults(void);
WMUserDefaults* WMGetDefaultsFromPath(char *path);
void WMSynchronizeUserDefaults(WMUserDefaults *database);
void WMSaveUserDefaults(WMUserDefaults *database);
void WMEnableUDPeriodicSynchronization(WMUserDefaults *database, Bool enable);
/* Returns a WMPropList array with all the keys in the user defaults database.
* Free the array with WMReleasePropList() when no longer needed.
* Keys in array are just retained references to the original keys */
WMPropList* WMGetUDKeys(WMUserDefaults *database);
WMPropList* WMGetUDObjectForKey(WMUserDefaults *database, char *defaultName);
void WMSetUDObjectForKey(WMUserDefaults *database, WMPropList *object,
char *defaultName);
void WMRemoveUDObjectForKey(WMUserDefaults *database, char *defaultName);
char* WMGetUDStringForKey(WMUserDefaults *database, char *defaultName);
int WMGetUDIntegerForKey(WMUserDefaults *database, char *defaultName);
float WMGetUDFloatForKey(WMUserDefaults *database, char *defaultName);
Bool WMGetUDBoolForKey(WMUserDefaults *database, char *defaultName);
void WMSetUDStringForKey(WMUserDefaults *database, char *value,
char *defaultName);
void WMSetUDIntegerForKey(WMUserDefaults *database, int value,
char *defaultName);
void WMSetUDFloatForKey(WMUserDefaults *database, float value,
char *defaultName);
void WMSetUDBoolForKey(WMUserDefaults *database, Bool value,
char *defaultName);
WMPropList* WMGetUDSearchList(WMUserDefaults *database);
void WMSetUDSearchList(WMUserDefaults *database, WMPropList *list);
extern char *WMUserDefaultsDidChangeNotification;
/*-------------------------------------------------------------------------*/
/* Global variables */
extern int WCErrorCode;
/*-------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

View File

@@ -1,138 +0,0 @@
/*
* This header file is provided for old libPropList compatibility.
* DO _NOT_ USE this except for letting your old libPropList-based code to
* work with the new property list code from WINGs, with minimal changes.
*
* All code written with old libPropList functions should work, given
* that the following changes are made:
*
* 1. Replace all
* #include <proplist.h>
* with
* #include <WINGs/proplist-compat.h>
* in your code.
*
* 2. Change all calls to PLSave() to have the extra filename parameter like:
* PLSave(proplist_t proplist, char* filename, Bool atomically)
*
* 3. The PLSetStringCmpHook() function is no longer available. There is a
* similar but simpler function provided which is enough for practical
* purposes:
* PLSetCaseSensitive(Bool caseSensitive)
*
* 4. The following functions do no longer exist. They were removed because
* they were based on concepts borrowed from UserDefaults which conflict
* with the retain/release mechanism:
* PLSynchronize(), PLDeepSynchronize(), PLShallowSynchronize()
* PLSetFilename(), PLGetFilename()
* PLGetContainer()
* You should change your code to not use them anymore.
*
* 5. The following functions are no longer available. They were removed
* because they also used borrowed concepts which have no place in a
* property list as defined in the OpenStep specifications. Also these
* functions were hardly ever used in programs to our knowledge.
* PLGetDomainNames(), PLGetDomain(), PLSetDomain(), PLDeleteDomain()
* PLRegister(), PLUnregister()
* You should also change your code to not use them anymore (in case you
* ever used them anyway ;-) ).
*
* 6. Link your program with libWINGs or libWUtil instead of libPropList.
* (libWINGs should be used for GUI apps, while libWUtil for non-GUI apps)
*
*
* Our recommandation is to rewrite your code to use the new functions and
* link against libWINGs/libWUtil. We do not recommend you to keep using old
* libPropList function names. This file is provided just to allow existing
* libropList based applications to run with minimal changes with the new
* proplist code from WINGs before their authors get the time to rewrite
* them. New proplist code from WINGs provide a better integration with the
* other data types from WINGs, not to mention that the proplist code in WINGs
* is actively maintained while the old libPropList is dead.
*
*/
#ifndef _PROPLIST_COMPAT_H_
#define _PROPLIST_COMPAT_H_
#include <WINGs/WUtil.h>
typedef WMPropList* proplist_t;
#ifndef YES
#define YES True
#endif
#ifndef NO
#define NO False
#endif
#define PLSetCaseSensitive(c) WMPLSetCaseSensitive(c)
#define PLMakeString(bytes) WMCreatePLString(bytes)
#define PLMakeData(bytes, length) WMCreatePLDataWithBytes(bytes, length)
#define PLMakeArrayFromElements WMCreatePLArray
#define PLMakeDictionaryFromEntries WMCreatePLDictionary
#define PLRetain(pl) WMRetainPropList(pl)
#define PLRelease(pl) WMReleasePropList(pl)
#define PLInsertArrayElement(array, pl, pos) WMInsertInPLArray(array, pos, pl)
#define PLAppendArrayElement(array, pl) WMAddToPLArray(array, pl)
#define PLRemoveArrayElement(array, pos) WMDeleteFromPLArray(array, pos)
#define PLInsertDictionaryEntry(dict, key, value) WMPutInPLDictionary(dict, key, value)
#define PLRemoveDictionaryEntry(dict, key) WMRemoveFromPLDictionary(dict, key)
#define PLMergeDictionaries(dest, source) WMMergePLDictionaries(dest, source, False)
#define PLGetNumberOfElements(pl) WMGetPropListItemCount(pl)
#define PLIsString(pl) WMIsPLString(pl)
#define PLIsData(pl) WMIsPLData(pl)
#define PLIsArray(pl) WMIsPLArray(pl)
#define PLIsDictionary(pl) WMIsPLDictionary(pl)
#define PLIsSimple(pl) (WMIsPLString(pl) || WMIsPLData(pl))
#define PLIsCompound(pl) (WMIsPLArray(pl) || WMIsPLDictionary(pl))
#define PLIsEqual(pl1, pl2) WMIsPropListEqualTo(pl1, pl2)
#define PLGetString(pl) WMGetFromPLString(pl)
#define PLGetDataBytes(pl) WMGetPLDataBytes(pl)
#define PLGetDataLength(pl) WMGetPLDataLength(pl)
#define PLGetArrayElement(pl, index) WMGetFromPLArray(pl, index)
#define PLGetDictionaryEntry(pl, key) WMGetFromPLDictionary(pl, key)
#define PLGetAllDictionaryKeys(pl) WMGetPLDictionaryKeys(pl)
#define PLShallowCopy(pl) WMShallowCopyPropList(pl)
#define PLDeepCopy(pl) WMDeepCopyPropList(pl)
#define PLGetProplistWithDescription(desc) WMCreatePropListFromDescription(desc)
#define PLGetDescriptionIndent(pl, level) WMGetPropListDescription(pl, True)
#define PLGetDescription(pl) WMGetPropListDescription(pl, False)
#define PLGetStringDescription(pl) WMGetPropListDescription(pl, False)
#define PLGetDataDescription(pl) WMGetPropListDescription(pl, False)
#define PLGetProplistWithPath(file) WMReadPropListFromFile(file)
#define PLSave(pl, file, atm) WMWritePropListToFile(pl, file)
/* Unsupported functions. Do not ask for them. They're evil :P */
#define PLSetStringCmpHook(fn) error_PLSetStringCmpHook_is_not_supported
#define PLDeepSynchronize(pl) error_PLDeepSynchronize_is_not_supported
#define PLSynchronize(pl) error_PLSynchronize_is_not_supported
#define PLShallowSynchronize(pl) error_PLShallowSynchronize_is_not_supported
#define PLSetFilename(pl, filename) error_PLSetFilename_is_not_supported
#define PLGetFilename(pl, filename) error_PLGetFilename_is_not_supported
#define PLGetContainer(pl) error_PLGetContainer_is_not_supported
#define PLGetDomainNames error_PLGetDomainNames_is_not_supported
#define PLGetDomain(name) error_PLGetDomain_is_not_supported
#define PLSetDomain(name, value, kickme) error_PLSetDomain_is_not_supported
#define PLDeleteDomain(name, kickme) error_PLDeleteDomain_is_not_supported
#define PLRegister(name, callback) error_PLRegister_is_not_supported
#define PLUnregister(name) error_PLUnregister_is_not_supported
#endif

394
WINGs/WINGsP.h Normal file
View File

@@ -0,0 +1,394 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "WINGs.h"
#include "WUtil.h"
#if WINGS_H_VERSION < 980922
#error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it.
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define DOUBLE_BUFFER
#define WC_UserWidget 128
#define SCROLLER_WIDTH 20
/* internal messages */
#define WM_UPDATE_COLORWELL 130
#define WM_USER_MESSAGE 1024
#define SETUP_INTERNAL_MESSAGE(event, scrPtr) \
event.xclient.type=ClientMessage;\
event.xclient.display=scrPtr->display;\
event.xclient.send_event=False;\
event.xclient.serial=0;\
event.xclient.format=32;\
event.xclient.message_type=scrPtr->internalMessage;
typedef struct W_Font {
struct W_Screen *screen;
union {
XFontSet set;
XFontStruct *normal;
} font;
short height;
short y;
short refCount;
unsigned int notFontSet:1;
} W_Font;
typedef struct W_Pixmap {
struct W_Screen *screen;
Pixmap pixmap;
Pixmap mask;
unsigned short width;
unsigned short height;
short depth;
short refCount;
} W_Pixmap;
typedef struct W_Color {
struct W_Screen *screen;
XColor color;
short refCount;
GC gc;
struct {
unsigned int exact:1;
} flags;
} W_Color;
typedef struct W_FocusInfo {
struct W_View *toplevel;
struct W_View *focused; /* view that has the focus in this toplevel */
struct W_FocusInfo *next;
} W_FocusInfo;
typedef struct W_Screen {
Display *display;
int screen;
int depth;
Colormap colormap;
Visual *visual;
Time lastEventTime;
Window rootWin;
struct W_View *rootView;
RContext *rcontext;
/* application related */
W_FocusInfo *focusInfo;
struct W_Pixmap *applicationIcon;
struct W_Window *windowList; /* list of windows in the app */
Window groupLeader; /* the leader of the application */
/* also used for other things */
struct W_SelectionHandlers *selectionHandlerList;
struct {
unsigned int hasAppIcon:1;
unsigned int simpleApplication:1;
} aflags;
WMOpenPanel *sharedOpenPanel;
WMSavePanel *sharedSavePanel;
struct W_FontPanel *sharedFontPanel;
struct W_ColorPanel *sharedColorPanel;
/* colors */
W_Color *white;
W_Color *black;
W_Color *gray;
W_Color *darkGray;
GC stippleGC;
GC copyGC;
GC clipGC;
GC monoGC; /* GC for 1bpp visuals */
GC xorGC;
GC ixorGC; /* IncludeInferiors XOR */
GC textFieldGC;
W_Font *normalFont;
W_Font *boldFont;
struct W_Pixmap *checkButtonImageOn;
struct W_Pixmap *checkButtonImageOff;
struct W_Pixmap *radioButtonImageOn;
struct W_Pixmap *radioButtonImageOff;
struct W_Pixmap *buttonArrow;
struct W_Pixmap *pushedButtonArrow;
struct W_Pixmap *scrollerDimple;
struct W_Pixmap *upArrow;
struct W_Pixmap *downArrow;
struct W_Pixmap *leftArrow;
struct W_Pixmap *rightArrow;
struct W_Pixmap *hiUpArrow;
struct W_Pixmap *hiDownArrow;
struct W_Pixmap *hiLeftArrow;
struct W_Pixmap *hiRightArrow;
struct W_Pixmap *pullDownIndicator;
struct W_Pixmap *popUpIndicator;
struct W_Pixmap *homeIcon;
struct W_Pixmap *defaultObjectIcon;
Cursor defaultCursor;
Cursor textCursor;
Atom internalMessage; /* for ClientMessage */
Atom attribsAtom; /* GNUstepWindowAttributes */
Atom deleteWindowAtom; /* WM_DELETE_WINDOW */
Atom protocolsAtom; /* _XA_WM_PROTOCOLS */
Atom clipboardAtom; /* CLIPBOARD */
/* stuff for detecting double-clicks */
Time lastClickTime; /* time of last mousedown event */
Window lastClickWindow; /* window of the last mousedown */
struct W_View *modalView;
unsigned modal:1;
unsigned ignoreNextDoubleClick:1;
} W_Screen;
typedef struct W_View {
struct W_Screen *screen;
WMWidget *self; /* must point to the widget the
* view belongs to */
Window window;
WMSize size;
WMPoint pos;
struct W_View *nextFocusChain; /* next/prev in focus chain */
struct W_View *prevFocusChain;
struct W_View *parent; /* parent WMView */
struct W_View *childrenList; /* first in list of child windows */
struct W_View *nextSister; /* next on parent's children list */
struct W_EventHandler *handlerList;/* list of event handlers for this window */
unsigned long attribFlags;
XSetWindowAttributes attribs;
void *hangedData; /* data holder for user program */
#if 0
struct W_DragSourceProcs *dragSourceProcs;
struct W_DragDestinationProcs *dragDestinationProcs;
#endif
int helpContext;
struct {
unsigned int realized:1;
unsigned int mapped:1;
unsigned int parentDying:1;
unsigned int dying:1; /* the view is being destroyed */
unsigned int topLevel:1; /* is a top level window */
unsigned int root:1; /* is the root window */
unsigned int mapWhenRealized:1;/* map the view when it's realized */
unsigned int alreadyDead:1; /* view was freed */
unsigned int dontCompressMotion:1; /* motion notify event compress */
unsigned int notifySizeChanged:1;
unsigned int dontCompressExpose:1; /* will compress all expose
events into one */
/* toplevel only */
unsigned int worksWhenModal:1;
unsigned int pendingRelease1:1;
unsigned int pendingRelease2:1;
unsigned int pendingRelease3:1;
unsigned int pendingRelease4:1;
unsigned int pendingRelease5:1;
} flags;
int refCount;
} W_View;
typedef struct W_EventHandler {
unsigned long eventMask;
WMEventProc *proc;
void *clientData;
struct W_EventHandler *nextHandler;
} W_EventHandler;
typedef struct W_ViewProcedureTable {
void (*setBackgroundColor)(WMWidget*, WMColor *color);
void (*resize)(WMWidget*, unsigned int, unsigned int);
void (*move)(WMWidget*, int, int);
} W_ViewProcedureTable;
typedef struct _WINGsConfiguration {
char *systemFont;
char *boldSystemFont;
unsigned doubleClickDelay;
} _WINGsConfiguration;
_WINGsConfiguration WINGsConfiguration;
#define CHECK_CLASS(widget, class) assert(W_CLASS(widget)==(class))
#define W_CLASS(widget) (((W_WidgetType*)(widget))->widgetClass)
#define W_VIEW(widget) (((W_WidgetType*)(widget))->view)
#define W_VIEW_REALIZED(view) (view)->flags.realized
#define W_VIEW_MAPPED(view) (view)->flags.mapped
#define W_PIXEL(c) (c)->color.pixel
#define W_GC(c) (c)->gc
#define W_FONTID(f) (f)->font->fid
#define W_DRAWABLE(scr) (scr)->rootWin
W_View *W_GetViewForXWindow(Display *display, Window window);
W_View *W_CreateView(W_View *parent);
W_View *W_CreateTopView(W_Screen *screen);
W_View *W_CreateRootView(W_Screen *screen);
void W_DestroyView(W_View *view);
void W_RealizeView(W_View *view);
void W_ReparentView(W_View *view, W_View *newParent);
void W_MapView(W_View *view);
void W_MapSubviews(W_View *view);
void W_UnmapSubviews(W_View *view);
W_View *W_TopLevelOfView(W_View *view);
void W_UnmapView(W_View *view);
void W_MoveView(W_View *view, int x, int y);
void W_ResizeView(W_View *view, unsigned int width, unsigned int height);
void W_SetViewBackgroundColor(W_View *view, WMColor *color);
void W_DrawRelief(W_Screen *scr, Drawable d, int x, int y, unsigned int width,
unsigned int height, WMReliefType relief);
void W_CleanUpEvents(W_View *view);
void W_CallDestroyHandlers(W_View *view);
void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, GC backGC, int ofs);
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
int width, WMAlignment alignment, GC gc,
int wrap, char *text, int length);
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
int W_TextWidth(WMFont *font, char *text, int length);
void W_BroadcastMessage(W_View *targetParent, XEvent *event);
void W_DispatchMessage(W_View *target, XEvent *event);
Bool W_CheckInternalMessage(W_Screen *scr, XClientMessageEvent *cev, int event);
void W_SetFocusOfToplevel(W_View *toplevel, W_View *view);
W_View *W_FocusedViewOfToplevel(W_View *view);
void W_SetFocusOfTopLevel(W_View *toplevel, W_View *view);
void W_ReleaseView(WMView *view);
WMView *W_RetainView(WMView *view);
void W_InitApplication(WMScreen *scr);
void W_InitNotificationCenter(void);
W_Class W_RegisterUserWidget(W_ViewProcedureTable *procTable);
void W_RedisplayView(WMView *view);
Bool W_ApplicationInitialized(void);
char *W_GetTextSelection(WMScreen *scr, Atom selection);

227
WINGs/WUtil.h Normal file
View File

@@ -0,0 +1,227 @@
#ifndef _WUTIL_H_
#define _WUTIL_H_
#include <X11/Xlib.h>
#include <sys/types.h>
/*
* Warning: proplist.h #defines BOOL which will clash with the
* typedef BOOL in Xmd.h
* proplist.h should use Bool (which is a #define in Xlib.h) instead.
*
*/
#include <proplist.h>
#ifndef WMAX
# define WMAX(a,b) ((a)>(b) ? (a) : (b))
#endif
#ifndef WMIN
# define WMIN(a,b) ((a)<(b) ? (a) : (b))
#endif
typedef enum {
WMPostWhenIdle = 1,
WMPostASAP = 2,
WMPostNow = 3
} WMPostingStyle;
typedef enum {
WNCNone = 0,
WNCOnName = 1,
WNCOnSender = 2
} WMNotificationCoalescing;
typedef struct W_HashTable WMHashTable;
typedef struct W_UserDefaults WMUserDefaults;
typedef struct W_Notification WMNotification;
typedef struct W_NotificationQueue WMNotificationQueue;
/* DO NOT ACCESS THE CONTENTS OF THIS STRUCT */
typedef struct {
void *table;
void *nextItem;
int index;
} WMHashEnumerator;
typedef struct {
/* NULL is pointer hash */
unsigned (*hash)(const void *);
/* NULL is pointer compare */
Bool (*keyIsEqual)(const void *, const void *);
/* NULL does nothing */
void* (*retainKey)(const void *);
/* NULL does nothing */
void (*releaseKey)(const void *);
} WMHashTableCallbacks;
typedef void WMNotificationObserverAction(void *observerData,
WMNotification *notification);
/*......................................................................*/
void wfatal(const char *msg, ...);
void wwarning(const char *msg, ...);
void wsyserror(const char *msg, ...);
char *wfindfile(char *paths, char *file);
char *wfindfileinlist(char **path_list, char *file);
char *wexpandpath(char *path);
/* don't free the returned string */
char *wgethomedir();
void *wmalloc(size_t size);
void *wrealloc(void *ptr, size_t newsize);
void wrelease(void *ptr);
void *wretain(void *ptr);
char *wstrdup(char *str);
char *wstrappend(char *dst, char *src);
char *wusergnusteppath();
char *wdefaultspathfordomain(char *domain);
void wusleep(unsigned int microsec);
/*......................................................................*/
WMHashTable *WMCreateHashTable(WMHashTableCallbacks callbacks);
void WMFreeHashTable(WMHashTable *table);
void WMResetHashTable(WMHashTable *table);
void *WMHashGet(WMHashTable *table, const void *key);
/* put data in table, replacing already existing data and returning
* the old value */
void *WMHashInsert(WMHashTable *table, void *key, void *data);
void WMHashRemove(WMHashTable *table, const void *key);
/* warning: do not manipulate the table while using these functions */
WMHashEnumerator WMEnumerateHashTable(WMHashTable *table);
void *WMNextHashEnumeratorItem(WMHashEnumerator *enumerator);
unsigned WMCountHashTable(WMHashTable *table);
/* some predefined callback sets */
extern const WMHashTableCallbacks WMIntHashCallbacks;
/* sizeof(keys) are <= sizeof(void*) */
extern const WMHashTableCallbacks WMStringHashCallbacks;
/* keys are strings. Strings will be copied with wstrdup()
* and freed with free() */
extern const WMHashTableCallbacks WMStringPointerHashCallbacks;
/* keys are strings, bug they are not copied */
/*......................................................................*/
WMNotification *WMCreateNotification(char *name, void *object, void *clientData);
void WMReleaseNotification(WMNotification *notification);
WMNotification *WMRetainNotification(WMNotification *notification);
void *WMGetNotificationClientData(WMNotification *notification);
void *WMGetNotificationObject(WMNotification *notification);
char *WMGetNotificationName(WMNotification *notification);
void WMAddNotificationObserver(WMNotificationObserverAction *observerAction,
void *observer, char *name, void *object);
void WMPostNotification(WMNotification *notification);
void WMRemoveNotificationObserver(void *observer);
void WMRemoveNotificationObserverWithName(void *observer, char *name,
void *object);
void WMPostNotificationName(char *name, void *object, void *clientData);
WMNotificationQueue *WMGetDefaultNotificationQueue(void);
WMNotificationQueue *WMCreateNotificationQueue(void);
void WMDequeueNotificationMatching(WMNotificationQueue *queue, unsigned mask);
void WMEnqueueNotification(WMNotificationQueue *queue, WMNotification *notification,
WMPostingStyle postingStyle);
void WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
WMNotification *notification,
WMPostingStyle postingStyle,
unsigned coalesceMask);
/*......................................................................*/
WMUserDefaults *WMGetStandardUserDefaults(void);
proplist_t WMGetUDObjectForKey(WMUserDefaults *database, char *defaultName);
void WMSetUDObjectForKey(WMUserDefaults *database, proplist_t object,
char *defaultName);
void WMRemoveUDObjectForKey(WMUserDefaults *database, char *defaultName);
/* you can free the returned string */
char *WMGetUDStringForKey(WMUserDefaults *database, char *defaultName);
int WMGetUDIntegerForKey(WMUserDefaults *database, char *defaultName);
int WMGetUDFloatForKey(WMUserDefaults *database, char *defaultName);
Bool WMGetUDBoolForKey(WMUserDefaults *database, char *defaultName);
void WMSetUDStringForKey(WMUserDefaults *database, char *value,
char *defaultName);
void WMSetUDIntegerForKey(WMUserDefaults *database, int value,
char *defaultName);
void WMSetUDFloatForKey(WMUserDefaults *database, float value,
char *defaultName);
void WMSetUDBoolForKey(WMUserDefaults *database, Bool value,
char *defaultName);
proplist_t WMGetUDSearchList(WMUserDefaults *database);
void WMSetUDSearchList(WMUserDefaults *database, proplist_t list);
#endif

View File

@@ -1,314 +0,0 @@
/*
* Dynamically Resized Array
*
* Authors: Alfredo K. Kojima <kojima@windowmaker.info>
* Dan Pascu <dan@windowmaker.info>
*
* This code is released to the Public Domain, but
* proper credit is always appreciated :)
*/
#include <stdlib.h>
#include <string.h>
#include "WUtil.h"
#define INITIAL_SIZE 8
#define RESIZE_INCREMENT 8
typedef struct W_Array {
void **items; /* the array data */
int itemCount; /* # of items in array */
int allocSize; /* allocated size of array */
WMFreeDataProc *destructor; /* the destructor to free elements */
} W_Array;
WMArray *WMCreateArray(int initialSize)
{
return WMCreateArrayWithDestructor(initialSize, NULL);
}
WMArray *WMCreateArrayWithDestructor(int initialSize, WMFreeDataProc * destructor)
{
WMArray *array;
array = wmalloc(sizeof(WMArray));
if (initialSize <= 0) {
initialSize = INITIAL_SIZE;
}
array->items = wmalloc(sizeof(void *) * initialSize);
array->itemCount = 0;
array->allocSize = initialSize;
array->destructor = destructor;
return array;
}
WMArray *WMCreateArrayWithArray(WMArray * array)
{
WMArray *newArray;
newArray = wmalloc(sizeof(WMArray));
newArray->items = wmalloc(sizeof(void *) * array->allocSize);
memcpy(newArray->items, array->items, sizeof(void *) * array->itemCount);
newArray->itemCount = array->itemCount;
newArray->allocSize = array->allocSize;
newArray->destructor = NULL;
return newArray;
}
void WMEmptyArray(WMArray * array)
{
if (array->destructor) {
while (array->itemCount > 0) {
array->itemCount--;
array->destructor(array->items[array->itemCount]);
}
}
/*memset(array->items, 0, array->itemCount * sizeof(void*)); */
array->itemCount = 0;
}
void WMFreeArray(WMArray * array)
{
WMEmptyArray(array);
wfree(array->items);
wfree(array);
}
int WMGetArrayItemCount(WMArray * array)
{
return array->itemCount;
}
void WMAppendArray(WMArray * array, WMArray * other)
{
if (other->itemCount == 0)
return;
if (array->itemCount + other->itemCount > array->allocSize) {
array->allocSize += other->allocSize;
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
}
memcpy(array->items + array->itemCount, other->items, sizeof(void *) * other->itemCount);
array->itemCount += other->itemCount;
}
void WMAddToArray(WMArray * array, void *item)
{
if (array->itemCount >= array->allocSize) {
array->allocSize += RESIZE_INCREMENT;
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
}
array->items[array->itemCount] = item;
array->itemCount++;
}
void WMInsertInArray(WMArray * array, int index, void *item)
{
wassertr(index >= 0 && index <= array->itemCount);
if (array->itemCount >= array->allocSize) {
array->allocSize += RESIZE_INCREMENT;
array->items = wrealloc(array->items, sizeof(void *) * array->allocSize);
}
if (index < array->itemCount) {
memmove(array->items + index + 1, array->items + index,
sizeof(void *) * (array->itemCount - index));
}
array->items[index] = item;
array->itemCount++;
}
void *WMReplaceInArray(WMArray * array, int index, void *item)
{
void *old;
wassertrv(index >= 0 && index <= array->itemCount, NULL);
/* is it really useful to perform append if index == array->itemCount ? -Dan */
if (index == array->itemCount) {
WMAddToArray(array, item);
return NULL;
}
old = array->items[index];
array->items[index] = item;
return old;
}
int WMDeleteFromArray(WMArray * array, int index)
{
wassertrv(index >= 0 && index < array->itemCount, 0);
if (array->destructor) {
array->destructor(array->items[index]);
}
if (index < array->itemCount - 1) {
memmove(array->items + index, array->items + index + 1,
sizeof(void *) * (array->itemCount - index - 1));
}
array->itemCount--;
return 1;
}
int WMRemoveFromArrayMatching(WMArray * array, WMMatchDataProc * match, void *cdata)
{
int i;
if (match != NULL) {
for (i = 0; i < array->itemCount; i++) {
if ((*match) (array->items[i], cdata)) {
WMDeleteFromArray(array, i);
return 1;
}
}
} else {
for (i = 0; i < array->itemCount; i++) {
if (array->items[i] == cdata) {
WMDeleteFromArray(array, i);
return 1;
}
}
}
return 0;
}
void *WMGetFromArray(WMArray * array, int index)
{
if (index < 0 || index >= array->itemCount)
return NULL;
return array->items[index];
}
void *WMPopFromArray(WMArray * array)
{
array->itemCount--;
return array->items[array->itemCount];
}
int WMFindInArray(WMArray * array, WMMatchDataProc * match, void *cdata)
{
int i;
if (match != NULL) {
for (i = 0; i < array->itemCount; i++) {
if ((*match) (array->items[i], cdata))
return i;
}
} else {
for (i = 0; i < array->itemCount; i++) {
if (array->items[i] == cdata)
return i;
}
}
return WANotFound;
}
int WMCountInArray(WMArray * array, void *item)
{
int i, count;
for (i = 0, count = 0; i < array->itemCount; i++) {
if (array->items[i] == item)
count++;
}
return count;
}
void WMSortArray(WMArray * array, WMCompareDataProc * comparer)
{
if (array->itemCount > 1) { /* Don't sort empty or single element arrays */
qsort(array->items, array->itemCount, sizeof(void *), comparer);
}
}
void WMMapArray(WMArray * array, void (*function) (void *, void *), void *data)
{
int i;
for (i = 0; i < array->itemCount; i++) {
(*function) (array->items[i], data);
}
}
WMArray *WMGetSubarrayWithRange(WMArray * array, WMRange aRange)
{
WMArray *newArray;
if (aRange.count <= 0)
return WMCreateArray(0);
if (aRange.position < 0)
aRange.position = 0;
if (aRange.position >= array->itemCount)
aRange.position = array->itemCount - 1;
if (aRange.position + aRange.count > array->itemCount)
aRange.count = array->itemCount - aRange.position;
newArray = WMCreateArray(aRange.count);
memcpy(newArray->items, array->items + aRange.position, sizeof(void *) * aRange.count);
newArray->itemCount = aRange.count;
return newArray;
}
void *WMArrayFirst(WMArray * array, WMArrayIterator * iter)
{
if (array->itemCount == 0) {
*iter = WANotFound;
return NULL;
} else {
*iter = 0;
return array->items[0];
}
}
void *WMArrayLast(WMArray * array, WMArrayIterator * iter)
{
if (array->itemCount == 0) {
*iter = WANotFound;
return NULL;
} else {
*iter = array->itemCount - 1;
return array->items[*iter];
}
}
void *WMArrayNext(WMArray * array, WMArrayIterator * iter)
{
if (*iter >= 0 && *iter < array->itemCount - 1) {
return array->items[++(*iter)];
} else {
*iter = WANotFound;
return NULL;
}
}
void *WMArrayPrevious(WMArray * array, WMArrayIterator * iter)
{
if (*iter > 0 && *iter < array->itemCount) {
return array->items[--(*iter)];
} else {
*iter = WANotFound;
return NULL;
}
}

View File

@@ -1,762 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "WUtil.h"
typedef struct W_Node {
struct W_Node *parent;
struct W_Node *left;
struct W_Node *right;
int color;
void *data;
int index;
} W_Node;
typedef struct W_Bag {
W_Node *root;
W_Node *nil; /* sentinel */
int count;
void (*destructor) (void *item);
} W_Bag;
#define IS_LEFT(node) (node == node->parent->left)
#define IS_RIGHT(node) (node == node->parent->right)
static void leftRotate(W_Bag * tree, W_Node * node)
{
W_Node *node2;
node2 = node->right;
node->right = node2->left;
node2->left->parent = node;
node2->parent = node->parent;
if (node->parent == tree->nil) {
tree->root = node2;
} else {
if (IS_LEFT(node)) {
node->parent->left = node2;
} else {
node->parent->right = node2;
}
}
node2->left = node;
node->parent = node2;
}
static void rightRotate(W_Bag * tree, W_Node * node)
{
W_Node *node2;
node2 = node->left;
node->left = node2->right;
node2->right->parent = node;
node2->parent = node->parent;
if (node->parent == tree->nil) {
tree->root = node2;
} else {
if (IS_LEFT(node)) {
node->parent->left = node2;
} else {
node->parent->right = node2;
}
}
node2->right = node;
node->parent = node2;
}
static void treeInsert(W_Bag * tree, W_Node * node)
{
W_Node *y = tree->nil;
W_Node *x = tree->root;
while (x != tree->nil) {
y = x;
if (node->index <= x->index)
x = x->left;
else
x = x->right;
}
node->parent = y;
if (y == tree->nil)
tree->root = node;
else if (node->index <= y->index)
y->left = node;
else
y->right = node;
}
static void rbTreeInsert(W_Bag * tree, W_Node * node)
{
W_Node *y;
treeInsert(tree, node);
node->color = 'R';
while (node != tree->root && node->parent->color == 'R') {
if (IS_LEFT(node->parent)) {
y = node->parent->parent->right;
if (y->color == 'R') {
node->parent->color = 'B';
y->color = 'B';
node->parent->parent->color = 'R';
node = node->parent->parent;
} else {
if (IS_RIGHT(node)) {
node = node->parent;
leftRotate(tree, node);
}
node->parent->color = 'B';
node->parent->parent->color = 'R';
rightRotate(tree, node->parent->parent);
}
} else {
y = node->parent->parent->left;
if (y->color == 'R') {
node->parent->color = 'B';
y->color = 'B';
node->parent->parent->color = 'R';
node = node->parent->parent;
} else {
if (IS_LEFT(node)) {
node = node->parent;
rightRotate(tree, node);
}
node->parent->color = 'B';
node->parent->parent->color = 'R';
leftRotate(tree, node->parent->parent);
}
}
}
tree->root->color = 'B';
}
static void rbDeleteFixup(W_Bag * tree, W_Node * node)
{
W_Node *w;
while (node != tree->root && node->color == 'B') {
if (IS_LEFT(node)) {
w = node->parent->right;
if (w->color == 'R') {
w->color = 'B';
node->parent->color = 'R';
leftRotate(tree, node->parent);
w = node->parent->right;
}
if (w->left->color == 'B' && w->right->color == 'B') {
w->color = 'R';
node = node->parent;
} else {
if (w->right->color == 'B') {
w->left->color = 'B';
w->color = 'R';
rightRotate(tree, w);
w = node->parent->right;
}
w->color = node->parent->color;
node->parent->color = 'B';
w->right->color = 'B';
leftRotate(tree, node->parent);
node = tree->root;
}
} else {
w = node->parent->left;
if (w->color == 'R') {
w->color = 'B';
node->parent->color = 'R';
rightRotate(tree, node->parent);
w = node->parent->left;
}
if (w->left->color == 'B' && w->right->color == 'B') {
w->color = 'R';
node = node->parent;
} else {
if (w->left->color == 'B') {
w->right->color = 'B';
w->color = 'R';
leftRotate(tree, w);
w = node->parent->left;
}
w->color = node->parent->color;
node->parent->color = 'B';
w->left->color = 'B';
rightRotate(tree, node->parent);
node = tree->root;
}
}
}
node->color = 'B';
}
static W_Node *treeMinimum(W_Node * node, W_Node * nil)
{
while (node->left != nil)
node = node->left;
return node;
}
static W_Node *treeMaximum(W_Node * node, W_Node * nil)
{
while (node->right != nil)
node = node->right;
return node;
}
static W_Node *treeSuccessor(W_Node * node, W_Node * nil)
{
W_Node *y;
if (node->right != nil) {
return treeMinimum(node->right, nil);
}
y = node->parent;
while (y != nil && node == y->right) {
node = y;
y = y->parent;
}
return y;
}
static W_Node *treePredecessor(W_Node * node, W_Node * nil)
{
W_Node *y;
if (node->left != nil) {
return treeMaximum(node->left, nil);
}
y = node->parent;
while (y != nil && node == y->left) {
node = y;
y = y->parent;
}
return y;
}
static W_Node *rbTreeDelete(W_Bag * tree, W_Node * node)
{
W_Node *nil = tree->nil;
W_Node *x, *y;
if (node->left == nil || node->right == nil) {
y = node;
} else {
y = treeSuccessor(node, nil);
}
if (y->left != nil) {
x = y->left;
} else {
x = y->right;
}
x->parent = y->parent;
if (y->parent == nil) {
tree->root = x;
} else {
if (IS_LEFT(y)) {
y->parent->left = x;
} else {
y->parent->right = x;
}
}
if (y != node) {
node->index = y->index;
node->data = y->data;
}
if (y->color == 'B') {
rbDeleteFixup(tree, x);
}
return y;
}
static W_Node *treeSearch(W_Node * root, W_Node * nil, int index)
{
if (root == nil || root->index == index) {
return root;
}
if (index < root->index) {
return treeSearch(root->left, nil, index);
} else {
return treeSearch(root->right, nil, index);
}
}
static W_Node *treeFind(W_Node * root, W_Node * nil, void *data)
{
W_Node *tmp;
if (root == nil || root->data == data)
return root;
tmp = treeFind(root->left, nil, data);
if (tmp != nil)
return tmp;
tmp = treeFind(root->right, nil, data);
return tmp;
}
#if 0
static char buf[512];
static void printNodes(W_Node * node, W_Node * nil, int depth)
{
if (node == nil) {
return;
}
printNodes(node->left, nil, depth + 1);
memset(buf, ' ', depth * 2);
buf[depth * 2] = 0;
if (IS_LEFT(node))
printf("%s/(%2i\n", buf, node->index);
else
printf("%s\\(%2i\n", buf, node->index);
printNodes(node->right, nil, depth + 1);
}
void PrintTree(WMBag * bag)
{
W_TreeBag *tree = (W_TreeBag *) bag->data;
printNodes(tree->root, tree->nil, 0);
}
#endif
WMBag *WMCreateTreeBag(void)
{
return WMCreateTreeBagWithDestructor(NULL);
}
WMBag *WMCreateTreeBagWithDestructor(WMFreeDataProc * destructor)
{
WMBag *bag;
bag = wmalloc(sizeof(WMBag));
bag->nil = wmalloc(sizeof(W_Node));
bag->nil->left = bag->nil->right = bag->nil->parent = bag->nil;
bag->nil->index = WBNotFound;
bag->root = bag->nil;
bag->destructor = destructor;
return bag;
}
int WMGetBagItemCount(WMBag * self)
{
return self->count;
}
void WMAppendBag(WMBag * self, WMBag * bag)
{
WMBagIterator ptr;
void *data;
for (data = WMBagFirst(bag, &ptr); data != NULL; data = WMBagNext(bag, &ptr)) {
WMPutInBag(self, data);
}
}
void WMPutInBag(WMBag * self, void *item)
{
W_Node *ptr;
ptr = wmalloc(sizeof(W_Node));
ptr->data = item;
ptr->index = self->count;
ptr->left = self->nil;
ptr->right = self->nil;
ptr->parent = self->nil;
rbTreeInsert(self, ptr);
self->count++;
}
void WMInsertInBag(WMBag * self, int index, void *item)
{
W_Node *ptr;
ptr = wmalloc(sizeof(W_Node));
ptr->data = item;
ptr->index = index;
ptr->left = self->nil;
ptr->right = self->nil;
ptr->parent = self->nil;
rbTreeInsert(self, ptr);
while ((ptr = treeSuccessor(ptr, self->nil)) != self->nil) {
ptr->index++;
}
self->count++;
}
int WMRemoveFromBag(WMBag * self, void *item)
{
W_Node *ptr = treeFind(self->root, self->nil, item);
if (ptr != self->nil) {
W_Node *tmp;
self->count--;
tmp = treeSuccessor(ptr, self->nil);
while (tmp != self->nil) {
tmp->index--;
tmp = treeSuccessor(tmp, self->nil);
}
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
return 1;
} else {
return 0;
}
}
int WMEraseFromBag(WMBag * self, int index)
{
W_Node *ptr = treeSearch(self->root, self->nil, index);
if (ptr != self->nil) {
self->count--;
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
wassertrv(self->count == 0 || self->root->index >= 0, 1);
return 1;
} else {
return 0;
}
}
int WMDeleteFromBag(WMBag * self, int index)
{
W_Node *ptr = treeSearch(self->root, self->nil, index);
if (ptr != self->nil) {
W_Node *tmp;
self->count--;
tmp = treeSuccessor(ptr, self->nil);
while (tmp != self->nil) {
tmp->index--;
tmp = treeSuccessor(tmp, self->nil);
}
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
wassertrv(self->count == 0 || self->root->index >= 0, 1);
return 1;
} else {
return 0;
}
}
void *WMGetFromBag(WMBag * self, int index)
{
W_Node *node;
node = treeSearch(self->root, self->nil, index);
if (node != self->nil)
return node->data;
else
return NULL;
}
int WMGetFirstInBag(WMBag * self, void *item)
{
W_Node *node;
node = treeFind(self->root, self->nil, item);
if (node != self->nil)
return node->index;
else
return WBNotFound;
}
static int treeCount(W_Node * root, W_Node * nil, void *item)
{
int count = 0;
if (root == nil)
return 0;
if (root->data == item)
count++;
if (root->left != nil)
count += treeCount(root->left, nil, item);
if (root->right != nil)
count += treeCount(root->right, nil, item);
return count;
}
int WMCountInBag(WMBag * self, void *item)
{
return treeCount(self->root, self->nil, item);
}
void *WMReplaceInBag(WMBag * self, int index, void *item)
{
W_Node *ptr = treeSearch(self->root, self->nil, index);
void *old = NULL;
if (item == NULL) {
self->count--;
ptr = rbTreeDelete(self, ptr);
if (self->destructor)
self->destructor(ptr->data);
wfree(ptr);
} else if (ptr != self->nil) {
old = ptr->data;
ptr->data = item;
} else {
W_Node *ptr;
ptr = wmalloc(sizeof(W_Node));
ptr->data = item;
ptr->index = index;
ptr->left = self->nil;
ptr->right = self->nil;
ptr->parent = self->nil;
rbTreeInsert(self, ptr);
self->count++;
}
return old;
}
void WMSortBag(WMBag * self, WMCompareDataProc * comparer)
{
void **items;
W_Node *tmp;
int i;
if (self->count == 0)
return;
items = wmalloc(sizeof(void *) * self->count);
i = 0;
tmp = treeMinimum(self->root, self->nil);
while (tmp != self->nil) {
items[i++] = tmp->data;
tmp = treeSuccessor(tmp, self->nil);
}
qsort(&items[0], self->count, sizeof(void *), comparer);
i = 0;
tmp = treeMinimum(self->root, self->nil);
while (tmp != self->nil) {
tmp->index = i;
tmp->data = items[i++];
tmp = treeSuccessor(tmp, self->nil);
}
wfree(items);
}
static void deleteTree(WMBag * self, W_Node * node)
{
if (node == self->nil)
return;
deleteTree(self, node->left);
if (self->destructor)
self->destructor(node->data);
deleteTree(self, node->right);
wfree(node);
}
void WMEmptyBag(WMBag * self)
{
deleteTree(self, self->root);
self->root = self->nil;
self->count = 0;
}
void WMFreeBag(WMBag * self)
{
WMEmptyBag(self);
wfree(self->nil);
wfree(self);
}
static void mapTree(W_Bag * tree, W_Node * node, void (*function) (void *, void *), void *data)
{
if (node == tree->nil)
return;
mapTree(tree, node->left, function, data);
(*function) (node->data, data);
mapTree(tree, node->right, function, data);
}
void WMMapBag(WMBag * self, void (*function) (void *, void *), void *data)
{
mapTree(self, self->root, function, data);
}
static int findInTree(W_Bag * tree, W_Node * node, WMMatchDataProc * function, void *cdata)
{
int index;
if (node == tree->nil)
return WBNotFound;
index = findInTree(tree, node->left, function, cdata);
if (index != WBNotFound)
return index;
if ((*function) (node->data, cdata)) {
return node->index;
}
return findInTree(tree, node->right, function, cdata);
}
int WMFindInBag(WMBag * self, WMMatchDataProc * match, void *cdata)
{
return findInTree(self, self->root, match, cdata);
}
void *WMBagFirst(WMBag * self, WMBagIterator * ptr)
{
W_Node *node;
node = treeMinimum(self->root, self->nil);
if (node == self->nil) {
*ptr = NULL;
return NULL;
} else {
*ptr = node;
return node->data;
}
}
void *WMBagLast(WMBag * self, WMBagIterator * ptr)
{
W_Node *node;
node = treeMaximum(self->root, self->nil);
if (node == self->nil) {
*ptr = NULL;
return NULL;
} else {
*ptr = node;
return node->data;
}
}
void *WMBagNext(WMBag * self, WMBagIterator * ptr)
{
W_Node *node;
if (*ptr == NULL)
return NULL;
node = treeSuccessor(*ptr, self->nil);
if (node == self->nil) {
*ptr = NULL;
return NULL;
} else {
*ptr = node;
return node->data;
}
}
void *WMBagPrevious(WMBag * self, WMBagIterator * ptr)
{
W_Node *node;
if (*ptr == NULL)
return NULL;
node = treePredecessor(*ptr, self->nil);
if (node == self->nil) {
*ptr = NULL;
return NULL;
} else {
*ptr = node;
return node->data;
}
}
void *WMBagIteratorAtIndex(WMBag * self, int index, WMBagIterator * ptr)
{
W_Node *node;
node = treeSearch(self->root, self->nil, index);
if (node == self->nil) {
*ptr = NULL;
return NULL;
} else {
*ptr = node;
return node->data;
}
}
int WMBagIndexForIterator(WMBag * bag, WMBagIterator ptr)
{
return ((W_Node *) ptr)->index;
}

View File

@@ -1,92 +1,39 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <X11/Xlocale.h> #include <proplist.h>
_WINGsConfiguration WINGsConfiguration; _WINGsConfiguration WINGsConfiguration;
#define SYSTEM_FONT "Trebuchet MS,sans serif"
#define BOLD_SYSTEM_FONT "Trebuchet MS,sans serif:bold"
#define DEFAULT_FONT_SIZE 12
#define FLOPPY_PATH "/floppy"
static unsigned getButtonWithName(const char *name, unsigned defaultButton) #define SYSTEM_FONT "-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*"
{
if (strncmp(name, "Button", 6) == 0 && strlen(name) == 7) {
switch (name[6]) {
case '1':
return Button1;
case '2':
return Button2;
case '3':
return Button3;
case '4':
return Button4;
case '5':
return Button5;
default:
break;
}
}
return defaultButton; #define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*"
}
void W_ReadConfigurations(void)
void
W_ReadConfigurations(void)
{ {
WMUserDefaults *defaults; WMUserDefaults *defaults;
Bool aaIsSet = False;
memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration)); memset(&WINGsConfiguration, 0, sizeof(_WINGsConfiguration));
defaults = WMGetStandardUserDefaults(); defaults = WMGetStandardUserDefaults();
if (defaults) { if (defaults) {
char *buttonName; WINGsConfiguration.systemFont =
WMPropList *val; WMGetUDStringForKey(defaults, "SystemFont");
unsigned button;
WINGsConfiguration.systemFont = WMGetUDStringForKey(defaults, "SystemFont"); WINGsConfiguration.boldSystemFont =
WMGetUDStringForKey(defaults, "BoldSystemFont");
WINGsConfiguration.boldSystemFont = WMGetUDStringForKey(defaults, "BoldSystemFont"); WINGsConfiguration.doubleClickDelay =
WMGetUDIntegerForKey(defaults, "DoubleClickTime");
val = WMGetUDObjectForKey(defaults, "AntialiasedText");
if (val && WMIsPLString(val) && WMGetFromPLString(val)) {
aaIsSet = True;
WINGsConfiguration.antialiasedText =
WMGetUDBoolForKey(defaults, "AntialiasedText");
}
WINGsConfiguration.doubleClickDelay = WMGetUDIntegerForKey(defaults, "DoubleClickTime");
WINGsConfiguration.floppyPath = WMGetUDStringForKey(defaults, "FloppyPath");
buttonName = WMGetUDStringForKey(defaults, "MouseWheelUp");
if (buttonName) {
button = getButtonWithName(buttonName, Button4);
wfree(buttonName);
} else {
button = Button4;
}
WINGsConfiguration.mouseWheelUp = button;
buttonName = WMGetUDStringForKey(defaults, "MouseWheelDown");
if (buttonName) {
button = getButtonWithName(buttonName, Button5);
wfree(buttonName);
} else {
button = Button5;
}
WINGsConfiguration.mouseWheelDown = button;
if (WINGsConfiguration.mouseWheelDown == WINGsConfiguration.mouseWheelUp) {
WINGsConfiguration.mouseWheelUp = Button4;
WINGsConfiguration.mouseWheelDown = Button5;
}
WINGsConfiguration.defaultFontSize = WMGetUDIntegerForKey(defaults, "DefaultFontSize");
} }
if (!WINGsConfiguration.systemFont) { if (!WINGsConfiguration.systemFont) {
@@ -95,23 +42,8 @@ void W_ReadConfigurations(void)
if (!WINGsConfiguration.boldSystemFont) { if (!WINGsConfiguration.boldSystemFont) {
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT; WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
} }
if (WINGsConfiguration.defaultFontSize == 0) {
WINGsConfiguration.defaultFontSize = DEFAULT_FONT_SIZE;
}
if (!aaIsSet) {
WINGsConfiguration.antialiasedText = True;
}
if (!WINGsConfiguration.floppyPath) {
WINGsConfiguration.floppyPath = FLOPPY_PATH;
}
if (WINGsConfiguration.doubleClickDelay == 0) { if (WINGsConfiguration.doubleClickDelay == 0) {
WINGsConfiguration.doubleClickDelay = 250; WINGsConfiguration.doubleClickDelay = 250;
} }
if (WINGsConfiguration.mouseWheelUp == 0) {
WINGsConfiguration.mouseWheelUp = Button4;
}
if (WINGsConfiguration.mouseWheelDown == 0) {
WINGsConfiguration.mouseWheelDown = Button5;
} }
}

View File

@@ -1,289 +0,0 @@
/*
* WINGs WMData function library
*
* Copyright (c) 1999-2003 Dan Pascu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <string.h>
#include "WUtil.h"
typedef struct W_Data {
unsigned length; /* How many bytes we have */
unsigned capacity; /* How many bytes it can hold */
unsigned growth; /* How much to grow */
void *bytes; /* Actual data */
unsigned retainCount;
WMFreeDataProc *destructor;
int format; /* 0, 8, 16 or 32 */
} W_Data;
/* Creating and destroying data objects */
WMData *WMCreateDataWithCapacity(unsigned capacity)
{
WMData *aData;
aData = (WMData *) wmalloc(sizeof(WMData));
if (capacity > 0)
aData->bytes = wmalloc(capacity);
else
aData->bytes = NULL;
aData->capacity = capacity;
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
aData->length = 0;
aData->retainCount = 1;
aData->format = 0;
aData->destructor = wfree;
return aData;
}
WMData *WMCreateDataWithLength(unsigned length)
{
WMData *aData;
aData = WMCreateDataWithCapacity(length);
if (length > 0) {
memset(aData->bytes, 0, length);
aData->length = length;
}
return aData;
}
WMData *WMCreateDataWithBytes(void *bytes, unsigned length)
{
WMData *aData;
aData = WMCreateDataWithCapacity(length);
aData->length = length;
memcpy(aData->bytes, bytes, length);
return aData;
}
WMData *WMCreateDataWithBytesNoCopy(void *bytes, unsigned length, WMFreeDataProc * destructor)
{
WMData *aData;
aData = (WMData *) wmalloc(sizeof(WMData));
aData->length = length;
aData->capacity = length;
aData->growth = length / 2 > 0 ? length / 2 : 1;
aData->bytes = bytes;
aData->retainCount = 1;
aData->format = 0;
aData->destructor = destructor;
return aData;
}
WMData *WMCreateDataWithData(WMData * aData)
{
WMData *newData;
if (aData->length > 0) {
newData = WMCreateDataWithBytes(aData->bytes, aData->length);
} else {
newData = WMCreateDataWithCapacity(0);
}
newData->format = aData->format;
return newData;
}
WMData *WMRetainData(WMData * aData)
{
aData->retainCount++;
return aData;
}
void WMReleaseData(WMData * aData)
{
aData->retainCount--;
if (aData->retainCount > 0)
return;
if (aData->bytes != NULL && aData->destructor != NULL) {
aData->destructor(aData->bytes);
}
wfree(aData);
}
/* Adjusting capacity */
void WMSetDataCapacity(WMData * aData, unsigned capacity)
{
if (aData->capacity != capacity) {
aData->bytes = wrealloc(aData->bytes, capacity);
aData->capacity = capacity;
aData->growth = capacity / 2 > 0 ? capacity / 2 : 1;
}
if (aData->length > capacity) {
aData->length = capacity;
}
}
void WMSetDataLength(WMData * aData, unsigned length)
{
if (length > aData->capacity) {
WMSetDataCapacity(aData, length);
}
if (length > aData->length) {
memset((unsigned char *)aData->bytes + aData->length, 0, length - aData->length);
}
aData->length = length;
}
void WMSetDataFormat(WMData * aData, unsigned format)
{
aData->format = format;
}
void WMIncreaseDataLengthBy(WMData * aData, unsigned extraLength)
{
WMSetDataLength(aData, aData->length + extraLength);
}
/* Accessing data */
const void *WMDataBytes(WMData * aData)
{
return aData->bytes;
}
void WMGetDataBytes(WMData * aData, void *buffer)
{
wassertr(aData->length > 0);
memcpy(buffer, aData->bytes, aData->length);
}
unsigned WMGetDataFormat(WMData * aData)
{
return aData->format;
}
void WMGetDataBytesWithLength(WMData * aData, void *buffer, unsigned length)
{
wassertr(aData->length > 0);
wassertr(length <= aData->length);
memcpy(buffer, aData->bytes, length);
}
void WMGetDataBytesWithRange(WMData * aData, void *buffer, WMRange aRange)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length - aRange.position);
memcpy(buffer, (unsigned char *)aData->bytes + aRange.position, aRange.count);
}
WMData *WMGetSubdataWithRange(WMData * aData, WMRange aRange)
{
void *buffer;
WMData *newData;
if (aRange.count <= 0)
return WMCreateDataWithCapacity(0);
buffer = wmalloc(aRange.count);
WMGetDataBytesWithRange(aData, buffer, aRange);
newData = WMCreateDataWithBytesNoCopy(buffer, aRange.count, wfree);
newData->format = aData->format;
return newData;
}
/* Testing data */
Bool WMIsDataEqualToData(WMData * aData, WMData * anotherData)
{
if (aData->length != anotherData->length)
return False;
else if (!aData->bytes && !anotherData->bytes) /* both are empty */
return True;
else if (!aData->bytes || !anotherData->bytes) /* one of them is empty */
return False;
return (memcmp(aData->bytes, anotherData->bytes, aData->length) == 0);
}
unsigned WMGetDataLength(WMData * aData)
{
return aData->length;
}
/* Adding data */
void WMAppendDataBytes(WMData * aData, void *bytes, unsigned length)
{
unsigned oldLength = aData->length;
unsigned newLength = oldLength + length;
if (newLength > aData->capacity) {
unsigned nextCapacity = aData->capacity + aData->growth;
unsigned nextGrowth = aData->capacity ? aData->capacity : 1;
while (nextCapacity < newLength) {
unsigned tmp = nextCapacity + nextGrowth;
nextGrowth = nextCapacity;
nextCapacity = tmp;
}
WMSetDataCapacity(aData, nextCapacity);
aData->growth = nextGrowth;
}
memcpy((unsigned char *)aData->bytes + oldLength, bytes, length);
aData->length = newLength;
}
void WMAppendData(WMData * aData, WMData * anotherData)
{
if (anotherData->length > 0)
WMAppendDataBytes(aData, anotherData->bytes, anotherData->length);
}
/* Modifying data */
void WMReplaceDataBytesInRange(WMData * aData, WMRange aRange, void *bytes)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length - aRange.position);
memcpy((unsigned char *)aData->bytes + aRange.position, bytes, aRange.count);
}
void WMResetDataBytesInRange(WMData * aData, WMRange aRange)
{
wassertr(aRange.position < aData->length);
wassertr(aRange.count <= aData->length - aRange.position);
memset((unsigned char *)aData->bytes + aRange.position, 0, aRange.count);
}
void WMSetData(WMData * aData, WMData * anotherData)
{
unsigned length = anotherData->length;
WMSetDataCapacity(aData, length);
if (length > 0)
memcpy(aData->bytes, anotherData->bytes, length);
aData->length = length;
}
/* Storing data */

View File

@@ -1,255 +0,0 @@
#include "WINGsP.h"
#define XDND_SOURCE_VERSION(dragInfo) dragInfo->protocolVersion
#define XDND_DEST_INFO(dragInfo) dragInfo->destInfo
#define XDND_DEST_VIEW(dragInfo) dragInfo->destInfo->destView
static Bool _WindowExists;
Atom W_OperationToAction(WMScreen * scr, WMDragOperationType operation)
{
switch (operation) {
case WDOperationNone:
return None;
case WDOperationCopy:
return scr->xdndActionCopy;
case WDOperationMove:
return scr->xdndActionMove;
case WDOperationLink:
return scr->xdndActionLink;
case WDOperationAsk:
return scr->xdndActionAsk;
case WDOperationPrivate:
return scr->xdndActionPrivate;
default:
return None;
}
}
WMDragOperationType W_ActionToOperation(WMScreen * scr, Atom action)
{
if (action == scr->xdndActionCopy) {
return WDOperationCopy;
} else if (action == scr->xdndActionMove) {
return WDOperationMove;
} else if (action == scr->xdndActionLink) {
return WDOperationLink;
} else if (action == scr->xdndActionAsk) {
return WDOperationAsk;
} else if (action == scr->xdndActionPrivate) {
return WDOperationPrivate;
} else if (action == None) {
return WDOperationNone;
} else {
char *tmp = XGetAtomName(scr->display, action);
wwarning("unknown XDND action %s ", tmp);
XFree(tmp);
return WDOperationCopy;
}
}
static void freeDragOperationItem(void *item)
{
wfree(item);
}
WMArray *WMCreateDragOperationArray(int initialSize)
{
return WMCreateArrayWithDestructor(initialSize, freeDragOperationItem);
}
WMDragOperationItem *WMCreateDragOperationItem(WMDragOperationType type, char *text)
{
W_DragOperationItem *result = wmalloc(sizeof(W_DragOperationItem));
result->type = type;
result->text = text;
return (WMDragOperationItem *) result;
}
WMDragOperationType WMGetDragOperationItemType(WMDragOperationItem * item)
{
return ((W_DragOperationItem *) item)->type;
}
char *WMGetDragOperationItemText(WMDragOperationItem * item)
{
return ((W_DragOperationItem *) item)->text;
}
static int handleNoWindowXError(Display * dpy, XErrorEvent * errEvt)
{
if (errEvt->error_code == BadWindow || errEvt->error_code == BadDrawable) {
_WindowExists = False;
return Success;
}
return errEvt->error_code;
}
static Bool windowExists(Display * dpy, Window win)
{
void *previousErrorHandler;
XWindowAttributes attr;
XSynchronize(dpy, True);
previousErrorHandler = XSetErrorHandler(handleNoWindowXError);
_WindowExists = True;
/* can generate BadDrawable or BadWindow */
XGetWindowAttributes(dpy, win, &attr);
XSetErrorHandler(previousErrorHandler);
XSynchronize(dpy, False);
return _WindowExists;
}
Bool
W_SendDnDClientMessage(Display * dpy, Window win, Atom message,
unsigned long data0,
unsigned long data1, unsigned long data2, unsigned long data3, unsigned long data4)
{
XEvent ev;
#ifdef XDND_DEBUG
char *msgName = XGetAtomName(dpy, message);
printf("sending message %s ... ", msgName);
XFree(msgName);
#endif
if (!windowExists(dpy, win)) {
wwarning("xdnd message target %lu does no longer exist.", win);
return False; /* message not sent */
}
ev.type = ClientMessage;
ev.xclient.message_type = message;
ev.xclient.format = 32;
ev.xclient.window = win;
ev.xclient.data.l[0] = data0;
ev.xclient.data.l[1] = data1;
ev.xclient.data.l[2] = data2;
ev.xclient.data.l[3] = data3;
ev.xclient.data.l[4] = data4;
XSendEvent(dpy, win, False, 0, &ev);
XFlush(dpy);
#ifdef XDND_DEBUG
printf("sent\n");
#endif
return True; /* message sent */
}
static void handleLeaveMessage(WMDraggingInfo * info)
{
if (XDND_DEST_INFO(info) != NULL) {
/* XDND_DEST_VIEW is never NULL (it's the xdnd aware view) */
wassertr(XDND_DEST_VIEW(info) != NULL);
if (XDND_DEST_VIEW(info)->dragDestinationProcs != NULL) {
XDND_DEST_VIEW(info)->dragDestinationProcs->concludeDragOperation(XDND_DEST_VIEW(info));
}
W_DragDestinationInfoClear(info);
}
}
void W_HandleDNDClientMessage(WMView * toplevel, XClientMessageEvent * event)
{
WMScreen *scr = W_VIEW_SCREEN(toplevel);
WMDraggingInfo *info = &scr->dragInfo;
Atom messageType = event->message_type;
#ifdef XDND_DEBUG
{
char *msgTypeName = XGetAtomName(scr->display, messageType);
if (msgTypeName != NULL)
printf("event type = %s\n", msgTypeName);
else
printf("pb with event type !\n");
}
#endif
/* Messages from destination to source */
if (messageType == scr->xdndStatusAtom || messageType == scr->xdndFinishedAtom) {
W_DragSourceStopTimer();
W_DragSourceStateHandler(info, event);
return;
}
/* Messages from source to destination */
if (messageType == scr->xdndEnterAtom) {
Bool positionSent = (XDND_DEST_INFO(info) != NULL);
W_DragDestinationStopTimer();
W_DragDestinationStoreEnterMsgInfo(info, toplevel, event);
/* Xdnd version 3 and up are not compatible with version 1 or 2 */
if (XDND_SOURCE_VERSION(info) > 2) {
if (positionSent) {
/* xdndPosition previously received on xdnd aware view */
W_DragDestinationStateHandler(info, event);
return;
} else {
W_DragDestinationStartTimer(info);
return;
}
} else {
wwarning("received dnd enter msg with unsupported version %i", XDND_SOURCE_VERSION(info));
W_DragDestinationCancelDropOnEnter(toplevel, info);
return;
}
}
if (messageType == scr->xdndPositionAtom) {
W_DragDestinationStopTimer();
W_DragDestinationStorePositionMsgInfo(info, toplevel, event);
W_DragDestinationStateHandler(info, event);
return;
}
if (messageType == scr->xdndSelectionAtom || messageType == scr->xdndDropAtom) {
W_DragDestinationStopTimer();
W_DragDestinationStateHandler(info, event);
return;
}
if (messageType == scr->xdndLeaveAtom) {
/* conclude drop operation, and clear dragging info */
W_DragDestinationStopTimer();
handleLeaveMessage(info);
}
}
/* called in destroyView (wview.c) */
void W_FreeViewXdndPart(WMView * view)
{
WMUnregisterViewDraggedTypes(view);
if (view->dragSourceProcs)
wfree(view->dragSourceProcs);
if (view->dragDestinationProcs)
wfree(view->dragDestinationProcs);
if (view->dragImage)
WMReleasePixmap(view->dragImage);
}

View File

@@ -1,978 +0,0 @@
#include "WINGsP.h"
#include <X11/Xatom.h>
#define XDND_SOURCE_RESPONSE_MAX_DELAY 3000
#define XDND_PROPERTY_FORMAT 32
#define XDND_ACTION_DESCRIPTION_FORMAT 8
#define XDND_SOURCE_VERSION(dragInfo) dragInfo->protocolVersion
#define XDND_DEST_INFO(dragInfo) dragInfo->destInfo
#define XDND_AWARE_VIEW(dragInfo) dragInfo->destInfo->xdndAwareView
#define XDND_SOURCE_WIN(dragInfo) dragInfo->destInfo->sourceWindow
#define XDND_DEST_VIEW(dragInfo) dragInfo->destInfo->destView
#define XDND_DEST_STATE(dragInfo) dragInfo->destInfo->state
#define XDND_SOURCE_ACTION_CHANGED(dragInfo) dragInfo->destInfo->sourceActionChanged
#define XDND_SOURCE_TYPES(dragInfo) dragInfo->destInfo->sourceTypes
#define XDND_TYPE_LIST_AVAILABLE(dragInfo) dragInfo->destInfo->typeListAvailable
#define XDND_REQUIRED_TYPES(dragInfo) dragInfo->destInfo->requiredTypes
#define XDND_SOURCE_ACTION(dragInfo) dragInfo->sourceAction
#define XDND_DEST_ACTION(dragInfo) dragInfo->destinationAction
#define XDND_SOURCE_OPERATIONS(dragInfo) dragInfo->destInfo->sourceOperations
#define XDND_DROP_DATAS(dragInfo) dragInfo->destInfo->dropDatas
#define XDND_DROP_DATA_COUNT(dragInfo) dragInfo->destInfo->dropDataCount
#define XDND_DEST_VIEW_IS_REGISTERED(dragInfo) ((dragInfo->destInfo) != NULL)\
&& ((dragInfo->destInfo->destView->dragDestinationProcs) != NULL)
static unsigned char XDNDversion = XDND_VERSION;
static WMHandlerID dndDestinationTimer = NULL;
static void *idleState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
static void *waitEnterState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
static void *inspectDropDataState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
static void *dropAllowedState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
static void *dropNotAllowedState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
static void *waitForDropDataState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info);
/* ----- Types & datas list ----- */
static void freeSourceTypeArrayItem(void *type)
{
XFree(type);
}
static WMArray *createSourceTypeArray(int initialSize)
{
return WMCreateArrayWithDestructor(initialSize, freeSourceTypeArrayItem);
}
static void freeDropDataArrayItem(void *data)
{
if (data != NULL)
WMReleaseData((WMData *) data);
}
static WMArray *createDropDataArray(WMArray * requiredTypes)
{
if (requiredTypes != NULL)
return WMCreateArrayWithDestructor(WMGetArrayItemCount(requiredTypes), freeDropDataArrayItem);
else
return WMCreateArray(0);
}
static WMArray *getTypesFromTypeList(WMScreen * scr, Window sourceWin)
{
Atom dataType;
Atom *typeAtomList;
WMArray *typeList;
int i, format;
unsigned long count, remaining;
unsigned char *data = NULL;
XGetWindowProperty(scr->display, sourceWin, scr->xdndTypeListAtom,
0, 0x8000000L, False, XA_ATOM, &dataType, &format, &count, &remaining, &data);
if (dataType != XA_ATOM || format != XDND_PROPERTY_FORMAT || count == 0 || !data) {
if (data) {
XFree(data);
}
return createSourceTypeArray(0);
}
typeList = createSourceTypeArray(count);
typeAtomList = (Atom *) data;
for (i = 0; i < count; i++) {
WMAddToArray(typeList, XGetAtomName(scr->display, typeAtomList[i]));
}
XFree(data);
return typeList;
}
static WMArray *getTypesFromThreeTypes(WMScreen * scr, XClientMessageEvent * event)
{
WMArray *typeList;
Atom atom;
int i;
typeList = createSourceTypeArray(3);
for (i = 2; i < 5; i++) {
if (event->data.l[i] != None) {
atom = (Atom) event->data.l[i];
WMAddToArray(typeList, XGetAtomName(scr->display, atom));
}
}
return typeList;
}
void storeRequiredTypeList(WMDraggingInfo * info)
{
WMView *destView = XDND_DEST_VIEW(info);
WMScreen *scr = W_VIEW_SCREEN(destView);
WMArray *requiredTypes;
/* First, see if the stored source types are enough for dest requirements */
requiredTypes = destView->dragDestinationProcs->requiredDataTypes(destView,
W_ActionToOperation(scr,
XDND_SOURCE_ACTION
(info)),
XDND_SOURCE_TYPES(info));
if (requiredTypes == NULL && XDND_TYPE_LIST_AVAILABLE(info)) {
/* None of the stored source types fits, but the whole type list
hasn't been retrieved yet. */
WMFreeArray(XDND_SOURCE_TYPES(info));
XDND_SOURCE_TYPES(info) = getTypesFromTypeList(scr, XDND_SOURCE_WIN(info));
/* Don't retrieve the type list again */
XDND_TYPE_LIST_AVAILABLE(info) = False;
requiredTypes =
destView->dragDestinationProcs->requiredDataTypes(destView,
W_ActionToOperation(scr,
XDND_SOURCE_ACTION
(info)),
XDND_SOURCE_TYPES(info));
}
XDND_REQUIRED_TYPES(info) = requiredTypes;
}
char *getNextRequestedDataType(WMDraggingInfo * info)
{
/* get the type of the first data not yet retrieved from selection */
int nextTypeIndex;
if (XDND_REQUIRED_TYPES(info) != NULL) {
nextTypeIndex = WMGetArrayItemCount(XDND_DROP_DATAS(info));
return WMGetFromArray(XDND_REQUIRED_TYPES(info), nextTypeIndex);
/* NULL if no more type */
} else
return NULL;
}
/* ----- Action list ----- */
WMArray *sourceOperationList(WMScreen * scr, Window sourceWin)
{
Atom dataType, *actionList;
int i, size;
unsigned long count, remaining;
unsigned char *actionDatas = NULL;
unsigned char *descriptionList = NULL;
WMArray *operationArray;
WMDragOperationItem *operationItem;
char *description;
remaining = 0;
XGetWindowProperty(scr->display, sourceWin, scr->xdndActionListAtom,
0, 0x8000000L, False, XA_ATOM, &dataType, &size, &count, &remaining, &actionDatas);
if (dataType != XA_ATOM || size != XDND_PROPERTY_FORMAT || count == 0 || !actionDatas) {
wwarning("Cannot read action list");
if (actionDatas) {
XFree(actionDatas);
}
return NULL;
}
actionList = (Atom *) actionDatas;
XGetWindowProperty(scr->display, sourceWin, scr->xdndActionDescriptionAtom,
0, 0x8000000L, False, XA_STRING, &dataType, &size,
&count, &remaining, &descriptionList);
if (dataType != XA_STRING || size != XDND_ACTION_DESCRIPTION_FORMAT || count == 0 || !descriptionList) {
wwarning("Cannot read action description list");
if (actionList) {
XFree(actionList);
}
if (descriptionList) {
XFree(descriptionList);
}
return NULL;
}
operationArray = WMCreateDragOperationArray(count);
description = (char *)descriptionList;
for (i = 0; count > 0; i++) {
size = strlen(description);
operationItem = WMCreateDragOperationItem(W_ActionToOperation(scr, actionList[i]),
wstrdup(description));
WMAddToArray(operationArray, operationItem);
count -= (size + 1); /* -1 : -NULL char */
/* next description */
description = &(description[size + 1]);
}
XFree(actionList);
XFree(descriptionList);
return operationArray;
}
/* ----- Dragging Info ----- */
static void updateSourceWindow(WMDraggingInfo * info, XClientMessageEvent * event)
{
XDND_SOURCE_WIN(info) = (Window) event->data.l[0];
}
static WMView *findChildInView(WMView * parent, int x, int y)
{
if (parent->childrenList == NULL)
return parent;
else {
WMView *child = parent->childrenList;
while (child != NULL
&& (!child->flags.mapped
|| x < WMGetViewPosition(child).x
|| x > WMGetViewPosition(child).x + WMGetViewSize(child).width
|| y < WMGetViewPosition(child).y
|| y > WMGetViewPosition(child).y + WMGetViewSize(child).height))
child = child->nextSister;
if (child == NULL)
return parent;
else
return findChildInView(child,
x - WMGetViewPosition(child).x, y - WMGetViewPosition(child).y);
}
}
static WMView *findDestinationViewInToplevel(WMView * toplevel, int x, int y)
{
WMScreen *scr = W_VIEW_SCREEN(toplevel);
Window toplevelWin = WMViewXID(toplevel);
int xInToplevel, yInToplevel;
Window foo;
XTranslateCoordinates(scr->display, scr->rootWin, toplevelWin, x, y, &xInToplevel, &yInToplevel, &foo);
return findChildInView(toplevel, xInToplevel, yInToplevel);
}
/* Clear datas only used by current destination view */
static void freeDestinationViewInfos(WMDraggingInfo * info)
{
if (XDND_SOURCE_TYPES(info) != NULL) {
WMFreeArray(XDND_SOURCE_TYPES(info));
XDND_SOURCE_TYPES(info) = NULL;
}
if (XDND_DROP_DATAS(info) != NULL) {
WMFreeArray(XDND_DROP_DATAS(info));
XDND_DROP_DATAS(info) = NULL;
}
XDND_REQUIRED_TYPES(info) = NULL;
}
void W_DragDestinationInfoClear(WMDraggingInfo * info)
{
W_DragDestinationStopTimer();
if (XDND_DEST_INFO(info) != NULL) {
freeDestinationViewInfos(info);
wfree(XDND_DEST_INFO(info));
XDND_DEST_INFO(info) = NULL;
}
}
static void initDestinationDragInfo(WMDraggingInfo * info, WMView * destView)
{
wassertr(destView != NULL);
XDND_DEST_INFO(info) = (W_DragDestinationInfo *) wmalloc(sizeof(W_DragDestinationInfo));
XDND_DEST_STATE(info) = idleState;
XDND_DEST_VIEW(info) = destView;
XDND_SOURCE_ACTION_CHANGED(info) = False;
XDND_SOURCE_TYPES(info) = NULL;
XDND_REQUIRED_TYPES(info) = NULL;
XDND_DROP_DATAS(info) = NULL;
}
void W_DragDestinationStoreEnterMsgInfo(WMDraggingInfo * info, WMView * toplevel, XClientMessageEvent * event)
{
WMScreen *scr = W_VIEW_SCREEN(toplevel);
if (XDND_DEST_INFO(info) == NULL)
initDestinationDragInfo(info, toplevel);
XDND_SOURCE_VERSION(info) = (event->data.l[1] >> 24);
XDND_AWARE_VIEW(info) = toplevel;
updateSourceWindow(info, event);
#if 0
if (event->data.l[1] & 1)
/* XdndTypeList property is available */
XDND_SOURCE_TYPES(info) = getTypesFromTypeList(scr, XDND_SOURCE_WIN(info));
else
XDND_SOURCE_TYPES(info) = getTypesFromThreeTypes(scr, event);
#endif
XDND_SOURCE_TYPES(info) = getTypesFromThreeTypes(scr, event);
/* to use if the 3 types are not enough */
XDND_TYPE_LIST_AVAILABLE(info) = (event->data.l[1] & 1);
}
void W_DragDestinationStorePositionMsgInfo(WMDraggingInfo * info, WMView * toplevel, XClientMessageEvent * event)
{
int x = event->data.l[2] >> 16;
int y = event->data.l[2] & 0xffff;
WMView *newDestView;
newDestView = findDestinationViewInToplevel(toplevel, x, y);
if (XDND_DEST_INFO(info) == NULL) {
initDestinationDragInfo(info, newDestView);
XDND_AWARE_VIEW(info) = toplevel;
updateSourceWindow(info, event);
} else {
if (newDestView != XDND_DEST_VIEW(info)) {
updateSourceWindow(info, event);
XDND_DEST_VIEW(info) = newDestView;
XDND_SOURCE_ACTION_CHANGED(info) = False;
if (XDND_DEST_STATE(info) != waitEnterState)
XDND_DEST_STATE(info) = idleState;
} else {
XDND_SOURCE_ACTION_CHANGED(info) = (XDND_SOURCE_ACTION(info) != event->data.l[4]);
}
}
XDND_SOURCE_ACTION(info) = event->data.l[4];
/* note: source position is not stored */
}
/* ----- End of Dragging Info ----- */
/* ----- Messages ----- */
/* send a DnD message to the source window */
static void
sendDnDClientMessage(WMDraggingInfo * info, Atom message,
unsigned long data1, unsigned long data2, unsigned long data3, unsigned long data4)
{
if (!W_SendDnDClientMessage(W_VIEW_SCREEN(XDND_AWARE_VIEW(info))->display,
XDND_SOURCE_WIN(info),
message, WMViewXID(XDND_AWARE_VIEW(info)), data1, data2, data3, data4)) {
/* drop failed */
W_DragDestinationInfoClear(info);
}
}
/* send a xdndStatus message to the source, with position and size
of the destination if it has no subwidget (requesting a position message
on every move otherwise) */
static void sendStatusMessage(WMView * destView, WMDraggingInfo * info, Atom action)
{
unsigned long data1;
data1 = (action == None) ? 0 : 1;
if (destView->childrenList == NULL) {
WMScreen *scr = W_VIEW_SCREEN(destView);
int destX, destY;
WMSize destSize = WMGetViewSize(destView);
Window foo;
XTranslateCoordinates(scr->display, WMViewXID(destView), scr->rootWin, 0, 0, &destX, &destY, &foo);
sendDnDClientMessage(info,
W_VIEW_SCREEN(destView)->xdndStatusAtom,
data1,
(destX << 16) | destY, (destSize.width << 16) | destSize.height, action);
} else {
/* set bit 1 to request explicitly position message on every move */
data1 = data1 | 2;
sendDnDClientMessage(info, W_VIEW_SCREEN(destView)->xdndStatusAtom, data1, 0, 0, action);
}
}
static void
storeDropData(WMView * destView, Atom selection, Atom target, Time timestamp, void *cdata, WMData * data)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
WMDraggingInfo *info = &(scr->dragInfo);
WMData *dataToStore = NULL;
if (data != NULL)
dataToStore = WMRetainData(data);
if (XDND_DEST_INFO(info) != NULL && XDND_DROP_DATAS(info) != NULL) {
WMAddToArray(XDND_DROP_DATAS(info), dataToStore);
W_SendDnDClientMessage(scr->display, WMViewXID(destView),
scr->xdndSelectionAtom, WMViewXID(destView), 0, 0, 0, 0);
}
}
Bool requestDropDataInSelection(WMView * destView, char *type)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
if (type != NULL) {
if (!WMRequestSelection(destView,
scr->xdndSelectionAtom,
XInternAtom(scr->display, type, False),
CurrentTime, storeDropData, NULL)) {
wwarning("could not request data for dropped data");
return False;
}
return True;
}
return False;
}
Bool requestDropData(WMDraggingInfo * info)
{
WMView *destView = XDND_DEST_VIEW(info);
char *nextType = getNextRequestedDataType(info);
while ((nextType != NULL)
&& (!requestDropDataInSelection(destView, nextType))) {
/* store NULL if request failed, and try with next type */
WMAddToArray(XDND_DROP_DATAS(info), NULL);
nextType = getNextRequestedDataType(info);
}
/* remains types to retrieve ? */
return (nextType != NULL);
}
static void concludeDrop(WMView * destView)
{
destView->dragDestinationProcs->concludeDragOperation(destView);
}
/* send cancel message to the source */
static void cancelDrop(WMView * destView, WMDraggingInfo * info)
{
sendStatusMessage(destView, info, None);
concludeDrop(destView);
freeDestinationViewInfos(info);
}
/* suspend drop, when dragged icon enter an unregistered view
or a register view that doesn't accept the drop */
static void suspendDropAuthorization(WMView * destView, WMDraggingInfo * info)
{
sendStatusMessage(destView, info, None);
/* Free datas that depend on destination behaviour */
if (XDND_DROP_DATAS(info) != NULL) {
WMFreeArray(XDND_DROP_DATAS(info));
XDND_DROP_DATAS(info) = NULL;
}
XDND_REQUIRED_TYPES(info) = NULL;
}
/* cancel drop on Enter message, if protocol version is nok */
void W_DragDestinationCancelDropOnEnter(WMView * toplevel, WMDraggingInfo * info)
{
if (XDND_DEST_VIEW_IS_REGISTERED(info))
cancelDrop(XDND_DEST_VIEW(info), info);
else
sendStatusMessage(toplevel, info, None);
W_DragDestinationInfoClear(info);
}
static void finishDrop(WMView * destView, WMDraggingInfo * info)
{
sendDnDClientMessage(info, W_VIEW_SCREEN(destView)->xdndFinishedAtom, 0, 0, 0, 0);
concludeDrop(destView);
W_DragDestinationInfoClear(info);
}
static Atom getAllowedAction(WMView * destView, WMDraggingInfo * info)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
return W_OperationToAction(scr,
destView->dragDestinationProcs->allowedOperation(destView,
W_ActionToOperation(scr,
XDND_SOURCE_ACTION
(info)),
XDND_SOURCE_TYPES(info)));
}
static void *checkActionAllowed(WMView * destView, WMDraggingInfo * info)
{
XDND_DEST_ACTION(info) = getAllowedAction(destView, info);
if (XDND_DEST_ACTION(info) == None) {
suspendDropAuthorization(destView, info);
return dropNotAllowedState;
}
sendStatusMessage(destView, info, XDND_DEST_ACTION(info));
return dropAllowedState;
}
static void *checkDropAllowed(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
storeRequiredTypeList(info);
if (destView->dragDestinationProcs->inspectDropData != NULL) {
XDND_DROP_DATAS(info) = createDropDataArray(XDND_REQUIRED_TYPES(info));
/* store first available data */
if (requestDropData(info))
return inspectDropDataState;
/* no data retrieved, but inspect can allow it */
if (destView->dragDestinationProcs->inspectDropData(destView, XDND_DROP_DATAS(info)))
return checkActionAllowed(destView, info);
suspendDropAuthorization(destView, info);
return dropNotAllowedState;
}
return checkActionAllowed(destView, info);
}
static WMPoint *getDropLocationInView(WMView * view)
{
Window rootWin, childWin;
int rootX, rootY;
unsigned int mask;
WMPoint *location;
location = (WMPoint *) wmalloc(sizeof(WMPoint));
XQueryPointer(W_VIEW_SCREEN(view)->display,
WMViewXID(view), &rootWin, &childWin, &rootX, &rootY, &(location->x), &(location->y), &mask);
return location;
}
static void callPerformDragOperation(WMView * destView, WMDraggingInfo * info)
{
WMArray *operationList = NULL;
WMScreen *scr = W_VIEW_SCREEN(destView);
WMPoint *dropLocation;
if (XDND_SOURCE_ACTION(info) == scr->xdndActionAsk)
operationList = sourceOperationList(scr, XDND_SOURCE_WIN(info));
dropLocation = getDropLocationInView(destView);
destView->dragDestinationProcs->performDragOperation(destView,
XDND_DROP_DATAS(info), operationList, dropLocation);
wfree(dropLocation);
if (operationList != NULL)
WMFreeArray(operationList);
}
/* ----- Destination timer ----- */
static void dragSourceResponseTimeOut(void *destView)
{
WMView *view = (WMView *) destView;
WMDraggingInfo *info;
wwarning("delay for drag source response expired");
info = &(W_VIEW_SCREEN(view)->dragInfo);
if (XDND_DEST_VIEW_IS_REGISTERED(info))
cancelDrop(view, info);
else {
sendStatusMessage(view, info, None);
}
W_DragDestinationInfoClear(info);
}
void W_DragDestinationStopTimer()
{
if (dndDestinationTimer != NULL) {
WMDeleteTimerHandler(dndDestinationTimer);
dndDestinationTimer = NULL;
}
}
void W_DragDestinationStartTimer(WMDraggingInfo * info)
{
W_DragDestinationStopTimer();
if (XDND_DEST_STATE(info) != idleState)
dndDestinationTimer = WMAddTimerHandler(XDND_SOURCE_RESPONSE_MAX_DELAY,
dragSourceResponseTimeOut, XDND_DEST_VIEW(info));
}
/* ----- End of Destination timer ----- */
/* ----- Destination states ----- */
#ifdef XDND_DEBUG
static const char *stateName(W_DndState * state)
{
if (state == NULL)
return "no state defined";
if (state == idleState)
return "idleState";
if (state == waitEnterState)
return "waitEnterState";
if (state == inspectDropDataState)
return "inspectDropDataState";
if (state == dropAllowedState)
return "dropAllowedState";
if (state == dropNotAllowedState)
return "dropNotAllowedState";
if (state == waitForDropDataState)
return "waitForDropDataState";
return "unknown state";
}
#endif
static void *idleState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr;
Atom sourceMsg;
if (destView->dragDestinationProcs != NULL) {
scr = W_VIEW_SCREEN(destView);
sourceMsg = event->message_type;
if (sourceMsg == scr->xdndPositionAtom) {
destView->dragDestinationProcs->prepareForDragOperation(destView);
if (XDND_SOURCE_TYPES(info) != NULL) {
/* enter message infos are available */
return checkDropAllowed(destView, event, info);
}
/* waiting for enter message */
return waitEnterState;
}
}
suspendDropAuthorization(destView, info);
return idleState;
}
/* Source position and action are stored,
waiting for xdnd protocol version and source type */
static void *waitEnterState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
Atom sourceMsg = event->message_type;
if (sourceMsg == scr->xdndEnterAtom) {
W_DragDestinationStoreEnterMsgInfo(info, destView, event);
return checkDropAllowed(destView, event, info);
}
return waitEnterState;
}
/* We have requested a data, and have received it */
static void *inspectDropDataState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr;
Atom sourceMsg;
scr = W_VIEW_SCREEN(destView);
sourceMsg = event->message_type;
if (sourceMsg == scr->xdndSelectionAtom) {
/* a data has been retrieved, store next available */
if (requestDropData(info))
return inspectDropDataState;
/* all required (and available) datas are stored */
if (destView->dragDestinationProcs->inspectDropData(destView, XDND_DROP_DATAS(info)))
return checkActionAllowed(destView, info);
suspendDropAuthorization(destView, info);
return dropNotAllowedState;
}
return inspectDropDataState;
}
static void *dropNotAllowedState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
Atom sourceMsg = event->message_type;
if (sourceMsg == scr->xdndDropAtom) {
finishDrop(destView, info);
return idleState;
}
if (sourceMsg == scr->xdndPositionAtom) {
if (XDND_SOURCE_ACTION_CHANGED(info)) {
return checkDropAllowed(destView, event, info);
} else {
sendStatusMessage(destView, info, None);
return dropNotAllowedState;
}
}
return dropNotAllowedState;
}
static void *dropAllowedState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
Atom sourceMsg = event->message_type;
if (sourceMsg == scr->xdndDropAtom) {
if (XDND_DROP_DATAS(info) != NULL) {
/* drop datas were cached with inspectDropData call */
callPerformDragOperation(destView, info);
} else {
XDND_DROP_DATAS(info) = createDropDataArray(XDND_REQUIRED_TYPES(info));
/* store first available data */
if (requestDropData(info))
return waitForDropDataState;
/* no data retrieved */
callPerformDragOperation(destView, info);
}
finishDrop(destView, info);
return idleState;
}
if (sourceMsg == scr->xdndPositionAtom) {
if (XDND_SOURCE_ACTION_CHANGED(info)) {
return checkDropAllowed(destView, event, info);
} else {
sendStatusMessage(destView, info, XDND_DEST_ACTION(info));
return dropAllowedState;
}
}
return dropAllowedState;
}
static void *waitForDropDataState(WMView * destView, XClientMessageEvent * event, WMDraggingInfo * info)
{
WMScreen *scr = W_VIEW_SCREEN(destView);
Atom sourceMsg = event->message_type;
if (sourceMsg == scr->xdndSelectionAtom) {
/* store next data */
if (requestDropData(info))
return waitForDropDataState;
/* all required (and available) datas are stored */
callPerformDragOperation(destView, info);
finishDrop(destView, info);
return idleState;
}
return waitForDropDataState;
}
/* ----- End of Destination states ----- */
void W_DragDestinationStateHandler(WMDraggingInfo * info, XClientMessageEvent * event)
{
WMView *destView;
W_DndState *newState;
wassertr(XDND_DEST_INFO(info) != NULL);
wassertr(XDND_DEST_VIEW(info) != NULL);
destView = XDND_DEST_VIEW(info);
if (XDND_DEST_STATE(info) == NULL)
XDND_DEST_STATE(info) = idleState;
#ifdef XDND_DEBUG
printf("current dest state: %s\n", stateName(XDND_DEST_STATE(info)));
#endif
newState = (W_DndState *) XDND_DEST_STATE(info) (destView, event, info);
#ifdef XDND_DEBUG
printf("new dest state: %s\n", stateName(newState));
#endif
if (XDND_DEST_INFO(info) != NULL) {
XDND_DEST_STATE(info) = newState;
if (XDND_DEST_STATE(info) != idleState)
W_DragDestinationStartTimer(info);
}
}
static void realizedObserver(void *self, WMNotification * notif)
{
WMView *view = (WMView *) WMGetNotificationObject(notif);
WMScreen *scr = W_VIEW_SCREEN(view);
XChangeProperty(scr->display, W_VIEW_DRAWABLE(view),
scr->xdndAwareAtom, XA_ATOM, XDND_PROPERTY_FORMAT, PropModeReplace, &XDNDversion, 1);
WMRemoveNotificationObserver(self);
}
void W_SetXdndAwareProperty(WMScreen * scr, WMView * view, Atom * types, int typeCount)
{
WMView *toplevel = W_TopLevelOfView(view);
if (!toplevel->flags.xdndHintSet) {
toplevel->flags.xdndHintSet = 1;
if (toplevel->flags.realized) {
XChangeProperty(scr->display, W_VIEW_DRAWABLE(toplevel),
scr->xdndAwareAtom, XA_ATOM, XDND_PROPERTY_FORMAT,
PropModeReplace, &XDNDversion, 1);
} else {
WMAddNotificationObserver(realizedObserver,
/* just use as an id */
&view->dragDestinationProcs,
WMViewRealizedNotification, toplevel);
}
}
}
void WMRegisterViewForDraggedTypes(WMView * view, WMArray * acceptedTypes)
{
Atom *types;
int typeCount;
int i;
typeCount = WMGetArrayItemCount(acceptedTypes);
types = wmalloc(sizeof(Atom) * (typeCount + 1));
for (i = 0; i < typeCount; i++) {
types[i] = XInternAtom(W_VIEW_SCREEN(view)->display, WMGetFromArray(acceptedTypes, i), False);
}
types[i] = 0;
view->droppableTypes = types;
/* WMFreeArray(acceptedTypes); */
W_SetXdndAwareProperty(W_VIEW_SCREEN(view), view, types, typeCount);
}
void WMUnregisterViewDraggedTypes(WMView * view)
{
if (view->droppableTypes != NULL)
wfree(view->droppableTypes);
view->droppableTypes = NULL;
}
/*
requestedOperation: operation requested by the source
sourceDataTypes: data types (mime-types strings) supported by the source
(never NULL, destroyed when drop ends)
return operation allowed by destination (self)
*/
static WMDragOperationType
defAllowedOperation(WMView * self, WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
{
/* no operation allowed */
return WDOperationNone;
}
/*
requestedOperation: operation requested by the source
sourceDataTypes: data types (mime-types strings) supported by the source
(never NULL, destroyed when drop ends)
return data types (mime-types strings) required by destination (self)
or NULL if no suitable data type is available (force
to 2nd pass with full source type list).
*/
static WMArray *defRequiredDataTypes(WMView * self,
WMDragOperationType requestedOperation, WMArray * sourceDataTypes)
{
/* no data type allowed (NULL even at 2nd pass) */
return NULL;
}
/*
Executed when the drag enters destination (self)
*/
static void defPrepareForDragOperation(WMView * self)
{
}
/*
Checks datas to be dropped (optional).
dropDatas: datas (WMData*) required by destination (self)
(given in same order as returned by requiredDataTypes).
A NULL data means it couldn't be retreived.
Destroyed when drop ends.
return true if data array is ok
*/
/* Bool (*inspectDropData)(WMView *self, WMArray *dropDatas); */
/*
Process drop
dropDatas: datas (WMData*) required by destination (self)
(given in same order as returned by requiredDataTypes).
A NULL data means it couldn't be retrieved.
Destroyed when drop ends.
operationList: if source operation is WDOperationAsk, contains
operations (and associated texts) that can be asked
to source. (destroyed after performDragOperation call)
Otherwise this parameter is NULL.
*/
static void
defPerformDragOperation(WMView * self, WMArray * dropDatas, WMArray * operationList, WMPoint * dropLocation)
{
}
/* Executed after drop */
static void defConcludeDragOperation(WMView * self)
{
}
void WMSetViewDragDestinationProcs(WMView * view, WMDragDestinationProcs * procs)
{
if (view->dragDestinationProcs == NULL) {
view->dragDestinationProcs = wmalloc(sizeof(WMDragDestinationProcs));
} else {
free(view->dragDestinationProcs);
}
*view->dragDestinationProcs = *procs;
/*XXX fill in non-implemented stuffs */
if (procs->allowedOperation == NULL) {
view->dragDestinationProcs->allowedOperation = defAllowedOperation;
}
if (procs->allowedOperation == NULL) {
view->dragDestinationProcs->requiredDataTypes = defRequiredDataTypes;
}
/* note: inspectDropData can be NULL, if data consultation is not needed
to give drop permission */
if (procs->prepareForDragOperation == NULL) {
view->dragDestinationProcs->prepareForDragOperation = defPrepareForDragOperation;
}
if (procs->performDragOperation == NULL) {
view->dragDestinationProcs->performDragOperation = defPerformDragOperation;
}
if (procs->concludeDragOperation == NULL) {
view->dragDestinationProcs->concludeDragOperation = defConcludeDragOperation;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/* /*
* WindowMaker miscelaneous function library * WindowMaker miscelaneous function library
* *
* Copyright (c) 1997-2003 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -18,79 +18,101 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "wconfig.h"
#include <stdarg.h> #include "../src/config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <errno.h>
#include <WUtil.h>
extern char *_WINGS_progname; extern char *_WINGS_progname;
void __wmessage(const char *func, const char *file, int line, int type, const char *msg, ...) #define MAXLINE 1024
/**************************************************************************
* Prints a fatal error message with variable arguments and terminates
*
* msg - message to print with optional formatting
* ... - arguments to use on formatting
**************************************************************************/
void
wfatal(const char *msg, ...)
{ {
va_list args; va_list args;
char *buf; char buf[MAXLINE];
static int linemax = 0;
int truncated = 0;
if (linemax == 0) {
#ifdef HAVE_SYSCONF
linemax = sysconf(_SC_LINE_MAX);
if (linemax == -1) {
/* I'd like to know of this ever fires */
fprintf(stderr, "%s %d: sysconf(_SC_LINE_MAX) returned error\n",
__FILE__, __LINE__);
linemax = 512;
}
#else /* !HAVE_SYSCONF */
fprintf(stderr, "%s %d: Your system does not have sysconf(3); "
"let wmaker-dev@windowmaker.org know.\n", __FILE__, __LINE__);
linemax = 512;
#endif /* HAVE_SYSCONF */
}
buf = wmalloc(linemax);
fflush(stdout);
/* message format: <wings_progname>(function(file:line): <type?>: <message>"\n" */
strncat(buf, _WINGS_progname ? _WINGS_progname : "WINGs", linemax - 1);
snprintf(buf + strlen(buf), linemax - strlen(buf), "(%s(%s:%d))", func, file, line);
strncat(buf, ": ", linemax - 1 - strlen(buf));
switch (type) {
case WMESSAGE_TYPE_FATAL:
strncat(buf, _("fatal error: "), linemax - 1 - strlen(buf));
break;
case WMESSAGE_TYPE_ERROR:
strncat(buf, _("error: "), linemax - 1 - strlen(buf));
break;
case WMESSAGE_TYPE_WARNING:
strncat(buf, _("warning: "), linemax - 1 - strlen(buf));
break;
case WMESSAGE_TYPE_MESSAGE:
/* FALLTHROUGH */
default: /* should not happen, but doesn't hurt either */
break;
}
va_start(args, msg); va_start(args, msg);
if (vsnprintf(buf + strlen(buf), linemax - strlen(buf), msg, args) >= linemax - strlen(buf))
truncated = 1; vsprintf(buf, msg, args);
strcat(buf,"\n");
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" fatal error: ",stderr);
fputs(buf, stderr);
fflush(NULL);
va_end(args); va_end(args);
}
fputs(buf, stderr);
if (truncated) /*********************************************************************
fputs("*** message truncated ***", stderr); * Prints a warning message with variable arguments
*
fputs("\n", stderr); * msg - message to print with optional formatting
* ... - arguments to use on formatting
wfree(buf); *********************************************************************/
void
wwarning(const char *msg, ...)
{
va_list args;
char buf[MAXLINE];
va_start(args, msg);
vsprintf(buf, msg, args);
strcat(buf,"\n");
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" warning: ",stderr);
fputs(buf, stderr);
fflush(NULL);
va_end(args);
}
/*********************************************************************
* Prints a system error message with variable arguments
*
* msg - message to print with optional formatting
* ... - arguments to use on formatting
*********************************************************************/
void
wsyserror(const char *msg, ...)
{
va_list args;
char buf[MAXLINE];
#ifdef HAVE_STRERROR
int error=errno;
#endif
va_start(args, msg);
vsprintf(buf, msg, args);
fflush(stdout);
fputs(_WINGS_progname, stderr);
fputs(" error: ", stderr);
strcat(buf, ": ");
#ifdef HAVE_STRERROR
strcat(buf, strerror(error));
strcat(buf,"\n");
fputs(buf, stderr);
fflush(NULL);
#else
perror(buf);
#endif
va_end(args);
} }

View File

@@ -1,7 +1,7 @@
/* /*
* WindowMaker miscelaneous function library * WindowMaker miscelaneous function library
* *
* Copyright (c) 1997-2003 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -18,11 +18,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "wconfig.h"
#include "../src/config.h"
#include "WUtil.h" #include "WUtil.h"
#include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
@@ -33,59 +33,52 @@
#define PATH_MAX 1024 #define PATH_MAX 1024
#endif #endif
char *wgethomedir()
char*
wgethomedir()
{ {
static char *home = NULL; char *home = getenv("HOME");
char *tmp;
struct passwd *user; struct passwd *user;
if (home) if (home)
return home; return home;
tmp = getenv("HOME");
if (tmp) {
home = wstrdup(tmp);
return home;
}
user = getpwuid(getuid()); user = getpwuid(getuid());
if (!user) { if (!user) {
werror(_("could not get password entry for UID %i"), getuid()); wsyserror("could not get password entry for UID %i", getuid());
home = "/"; return "/";
}
if (!user->pw_dir) {
return "/";
} else {
return user->pw_dir;
}
} }
if (!user->pw_dir)
home = "/";
else
home = wstrdup(user->pw_dir);
return home; static char*
} getuserhomedir(char *username)
static char *getuserhomedir(const char *username)
{ {
static char *home = NULL;
struct passwd *user; struct passwd *user;
if (home)
return home;
user = getpwnam(username); user = getpwnam(username);
if (!user) { if (!user) {
werror(_("could not get password entry for user %s"), username); wsyserror("could not get password entry for user %s", username);
return NULL; return NULL;
} }
if (!user->pw_dir) if (!user->pw_dir) {
home = "/"; return "/";
else } else {
home = wstrdup(user->pw_dir); return user->pw_dir;
}
return home;
} }
char *wexpandpath(char *path)
char*
wexpandpath(char *path)
{ {
char *origpath = path;
char buffer2[PATH_MAX+2]; char buffer2[PATH_MAX+2];
char buffer[PATH_MAX+2]; char buffer[PATH_MAX+2];
int i; int i;
@@ -98,28 +91,25 @@ char *wexpandpath(char *path)
path++; path++;
if (*path=='/' || *path==0) { if (*path=='/' || *path==0) {
home = wgethomedir(); home = wgethomedir();
if (strlen(home) > PATH_MAX || strcat(buffer, home);
wstrlcpy(buffer, home, sizeof(buffer)) >= sizeof(buffer))
goto error;
} else { } else {
int j; int j;
j = 0; j = 0;
while (*path!=0 && *path!='/') { while (*path!=0 && *path!='/') {
if (j > PATH_MAX)
goto error;
buffer2[j++] = *path; buffer2[j++] = *path;
buffer2[j] = 0; buffer2[j] = 0;
path++; path++;
} }
home = getuserhomedir(buffer2); home = getuserhomedir(buffer2);
if (!home || wstrlcat(buffer, home, sizeof(buffer)) >= sizeof(buffer)) if (!home)
goto error; return NULL;
strcat(buffer, home);
} }
} }
i = strlen(buffer); i = strlen(buffer);
while (*path != 0 && i <= PATH_MAX) { while (*path!=0) {
char *tmp; char *tmp;
if (*path=='$') { if (*path=='$') {
@@ -129,51 +119,35 @@ char *wexpandpath(char *path)
if (*path=='(') { if (*path=='(') {
path++; path++;
while (*path!=0 && *path!=')') { while (*path!=0 && *path!=')') {
if (j > PATH_MAX)
goto error;
buffer2[j++] = *(path++); buffer2[j++] = *(path++);
buffer2[j] = 0; buffer2[j] = 0;
} }
if (*path == ')') { if (*path==')')
path++; path++;
tmp = getenv(buffer2); tmp = getenv(buffer2);
} else {
tmp = NULL;
}
if (!tmp) { if (!tmp) {
if ((i += strlen(buffer2) + 2) > PATH_MAX)
goto error;
buffer[i] = 0; buffer[i] = 0;
if (wstrlcat(buffer, "$(", sizeof(buffer)) >= sizeof(buffer) || strcat(buffer, "$(");
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer)) strcat(buffer, buffer2);
goto error; strcat(buffer, ")");
if (*(path-1)==')') { i += strlen(buffer2)+3;
if (++i > PATH_MAX ||
wstrlcat(buffer, ")", sizeof(buffer)) >= sizeof(buffer))
goto error;
}
} else { } else {
if ((i += strlen(tmp)) > PATH_MAX || strcat(buffer, tmp);
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer)) i += strlen(tmp);
goto error;
} }
} else { } else {
while (*path!=0 && *path!='/') { while (*path!=0 && *path!='/') {
if (j > PATH_MAX)
goto error;
buffer2[j++] = *(path++); buffer2[j++] = *(path++);
buffer2[j] = 0; buffer2[j] = 0;
} }
tmp = getenv(buffer2); tmp = getenv(buffer2);
if (!tmp) { if (!tmp) {
if ((i += strlen(buffer2) + 1) > PATH_MAX || strcat(buffer, "$");
wstrlcat(buffer, "$", sizeof(buffer)) >= sizeof(buffer) || strcat(buffer, buffer2);
wstrlcat(buffer, buffer2, sizeof(buffer)) >= sizeof(buffer)) i += strlen(buffer2)+1;
goto error;
} else { } else {
if ((i += strlen(tmp)) > PATH_MAX || strcat(buffer, tmp);
wstrlcat(buffer, tmp, sizeof(buffer)) >= sizeof(buffer)) i += strlen(tmp);
goto error;
} }
} }
} else { } else {
@@ -182,35 +156,10 @@ char *wexpandpath(char *path)
} }
} }
if (*path!=0)
goto error;
return wstrdup(buffer); return wstrdup(buffer);
error:
errno = ENAMETOOLONG;
werror(_("could not expand %s"), origpath);
return NULL;
} }
/* return address of next char != tok or end of string whichever comes first */
static char *skipchar(char *string, char tok)
{
while (*string != 0 && *string == tok)
string++;
return string;
}
/* return address of next char == tok or end of string whichever comes first */
static char *nextchar(char *string, char tok)
{
while (*string != 0 && *string != tok)
string++;
return string;
}
/* /*
*---------------------------------------------------------------------- *----------------------------------------------------------------------
@@ -227,24 +176,26 @@ static char *nextchar(char *string, char tok)
* *
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
char *wfindfile(char *paths, char *file) char*
wfindfile(char *paths, char *file)
{ {
char *path; char *path;
char *tmp, *tmp2; char *tmp;
int done;
int len, flen; int len, flen;
char *fullpath; char *fullpath;
if (!file) if (!file)
return NULL; return NULL;
if (*file == '/' || *file == '~' || *file == '$' || !paths || *paths == 0) { if (*file=='/' || *file=='~' || *file=='$' || !paths) {
if (access(file, F_OK) < 0) { if (access(file, R_OK)<0) {
fullpath = wexpandpath(file); fullpath = wexpandpath(file);
if (!fullpath) if (!fullpath)
return NULL; return NULL;
if (access(fullpath, F_OK) < 0) { if (access(fullpath, R_OK)<0) {
wfree(fullpath); free(fullpath);
return NULL; return NULL;
} else { } else {
return fullpath; return fullpath;
@@ -256,42 +207,32 @@ char *wfindfile(char *paths, char *file)
flen = strlen(file); flen = strlen(file);
tmp = paths; tmp = paths;
while (*tmp) { done = 0;
tmp = skipchar(tmp, ':'); while (!done) {
if (*tmp == 0) len = strcspn(tmp, ":");
break; if (len==0) done=1;
tmp2 = nextchar(tmp, ':');
len = tmp2 - tmp;
path = wmalloc(len+flen+2); path = wmalloc(len+flen+2);
path = memcpy(path, tmp, len); path = memcpy(path, tmp, len);
path[len]=0; path[len]=0;
if (path[len - 1] != '/' && strcat(path, "/");
wstrlcat(path, "/", len + flen + 2) >= len + flen + 2) { strcat(path, file);
wfree(path);
return NULL;
}
if (wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
wfree(path);
return NULL;
}
fullpath = wexpandpath(path); fullpath = wexpandpath(path);
wfree(path); free(path);
if (fullpath) { if (fullpath) {
if (access(fullpath, F_OK) == 0) { if (access(fullpath, R_OK)==0) {
return fullpath; return fullpath;
} }
wfree(fullpath); free(fullpath);
} }
tmp = tmp2; tmp=&(tmp[len+1]);
if (*tmp==0) break;
} }
return NULL; return NULL;
} }
char *wfindfileinlist(char **path_list, char *file)
char*
wfindfileinlist(char **path_list, char *file)
{ {
int i; int i;
char *path; char *path;
@@ -302,13 +243,13 @@ char *wfindfileinlist(char **path_list, char *file)
return NULL; return NULL;
if (*file=='/' || *file=='~' || !path_list) { if (*file=='/' || *file=='~' || !path_list) {
if (access(file, F_OK) < 0) { if (access(file, R_OK)<0) {
fullpath = wexpandpath(file); fullpath = wexpandpath(file);
if (!fullpath) if (!fullpath)
return NULL; return NULL;
if (access(fullpath, F_OK) < 0) { if (access(fullpath, R_OK)<0) {
wfree(fullpath); free(fullpath);
return NULL; return NULL;
} else { } else {
return fullpath; return fullpath;
@@ -324,82 +265,21 @@ char *wfindfileinlist(char **path_list, char *file)
path = wmalloc(len+flen+2); path = wmalloc(len+flen+2);
path = memcpy(path, path_list[i], len); path = memcpy(path, path_list[i], len);
path[len]=0; path[len]=0;
if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 || strcat(path, "/");
wstrlcat(path, file, len + flen + 2) >= len + flen + 2) { strcat(path, file);
wfree(path);
return NULL;
}
/* expand tilde */ /* expand tilde */
fullpath = wexpandpath(path); fullpath = wexpandpath(path);
wfree(path); free(path);
if (fullpath) { if (fullpath) {
/* check if file exists */ /* check if file is readable */
if (access(fullpath, F_OK) == 0) { if (access(fullpath, R_OK)==0) {
return fullpath; return fullpath;
} }
wfree(fullpath); free(fullpath);
}
}
return NULL;
}
char *wfindfileinarray(WMPropList * array, char *file)
{
int i;
char *path;
int len, flen;
char *fullpath;
if (!file)
return NULL;
if (*file == '/' || *file == '~' || !array) {
if (access(file, F_OK) < 0) {
fullpath = wexpandpath(file);
if (!fullpath)
return NULL;
if (access(fullpath, F_OK) < 0) {
wfree(fullpath);
return NULL;
} else {
return fullpath;
}
} else {
return wstrdup(file);
}
}
flen = strlen(file);
for (i = 0; i < WMGetPropListItemCount(array); i++) {
WMPropList *prop;
char *p;
prop = WMGetFromPLArray(array, i);
if (!prop)
continue;
p = WMGetFromPLString(prop);
len = strlen(p);
path = wmalloc(len + flen + 2);
path = memcpy(path, p, len);
path[len] = 0;
if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 ||
wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {
wfree(path);
return NULL;
}
/* expand tilde */
fullpath = wexpandpath(path);
wfree(path);
if (fullpath) {
/* check if file exists */
if (access(fullpath, F_OK) == 0) {
return fullpath;
}
wfree(fullpath);
} }
} }
return NULL; return NULL;
} }

104
WINGs/fontl.c Normal file
View File

@@ -0,0 +1,104 @@
/*
* WINGs demo: font lister
*
* Copyright (c) 1998 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdlib.h>
#include <stdio.h>
#include "WINGs.h"
#include "WUtil.h"
void
wAbort()
{
exit(0);
}
void show(WMWidget *self, void *data)
{
char buf[60];
void *d;
WMLabel *l = (WMLabel*)data;
d = WMGetHangedData(self);
sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
WMSetLabelText(l, buf);
}
void quit(WMWidget *self, void *data)
{
exit(0);
}
int
main(int argc, char **argv)
{
Display *dpy;
WMWindow *win;
WMScreen *scr;
WMButton *lab, *l0=NULL;
WMLabel *pos;
int x, y, c;
char buf[20];
WMInitializeApplication("FontView", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
wfatal("cant open display");
exit(0);
}
scr = WMCreateSimpleApplicationScreen(dpy);
win = WMCreateWindow(scr, "main");
WMResizeWidget(win, 20*33, 20+20*9);
WMSetWindowTitle(win, "Font Chars");
WMSetWindowCloseAction(win, quit, NULL);
pos = WMCreateLabel(win);
WMResizeWidget(pos, 20*33, 20);
WMMoveWidget(pos, 10, 5);
c = 0;
for (y=0; y<8; y++) {
for (x=0; x<32; x++, c++) {
lab = WMCreateCustomButton(win, WBBStateLightMask);
WMResizeWidget(lab, 20, 20);
WMMoveWidget(lab, 10+x*20, 30+y*20);
sprintf(buf, "%c", c);
WMSetButtonText(lab, buf);
WMSetButtonAction(lab, show, pos);
WMHangData(lab, (void*)c);
if (c>0) {
WMGroupButtons(l0, lab);
} else {
l0 = lab;
}
}
}
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,31 +0,0 @@
#!/bin/sh
WCFLAGS="${inc_search_path}"
WLFLAGS="${lib_search_path}"
WLIBS="-lWINGs -lWUtil -lwraster ${GFXLIBS} ${XFTLIBS} ${XLIBS} -lm ${INTLIBS}"
usage="Usage: get-wings-flags [--cflags] [--ldflags] [--libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo $WCFLAGS
;;
--ldflags|--lflags)
echo $WLFLAGS
;;
--libs)
echo $WLIBS
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done

View File

@@ -1,31 +0,0 @@
#!/bin/sh
WCFLAGS="-I${includedir}"
WLFLAGS="-L${libdir}"
WLIBS="-lWUtil ${INTLIBS}"
usage="Usage: get-wutil-flags [--cflags] [--ldflags] [--libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo $WCFLAGS
;;
--ldflags|--lflags)
echo $WLFLAGS
;;
--libs)
echo $WLIBS
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done

View File

@@ -1,566 +0,0 @@
/*
* WINGs internal handlers: timer, idle and input handlers
*/
#include "wconfig.h"
#include "WINGsP.h"
#include <sys/types.h>
#include <unistd.h>
#include <X11/Xos.h>
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#include <time.h>
#ifndef X_GETTIMEOFDAY
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
#endif
typedef struct TimerHandler {
WMCallback *callback; /* procedure to call */
struct timeval when; /* when to call the callback */
void *clientData;
struct TimerHandler *next;
int nextDelay; /* 0 if it's one-shot */
} TimerHandler;
typedef struct IdleHandler {
WMCallback *callback;
void *clientData;
} IdleHandler;
typedef struct InputHandler {
WMInputProc *callback;
void *clientData;
int fd;
int mask;
} InputHandler;
/* queue of timer event handlers */
static TimerHandler *timerHandler = NULL;
static WMArray *idleHandler = NULL;
static WMArray *inputHandler = NULL;
#define timerPending() (timerHandler)
static void rightNow(struct timeval *tv)
{
X_GETTIMEOFDAY(tv);
}
/* is t1 after t2 ? */
#define IS_AFTER(t1, t2) (((t1).tv_sec > (t2).tv_sec) || \
(((t1).tv_sec == (t2).tv_sec) \
&& ((t1).tv_usec > (t2).tv_usec)))
#define IS_ZERO(tv) (tv.tv_sec == 0 && tv.tv_usec == 0)
#define SET_ZERO(tv) tv.tv_sec = 0, tv.tv_usec = 0
static void addmillisecs(struct timeval *tv, int milliseconds)
{
tv->tv_usec += milliseconds * 1000;
tv->tv_sec += tv->tv_usec / 1000000;
tv->tv_usec = tv->tv_usec % 1000000;
}
static void enqueueTimerHandler(TimerHandler * handler)
{
TimerHandler *tmp;
/* insert callback in queue, sorted by time left */
if (!timerHandler || !IS_AFTER(handler->when, timerHandler->when)) {
/* first in the queue */
handler->next = timerHandler;
timerHandler = handler;
} else {
tmp = timerHandler;
while (tmp->next && IS_AFTER(handler->when, tmp->next->when)) {
tmp = tmp->next;
}
handler->next = tmp->next;
tmp->next = handler;
}
}
static void delayUntilNextTimerEvent(struct timeval *delay)
{
struct timeval now;
TimerHandler *handler;
handler = timerHandler;
while (handler && IS_ZERO(handler->when))
handler = handler->next;
if (!handler) {
/* The return value of this function is only valid if there _are_
timers active. */
delay->tv_sec = 0;
delay->tv_usec = 0;
return;
}
rightNow(&now);
if (IS_AFTER(now, handler->when)) {
delay->tv_sec = 0;
delay->tv_usec = 0;
} else {
delay->tv_sec = handler->when.tv_sec - now.tv_sec;
delay->tv_usec = handler->when.tv_usec - now.tv_usec;
if (delay->tv_usec < 0) {
delay->tv_usec += 1000000;
delay->tv_sec--;
}
}
}
WMHandlerID WMAddTimerHandler(int milliseconds, WMCallback * callback, void *cdata)
{
TimerHandler *handler;
handler = malloc(sizeof(TimerHandler));
if (!handler)
return NULL;
rightNow(&handler->when);
addmillisecs(&handler->when, milliseconds);
handler->callback = callback;
handler->clientData = cdata;
handler->nextDelay = 0;
enqueueTimerHandler(handler);
return handler;
}
WMHandlerID WMAddPersistentTimerHandler(int milliseconds, WMCallback * callback, void *cdata)
{
TimerHandler *handler = WMAddTimerHandler(milliseconds, callback, cdata);
if (handler != NULL)
handler->nextDelay = milliseconds;
return handler;
}
void WMDeleteTimerWithClientData(void *cdata)
{
TimerHandler *handler, *tmp;
if (!cdata || !timerHandler)
return;
tmp = timerHandler;
if (tmp->clientData == cdata) {
tmp->nextDelay = 0;
if (!IS_ZERO(tmp->when)) {
timerHandler = tmp->next;
wfree(tmp);
}
} else {
while (tmp->next) {
if (tmp->next->clientData == cdata) {
handler = tmp->next;
handler->nextDelay = 0;
if (IS_ZERO(handler->when))
break;
tmp->next = handler->next;
wfree(handler);
break;
}
tmp = tmp->next;
}
}
}
void WMDeleteTimerHandler(WMHandlerID handlerID)
{
TimerHandler *tmp, *handler = (TimerHandler *) handlerID;
if (!handler || !timerHandler)
return;
tmp = timerHandler;
handler->nextDelay = 0;
if (IS_ZERO(handler->when))
return;
if (tmp == handler) {
timerHandler = handler->next;
wfree(handler);
} else {
while (tmp->next) {
if (tmp->next == handler) {
tmp->next = handler->next;
wfree(handler);
break;
}
tmp = tmp->next;
}
}
}
WMHandlerID WMAddIdleHandler(WMCallback * callback, void *cdata)
{
IdleHandler *handler;
handler = malloc(sizeof(IdleHandler));
if (!handler)
return NULL;
handler->callback = callback;
handler->clientData = cdata;
/* add handler at end of queue */
if (!idleHandler) {
idleHandler = WMCreateArrayWithDestructor(16, wfree);
}
WMAddToArray(idleHandler, handler);
return handler;
}
void WMDeleteIdleHandler(WMHandlerID handlerID)
{
IdleHandler *handler = (IdleHandler *) handlerID;
if (!handler || !idleHandler)
return;
WMRemoveFromArray(idleHandler, handler);
}
WMHandlerID WMAddInputHandler(int fd, int condition, WMInputProc * proc, void *clientData)
{
InputHandler *handler;
handler = wmalloc(sizeof(InputHandler));
handler->fd = fd;
handler->mask = condition;
handler->callback = proc;
handler->clientData = clientData;
if (!inputHandler)
inputHandler = WMCreateArrayWithDestructor(16, wfree);
WMAddToArray(inputHandler, handler);
return handler;
}
void WMDeleteInputHandler(WMHandlerID handlerID)
{
InputHandler *handler = (InputHandler *) handlerID;
if (!handler || !inputHandler)
return;
WMRemoveFromArray(inputHandler, handler);
}
Bool W_CheckIdleHandlers(void)
{
IdleHandler *handler;
WMArray *handlerCopy;
WMArrayIterator iter;
if (!idleHandler || WMGetArrayItemCount(idleHandler) == 0) {
W_FlushIdleNotificationQueue();
/* make sure an observer in queue didn't added an idle handler */
return (idleHandler != NULL && WMGetArrayItemCount(idleHandler) > 0);
}
handlerCopy = WMDuplicateArray(idleHandler);
WM_ITERATE_ARRAY(handlerCopy, handler, iter) {
/* check if the handler still exist or was removed by a callback */
if (WMGetFirstInArray(idleHandler, handler) == WANotFound)
continue;
(*handler->callback) (handler->clientData);
WMDeleteIdleHandler(handler);
}
WMFreeArray(handlerCopy);
W_FlushIdleNotificationQueue();
/* this is not necesarrily False, because one handler can re-add itself */
return (WMGetArrayItemCount(idleHandler) > 0);
}
void W_CheckTimerHandlers(void)
{
TimerHandler *handler;
struct timeval now;
if (!timerHandler) {
W_FlushASAPNotificationQueue();
return;
}
rightNow(&now);
handler = timerHandler;
while (handler && IS_AFTER(now, handler->when)) {
if (!IS_ZERO(handler->when)) {
SET_ZERO(handler->when);
(*handler->callback) (handler->clientData);
}
handler = handler->next;
}
while (timerHandler && IS_ZERO(timerHandler->when)) {
handler = timerHandler;
timerHandler = timerHandler->next;
if (handler->nextDelay > 0) {
handler->when = now;
addmillisecs(&handler->when, handler->nextDelay);
enqueueTimerHandler(handler);
} else {
wfree(handler);
}
}
W_FlushASAPNotificationQueue();
}
/*
* This functions will handle input events on all registered file descriptors.
* Input:
* - waitForInput - True if we want the function to wait until an event
* appears on a file descriptor we watch, False if we
* want the function to immediately return if there is
* no data available on the file descriptors we watch.
* - inputfd - Extra input file descriptor to watch for input.
* This is only used when called from wevent.c to watch
* on ConnectionNumber(dpy) to avoid blocking of X events
* if we wait for input from other file handlers.
* Output:
* if waitForInput is False, the function will return False if there are no
* input handlers registered, or if there is no data
* available on the registered ones, and will return True
* if there is at least one input handler that has data
* available.
* if waitForInput is True, the function will return False if there are no
* input handlers registered, else it will block until an
* event appears on one of the file descriptors it watches
* and then it will return True.
*
* If the retured value is True, the input handlers for the corresponding file
* descriptors are also called.
*
* Parametersshould be passed like this:
* - from wevent.c:
* waitForInput - apropriate value passed by the function who called us
* inputfd = ConnectionNumber(dpy)
* - from wutil.c:
* waitForInput - apropriate value passed by the function who called us
* inputfd = -1
*
*/
Bool W_HandleInputEvents(Bool waitForInput, int inputfd)
{
#if defined(HAVE_POLL) && defined(HAVE_POLL_H) && !defined(HAVE_SELECT)
struct poll fd *fds;
InputHandler *handler;
int count, timeout, nfds, i, extrafd;
extrafd = (inputfd < 0) ? 0 : 1;
if (inputHandler)
nfds = WMGetArrayItemCount(inputHandler);
else
nfds = 0;
if (!extrafd && nfds == 0) {
W_FlushASAPNotificationQueue();
return False;
}
fds = wmalloc((nfds + extrafd) * sizeof(struct pollfd));
if (extrafd) {
/* put this to the end of array to avoid using ranges from 1 to nfds+1 */
fds[nfds].fd = inputfd;
fds[nfds].events = POLLIN;
}
/* use WM_ITERATE_ARRAY() here */
for (i = 0; i < nfds; i++) {
handler = WMGetFromArray(inputHandler, i);
fds[i].fd = handler->fd;
fds[i].events = 0;
if (handler->mask & WIReadMask)
fds[i].events |= POLLIN;
if (handler->mask & WIWriteMask)
fds[i].events |= POLLOUT;
#if 0 /* FIXME */
if (handler->mask & WIExceptMask)
FD_SET(handler->fd, &eset);
#endif
}
/*
* Setup the timeout to the estimated time until the
* next timer expires.
*/
if (!waitForInput) {
timeout = 0;
} else if (timerPending()) {
struct timeval tv;
delayUntilNextTimerEvent(&tv);
timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
} else {
timeout = -1;
}
count = poll(fds, nfds + extrafd, timeout);
if (count > 0 && nfds > 0) {
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
int mask;
/* use WM_ITERATE_ARRAY() here */
for (i = 0; i < nfds; i++) {
handler = WMGetFromArray(handlerCopy, i);
/* check if the handler still exist or was removed by a callback */
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
continue;
mask = 0;
if ((handler->mask & WIReadMask) &&
(fds[i].revents & (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI)))
mask |= WIReadMask;
if ((handler->mask & WIWriteMask) && (fds[i].revents & (POLLOUT | POLLWRBAND)))
mask |= WIWriteMask;
if ((handler->mask & WIExceptMask) && (fds[i].revents & (POLLHUP | POLLNVAL | POLLERR)))
mask |= WIExceptMask;
if (mask != 0 && handler->callback) {
(*handler->callback) (handler->fd, mask, handler->clientData);
}
}
WMFreeArray(handlerCopy);
}
wfree(fds);
W_FlushASAPNotificationQueue();
return (count > 0);
#else
#ifdef HAVE_SELECT
struct timeval timeout;
struct timeval *timeoutPtr;
fd_set rset, wset, eset;
int maxfd, nfds, i;
int count;
InputHandler *handler;
if (inputHandler)
nfds = WMGetArrayItemCount(inputHandler);
else
nfds = 0;
if (inputfd < 0 && nfds == 0) {
W_FlushASAPNotificationQueue();
return False;
}
FD_ZERO(&rset);
FD_ZERO(&wset);
FD_ZERO(&eset);
if (inputfd < 0) {
maxfd = 0;
} else {
FD_SET(inputfd, &rset);
maxfd = inputfd;
}
/* use WM_ITERATE_ARRAY() here */
for (i = 0; i < nfds; i++) {
handler = WMGetFromArray(inputHandler, i);
if (handler->mask & WIReadMask)
FD_SET(handler->fd, &rset);
if (handler->mask & WIWriteMask)
FD_SET(handler->fd, &wset);
if (handler->mask & WIExceptMask)
FD_SET(handler->fd, &eset);
if (maxfd < handler->fd)
maxfd = handler->fd;
}
/*
* Setup the timeout to the estimated time until the
* next timer expires.
*/
if (!waitForInput) {
SET_ZERO(timeout);
timeoutPtr = &timeout;
} else if (timerPending()) {
delayUntilNextTimerEvent(&timeout);
timeoutPtr = &timeout;
} else {
timeoutPtr = (struct timeval *)0;
}
count = select(1 + maxfd, &rset, &wset, &eset, timeoutPtr);
if (count > 0 && nfds > 0) {
WMArray *handlerCopy = WMDuplicateArray(inputHandler);
int mask;
/* use WM_ITERATE_ARRAY() here */
for (i = 0; i < nfds; i++) {
handler = WMGetFromArray(handlerCopy, i);
/* check if the handler still exist or was removed by a callback */
if (WMGetFirstInArray(inputHandler, handler) == WANotFound)
continue;
mask = 0;
if ((handler->mask & WIReadMask) && FD_ISSET(handler->fd, &rset))
mask |= WIReadMask;
if ((handler->mask & WIWriteMask) && FD_ISSET(handler->fd, &wset))
mask |= WIWriteMask;
if ((handler->mask & WIExceptMask) && FD_ISSET(handler->fd, &eset))
mask |= WIExceptMask;
if (mask != 0 && handler->callback) {
(*handler->callback) (handler->fd, mask, handler->clientData);
}
}
WMFreeArray(handlerCopy);
}
W_FlushASAPNotificationQueue();
return (count > 0);
#else /* not HAVE_SELECT, not HAVE_POLL */
# error Neither select nor poll. You lose.
#endif /* HAVE_SELECT */
#endif /* HAVE_POLL */
}

View File

@@ -1,4 +1,5 @@
#include <sys/types.h> #include <sys/types.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@@ -6,21 +7,27 @@
#include "WUtil.h" #include "WUtil.h"
#define INITIAL_CAPACITY 23 #define INITIAL_CAPACITY 23
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define INLINE inline # define INLINE inline
#else #else
# define INLINE # define INLINE
#endif #endif
typedef struct HashItem { typedef struct HashItem {
const void *key; void *key;
const void *data; void *data;
struct HashItem *next; /* collided item list */ struct HashItem *next; /* collided item list */
} HashItem; } HashItem;
typedef struct W_HashTable { typedef struct W_HashTable {
WMHashTableCallbacks callbacks; WMHashTableCallbacks callbacks;
@@ -30,6 +37,9 @@ typedef struct W_HashTable {
HashItem **table; HashItem **table;
} HashTable; } HashTable;
#define HASH(table, key) (((table)->callbacks.hash ? \ #define HASH(table, key) (((table)->callbacks.hash ? \
(*(table)->callbacks.hash)(key) : hashPtr(key)) % (table)->size) (*(table)->callbacks.hash)(key) : hashPtr(key)) % (table)->size)
@@ -39,7 +49,11 @@ typedef struct W_HashTable {
#define RELKEY(table, key) if ((table)->callbacks.releaseKey) \ #define RELKEY(table, key) if ((table)->callbacks.releaseKey) \
(*(table)->callbacks.releaseKey)(key) (*(table)->callbacks.releaseKey)(key)
static INLINE unsigned hashString(const char *key)
static INLINE unsigned
hashString(const char *key)
{ {
unsigned ret = 0; unsigned ret = 0;
unsigned ctr = 0; unsigned ctr = 0;
@@ -52,12 +66,19 @@ static INLINE unsigned hashString(const char *key)
return ret; return ret;
} }
static INLINE unsigned hashPtr(const void *key)
static INLINE unsigned
hashPtr(const void *key)
{ {
return ((size_t)key / sizeof(char*)); return ((size_t)key / sizeof(char*));
} }
static void rellocateItem(WMHashTable * table, HashItem * item)
static void
rellocateItem(WMHashTable *table, HashItem *item)
{ {
unsigned h; unsigned h;
@@ -67,7 +88,9 @@ static void rellocateItem(WMHashTable * table, HashItem * item)
table->table[h] = item; table->table[h] = item;
} }
static void rebuildTable(WMHashTable * table)
static void
rebuildTable(WMHashTable *table)
{ {
HashItem *next; HashItem *next;
HashItem **oldArray; HashItem **oldArray;
@@ -81,6 +104,7 @@ static void rebuildTable(WMHashTable * table)
newSize = table->size*2; newSize = table->size*2;
table->table = wmalloc(sizeof(char*)*newSize); table->table = wmalloc(sizeof(char*)*newSize);
memset(table->table, 0, sizeof(char*)*newSize);
table->size = newSize; table->size = newSize;
for (i = 0; i < oldSize; i++) { for (i = 0; i < oldSize; i++) {
@@ -90,10 +114,13 @@ static void rebuildTable(WMHashTable * table)
oldArray[i] = next; oldArray[i] = next;
} }
} }
wfree(oldArray); free(oldArray);
} }
WMHashTable *WMCreateHashTable(WMHashTableCallbacks callbacks)
WMHashTable*
WMCreateHashTable(WMHashTableCallbacks callbacks)
{ {
HashTable *table; HashTable *table;
@@ -110,7 +137,9 @@ WMHashTable *WMCreateHashTable(WMHashTableCallbacks callbacks)
return table; return table;
} }
void WMResetHashTable(WMHashTable * table)
void
WMResetHashTable(WMHashTable *table)
{ {
HashItem *item, *tmp; HashItem *item, *tmp;
int i; int i;
@@ -119,8 +148,8 @@ void WMResetHashTable(WMHashTable * table)
item = table->table[i]; item = table->table[i];
while (item) { while (item) {
tmp = item->next; tmp = item->next;
RELKEY(table, item->key); RELKEY(table, item);
wfree(item); free(item);
item = tmp; item = tmp;
} }
} }
@@ -128,14 +157,16 @@ void WMResetHashTable(WMHashTable * table)
table->itemCount = 0; table->itemCount = 0;
if (table->size > INITIAL_CAPACITY) { if (table->size > INITIAL_CAPACITY) {
wfree(table->table); free(table->table);
table->size = INITIAL_CAPACITY; table->size = INITIAL_CAPACITY;
table->table = wmalloc(sizeof(HashItem*)*table->size); table->table = wmalloc(sizeof(HashItem*)*table->size);
} }
memset(table->table, 0, sizeof(HashItem*)*table->size); memset(table->table, 0, sizeof(HashItem*)*table->size);
} }
void WMFreeHashTable(WMHashTable * table)
void
WMFreeHashTable(WMHashTable *table)
{ {
HashItem *item, *tmp; HashItem *item, *tmp;
int i; int i;
@@ -144,21 +175,19 @@ void WMFreeHashTable(WMHashTable * table)
item = table->table[i]; item = table->table[i];
while (item) { while (item) {
tmp = item->next; tmp = item->next;
RELKEY(table, item->key); RELKEY(table, item);
wfree(item); free(item);
item = tmp; item = tmp;
} }
} }
wfree(table->table); free(table->table);
wfree(table); free(table);
} }
unsigned WMCountHashTable(WMHashTable * table)
{
return table->itemCount;
}
void *WMHashGet(WMHashTable * table, const void *key)
void*
WMHashGet(WMHashTable *table, const void *key)
{ {
unsigned h; unsigned h;
HashItem *item; HashItem *item;
@@ -182,46 +211,15 @@ void *WMHashGet(WMHashTable * table, const void *key)
} }
} }
if (item) if (item)
return (void *)item->data; return item->data;
else else
return NULL; return NULL;
} }
Bool WMHashGetItemAndKey(WMHashTable * table, const void *key, void **retItem, void **retKey)
{
unsigned h;
HashItem *item;
h = HASH(table, key);
item = table->table[h];
if (table->callbacks.keyIsEqual) { void*
while (item) { WMHashInsert(WMHashTable *table, void *key, void *data)
if ((*table->callbacks.keyIsEqual) (key, item->key)) {
break;
}
item = item->next;
}
} else {
while (item) {
if (key == item->key) {
break;
}
item = item->next;
}
}
if (item) {
if (retKey)
*retKey = (void *)item->key;
if (retItem)
*retItem = (void *)item->data;
return True;
} else {
return False;
}
}
void *WMHashInsert(WMHashTable * table, const void *key, const void *data)
{ {
unsigned h; unsigned h;
HashItem *item; HashItem *item;
@@ -249,14 +247,14 @@ void *WMHashInsert(WMHashTable * table, const void *key, const void *data)
} }
if (replacing) { if (replacing) {
const void *old; void *old;
old = item->data; old = item->data;
item->data = data; item->data = data;
RELKEY(table, item->key); RELKEY(table, item->key);
item->key = DUPKEY(table, key); item->key = DUPKEY(table, key);
return (void *)old; return old;
} else { } else {
HashItem *nitem; HashItem *nitem;
@@ -283,19 +281,22 @@ void *WMHashInsert(WMHashTable * table, const void *key, const void *data)
return NULL; return NULL;
} }
static HashItem *deleteFromList(HashTable * table, HashItem * item, const void *key)
static HashItem*
deleteFromList(HashTable *table, HashItem *item, const void *key)
{ {
HashItem *next; HashItem *next;
if (item==NULL) if (item==NULL)
return NULL; return NULL;
if ((table->callbacks.keyIsEqual && (*table->callbacks.keyIsEqual) (key, item->key)) if ((table->callbacks.keyIsEqual
&& (*table->callbacks.keyIsEqual)(key, item->key))
|| (!table->callbacks.keyIsEqual && key==item->key)) { || (!table->callbacks.keyIsEqual && key==item->key)) {
next = item->next; next = item->next;
RELKEY(table, item->key); RELKEY(table, item->key);
wfree(item); free(item);
table->itemCount--; table->itemCount--;
@@ -307,7 +308,9 @@ static HashItem *deleteFromList(HashTable * table, HashItem * item, const void *
return item; return item;
} }
void WMHashRemove(WMHashTable * table, const void *key)
void
WMHashRemove(WMHashTable *table, const void *key)
{ {
unsigned h; unsigned h;
@@ -316,7 +319,9 @@ void WMHashRemove(WMHashTable * table, const void *key)
table->table[h] = deleteFromList(table, table->table[h], key); table->table[h] = deleteFromList(table, table->table[h], key);
} }
WMHashEnumerator WMEnumerateHashTable(WMHashTable * table)
WMHashEnumerator
WMEnumerateHashTable(WMHashTable *table)
{ {
WMHashEnumerator enumerator; WMHashEnumerator enumerator;
@@ -327,9 +332,12 @@ WMHashEnumerator WMEnumerateHashTable(WMHashTable * table)
return enumerator; return enumerator;
} }
void *WMNextHashEnumeratorItem(WMHashEnumerator * enumerator)
void*
WMNextHashEnumeratorItem(WMHashEnumerator *enumerator)
{ {
const void *data = NULL; void *data = NULL;
/* this assumes the table doesn't change between /* this assumes the table doesn't change between
* WMEnumerateHashTable() and WMNextHashEnumeratorItem() calls */ * WMEnumerateHashTable() and WMNextHashEnumeratorItem() calls */
@@ -349,72 +357,30 @@ void *WMNextHashEnumeratorItem(WMHashEnumerator * enumerator)
enumerator->nextItem = ((HashItem*)enumerator->nextItem)->next; enumerator->nextItem = ((HashItem*)enumerator->nextItem)->next;
} }
return (void *)data; return data;
} }
void *WMNextHashEnumeratorKey(WMHashEnumerator * enumerator)
unsigned
WMCountHashTable(WMHashTable *table)
{ {
const void *key = NULL; return table->itemCount;
/* this assumes the table doesn't change between
* WMEnumerateHashTable() and WMNextHashEnumeratorKey() calls */
if (enumerator->nextItem == NULL) {
HashTable *table = enumerator->table;
while (++enumerator->index < table->size) {
if (table->table[enumerator->index] != NULL) {
enumerator->nextItem = table->table[enumerator->index];
break;
}
}
} }
if (enumerator->nextItem) {
key = ((HashItem *) enumerator->nextItem)->key;
enumerator->nextItem = ((HashItem *) enumerator->nextItem)->next;
}
return (void *)key; static Bool
} compareStrings(const char *key1, const char *key2)
Bool WMNextHashEnumeratorItemAndKey(WMHashEnumerator * enumerator, void **item, void **key)
{
/* this assumes the table doesn't change between
* WMEnumerateHashTable() and WMNextHashEnumeratorItemAndKey() calls */
if (enumerator->nextItem == NULL) {
HashTable *table = enumerator->table;
while (++enumerator->index < table->size) {
if (table->table[enumerator->index] != NULL) {
enumerator->nextItem = table->table[enumerator->index];
break;
}
}
}
if (enumerator->nextItem) {
if (item)
*item = (void *)((HashItem *) enumerator->nextItem)->data;
if (key)
*key = (void *)((HashItem *) enumerator->nextItem)->key;
enumerator->nextItem = ((HashItem *) enumerator->nextItem)->next;
return True;
}
return False;
}
static Bool compareStrings(const char *key1, const char *key2)
{ {
return strcmp(key1, key2)==0; return strcmp(key1, key2)==0;
} }
typedef unsigned (*hashFunc)(const void*); typedef unsigned (*hashFunc)(const void*);
typedef Bool (*isEqualFunc)(const void*, const void*); typedef Bool (*isEqualFunc)(const void*, const void*);
typedef void* (*retainFunc)(const void*); typedef void* (*retainFunc)(const void*);
typedef void (*releaseFunc)(const void*); typedef void (*releaseFunc)(const void*);
const WMHashTableCallbacks WMIntHashCallbacks = { const WMHashTableCallbacks WMIntHashCallbacks = {
NULL, NULL,
NULL, NULL,
@@ -426,12 +392,15 @@ const WMHashTableCallbacks WMStringHashCallbacks = {
(hashFunc)hashString, (hashFunc)hashString,
(isEqualFunc)compareStrings, (isEqualFunc)compareStrings,
(retainFunc)wstrdup, (retainFunc)wstrdup,
(releaseFunc) wfree (releaseFunc)free
}; };
const WMHashTableCallbacks WMStringPointerHashCallbacks = { const WMHashTableCallbacks WMStringPointerHashCallbacks = {
(hashFunc)hashString, (hashFunc)hashString,
(isEqualFunc)compareStrings, (isEqualFunc)compareStrings,
NULL, NULL,
NULL NULL
}; };

12
WINGs/international.c Normal file
View File

@@ -0,0 +1,12 @@
#include <X11/Xlib.h>
#include "WINGsP.h"
void
InitI18n(Display *dpy)
{
}

View File

@@ -1,53 +0,0 @@
#!/usr/bin/python
import sys
import re
from optparse import OptionParser
parser = OptionParser(version="%prog 1.0")
parser.add_option("-f", "--file", dest="rgbtxtFile", default='/etc/X11/rgb.txt',
help="rgb.txt file containing X11 colors (/etc/X11/rgb.txt)",
metavar="File")
(options, args) = parser.parse_args()
f = open(options.rgbtxtFile)
lines = f.readlines()
f.close()
colorLine = re.compile(r'''\s*
(?P<red>\d+) # red
\s+
(?P<green>\d+) # green
\s+
(?P<blue>\d+) # blue
\s+
(?P<name>[^\s]+) # name
''', re.VERBOSE)
print '''
/* Automatically generated file. Do NOT edit. Regenerate it using make-rgb */
#ifndef RGB_H_
#define RGB_H_
#include <wraster.h>
typedef struct RGBColor {
RColor color;
char *name;
} RGBColor;
RGBColor rgbColors[] = {'''
for line in lines:
m = colorLine.match(line)
if m:
print ''' {{%(red)3s, %(green)3s, %(blue)3s, 0}, "%(name)s"},''' % m.groupdict()
print ''' {{ 0, 0, 0, 0}, NULL}
};
#endif
'''

View File

@@ -1,7 +1,7 @@
/* /*
* WindowMaker miscelaneous function library * WindowMaker miscelaneous function library
* *
* Copyright (c) 1997-2003 Alfredo K. Kojima * Copyright (c) 1997 Alfredo K. Kojima
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include "wconfig.h"
#include "../src/config.h"
#include "WUtil.h" #include "WUtil.h"
#include <stdlib.h> #include <stdlib.h>
@@ -27,14 +29,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <signal.h>
#ifdef USE_BOEHM_GC
#ifndef GC_DEBUG
#define GC_DEBUG
#endif /* !GC_DEBUG */
#include <gc/gc.h>
#endif /* USE_BOEHM_GC */
#ifndef False #ifndef False
# define False 0 # define False 0
@@ -43,53 +37,26 @@
# define True 1 # define True 1
#endif #endif
static void defaultHandler(int bla) extern void wAbort(int);
{
if (bla)
kill(getpid(), SIGABRT);
else
exit(1);
}
static waborthandler *aborthandler = (waborthandler *) defaultHandler;
#define wAbort(a) (*aborthandler)(a)
waborthandler *wsetabort(waborthandler * handler)
{
waborthandler *old = aborthandler;
aborthandler = handler;
return old;
}
static int Aborting=0; /* if we're in the middle of an emergency exit */ static int Aborting=0; /* if we're in the middle of an emergency exit */
static WMHashTable *table = NULL; static WMHashTable *table = NULL;
void *wmalloc(size_t size) void *wmalloc(size_t size)
{ {
void *tmp; void *tmp;
assert(size > 0);
#ifdef USE_BOEHM_GC
tmp = GC_MALLOC(size);
#else
tmp = malloc(size); tmp = malloc(size);
#endif
if (tmp == NULL) { if (tmp == NULL) {
wwarning("malloc() failed. Retrying after 2s."); wwarning("malloc() failed. Retrying after 2s.");
sleep(2); sleep(2);
#ifdef USE_BOEHM_GC
tmp = GC_MALLOC(size);
#else
tmp = malloc(size); tmp = malloc(size);
#endif
if (tmp == NULL) { if (tmp == NULL) {
if (Aborting) { if (Aborting) {
fputs("Really Bad Error: recursive malloc() failure.", stderr); puts("Real Bad Error: recursive malloc() failure.");
exit(-1); exit(-1);
} else { } else {
wfatal("virtual memory exhausted"); wfatal("virtual memory exhausted");
@@ -98,49 +65,29 @@ void *wmalloc(size_t size)
} }
} }
} }
memset(tmp, 0, size);
return tmp; return tmp;
} }
void *wrealloc(void *ptr, size_t newsize) void *wrealloc(void *ptr, size_t newsize)
{ {
void *nptr; void *nptr;
if (!ptr) { if (!ptr) {
nptr = wmalloc(newsize); nptr = malloc(newsize);
} else if (newsize == 0) {
wfree(ptr);
nptr = NULL;
} else { } else {
#ifdef USE_BOEHM_GC
nptr = GC_REALLOC(ptr, newsize);
#else
nptr=realloc(ptr, newsize); nptr=realloc(ptr, newsize);
#endif }
if (nptr==NULL) { if (nptr==NULL) {
wwarning("realloc() failed. Retrying after 2s."); printf("Could not do realloc");
sleep(2); return NULL;
#ifdef USE_BOEHM_GC
nptr = GC_REALLOC(ptr, newsize);
#else
nptr = realloc(ptr, newsize);
#endif
if (nptr == NULL) {
if (Aborting) {
fputs("Really Bad Error: recursive realloc() failure.", stderr);
exit(-1);
} else {
wfatal("virtual memory exhausted");
Aborting = 1;
wAbort(False);
}
}
}
} }
return nptr; return nptr;
} }
void *wretain(void *ptr)
void*
wretain(void *ptr)
{ {
int *refcount; int *refcount;
@@ -166,28 +113,9 @@ void *wretain(void *ptr)
return ptr; return ptr;
} }
void wfree(void *ptr)
{
if (ptr)
#ifdef USE_BOEHM_GC
/* This should eventually be removed, once the criss-cross
* of wmalloc()d memory being free()d, malloc()d memory being
* wfree()d, various misuses of calling wfree() on objects
* allocated by libc malloc() and calling libc free() on
* objects allocated by Boehm GC (think external libraries)
* is cleaned up.
*/
if (GC_base(ptr) != 0)
GC_FREE(ptr);
else
free(ptr);
#else
free(ptr);
#endif
ptr = NULL;
}
void wrelease(void *ptr) void
wrelease(void *ptr)
{ {
int *refcount; int *refcount;
@@ -201,8 +129,8 @@ void wrelease(void *ptr)
printf("RELEASING %p\n", ptr); printf("RELEASING %p\n", ptr);
#endif #endif
WMHashRemove(table, ptr); WMHashRemove(table, ptr);
wfree(refcount); free(refcount);
wfree(ptr); free(ptr);
} }
#ifdef VERBOSE #ifdef VERBOSE
else { else {
@@ -211,3 +139,31 @@ void wrelease(void *ptr)
#endif #endif
} }
} }
char*
wstrdup(char *str)
{
assert(str!=NULL);
return strcpy(wmalloc(strlen(str)+1), str);
}
char*
wstrappend(char *dst, char *src)
{
char *str;
if (!dst)
return wstrdup(src);
else if (!src)
return wstrdup(dst);
str = wmalloc(strlen(dst)+strlen(src)+1);
strcpy(str, dst);
strcat(str, src);
return str;
}

View File

@@ -1,14 +0,0 @@
/* Miscelaneous helper functions */
#include "WINGsP.h"
WMRange wmkrange(int start, int count)
{
WMRange range;
range.position = start;
range.count = count;
return range;
}

221
WINGs/mywidget.c Normal file
View File

@@ -0,0 +1,221 @@
/*
* Demo user widget for WINGs.
*
*
* Copyright (c) 1998 Alfredo K. Kojima
*/
/*
*
* Include the WINGs private data header.
*
*
*/
#include "WINGsP.h"
/*
* Our public header.
*/
#include "mywidget.h"
/*
* Define the widget "class"
*/
typedef struct W_MyWidget {
/* these two fields must be present in all your widgets in this
* exact position */
W_Class widgetClass;
WMView *view;
/* put your stuff here */
char *text;
} _MyWidget;
/* some forward declarations */
static void destroyMyWidget(_MyWidget *mPtr);
static void paintMyWidget(_MyWidget *mPtr);
static void handleEvents(XEvent *event, void *data);
static void handleActionEvents(XEvent *event, void *data);
/*
* Some procedures you might want to override. Don't forget to call
* the equivalent view procedure after (or before) doing your stuff.
* See the source for the other widgets to see how to use.
* You won't need to use this most of the time.
*/
static W_ViewProcedureTable _MyWidgetViewProcedures = {
NULL,
NULL,
NULL
};
/* our widget class ID */
static W_Class myWidgetClass = 0;
/*
* Initializer for our widget. Must be called before creating any
* instances of the widget.
*/
W_Class
InitMyWidget(WMScreen *scr)
{
/* register our widget with WINGs and get our widget class ID */
if (!myWidgetClass) {
myWidgetClass = W_RegisterUserWidget(&_MyWidgetViewProcedures);
}
return myWidgetClass;
}
/*
* Our widget fabrication plant.
*/
MyWidget*
CreateMyWidget(WMWidget *parent)
{
MyWidget *mPtr;
/* allocate some storage for our new widget instance */
mPtr = wmalloc(sizeof(MyWidget));
/* initialize it */
memset(mPtr, 0, sizeof(MyWidget));
/* set the class ID */
mPtr->widgetClass = myWidgetClass;
/*
* Create the view for our widget.
* Note: the Window for the view is only created after the view is
* realized with W_RealizeView()
*
* Consider the returned view as read-only.
*/
mPtr->view = W_CreateView(W_VIEW(parent));
if (!mPtr->view) {
free(mPtr);
return NULL;
}
/* always do this */
mPtr->view->self = mPtr;
/*
* Intercept some events for our widget, so that we can handle them.
*/
WMCreateEventHandler(mPtr->view, ExposureMask /* this allows us to know when we should paint */
|StructureNotifyMask, /* this allows us to know things like when we are destroyed */
handleEvents, mPtr);
/*
* Intercept some other events. This could be merged with the above
* call, but we separate for more organization.
*/
WMCreateEventHandler(mPtr->view, ButtonPressMask,handleActionEvents, mPtr);
return mPtr;
}
/*
* Paint our widget contents.
*/
static void
paintMyWidget(_MyWidget *mPtr)
{
W_Screen *scr = mPtr->view->screen;
WMColor *color;
if (mPtr->text) {
color = WMWhiteColor(scr);
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
mPtr->view->size.width, WACenter, W_GC(color),
False, mPtr->text, strlen(mPtr->text));
WMReleaseColor(color);
}
}
static void
handleEvents(XEvent *event, void *data)
{
_MyWidget *mPtr = (_MyWidget*)data;
switch (event->type) {
case Expose:
if (event->xexpose.count!=0)
break;
paintMyWidget(mPtr);
break;
case DestroyNotify:
destroyMyWidget(mPtr);
break;
}
}
static void
handleActionEvents(XEvent *event, void *data)
{
_MyWidget *mPtr = (_MyWidget*)data;
switch (event->type) {
case ButtonPress:
XBell(mPtr->view->screen->display, 100);
XBell(mPtr->view->screen->display, 100);
break;
}
}
void
SetMyWidgetText(MyWidget *mPtr, char *text)
{
CHECK_CLASS(mPtr, myWidgetClass);
if (mPtr->text)
free(mPtr->text);
mPtr->text = wstrdup(text);
if (W_VIEW_MAPPED(mPtr->view)) {
paintMyWidget(mPtr);
}
}
static void
destroyMyWidget(_MyWidget *mPtr)
{
/*
* Free all data we allocated for our widget.
*/
if (mPtr->text)
free(mPtr->text);
free(mPtr);
}

View File

@@ -1,6 +1,6 @@
/* /*
* Header for demo widget. * Header foy demo widget.
* *
*/ */

View File

@@ -6,66 +6,81 @@
#include "WUtil.h" #include "WUtil.h"
typedef struct W_Notification { typedef struct W_Notification {
const char *name; char *name;
void *object; void *object;
void *clientData; void *clientData;
int refCount; int refCount;
} Notification; } Notification;
extern void W_FlushASAPNotificationQueue();
const char *WMGetNotificationName(WMNotification * notification)
char*
WMGetNotificationName(WMNotification *notification)
{ {
return notification->name; return notification->name;
} }
void *WMGetNotificationObject(WMNotification * notification)
void*
WMGetNotificationObject(WMNotification *notification)
{ {
return notification->object; return notification->object;
} }
void *WMGetNotificationClientData(WMNotification * notification)
void*
WMGetNotificationClientData(WMNotification *notification)
{ {
return notification->clientData; return notification->clientData;
} }
WMNotification *WMCreateNotification(const char *name, void *object, void *clientData)
WMNotification*
WMCreateNotification(char *name, void *object, void *clientData)
{ {
Notification *nPtr; Notification *nPtr;
nPtr = wmalloc(sizeof(Notification)); nPtr = wmalloc(sizeof(Notification));
nPtr->name = name; nPtr->name = name;
nPtr->object = object; nPtr->object = object;
nPtr->clientData = clientData; nPtr->clientData = clientData;
nPtr->refCount = 1; nPtr->refCount = 1;
return nPtr; return nPtr;
} }
void WMReleaseNotification(WMNotification * notification)
void
WMReleaseNotification(WMNotification *notification)
{ {
notification->refCount--; notification->refCount--;
if (notification->refCount < 1) { if (notification->refCount < 1) {
wfree(notification); free(notification);
} }
} }
WMNotification *WMRetainNotification(WMNotification * notification)
WMNotification*
WMRetainNotification(WMNotification *notification)
{ {
notification->refCount++; notification->refCount++;
return notification; return notification;
} }
/***************** Notification Center *****************/ /***************** Notification Center *****************/
typedef struct NotificationObserver { typedef struct NotificationObserver {
WMNotificationObserverAction *observerAction; WMNotificationObserverAction *observerAction;
void *observer; void *observer;
const char *name; char *name;
void *object; void *object;
struct NotificationObserver *prev; /* for tables */ struct NotificationObserver *prev; /* for tables */
@@ -73,6 +88,7 @@ typedef struct NotificationObserver {
struct NotificationObserver *nextAction; /* for observerTable */ struct NotificationObserver *nextAction; /* for observerTable */
} NotificationObserver; } NotificationObserver;
typedef struct W_NotificationCenter { typedef struct W_NotificationCenter {
WMHashTable *nameTable; /* names -> observer lists */ WMHashTable *nameTable; /* names -> observer lists */
WMHashTable *objectTable; /* object -> observer lists */ WMHashTable *objectTable; /* object -> observer lists */
@@ -81,21 +97,27 @@ typedef struct W_NotificationCenter {
WMHashTable *observerTable; /* observer -> NotificationObserver */ WMHashTable *observerTable; /* observer -> NotificationObserver */
} NotificationCenter; } NotificationCenter;
/* default (and only) center */ /* default (and only) center */
static NotificationCenter *notificationCenter = NULL; static NotificationCenter *notificationCenter = NULL;
void W_InitNotificationCenter(void)
void
W_InitNotificationCenter(void)
{ {
notificationCenter = wmalloc(sizeof(NotificationCenter)); notificationCenter = wmalloc(sizeof(NotificationCenter));
notificationCenter->nameTable = WMCreateHashTable(WMStringPointerHashCallbacks); notificationCenter->nameTable = WMCreateHashTable(WMStringPointerHashCallbacks);
notificationCenter->objectTable = WMCreateHashTable(WMIntHashCallbacks); notificationCenter->objectTable = WMCreateHashTable(WMIntHashCallbacks);
notificationCenter->nilList = NULL; notificationCenter->nilList = NULL;
notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks); notificationCenter->observerTable = WMCreateHashTable(WMIntHashCallbacks);
} }
void void
WMAddNotificationObserver(WMNotificationObserverAction *observerAction, WMAddNotificationObserver(WMNotificationObserverAction *observerAction,
void *observer, const char *name, void *object) void *observer, char *name, void *object)
{ {
NotificationObserver *oRec, *rec; NotificationObserver *oRec, *rec;
@@ -107,8 +129,9 @@ WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
oRec->next = NULL; oRec->next = NULL;
oRec->prev = NULL; oRec->prev = NULL;
/* put this action in the list of actions for this observer */ /* put this action in the list of actions for this observer */
rec = (NotificationObserver *) WMHashInsert(notificationCenter->observerTable, observer, oRec); rec = WMHashInsert(notificationCenter->observerTable, observer, oRec);
if (rec) { if (rec) {
/* if this is not the first action for the observer */ /* if this is not the first action for the observer */
@@ -126,14 +149,14 @@ WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
notificationCenter->nilList = oRec; notificationCenter->nilList = oRec;
} else if (!name) { } else if (!name) {
/* any message coming from object */ /* any message coming from object */
rec = (NotificationObserver *) WMHashInsert(notificationCenter->objectTable, object, oRec); rec = WMHashInsert(notificationCenter->objectTable, object, oRec);
oRec->next = rec; oRec->next = rec;
if (rec) { if (rec) {
rec->prev = oRec; rec->prev = oRec;
} }
} else { } else {
/* name && (object || !object) */ /* name && (object || !object) */
rec = (NotificationObserver *) WMHashInsert(notificationCenter->nameTable, name, oRec); rec = WMHashInsert(notificationCenter->nameTable, name, oRec);
oRec->next = rec; oRec->next = rec;
if (rec) { if (rec) {
rec->prev = oRec; rec->prev = oRec;
@@ -141,19 +164,21 @@ WMAddNotificationObserver(WMNotificationObserverAction * observerAction,
} }
} }
void WMPostNotification(WMNotification * notification)
void
WMPostNotification(WMNotification *notification)
{ {
NotificationObserver *orec, *tmp; NotificationObserver *orec, *tmp;
WMRetainNotification(notification); WMRetainNotification(notification);
/* tell the observers that want to know about a particular message */ /* tell the observers that want to know about a particular message */
orec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, notification->name); orec = WMHashGet(notificationCenter->nameTable, notification->name);
while (orec) { while (orec) {
tmp = orec->next; tmp = orec->next;
if (!orec->object || !notification->object || orec->object == notification->object) { if (!orec->object || orec->object == notification->object) {
/* tell the observer */ /* tell the observer */
if (orec->observerAction) { if (orec->observerAction) {
(*orec->observerAction)(orec->observer, notification); (*orec->observerAction)(orec->observer, notification);
@@ -164,7 +189,7 @@ void WMPostNotification(WMNotification * notification)
} }
/* tell the observers that want to know about an object */ /* tell the observers that want to know about an object */
orec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, notification->object); orec = WMHashGet(notificationCenter->objectTable, notification->object);
while (orec) { while (orec) {
tmp = orec->next; tmp = orec->next;
@@ -191,12 +216,17 @@ void WMPostNotification(WMNotification * notification)
WMReleaseNotification(notification); WMReleaseNotification(notification);
} }
void WMRemoveNotificationObserver(void *observer)
void
WMRemoveNotificationObserver(void *observer)
{ {
NotificationObserver *orec, *tmp, *rec; NotificationObserver *orec, *tmp, *rec;
/* get the list of actions the observer is doing */ /* get the list of actions the observer is doing */
orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer); orec = WMHashGet(notificationCenter->observerTable, observer);
/* /*
* FOREACH orec IN actionlist for observer * FOREACH orec IN actionlist for observer
@@ -214,22 +244,24 @@ void WMRemoveNotificationObserver(void *observer)
notificationCenter->nilList = orec->next; notificationCenter->nilList = orec->next;
} else if (!orec->name) { } else if (!orec->name) {
/* any message coming from object */ /* any message coming from object */
rec = (NotificationObserver *) WMHashGet(notificationCenter->objectTable, orec->object); rec = WMHashGet(notificationCenter->objectTable, orec->object);
if (rec==orec) { if (rec==orec) {
/* replace table entry */ /* replace table entry */
if (orec->next) { if (orec->next) {
WMHashInsert(notificationCenter->objectTable, orec->object, orec->next); WMHashInsert(notificationCenter->objectTable, orec->object,
orec->next);
} else { } else {
WMHashRemove(notificationCenter->objectTable, orec->object); WMHashRemove(notificationCenter->objectTable, orec->object);
} }
} }
} else { } else {
/* name && (object || !object) */ /* name && (object || !object) */
rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable, orec->name); rec = WMHashGet(notificationCenter->nameTable, orec->name);
if (rec==orec) { if (rec==orec) {
/* replace table entry */ /* replace table entry */
if (orec->next) { if (orec->next) {
WMHashInsert(notificationCenter->nameTable, orec->name, orec->next); WMHashInsert(notificationCenter->nameTable, orec->name,
orec->next);
} else { } else {
WMHashRemove(notificationCenter->nameTable, orec->name); WMHashRemove(notificationCenter->nameTable, orec->name);
} }
@@ -240,7 +272,7 @@ void WMRemoveNotificationObserver(void *observer)
if (orec->next) if (orec->next)
orec->next->prev = orec->prev; orec->next->prev = orec->prev;
wfree(orec); free(orec);
orec = tmp; orec = tmp;
} }
@@ -248,17 +280,14 @@ void WMRemoveNotificationObserver(void *observer)
WMHashRemove(notificationCenter->observerTable, observer); WMHashRemove(notificationCenter->observerTable, observer);
} }
void WMRemoveNotificationObserverWithName(void *observer, const char *name, void *object)
void
WMRemoveNotificationObserverWithName(void *observer, char *name, void *object)
{ {
NotificationObserver *orec, *tmp, *rec; NotificationObserver *orec, *tmp, *rec;
NotificationObserver *newList = NULL;
/* get the list of actions the observer is doing */ /* get the list of actions the observer is doing */
orec = (NotificationObserver *) WMHashGet(notificationCenter->observerTable, observer); orec = WMHashGet(notificationCenter->observerTable, observer);
WMHashRemove(notificationCenter->observerTable, observer);
/* rebuild the list of actions for the observer */
while (orec) { while (orec) {
tmp = orec->nextAction; tmp = orec->nextAction;
@@ -267,64 +296,57 @@ void WMRemoveNotificationObserverWithName(void *observer, const char *name, void
if (notificationCenter->nilList == orec) if (notificationCenter->nilList == orec)
notificationCenter->nilList = orec->next; notificationCenter->nilList = orec->next;
} else if (!name) { } else if (!name) {
rec = rec = WMHashGet(notificationCenter->objectTable, orec->object);
(NotificationObserver *) WMHashGet(notificationCenter->objectTable, if (rec==orec) {
assert(rec->prev==NULL);
/* replace table entry */
if (orec->next) {
WMHashInsert(notificationCenter->objectTable, orec->object,
orec->next);
} else {
WMHashRemove(notificationCenter->objectTable,
orec->object); orec->object);
}
}
} else {
rec = WMHashGet(notificationCenter->nameTable, orec->name);
if (rec==orec) { if (rec==orec) {
assert(rec->prev==NULL); assert(rec->prev==NULL);
/* replace table entry */ /* replace table entry */
if (orec->next) { if (orec->next) {
WMHashInsert(notificationCenter->objectTable, WMHashInsert(notificationCenter->nameTable, orec->name,
orec->object, orec->next); orec->next);
} else {
WMHashRemove(notificationCenter->objectTable, orec->object);
}
}
} else {
rec = (NotificationObserver *) WMHashGet(notificationCenter->nameTable,
orec->name);
if (rec == orec) {
assert(rec->prev == NULL);
/* replace table entry */
if (orec->next) {
WMHashInsert(notificationCenter->nameTable,
orec->name, orec->next);
} else { } else {
WMHashRemove(notificationCenter->nameTable, orec->name); WMHashRemove(notificationCenter->nameTable, orec->name);
} }
} }
} }
/* update the action list for the observer */
rec = WMHashGet(notificationCenter->observerTable, observer);
if (rec == orec) {
if (orec->nextAction) {
WMHashInsert(notificationCenter->nameTable, observer,
orec->nextAction);
} else {
WMHashRemove(notificationCenter->nameTable, observer);
}
}
if (orec->prev) if (orec->prev)
orec->prev->next = orec->next; orec->prev->next = orec->next;
if (orec->next) if (orec->next)
orec->next->prev = orec->prev; orec->next->prev = orec->prev;
wfree(orec); free(orec);
} else {
/* append this action in the new action list */
orec->nextAction = NULL;
if (!newList) {
newList = orec;
} else {
NotificationObserver *p;
p = newList;
while (p->nextAction) {
p = p->nextAction;
}
p->nextAction = orec;
}
} }
orec = tmp; orec = tmp;
} }
/* reinsert the list to the table */
if (newList) {
WMHashInsert(notificationCenter->observerTable, observer, newList);
}
} }
void WMPostNotificationName(const char *name, void *object, void *clientData)
void
WMPostNotificationName(char *name, void *object, void *clientData)
{ {
WMNotification *notification; WMNotification *notification;
@@ -335,132 +357,58 @@ void WMPostNotificationName(const char *name, void *object, void *clientData)
WMReleaseNotification(notification); WMReleaseNotification(notification);
} }
/**************** Notification Queues ****************/ /**************** Notification Queues ****************/
typedef struct W_NotificationQueue {
WMArray *asapQueue;
WMArray *idleQueue;
struct W_NotificationQueue *next; typedef struct W_NotificationQueue {
NotificationCenter *center;
void *asapQueue;
void *idleQueue;
} NotificationQueue; } NotificationQueue;
static WMNotificationQueue *notificationQueueList = NULL;
/* default queue */ /* default queue */
static WMNotificationQueue *notificationQueue = NULL; static WMNotificationQueue *notificationQueue = NULL;
WMNotificationQueue *WMGetDefaultNotificationQueue(void) WMNotificationQueue*
WMGetDefaultNotificationQueue(void)
{ {
if (!notificationQueue)
notificationQueue = WMCreateNotificationQueue();
return notificationQueue; return notificationQueue;
} }
WMNotificationQueue *WMCreateNotificationQueue(void)
WMNotificationQueue*
WMCreateNotificationQueue(void)
{ {
NotificationQueue *queue; return NULL;
queue = wmalloc(sizeof(NotificationQueue));
queue->asapQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
queue->idleQueue = WMCreateArrayWithDestructor(8, (WMFreeDataProc *) WMReleaseNotification);
queue->next = notificationQueueList;
notificationQueueList = queue;
return queue;
} }
void WMEnqueueNotification(WMNotificationQueue * queue, WMNotification * notification, WMPostingStyle postingStyle)
void
WMDequeueNotificationMatching(WMNotificationQueue *queue, unsigned mask)
{ {
WMEnqueueCoalesceNotification(queue, notification, postingStyle, WNCOnName | WNCOnSender);
} }
#define NOTIF ((WMNotification*)cdata)
#define ITEM ((WMNotification*)item)
static int matchSenderAndName(const void *item, const void *cdata) void
WMEnqueueNotification(WMNotificationQueue *queue, WMNotification *notification,
WMPostingStyle postingStyle)
{ {
return (NOTIF->object == ITEM->object && strcmp(NOTIF->name, ITEM->name) == 0);
} }
static int matchSender(const void *item, const void *cdata)
{
return (NOTIF->object == ITEM->object);
}
static int matchName(const void *item, const void *cdata)
{
return (strcmp(NOTIF->name, ITEM->name) == 0);
}
#undef NOTIF
#undef ITEM
void WMDequeueNotificationMatching(WMNotificationQueue * queue, WMNotification * notification, unsigned mask)
{
WMMatchDataProc *matchFunc;
if ((mask & WNCOnName) && (mask & WNCOnSender))
matchFunc = matchSenderAndName;
else if (mask & WNCOnName)
matchFunc = matchName;
else if (mask & WNCOnSender)
matchFunc = matchSender;
else
return;
WMRemoveFromArrayMatching(queue->asapQueue, matchFunc, notification);
WMRemoveFromArrayMatching(queue->idleQueue, matchFunc, notification);
}
void void
WMEnqueueCoalesceNotification(WMNotificationQueue *queue, WMEnqueueCoalesceNotification(WMNotificationQueue *queue,
WMNotification * notification, WMPostingStyle postingStyle, unsigned coalesceMask) WMNotification *notification,
WMPostingStyle postingStyle,
unsigned coalesceMask)
{ {
if (coalesceMask != WNCNone)
WMDequeueNotificationMatching(queue, notification, coalesceMask);
switch (postingStyle) {
case WMPostNow:
WMPostNotification(notification);
WMReleaseNotification(notification);
break;
case WMPostASAP:
WMAddToArray(queue->asapQueue, notification);
break;
case WMPostWhenIdle:
WMAddToArray(queue->idleQueue, notification);
break;
}
} }
void W_FlushASAPNotificationQueue()
{
WMNotificationQueue *queue = notificationQueueList;
while (queue) {
while (WMGetArrayItemCount(queue->asapQueue)) {
WMPostNotification(WMGetFromArray(queue->asapQueue, 0));
WMDeleteFromArray(queue->asapQueue, 0);
}
queue = queue->next;
}
}
void W_FlushIdleNotificationQueue()
{
WMNotificationQueue *queue = notificationQueueList;
while (queue) {
while (WMGetArrayItemCount(queue->idleQueue)) {
WMPostNotification(WMGetFromArray(queue->idleQueue, 0));
WMDeleteFromArray(queue->idleQueue, 0);
}
queue = queue->next;
}
}

View File

@@ -1,50 +0,0 @@
nlsdir = $(NLSDIR)
CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) WINGs.pot
EXTRA_DIST = bg.po ca.po cs.po de.po fr.po sk.po
POTFILES = \
$(top_builddir)/WINGs/error.c \
$(top_builddir)/WINGs/findfile.c \
$(top_builddir)/WINGs/proplist.c \
$(top_builddir)/WINGs/userdefaults.c \
$(top_builddir)/WINGs/wcolor.c \
$(top_builddir)/WINGs/wcolorpanel.c \
$(top_builddir)/WINGs/wfilepanel.c \
$(top_builddir)/WINGs/wfont.c \
$(top_builddir)/WINGs/wfontpanel.c \
$(top_builddir)/WINGs/widgets.c \
$(top_builddir)/WINGs/wruler.c
SUFFIXES = .po .mo
.po.mo:
msgfmt -c -o $@ $<
all-local: $(CATALOGS)
WINGs.pot: $(POTFILES)
xgettext --default-domain=WINGs \
--add-comments --keyword=_ --keyword=N_ $(POTFILES)
if cmp -s WINGs.po WINGs.pot; then \
rm -f WINGs.po; \
else \
mv -f WINGs.po WINGs.pot; \
fi
install-data-local: $(CATALOGS)
$(mkinstalldirs) $(DESTDIR)$(nlsdir)
chmod 755 $(DESTDIR)$(nlsdir)
for n in $(CATALOGS) __DuMmY ; do \
if test "$$n" -a "$$n" != "__DuMmY" ; then \
l=`basename $$n .mo`; \
$(mkinstalldirs) $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
chmod 755 $(DESTDIR)$(nlsdir)/$$l; \
chmod 755 $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES; \
$(INSTALL_DATA) -m 644 $$n $(DESTDIR)$(nlsdir)/$$l/LC_MESSAGES/WINGs.mo; \
fi; \
done

View File

@@ -1,19 +0,0 @@
Instructions for translating po files can be found in the po/README directory
in the top of the WindowMaker source tree.
All files are in UTF-8
File Language Note Current Maintainer
------------------------------------------------------------------------------
ca.po Catalan Ernest Adrogué <eadrogue@gmx.net>
cs.po Czech Jiri Hnidek <Jiri.Hnidek@vslib.cz
de.po German Guido Scholz <guido.scholz@bayernline.de>
fr.po French Emmanuel Benoit <tseeker@neptune.fr>
Antoine Hulin <antoine@origan.fdn.org>
sk.po Slovak Jan 'judas' Tomka <judas@linux.sk>
bg.po Bulgarian Anton Zinoviev <zinoviev@debian.org>
Notes
-----

View File

@@ -1,660 +0,0 @@
# Message catalog for WINGs
# Copyright (C) 2003 Free Software Foundation, Inc.
# Anton Zinoviev <zinoviev@debian.org>, 2003
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.80.0\n"
"POT-Creation-Date: 2003-02-08 21:42+0200\n"
"PO-Revision-Date: 2003-02-09 12:10+0200\n"
"Last-Translator: Anton Zinoviev <zinoviev@debian.org>\n"
"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../WINGs/connection.c:461 ../../WINGs/connection.c:526
#: ../../WINGs/connection.c:569
msgid "Bad address-service-protocol combination"
msgstr "Неправилна комбинация адрес-услуга-протокол"
#: ../../WINGs/error.c:54
#, c-format
msgid "Unknown error %d"
msgstr "Непозната грешка %d"
#: ../../WINGs/error.c:59
#, c-format
msgid "Error %d"
msgstr "Грешка %d"
#: ../../WINGs/error.c:110
msgid " warning: "
msgstr "внимание: "
#: ../../WINGs/error.c:137
msgid " fatal error: "
msgstr " критична грешка: "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: "
msgstr " грешка: "
#: ../../WINGs/findfile.c:48
#, c-format
msgid "could not get password entry for UID %i"
msgstr "не може да се получи записът за парола на потребител с номер %i"
#: ../../WINGs/findfile.c:66
#, c-format
msgid "could not get password entry for user %s"
msgstr "не може да се получи записът за парола на потребител %s<"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "Не може да се получи името на хоста"
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "синтактична грешка в %s %s, ред %i: %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr "Като ключ за достъп до proplist се поддържат само низове или данни"
#: ../../WINGs/proplist.c:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "Ползват се proplist-функции за обекти, които не са от тип WMPropLists"
#: ../../WINGs/proplist.c:630
msgid "unterminated PropList string"
msgstr "незавършен низ PropList"
#: ../../WINGs/proplist.c:670
msgid "unterminated PropList data"
msgstr "незавършени данни PropList"
#: ../../WINGs/proplist.c:678
msgid "unterminated PropList data (missing hexdigit)"
msgstr "незавършени данни PropList (липсва шестнадесетично число)"
#: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data"
msgstr "знак, който не е шестнадесетично число, в данни PropList"
#: ../../WINGs/proplist.c:729
msgid "unterminated PropList array"
msgstr "незавършен масив PropList"
#: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array"
msgstr "липсващ или незавършен масив Proplist"
#: ../../WINGs/proplist.c:747
msgid "could not get PropList array element"
msgstr "не може да се получи елемент от масив PropList"
#: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary"
msgstr "незавършен речник PropList"
#: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key"
msgstr "липсващ ключ за достъп до PropList"
#: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "липсващ ключ за достъп до PropList или незавършен речник"
#: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key"
msgstr "грешка при разбор на ключ в PropList"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "липсва знак за равенство в елемент на PropList"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr "грешка при разбор на стойност на елемент в PropList"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "липсва знак точка и запетая в елемент на PropList"
#: ../../WINGs/proplist.c:888
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr "очакваха се низ, данни, масив или речник. Ако е речник, пробвайте да го оградите с \"."
#: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Не се позволяват коментари във файлове с области, собственост на Уиндоу Мейкър"
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1628
msgid "extra data after end of property list"
msgstr "данни в повече след края на списък свойства"
#: ../../WINGs/proplist.c:1606
#, c-format
msgid "could not get size for file '%s'"
msgstr "не може да се получи размерът за файл \"%s\""
#: ../../WINGs/proplist.c:1618
#, c-format
msgid "error reading from file '%s'"
msgstr "грешка при четене от файл \"%s\""
#: ../../WINGs/proplist.c:1669
#, c-format
msgid "mkstemp (%s) failed"
msgstr "mkstemp (%s) не успя"
#: ../../WINGs/proplist.c:1680
#, c-format
msgid "mktemp (%s) failed"
msgstr "mktemp (%s) не успя"
#: ../../WINGs/proplist.c:1691
#, c-format
msgid "open (%s) failed"
msgstr "open (%s) не успя"
#: ../../WINGs/proplist.c:1698
#, c-format
msgid "writing to file: %s failed"
msgstr "записът във файл %s не успя"
#: ../../WINGs/proplist.c:1706
#, c-format
msgid "fclose (%s) failed"
msgstr "fclose (%s) не успя"
#: ../../WINGs/proplist.c:1715
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "преименуването (от \"%s\" на \"%s\") не успя"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:192 ../../WINGs/userdefaults.c:208
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "не може да се прочете областта от файл \"%s\" при синхронизиране"
#: ../../WINGs/wcolor.c:198 ../../WINGs/wcolor.c:211 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:291
#, c-format
msgid "could not allocate %s color"
msgstr "не може да се задели цвят %s"
#: ../../WINGs/wcolor.c:198
msgid "white"
msgstr "бял"
#: ../../WINGs/wcolor.c:211
msgid "black"
msgstr "черен"
#: ../../WINGs/wcolor.c:250
msgid "gray"
msgstr "сив"
#: ../../WINGs/wcolor.c:291
msgid "dark gray"
msgstr "тъмносив"
#: ../../WINGs/wcolorpanel.c:415
msgid "Colors"
msgstr "Цветове"
#: ../../WINGs/wcolorpanel.c:605 ../../WINGs/wcolorpanel.c:2824
msgid "Brightness"
msgstr "Яркост"
#: ../../WINGs/wcolorpanel.c:607 ../../WINGs/wcolorpanel.c:683
#: ../../WINGs/wcolorpanel.c:716 ../../WINGs/wcolorpanel.c:750
#: ../../WINGs/wcolorpanel.c:810 ../../WINGs/wcolorpanel.c:844
#: ../../WINGs/wcolorpanel.c:878 ../../WINGs/wcolorpanel.c:913
#: ../../WINGs/wcolorpanel.c:2164 ../../WINGs/wcolorpanel.c:2826
#: ../../WINGs/wcolorpanel.c:2862 ../../WINGs/wcolorpanel.c:2898
#: ../../WINGs/wcolorpanel.c:3746
msgid "Color Panel: Could not allocate memory"
msgstr "Color Panel: не може да се задели памет"
#: ../../WINGs/wcolorpanel.c:680 ../../WINGs/wcolorpanel.c:681
msgid "Red"
msgstr "Червен"
#: ../../WINGs/wcolorpanel.c:713 ../../WINGs/wcolorpanel.c:714
msgid "Green"
msgstr "Зелен"
#: ../../WINGs/wcolorpanel.c:747 ../../WINGs/wcolorpanel.c:748
msgid "Blue"
msgstr "Син"
#: ../../WINGs/wcolorpanel.c:807 ../../WINGs/wcolorpanel.c:808
msgid "Cyan"
msgstr "Синьозелен"
#: ../../WINGs/wcolorpanel.c:841 ../../WINGs/wcolorpanel.c:842
msgid "Magenta"
msgstr "Пурпурен"
#: ../../WINGs/wcolorpanel.c:875 ../../WINGs/wcolorpanel.c:876
msgid "Yellow"
msgstr "Жълт"
#: ../../WINGs/wcolorpanel.c:910 ../../WINGs/wcolorpanel.c:911
msgid "Black"
msgstr "Черен"
#: ../../WINGs/wcolorpanel.c:991
msgid "Spectrum"
msgstr "Спектър"
#: ../../WINGs/wcolorpanel.c:1021
msgid "Palette"
msgstr "Палитра"
#: ../../WINGs/wcolorpanel.c:1027
msgid "New from File..."
msgstr "Нова от файл..."
#: ../../WINGs/wcolorpanel.c:1028 ../../WINGs/wcolorpanel.c:1076
#: ../../WINGs/wcolorpanel.c:1093
msgid "Rename..."
msgstr "Преименувай..."
#: ../../WINGs/wcolorpanel.c:1029 ../../WINGs/wcolorpanel.c:1077
#: ../../WINGs/wcolorpanel.c:1094 ../../WINGs/wcolorpanel.c:3321
msgid "Remove"
msgstr "Премахни"
#: ../../WINGs/wcolorpanel.c:1030
msgid "Copy"
msgstr "Копирай"
#: ../../WINGs/wcolorpanel.c:1031
#, fuzzy
msgid "New from Clipboard"
msgstr "Нова от Clipboard"
#: ../../WINGs/wcolorpanel.c:1052
msgid "X11-Colors"
msgstr "Цветове от X11"
#: ../../WINGs/wcolorpanel.c:1069
msgid "Color"
msgstr "Цвят"
#: ../../WINGs/wcolorpanel.c:1075
msgid "Add..."
msgstr "Добави..."
#: ../../WINGs/wcolorpanel.c:1085
msgid "List"
msgstr "Списък"
#: ../../WINGs/wcolorpanel.c:1092
msgid "New..."
msgstr "Нов..."
#: ../../WINGs/wcolorpanel.c:1231
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr "Color Panel: Не може да се създаде директория %s, необходима за да се запазят настройките"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1237 ../../WINGs/wcolorpanel.c:3207
#: ../../WINGs/wcolorpanel.c:3211
msgid "File Error"
msgstr "Файлова грешка"
#: ../../WINGs/wcolorpanel.c:1238
msgid "Could not create ColorPanel configuration directory"
msgstr "Не може да се създаде конфигурационна директория за ColorPanel"
#: ../../WINGs/wcolorpanel.c:1239 ../../WINGs/wcolorpanel.c:3208
#: ../../WINGs/wcolorpanel.c:3213 ../../WINGs/wcolorpanel.c:3240
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:647
#: ../../WINGs/wfilepanel.c:659 ../../WINGs/wfilepanel.c:760
#: ../../WINGs/wfilepanel.c:971 ../../WINGs/wfontpanel.c:709
msgid "OK"
msgstr "Приемам"
#: ../../WINGs/wcolorpanel.c:1245 ../../WINGs/wcolorpanel.c:1281
#: ../../WINGs/wcolorpanel.c:1299
msgid "Color Panel: Could not find file"
msgstr "Color Panel: Не може да се открие файла"
#: ../../WINGs/wcolorpanel.c:1486 ../../WINGs/wcolorpanel.c:1551
#: ../../WINGs/wcolorpanel.c:1615
msgid "Color Panel: X failed request"
msgstr "Color Panel: не успя заявка към X"
#: ../../WINGs/wcolorpanel.c:2860
msgid "Saturation"
msgstr "Наситеност"
#: ../../WINGs/wcolorpanel.c:2896
msgid "Hue"
msgstr "Нюанс"
#: ../../WINGs/wcolorpanel.c:3146
msgid "Open Palette"
msgstr "Отваряне на палитра"
#: ../../WINGs/wcolorpanel.c:3208
msgid "Invalid file format !"
msgstr "Неправилен файлов формат!"
#: ../../WINGs/wcolorpanel.c:3210
#, c-format
msgid "can't remove file %s"
msgstr "не може да се изтрие файлът %s"
#: ../../WINGs/wcolorpanel.c:3212
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Не може да се изтрие файл от директорията за настройки!"
#: ../../WINGs/wcolorpanel.c:3239
msgid "Rename"
msgstr "Преименуване"
#: ../../WINGs/wcolorpanel.c:3239
msgid "Rename palette to:"
msgstr "Преименувай палитрата на "
#: ../../WINGs/wcolorpanel.c:3240 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:659 ../../WINGs/wfilepanel.c:760
msgid "Cancel"
msgstr "Отменям"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3256 ../../WINGs/wfilepanel.c:760
msgid "Warning"
msgstr "Внимание"
#: ../../WINGs/wcolorpanel.c:3257
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Такава палитра вече съществува!\n"
"\n"
"Да бъде ли заменена с новата?"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321
msgid "No"
msgstr "Не"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321
msgid "Yes"
msgstr "Да"
#: ../../WINGs/wcolorpanel.c:3289
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "Палитрата %s не може да се преименува на %s\n"
#: ../../WINGs/wcolorpanel.c:3315
msgid "This will permanently remove the palette "
msgstr "Това ще отстрани палитрата необратимо "
#: ../../WINGs/wcolorpanel.c:3318
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Убедени ли сте, че искате да отстраните тази палитра?"
#: ../../WINGs/wcolorpanel.c:3343
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "Палитрата %s не може да бъде отстранена\n"
#: ../../WINGs/wcolorpanel.c:3648
#, c-format
msgid "Could not open %s"
msgstr "Не може да бъде отворен %s"
#: ../../WINGs/wcolorpanel.c:3655
#, c-format
msgid "Could not create %s"
msgstr "Не може да бъде създаден %s"
#: ../../WINGs/wcolorpanel.c:3666
#, c-format
msgid "Write error on file %s"
msgstr "Грешка при запис във файл %s"
#: ../../WINGs/wcolorpanel.c:3711
msgid "Color Panel: Color unspecified"
msgstr "Color Panel: Не е посочен цвят"
#: ../../WINGs/wfilepanel.c:235
msgid "Name:"
msgstr "Име:"
#: ../../WINGs/wfilepanel.c:332 ../../WINGs/wfilepanel.c:396
msgid "Open"
msgstr "Отвори"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save"
msgstr "Запази"
#: ../../WINGs/wfilepanel.c:562
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: директорията %s не може да се отвори\n"
#: ../../WINGs/wfilepanel.c:580
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: не могат да се получат атрибутите (stat) за %s\n"
#: ../../WINGs/wfilepanel.c:647 ../../WINGs/wfilepanel.c:970
#: ../../WINGs/wfontpanel.c:708
msgid "Error"
msgstr "Грешка"
#: ../../WINGs/wfilepanel.c:658
msgid "Create Directory"
msgstr "Създаване на директория"
#: ../../WINGs/wfilepanel.c:659
msgid "Enter directory name"
msgstr "Въведете името на директорията"
#: ../../WINGs/wfilepanel.c:695 ../../WINGs/wfilepanel.c:734
#: ../../WINGs/wfilepanel.c:765 ../../WINGs/wfilepanel.c:793
msgid "Permission denied."
msgstr "Отказан достъп"
#: ../../WINGs/wfilepanel.c:698
#, c-format
msgid "'%s' already exists."
msgstr "вече съществува \"%s\"."
#: ../../WINGs/wfilepanel.c:701
msgid "Path does not exist."
msgstr "Пътят не съществува."
#: ../../WINGs/wfilepanel.c:731 ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' does not exist."
msgstr "Не съществува \"%s\"."
#: ../../WINGs/wfilepanel.c:738 ../../WINGs/wfilepanel.c:797
msgid "Insufficient memory available."
msgstr "Не е достъпна достатъчно памет."
#: ../../WINGs/wfilepanel.c:742 ../../WINGs/wfilepanel.c:801
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "\"%s\" се намира във файлова система с достъп само за четене."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:777
#: ../../WINGs/wfilepanel.c:804
#, c-format
msgid "Can not delete '%s'."
msgstr "\"%s\" не може да бъде изтрит."
#: ../../WINGs/wfilepanel.c:752
#, c-format
msgid "Delete directory %s ?"
msgstr "Да се изтрие ли директорията %s?"
#: ../../WINGs/wfilepanel.c:756
#, c-format
msgid "Delete file %s ?"
msgstr "Да се изтрие ли файлът %s?"
#: ../../WINGs/wfilepanel.c:768
#, c-format
msgid "Directory '%s' does not exist."
msgstr "Директорията \"%s\" не съществува."
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' is not empty."
msgstr "Директорията \"%s\" не е празна."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is busy."
msgstr "Директорията \"%s е заета."
#: ../../WINGs/wfilepanel.c:787
#, c-format
msgid "'%s' is a directory."
msgstr "\"%s\" е директория."
#: ../../WINGs/wfilepanel.c:829
#, c-format
msgid "An error occured browsing '%s'."
msgstr "Настъпи грешка при показване на \"%s\"."
#: ../../WINGs/wfilepanel.c:833
#, c-format
msgid "'%s' is not a directory."
msgstr "\"%s\" не е директория."
#: ../../WINGs/wfilepanel.c:970
msgid "File does not exist."
msgstr "Файлът не съществува."
#: ../../WINGs/wfont.c:129
#, c-format
msgid "the following character sets are missing in %s:"
msgstr "в %s липсват следните кодирания:"
#: ../../WINGs/wfont.c:136
#, c-format
msgid ""
"the string \"%s\" will be used in place of any characters from those sets."
msgstr "Вместо кой да е символ от тези кодирания ще се използва низът \"%s\"."
#: ../../WINGs/wfont.c:300 ../../WINGs/wfont.c:336
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr "не може да се зареди шрифтова комбинация %s. Опит за шрифт fixed."
#: ../../WINGs/wfont.c:306 ../../WINGs/wfont.c:342
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr "не може да се зареди шрифт %s. Опит за шрифт fixed."
#: ../../WINGs/wfont.c:310 ../../WINGs/wfont.c:346
msgid "could not load fixed font!"
msgstr "не може да се зареди шрифтът fixed!"
#: ../../WINGs/wfont.c:441
#, c-format
msgid "font description %s is too large."
msgstr "шрифтовото описание %s е твърде дълго."
#: ../../WINGs/wfontpanel.c:205
msgid "Test!!!"
msgstr "Проба!!! Test!!!"
#: ../../WINGs/wfontpanel.c:211
msgid "Family"
msgstr "Гарнитура"
#: ../../WINGs/wfontpanel.c:222
msgid "Typeface"
msgstr "Стил"
#: ../../WINGs/wfontpanel.c:233
msgid "Size"
msgstr "Размер"
#: ../../WINGs/wfontpanel.c:252
msgid "Set"
msgstr "Установи"
#: ../../WINGs/wfontpanel.c:257
msgid "Revert"
msgstr "Предишното"
#: ../../WINGs/wfontpanel.c:709
msgid "Could not retrieve font list"
msgstr "Не може да се получи списъка от шрифтове"
#: ../../WINGs/wfontpanel.c:721
#, c-format
msgid "font name %s is longer than 256, which is invalid."
msgstr "името на шрифта %s е по-дълго от 256 символа, което е недопустимо."
#: ../../WINGs/wfontpanel.c:868
msgid "Roman"
msgstr "Изправен"
#: ../../WINGs/wfontpanel.c:871
msgid "Italic"
msgstr "Курсив"
#: ../../WINGs/wfontpanel.c:873
msgid "Oblique"
msgstr "Наклонен"
#: ../../WINGs/wfontpanel.c:875
msgid "Rev Italic"
msgstr "Обратен курсив"
#: ../../WINGs/wfontpanel.c:877
msgid "Rev Oblique"
msgstr "Обратно наклонен"
#: ../../WINGs/wfontpanel.c:883
msgid "Normal"
msgstr "Нормален"
#: ../../WINGs/widgets.c:415
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: не може да се зареди изображението %s на библиотеката."
#: ../../WINGs/widgets.c:763
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr "не може да се зареди никакъв шрифт. Убедете се, че имате правилно инсталирани шрифтове и посочен езиков локал."
#: ../../WINGs/wruler.c:189
msgid "0 inches"
msgstr "0 цола"

View File

@@ -1,736 +0,0 @@
# Catalan messages for WINGs.
# Copyright (C) 2003 Ernest Adrogué <eadrogue@gmx.net>.
# This file is distributed under the terms of the GNU General Public License.
#
# Version history:
# WM-ver author email date
# 0.80.2 Ernest Adrogué eadrogue@gmx.net 23 Feb 2003
# CVS-20030914 Ernest Adrogué eadrogue@gmx.net 15 Set 2003
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.80.2\n"
"POT-Creation-Date: 2003-09-16 22:59+0200\n"
"PO-Revision-Date: 2003-09-16 23:16+0200\n"
"Last-Translator: Ernest Adrogué <eadrogue@gmx.net>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../WINGs/connection.c:467 ../../WINGs/connection.c:532
#: ../../WINGs/connection.c:575
msgid "Bad address-service-protocol combination"
msgstr "Combinació adreça-servei-protocol incorrecta"
#: ../../WINGs/error.c:54
#, c-format
msgid "Unknown error %d"
msgstr "Error no identificat %d"
#: ../../WINGs/error.c:59
#, c-format
msgid "Error %d"
msgstr "Error %d"
#: ../../WINGs/error.c:110
msgid " warning: "
msgstr ": atenció: "
#: ../../WINGs/error.c:137
msgid " fatal error: "
msgstr ": error fatal: "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: "
msgstr ": error: "
#: ../../WINGs/findfile.c:48
#, c-format
msgid "could not get password entry for UID %i"
msgstr "no s'ha pogut obtenir l'informació de compte de l'UID %i"
#: ../../WINGs/findfile.c:66
#, c-format
msgid "could not get password entry for user %s"
msgstr "no s'ha pogut obtenir l'informació de compte de l'usuari %s"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "No s'ha pogut obtenir el nom de host actual"
# falten coses per traduïr en el codi font. eac
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "error de sintaxi a %s %s, línia %i: %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr ""
"Una entrada PropList de diccionari només pot contenir dades o una cadena"
#: ../../WINGs/proplist.c:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "S'han usat funcions PropList en objectes no-WMPropLists"
#: ../../WINGs/proplist.c:630
msgid "unterminated PropList string"
msgstr "cadena PropList incompleta"
#: ../../WINGs/proplist.c:670
msgid "unterminated PropList data"
msgstr "dades PropList incompletes"
#: ../../WINGs/proplist.c:678
msgid "unterminated PropList data (missing hexdigit)"
msgstr "Dades PropList incompletes (falta un digit hexadecimal)"
#: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data"
msgstr "cap digit hexadecimal a les dades PropList"
#: ../../WINGs/proplist.c:729
msgid "unterminated PropList array"
msgstr "matriu PropList incompleta"
#: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array"
msgstr "matriu PropList incompleta o inexistent"
#: ../../WINGs/proplist.c:747
msgid "could not get PropList array element"
msgstr "no s'ha pogut obtenir un element de la matriu PropList"
#: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary"
msgstr "diccionari PropList incomplet"
#: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key"
msgstr "falta una entrada PropList de diccionari"
#: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "falta una entrada PropList de diccionari o bé està incompleta"
#: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key"
msgstr "error mentre s'analitzava l'entrada PropList de diccionari"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "falta un \"=\" a l'entrada PropList de diccionari"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr "error mentre s'analitzava el valor de l'entrada PropList de diccionari"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "falta un \";\" a l'entrada PropList de diccionari"
#: ../../WINGs/proplist.c:888
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr ""
"s'esperava una cadena, dada, matriu o diccionari. Si es tractava d'una\n"
"cadena proveu d'escriure-la \"entre cometes\"."
#: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "No es permeten comentaris en els fitxers de domini de WindowMaker."
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1630
msgid "extra data after end of property list"
msgstr "sobren dades després de la llista de propietats"
#: ../../WINGs/proplist.c:1606
#, c-format
msgid "could not get size for file '%s'"
msgstr "no s'ha pogut obtenir la mida de \"%s\""
#: ../../WINGs/proplist.c:1619
#, c-format
msgid "error reading from file '%s'"
msgstr "error mentre es llegia el fitxer \"%s\""
#: ../../WINGs/proplist.c:1671
#, c-format
msgid "mkstemp (%s) failed"
msgstr "la rutina mkstemp (%s) ha fallat"
#: ../../WINGs/proplist.c:1682
#, c-format
msgid "mktemp (%s) failed"
msgstr "la rutina mktemp (%s) ha fallat"
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "open (%s) failed"
msgstr "la rutina open (%s) ha fallat"
#: ../../WINGs/proplist.c:1700
#, c-format
msgid "writing to file: %s failed"
msgstr "l'escriptura del fitxer \"%s\" ha fallat"
#: ../../WINGs/proplist.c:1708
#, c-format
msgid "fclose (%s) failed"
msgstr "la rutina fclose (%s) ha fallat"
#: ../../WINGs/proplist.c:1717
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "el canvi de nom (\"%s\" a \"%s\") ha fallat"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:188 ../../WINGs/userdefaults.c:204
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "no s'ha pogut llegir un domini del fitxer \"%s\" quan es sincronitzava"
#: ../../WINGs/wcolor.c:224 ../../WINGs/wcolor.c:236 ../../WINGs/wcolor.c:275
#: ../../WINGs/wcolor.c:316
#, c-format
msgid "could not allocate %s color"
msgstr "no s'ha pogut assignar espai pel color \"%s\""
#: ../../WINGs/wcolor.c:224
msgid "white"
msgstr "blanc"
#: ../../WINGs/wcolor.c:236
msgid "black"
msgstr "negre"
#: ../../WINGs/wcolor.c:275
msgid "gray"
msgstr "gris"
#: ../../WINGs/wcolor.c:316
msgid "dark gray"
msgstr "gris fosc"
#: ../../WINGs/wcolorpanel.c:420
msgid "Colors"
msgstr "Colors"
#: ../../WINGs/wcolorpanel.c:610 ../../WINGs/wcolorpanel.c:2829
msgid "Brightness"
msgstr "Claror"
#: ../../WINGs/wcolorpanel.c:612 ../../WINGs/wcolorpanel.c:688
#: ../../WINGs/wcolorpanel.c:721 ../../WINGs/wcolorpanel.c:755
#: ../../WINGs/wcolorpanel.c:815 ../../WINGs/wcolorpanel.c:849
#: ../../WINGs/wcolorpanel.c:883 ../../WINGs/wcolorpanel.c:918
#: ../../WINGs/wcolorpanel.c:2169 ../../WINGs/wcolorpanel.c:2831
#: ../../WINGs/wcolorpanel.c:2867 ../../WINGs/wcolorpanel.c:2903
#: ../../WINGs/wcolorpanel.c:3745
msgid "Color Panel: Could not allocate memory"
msgstr "Panell de color: No s'ha pogut assignar memòria"
#: ../../WINGs/wcolorpanel.c:685 ../../WINGs/wcolorpanel.c:686
msgid "Red"
msgstr "Roig"
#: ../../WINGs/wcolorpanel.c:718 ../../WINGs/wcolorpanel.c:719
msgid "Green"
msgstr "Verd"
#: ../../WINGs/wcolorpanel.c:752 ../../WINGs/wcolorpanel.c:753
msgid "Blue"
msgstr "Blau"
#: ../../WINGs/wcolorpanel.c:812 ../../WINGs/wcolorpanel.c:813
msgid "Cyan"
msgstr "Cian"
#: ../../WINGs/wcolorpanel.c:846 ../../WINGs/wcolorpanel.c:847
msgid "Magenta"
msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:880 ../../WINGs/wcolorpanel.c:881
msgid "Yellow"
msgstr "Groc"
#: ../../WINGs/wcolorpanel.c:915 ../../WINGs/wcolorpanel.c:916
msgid "Black"
msgstr "Negre"
#: ../../WINGs/wcolorpanel.c:996
msgid "Spectrum"
msgstr "Espectre"
#: ../../WINGs/wcolorpanel.c:1026
msgid "Palette"
msgstr "Paleta"
#: ../../WINGs/wcolorpanel.c:1032
msgid "New from File..."
msgstr "Obtenir d'un fitxer..."
#: ../../WINGs/wcolorpanel.c:1033 ../../WINGs/wcolorpanel.c:1081
#: ../../WINGs/wcolorpanel.c:1098
msgid "Rename..."
msgstr "Reanomenar..."
#: ../../WINGs/wcolorpanel.c:1034 ../../WINGs/wcolorpanel.c:1082
#: ../../WINGs/wcolorpanel.c:1099 ../../WINGs/wcolorpanel.c:3326
msgid "Remove"
msgstr "Eliminar"
#: ../../WINGs/wcolorpanel.c:1035
msgid "Copy"
msgstr "Copiar"
#: ../../WINGs/wcolorpanel.c:1036
msgid "New from Clipboard"
msgstr "Obtenir del porta-retalls..."
#: ../../WINGs/wcolorpanel.c:1057
msgid "X11-Colors"
msgstr "Colors-X11"
#: ../../WINGs/wcolorpanel.c:1074
msgid "Color"
msgstr "Color"
#: ../../WINGs/wcolorpanel.c:1080
msgid "Add..."
msgstr "Afegeix..."
#: ../../WINGs/wcolorpanel.c:1090
msgid "List"
msgstr "Llista"
#: ../../WINGs/wcolorpanel.c:1097
msgid "New..."
msgstr "Nou..."
#: ../../WINGs/wcolorpanel.c:1236
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Panell de color: No s'ha pogut crear el directori \"%s\" necessari per desar "
"la configuració"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1242 ../../WINGs/wcolorpanel.c:3212
#: ../../WINGs/wcolorpanel.c:3216
msgid "File Error"
msgstr "Error de fitxer"
#: ../../WINGs/wcolorpanel.c:1243
msgid "Could not create ColorPanel configuration directory"
msgstr "No s'ha pogut crear el directori de configuració del Panell de color"
#: ../../WINGs/wcolorpanel.c:1244 ../../WINGs/wcolorpanel.c:3213
#: ../../WINGs/wcolorpanel.c:3218 ../../WINGs/wcolorpanel.c:3245
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:650
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
#: ../../WINGs/wfilepanel.c:974 ../../WINGs/wfontpanel.c:751
msgid "OK"
msgstr "D'acord"
#: ../../WINGs/wcolorpanel.c:1250 ../../WINGs/wcolorpanel.c:1286
#: ../../WINGs/wcolorpanel.c:1304
msgid "Color Panel: Could not find file"
msgstr "Panell de color: No s'ha trobat el fitxer"
#: ../../WINGs/wcolorpanel.c:1491 ../../WINGs/wcolorpanel.c:1556
#: ../../WINGs/wcolorpanel.c:1620
msgid "Color Panel: X failed request"
msgstr "Panell de color: petició X fallida"
#: ../../WINGs/wcolorpanel.c:2865
msgid "Saturation"
msgstr "Saturació"
#: ../../WINGs/wcolorpanel.c:2901
msgid "Hue"
msgstr "Matís"
# és el títol d'un quadre de diàleg. eac
#: ../../WINGs/wcolorpanel.c:3151
msgid "Open Palette"
msgstr "Obrir paleta"
#: ../../WINGs/wcolorpanel.c:3213
msgid "Invalid file format !"
msgstr "El format del fitxer no és vàlid !"
#: ../../WINGs/wcolorpanel.c:3215
#, c-format
msgid "can't remove file %s"
msgstr "no s'ha pogut eliminar el fitxer \"%s\""
#: ../../WINGs/wcolorpanel.c:3217
msgid "Couldn't remove file from Configuration Directory !"
msgstr "No s'ha pogut eliminar el fitxer del directori de configuració !"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename"
msgstr "Reanomena"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename palette to:"
msgstr "Reanomena la paleta com a:"
#: ../../WINGs/wcolorpanel.c:3245 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
msgid "Cancel"
msgstr "Cancel·la"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3261 ../../WINGs/wfilepanel.c:763
msgid "Warning"
msgstr "Atenció"
#: ../../WINGs/wcolorpanel.c:3262
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Ja existia una paleta amb aquest nom!\n"
"\n"
"La voleu sobreescriure?"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "No"
msgstr "No"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "Yes"
msgstr "Sí"
#: ../../WINGs/wcolorpanel.c:3294
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "No s'ha pogut reanomenar la paleta %s com a %s\n"
#: ../../WINGs/wcolorpanel.c:3320
msgid "This will permanently remove the palette "
msgstr "Això eliminarà la paleta per sempre "
#: ../../WINGs/wcolorpanel.c:3323
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Esteu segurs que voleu eliminar aquesta paleta?"
#: ../../WINGs/wcolorpanel.c:3348
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "No s'ha pogut eliminar la paleta %s\n"
#: ../../WINGs/wcolorpanel.c:3647
#, c-format
msgid "Could not open %s"
msgstr "No s'ha pogut obrir %s"
#: ../../WINGs/wcolorpanel.c:3654
#, c-format
msgid "Could not create %s"
msgstr "No s'ha pogut crear %s"
#: ../../WINGs/wcolorpanel.c:3665
#, c-format
msgid "Write error on file %s"
msgstr "Error d'escriptura en el fitxer %s"
#: ../../WINGs/wcolorpanel.c:3710
msgid "Color Panel: Color unspecified"
msgstr "Panell de color: Color no especificat"
#: ../../WINGs/wfilepanel.c:235
msgid "Name:"
msgstr "Nom:"
#: ../../WINGs/wfilepanel.c:332 ../../WINGs/wfilepanel.c:396
msgid "Open"
msgstr "Obre"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save"
msgstr "Desa"
#: ../../WINGs/wfilepanel.c:565
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: no s'ha pogut obrir el directori %s\n"
#: ../../WINGs/wfilepanel.c:583
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: no s'ha pogut determinar l'estat de %s\n"
#: ../../WINGs/wfilepanel.c:650 ../../WINGs/wfilepanel.c:973
#: ../../WINGs/wfontpanel.c:750
msgid "Error"
msgstr "Error"
# és el nom d'un quadre de diàleg. eac
#: ../../WINGs/wfilepanel.c:661
msgid "Create Directory"
msgstr "Crear directori"
#: ../../WINGs/wfilepanel.c:662
msgid "Enter directory name"
msgstr "Entreu el nom del directori"
#: ../../WINGs/wfilepanel.c:698 ../../WINGs/wfilepanel.c:737
#: ../../WINGs/wfilepanel.c:768 ../../WINGs/wfilepanel.c:796
msgid "Permission denied."
msgstr "Permís denegat."
#: ../../WINGs/wfilepanel.c:701
#, c-format
msgid "'%s' already exists."
msgstr "\"%s\" existia prèviament."
#: ../../WINGs/wfilepanel.c:704
msgid "Path does not exist."
msgstr "L'ubicació no existeix."
#: ../../WINGs/wfilepanel.c:734 ../../WINGs/wfilepanel.c:793
#, c-format
msgid "'%s' does not exist."
msgstr "\"%s\" no existeix."
#: ../../WINGs/wfilepanel.c:741 ../../WINGs/wfilepanel.c:800
msgid "Insufficient memory available."
msgstr "No hi ha prou memòria disponible."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:804
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "\"%s\" es troba en un sistema de fitxers de només lectura."
#: ../../WINGs/wfilepanel.c:748 ../../WINGs/wfilepanel.c:780
#: ../../WINGs/wfilepanel.c:807
#, c-format
msgid "Can not delete '%s'."
msgstr "No s'ha pogut eliminar \"%s\"."
#: ../../WINGs/wfilepanel.c:755
#, c-format
msgid "Delete directory %s ?"
msgstr "Voleu eliminar el directori %s ?"
#: ../../WINGs/wfilepanel.c:759
#, c-format
msgid "Delete file %s ?"
msgstr "Voleu eliminar el fitxer %s ?"
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' does not exist."
msgstr "El directori \"%s\" no existeix."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is not empty."
msgstr "El directori \"%s\" no està buit."
#: ../../WINGs/wfilepanel.c:777
#, c-format
msgid "Directory '%s' is busy."
msgstr "El directori \"%s\" es troba ocupat."
#: ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' is a directory."
msgstr "\"%s\" és un directori."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgstr "S'ha produït un error mentre s'explorava \"%s\"."
#: ../../WINGs/wfilepanel.c:836
#, c-format
msgid "'%s' is not a directory."
msgstr "\"%s\" no és un directori."
#: ../../WINGs/wfilepanel.c:973
msgid "File does not exist."
msgstr "El fitxer no existeix."
#: ../../WINGs/wfont.c:324 ../../WINGs/wfont.c:344
#, c-format
msgid "could not load font %s."
msgstr "no s'ha pogut carregar el tipus de lletra %s."
#: ../../WINGs/wfont.c:375 ../../WINGs/wfont.c:420 ../../WINGs/wfont.c:475
#: ../../WINGs/wfont.c:1337 ../../WINGs/wfont.c:1398 ../../WINGs/wfont.c:1469
#, c-format
msgid ""
"Conversion to widechar failed (possible invalid multibyte sequence): '%s':"
"(pos %d)\n"
msgstr ""
"Ha fallat la conversió a caràcter estès (possible seqüència no vàlida): '%"
"s': (pos %d)\n"
#. // remove warning later. or maybe not
#: ../../WINGs/wfont.c:591 ../../WINGs/wfont.c:1568
#, c-format
msgid "Invalid font specification: '%s'\n"
msgstr "Especificació de font no vàlida: \"%s\"\n"
#: ../../WINGs/wfont.c:770 ../../WINGs/wfont.c:780
#, c-format
msgid "Invalid size specification '%s' in %s. Using default %d\n"
msgstr ""
"La mida \"%s\" especificada a %s no és vàlida. S'usa el valor per omissió %"
"d\n"
#: ../../WINGs/wfont.c:824
#, c-format
msgid "the following character sets are missing in %s:"
msgstr "els següents conjunts de caràcters falten a %s:"
#: ../../WINGs/wfont.c:830
#, c-format
msgid ""
"the string \"%s\" will be used in place of any characters from those sets."
msgstr ""
"la cadena \"%s\" s'usarà en lloc dels caràcters d'aquests conjunts de "
"caràcters."
#. is arial a good fallback for multibyte?
#: ../../WINGs/wfont.c:1232 ../../WINGs/wfont.c:1247
#, c-format
msgid "could not load font %s. Trying arial."
msgstr "no s'ha pogut carregar el tipus de lletra %s. Provant amb \"arial\"."
#: ../../WINGs/wfont.c:1239
msgid "could not load antialiased font set. Reverting to standard font sets."
msgstr ""
"no s'ha pogut carregar el conjunt de fonts amb allisat. S'usarà l'estàndard."
#: ../../WINGs/wfont.c:1242
#, c-format
msgid "could not load FontSet %s. Trying fixed."
msgstr "no s'ha pogut carregar el tipus de lletra %s. Provant amb \"fixed\"."
#: ../../WINGs/wfont.c:1254
msgid "could not load antialiased fonts. Reverting to normal fonts."
msgstr "no s'han pogut carregar fonts allisades. S'usaran fonts normals."
#: ../../WINGs/wfont.c:1257 ../../WINGs/wfont.c:1268
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr "no s'ha pogut carregar la font %s. Provant amb \"fixed\"."
#: ../../WINGs/wfont.c:1262
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr "no s'ha pogut carregar el conjunt de fonts %s. Provant amb \"fixed\"."
#: ../../WINGs/wfont.c:1272
msgid "could not load fixed font!"
msgstr "no s'ha pogut carregar el tipus de lletra \"fixed\" !"
#: ../../WINGs/wfont.c:1520
#, c-format
msgid "font description %s is too large."
msgstr "la descripció de tipus de lletra %s és massa gran."
#: ../../WINGs/wfontpanel.c:235
msgid "Test!!!"
msgstr "Prova!!!"
#: ../../WINGs/wfontpanel.c:241
msgid "Family"
msgstr "Familia"
#: ../../WINGs/wfontpanel.c:252
msgid "Typeface"
msgstr "Fosa"
#: ../../WINGs/wfontpanel.c:263
msgid "Size"
msgstr "Mida"
#: ../../WINGs/wfontpanel.c:282
msgid "Set"
msgstr "Conjunt"
#: ../../WINGs/wfontpanel.c:288
msgid "Revert"
msgstr "Torna"
#: ../../WINGs/wfontpanel.c:751
msgid "Could not retrieve font list"
msgstr "No s'ha pogut obtenir la llista de tipus de lletra"
#: ../../WINGs/wfontpanel.c:765
#, c-format
msgid "font name %s is longer than 256, which is invalid."
msgstr ""
"el nom de tipus de lletra %s ocupa més de 256 caràcters, per tant no és "
"vàlid."
#: ../../WINGs/wfontpanel.c:913
msgid "Roman"
msgstr "Romana"
#: ../../WINGs/wfontpanel.c:916
msgid "Italic"
msgstr "Itàlica"
#: ../../WINGs/wfontpanel.c:918
msgid "Oblique"
msgstr "Obliqua"
#: ../../WINGs/wfontpanel.c:920
msgid "Rev Italic"
msgstr "Itàlica inv"
#: ../../WINGs/wfontpanel.c:922
msgid "Rev Oblique"
msgstr "Obliqua inv"
#: ../../WINGs/wfontpanel.c:928
msgid "Normal"
msgstr "Normal"
#: ../../WINGs/widgets.c:419
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: no s'ha pogut carregar el fitxer d'imatges: %s"
#: ../../WINGs/widgets.c:772
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr ""
"no s'ha pogut carregar cap font. Assegureu-vos que heu instal·lat i "
"configurat correctament les fonts i el local."
#: ../../WINGs/wruler.c:192
msgid "0 inches"
msgstr "0 polzades"
#~ msgid ""
#~ "Text antialiasing is enabled in the configuration but the X server "
#~ "doesn't have the required capabilities (missing RENDER extension). "
#~ "Disabling text antialiasing."
#~ msgstr ""
#~ "L'allisat de text està habilitat a la configuració però el servidor X no\n"
#~ "té la capacitat necessària (falta l'extensió RENDER) de manera que "
#~ "l'allisat\n"
#~ "de text es deshabilitarà."

View File

@@ -1,663 +0,0 @@
# Czech messages for WINGs
# (C) 2001 Jiří Hnídek
# Special thanks to Jan "judas" Tomka
#
# Original translation by Jiří Hnídek on Oct 11 2001
# Currently maintained by Jiří Hnídek <jiri.hnidek@vslib.cz>
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.70.0\n"
"POT-Creation-Date: 2001-10-11 19:10+0100\n"
"PO-Revision-Date: 2001-10-11 22:00+0100\n"
"Last-Translator: Jiří Hnídek <jiri.hnidek@vslib.cz>\n"
"Language-Team: Czech <cz@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: unknown\n"
#: ../../WINGs/connection.c:451 ../../WINGs/connection.c:516
#: ../../WINGs/connection.c:559
msgid "Bad address-service-protocol combination"
msgstr "Nesprávná kombinace adresa-služba-protokol"
#: ../../WINGs/dragsource.c:541
msgid "DND selection lost during drag operation..."
msgstr "DND výběr se ztratil během opere táhnutí..."
#: ../../WINGs/dragsource.c:610
#, c-format
msgid "drag & drop timed out while waiting for response from 0x%x\n"
msgstr "čas pro drag & drop vypršel během čekání na odpoveď z 0x%x\n"
#: ../../WINGs/dragsource.c:728
msgid "could not get ownership or DND selection"
msgstr "nemožné získat vlastnictví nebo DND výběr"
#: ../../WINGs/dragsource.c:898
#, c-format
msgid "drag source received unexpected XdndFinished message from %x"
msgstr "zdroj tahání přijal neočekávanou zprávu XdndFinished z %x"
#: ../../WINGs/dragsource.c:1040
#, c-format
msgid "unknown XDND action %s from 0x%x"
msgstr "neznámá XDND akce %s z 0x%x"
#: ../../WINGs/dragsource.c:1073
msgid "received invalid drag & drop type list"
msgstr "přijatý nesprávný seznam typů drag & drop"
#: ../../WINGs/dragsource.c:1161
msgid "received Enter event in bad order"
msgstr "přijatá událost Enter v nesprávném pořadí"
#: ../../WINGs/dragsource.c:1168
#, c-format
msgid "received drag & drop request with unsupported version %i"
msgstr "přijatý požadavek drag & drop s nepodporovanou verzí %i"
#: ../../WINGs/error.c:56
#, c-format
msgid "Unknown error %d"
msgstr "Neznámá chyba %d"
#: ../../WINGs/error.c:61
#, c-format
msgid "Error %d"
msgstr "Chyba %d"
#: ../../WINGs/error.c:112
msgid " warning: "
msgstr " varovíní: "
#: ../../WINGs/error.c:139
msgid " fatal error: "
msgstr " fatální chyba: "
#: ../../WINGs/error.c:165 ../../WINGs/error.c:194
msgid " error: "
msgstr " chyba: "
#: ../../WINGs/findfile.c:50
#, c-format
msgid "could not get password entry for UID %i"
msgstr "nemožné zjistit informaci o UID %i"
#: ../../WINGs/findfile.c:68
#, c-format
msgid "could not get password entry for user %s"
msgstr "nemožné zjistit informaci o uživatelovi %s"
#: ../../WINGs/hashtable.c:275
msgid "rebuilding hash table...\n"
msgstr "přepis tabulky hashovských funkcí...\n"
#: ../../WINGs/hashtable.c:279
msgid "finished rebuild.\n"
msgstr "konec přepisu.\n"
#: ../../WINGs/host.c:116
msgid "Cannot get current host name"
msgstr "Nemožné zjistit aktuální jméno počítače"
#: ../../WINGs/memory.c:94
msgid "malloc() failed. Retrying after 2s."
msgstr "chyba malloc(). Nový pokus o 2s."
#: ../../WINGs/memory.c:103
msgid "Really Bad Error: recursive malloc() failure."
msgstr "Skutečně ošklivá chyba: rekurzivní chyba malloc()."
#: ../../WINGs/memory.c:106 ../../WINGs/memory.c:146
msgid "virtual memory exhausted"
msgstr "virtuální paměť vyčerpaná"
#: ../../WINGs/memory.c:133
msgid "realloc() failed. Retrying after 2s."
msgstr "chyba realloc(). Nový pokus o 2s."
#: ../../WINGs/memory.c:142
msgid "Really Bad Error: recursive realloc() failure."
msgstr "Skutečně ošklivá chyba: rekurzivní chyba realloc()."
#: ../../WINGs/memory.c:205
#, c-format
msgid "trying to release unexisting data %p"
msgstr "pokus uvolnit neexistujícá data %p"
#: ../../WINGs/memory.c:210
#, c-format
msgid "RELEASING %p\n"
msgstr "UVOLNĚNÍ %p\n"
#: ../../WINGs/wcolor.c:198 ../../WINGs/wcolor.c:211 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:291
#, c-format
msgid "could not allocate %s color"
msgstr "nemožné alokovat %s barvu"
#: ../../WINGs/wcolor.c:198
msgid "white"
msgstr "bílou"
#: ../../WINGs/wcolor.c:211
msgid "black"
msgstr "černou"
#: ../../WINGs/wcolor.c:250
msgid "gray"
msgstr "šedou"
#: ../../WINGs/wcolor.c:291
msgid "dark gray"
msgstr "tmavě šedou"
#: ../../WINGs/wcolorpanel.c:410
msgid "Colors"
msgstr "Barvy"
#: ../../WINGs/wcolorpanel.c:600 ../../WINGs/wcolorpanel.c:2819
msgid "Brightness"
msgstr "Světlost"
#: ../../WINGs/wcolorpanel.c:602 ../../WINGs/wcolorpanel.c:678
#: ../../WINGs/wcolorpanel.c:711 ../../WINGs/wcolorpanel.c:745
#: ../../WINGs/wcolorpanel.c:805 ../../WINGs/wcolorpanel.c:839
#: ../../WINGs/wcolorpanel.c:873 ../../WINGs/wcolorpanel.c:908
#: ../../WINGs/wcolorpanel.c:2159 ../../WINGs/wcolorpanel.c:2821
#: ../../WINGs/wcolorpanel.c:2857 ../../WINGs/wcolorpanel.c:2893
#: ../../WINGs/wcolorpanel.c:3741
msgid "Color Panel: Could not allocate memory"
msgstr "Panel barev: Nemožné alokovat paměť"
#: ../../WINGs/wcolorpanel.c:675 ../../WINGs/wcolorpanel.c:676
msgid "Red"
msgstr "Červená"
#: ../../WINGs/wcolorpanel.c:708 ../../WINGs/wcolorpanel.c:709
msgid "Green"
msgstr "Zelená"
#: ../../WINGs/wcolorpanel.c:742 ../../WINGs/wcolorpanel.c:743
msgid "Blue"
msgstr "Modrá"
#: ../../WINGs/wcolorpanel.c:802 ../../WINGs/wcolorpanel.c:803
msgid "Cyan"
msgstr ""
#: ../../WINGs/wcolorpanel.c:836 ../../WINGs/wcolorpanel.c:837
msgid "Magenta"
msgstr ""
#: ../../WINGs/wcolorpanel.c:870 ../../WINGs/wcolorpanel.c:871
msgid "Yellow"
msgstr "Žlutá"
#: ../../WINGs/wcolorpanel.c:905 ../../WINGs/wcolorpanel.c:906
msgid "Black"
msgstr "Černá"
#: ../../WINGs/wcolorpanel.c:986
msgid "Spectrum"
msgstr "Spektrum"
#: ../../WINGs/wcolorpanel.c:1016
msgid "Palette"
msgstr "Paleta"
#: ../../WINGs/wcolorpanel.c:1022
msgid "New from File..."
msgstr "Nová ze souboru..."
#: ../../WINGs/wcolorpanel.c:1023 ../../WINGs/wcolorpanel.c:1071
#: ../../WINGs/wcolorpanel.c:1088
msgid "Rename..."
msgstr "Přejmenovat..."
#: ../../WINGs/wcolorpanel.c:1024 ../../WINGs/wcolorpanel.c:1072
#: ../../WINGs/wcolorpanel.c:1089 ../../WINGs/wcolorpanel.c:3316
msgid "Remove"
msgstr "Odstranit"
#: ../../WINGs/wcolorpanel.c:1025
msgid "Copy"
msgstr "Kopírovat"
#: ../../WINGs/wcolorpanel.c:1026
msgid "New from Clipboard"
msgstr "Nová ze schránky"
#: ../../WINGs/wcolorpanel.c:1047
msgid "X11-Colors"
msgstr "Barvy X11"
#: ../../WINGs/wcolorpanel.c:1064
msgid "Color"
msgstr "Barva"
#: ../../WINGs/wcolorpanel.c:1070
msgid "Add..."
msgstr "Přidat..."
#: ../../WINGs/wcolorpanel.c:1080
msgid "List"
msgstr "Seznam"
#: ../../WINGs/wcolorpanel.c:1087
msgid "New..."
msgstr "Nový..."
#: ../../WINGs/wcolorpanel.c:1226
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Panel barev: Nemožné vytvořit adresář %s potřebný k uložení nastavení"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1232 ../../WINGs/wcolorpanel.c:3202
#: ../../WINGs/wcolorpanel.c:3206
msgid "File Error"
msgstr "Chyba souboru"
#: ../../WINGs/wcolorpanel.c:1233
msgid "Could not create ColorPanel configuration directory"
msgstr "Nemožné vytvořit konfigurační adresář panelu barev"
#: ../../WINGs/wcolorpanel.c:1234 ../../WINGs/wcolorpanel.c:3203
#: ../../WINGs/wcolorpanel.c:3208 ../../WINGs/wcolorpanel.c:3235
#: ../../WINGs/wfilepanel.c:243 ../../WINGs/wfilepanel.c:641
#: ../../WINGs/wfilepanel.c:653 ../../WINGs/wfilepanel.c:752
#: ../../WINGs/wfilepanel.c:963 ../../WINGs/wfontpanel.c:717
msgid "OK"
msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1240 ../../WINGs/wcolorpanel.c:1276
#: ../../WINGs/wcolorpanel.c:1294
msgid "Color Panel: Could not find file"
msgstr "Panel barev: Nemožné nalézt soubor"
#: ../../WINGs/wcolorpanel.c:1481 ../../WINGs/wcolorpanel.c:1546
#: ../../WINGs/wcolorpanel.c:1610
msgid "Color Panel: X failed request"
msgstr "Panel barev: chyba požadavku X"
#: ../../WINGs/wcolorpanel.c:2855
msgid "Saturation"
msgstr "Saturace"
#: ../../WINGs/wcolorpanel.c:2891
msgid "Hue"
msgstr "Odteď"
#: ../../WINGs/wcolorpanel.c:3141
msgid "Open Palette"
msgstr "Otevřít paletu"
#: ../../WINGs/wcolorpanel.c:3203
msgid "Invalid file format !"
msgstr "Nesprávný souborový formát!"
#: ../../WINGs/wcolorpanel.c:3205
#, c-format
msgid "can't remove file %s"
msgstr "nemožné odstranit soubor %s"
#: ../../WINGs/wcolorpanel.c:3207
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Nemožné odstranit soubor z konfiguračního adresáře!"
#: ../../WINGs/wcolorpanel.c:3234
msgid "Rename"
msgstr "Přejmenovat"
#: ../../WINGs/wcolorpanel.c:3234
msgid "Rename palette to:"
msgstr "Přejmenovat paletu:"
#: ../../WINGs/wcolorpanel.c:3235 ../../WINGs/wfilepanel.c:252
#: ../../WINGs/wfilepanel.c:653 ../../WINGs/wfilepanel.c:752
msgid "Cancel"
msgstr "Zrušit"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3251 ../../WINGs/wfilepanel.c:752
msgid "Warning"
msgstr "Varování"
#: ../../WINGs/wcolorpanel.c:3252
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Paleta už existuje!\n"
"\n"
"Přepsat?"
#: ../../WINGs/wcolorpanel.c:3252 ../../WINGs/wcolorpanel.c:3316
msgid "No"
msgstr "Ne"
#: ../../WINGs/wcolorpanel.c:3252 ../../WINGs/wcolorpanel.c:3316
msgid "Yes"
msgstr "Ano"
#: ../../WINGs/wcolorpanel.c:3284
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "Nemožné přejmenovat paletu %s na %s\n"
#: ../../WINGs/wcolorpanel.c:3310
msgid "This will permanently remove the palette "
msgstr "Paleta bude natrvalo smazaná"
#: ../../WINGs/wcolorpanel.c:3313
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Jste si jisti, že chcete odstranit tuto paletu?"
#: ../../WINGs/wcolorpanel.c:3338
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "Nemožné odstranit paletu %s\n"
#: ../../WINGs/wcolorpanel.c:3643
#, c-format
msgid "Could not open %s"
msgstr "Nemožné otevřít %s"
#: ../../WINGs/wcolorpanel.c:3650
#, c-format
msgid "Could not create %s"
msgstr "Nemožné vytvořit %s"
#: ../../WINGs/wcolorpanel.c:3661
#, c-format
msgid "Write error on file %s"
msgstr "Chyba při zápisu do souboru %s"
#: ../../WINGs/wcolorpanel.c:3706
msgid "Color Panel: Color unspecified"
msgstr "Panel barev: Nespecifikovaná barva"
#: ../../WINGs/wfilepanel.c:228
msgid "Name:"
msgstr "Jméno:"
#: ../../WINGs/wfilepanel.c:325 ../../WINGs/wfilepanel.c:390
msgid "Open"
msgstr "Otevřít"
#: ../../WINGs/wfilepanel.c:343 ../../WINGs/wfilepanel.c:396
msgid "Save"
msgstr "Uložit"
#: ../../WINGs/wfilepanel.c:556
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: nemožné otevřít adresář %s\n"
#: ../../WINGs/wfilepanel.c:574
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: nemožné zjistit informace o %s\n"
#: ../../WINGs/wfilepanel.c:641 ../../WINGs/wfilepanel.c:962
#: ../../WINGs/wfontpanel.c:716
msgid "Error"
msgstr "Chyba"
#: ../../WINGs/wfilepanel.c:652
msgid "Create Directory"
msgstr "Vytvořit adresář"
#: ../../WINGs/wfilepanel.c:653
msgid "Enter directory name"
msgstr "Jméno adresáře"
#: ../../WINGs/wfilepanel.c:689 ../../WINGs/wfilepanel.c:728
#: ../../WINGs/wfilepanel.c:757 ../../WINGs/wfilepanel.c:785
msgid "Permission denied."
msgstr "Přístup odmítnut."
#: ../../WINGs/wfilepanel.c:692
#, c-format
msgid "'%s' already exists."
msgstr "'%s' už existuje"
#: ../../WINGs/wfilepanel.c:695
msgid "Path does not exist."
msgstr "Cesta neexistuje."
#: ../../WINGs/wfilepanel.c:725 ../../WINGs/wfilepanel.c:782
#, c-format
msgid "'%s' does not exist."
msgstr "'%s' neexistuje."
#: ../../WINGs/wfilepanel.c:732 ../../WINGs/wfilepanel.c:789
msgid "Insufficient memory available."
msgstr "Nedostatek paměti."
#: ../../WINGs/wfilepanel.c:736 ../../WINGs/wfilepanel.c:793
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "'%s' je na souborovém systému jen pro čtení."
#: ../../WINGs/wfilepanel.c:739 ../../WINGs/wfilepanel.c:769
#: ../../WINGs/wfilepanel.c:796
#, c-format
msgid "Can not delete '%s'."
msgstr "Nemožné odstranit '%s'."
#: ../../WINGs/wfilepanel.c:745
#, c-format
msgid "Delete directory %s ?"
msgstr "Odstranit adresář %s?"
#: ../../WINGs/wfilepanel.c:748
#, c-format
msgid "Delete file %s ?"
msgstr "Odstranit soubor %s?"
#: ../../WINGs/wfilepanel.c:760
#, c-format
msgid "Directory '%s' does not exist."
msgstr "Adresář '%s' neexistuje."
#: ../../WINGs/wfilepanel.c:763
#, c-format
msgid "Directory '%s' is not empty."
msgstr "Adresář '%s' není prázdný."
#: ../../WINGs/wfilepanel.c:766
#, c-format
msgid "Directory '%s' is busy."
msgstr "Adresář '%s' je používaný."
#: ../../WINGs/wfilepanel.c:779
#, c-format
msgid "'%s' is a directory."
msgstr "'%s' je adresář."
#: ../../WINGs/wfilepanel.c:821
#, c-format
msgid "An error occured browsing '%s'."
msgstr "Při prohlížení '%s' nastala chyba."
#: ../../WINGs/wfilepanel.c:825
#, c-format
msgid "'%s' is not a directory."
msgstr "'%s' není adresář."
#: ../../WINGs/wfilepanel.c:962
msgid "File does not exist."
msgstr "Soubor neexistuje."
#: ../../WINGs/wfont.c:129
#, c-format
msgid "the following character sets are missing in %s:"
msgstr "nasledující sady znaků chybí v %s:"
#: ../../WINGs/wfont.c:136
#, c-format
msgid ""
"the string \"%s\" will be used in place of any characters from those sets."
msgstr ""
"řetězec \"%s\" bude použitý namísto znaků z těchto sad."
#: ../../WINGs/wfont.c:282 ../../WINGs/wfont.c:318
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr "nemožné načíst font %s. Zkouší se načíst fixed."
#: ../../WINGs/wfont.c:288 ../../WINGs/wfont.c:324
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr "nemožno načíst font %s. Zkoší se načíst fixed."
#: ../../WINGs/wfont.c:292 ../../WINGs/wfont.c:328
msgid "could not load fixed font!"
msgstr "nemožné načíst font fixed!"
#: ../../WINGs/wfont.c:423
#, c-format
msgid "font description %s is too large."
msgstr "popis fontu %s je příliš velký."
#: ../../WINGs/wfontpanel.c:205
msgid "Test!!!"
msgstr "Zkouška!!!"
#: ../../WINGs/wfontpanel.c:211
msgid "Family"
msgstr ""
#: ../../WINGs/wfontpanel.c:222
msgid "Typeface"
msgstr ""
#: ../../WINGs/wfontpanel.c:233
msgid "Size"
msgstr "Velikost"
#: ../../WINGs/wfontpanel.c:252
msgid "Set"
msgstr "Sada"
#: ../../WINGs/wfontpanel.c:257
msgid "Revert"
msgstr "Zpět"
#: ../../WINGs/wfontpanel.c:717
msgid "Could not retrieve font list"
msgstr "Nemožné obdržet seznam fontů"
#: ../../WINGs/wfontpanel.c:729
#, c-format
msgid "font name %s is longer than 256, which is invalid."
msgstr "jméno fontu %s je delší než 256, což je špatně."
#: ../../WINGs/wfontpanel.c:880
msgid "Roman"
msgstr ""
#: ../../WINGs/wfontpanel.c:883
msgid "Italic"
msgstr ""
#: ../../WINGs/wfontpanel.c:885
msgid "Oblique"
msgstr ""
#: ../../WINGs/wfontpanel.c:887
msgid "Rev Italic"
msgstr ""
#: ../../WINGs/wfontpanel.c:889
msgid "Rev Oblique"
msgstr ""
#: ../../WINGs/wfontpanel.c:895
msgid "Normal"
msgstr "Normílní"
#: ../../WINGs/widgets.c:414
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: nemožné načíst soubor s obrázky pro widgety: %s"
#: ../../WINGs/widgets.c:525
#, c-format
msgid "WINGs: could not open display %s"
msgstr "WINGs: nemožné otevřít display %s"
#: ../../WINGs/widgets.c:717
msgid ""
"could not load any fonts. Make sure your font installationand locale "
"settings are correct."
msgstr ""
"nemožné načíst žádný font. Ubezpečte se, že instalace fontů a místního "
"nastavení jsou v pořádku."
#: ../../WINGs/wruler.c:189
msgid "0 inches"
msgstr "0 palců"
#: ../../WINGs/wtext.c:1212
msgid "...for this app will surely crash :-)\n"
msgstr "...pro tuto aplikaci to určitě spadne :-)\n"
#: ../../WINGs/wtext.c:2084
msgid "didn't get it\n"
msgstr "nedosaženo\n"
#: ../../WINGs/wtext.c:2726
#, c-format
msgid "type is [%s]\n"
msgstr "typ je [%s]\n"
#: ../../WINGs/wtext.c:2797
msgid "could not request data for dropped data"
msgstr "nemohou být vyžádána data pro položená data"
#: ../../WINGs/wtext.c:2995
msgid "could not create text's view\n"
msgstr "nemožné zobrazit text\n"
#: ../../WINGs/wview.c:219
msgid "trying to realize widget of unrealized parent"
msgstr "snaha vytvořit widget neexistujícího rodiče objektu"
#: ../../WINGs/wview.c:267
msgid "trying to reparent realized view to unrealized parent"
msgstr ""
#: ../../WINGs/wtextfield.c:490
msgid "only left alignment is supported in textfields"
msgstr "pro textové pole je povolené jen levé zarovnání"
#pozor, co je STRING?
#: ../../WINGs/wwindow.c:222
msgid "window title conversion error... using STRING encoding"
msgstr "chyba konverze titulku okna... použije se kódovaní STRING"
#: ../../WINGs/wwindow.c:313
msgid "could not allocate memory for window size hints"
msgstr "nemožné alokovat paměť pro pokyny velikosti okna"
#: ../../WINGs/wwindow.c:586
msgid "could not allocate memory for WM hints"
msgstr "nemožné alokovat paměť pro pokyny WM"
#: ../../WINGs/wwindow.c:627
msgid "icon title conversion error..using STRING encoding"
msgstr "chyba konverze titulku ikony... použije se kódovaní STRING"

View File

@@ -1,627 +0,0 @@
#
# German Message Catalog for WINGs
#
# Initial translation
# Gudio Scholz <guido.scholz@bayernline.de>
#
# Adapted to versions 0.80 ff.
# Torsten Marek <shlomme@gmx.net>
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs\n"
"POT-Creation-Date: 2004-11-01 16:24+0100\n"
"PO-Revision-Date: 2004-11-05 23:48+0100\n"
"Last-Translator: shlomme@gmx.net\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../WINGs/connection.c:471 ../../WINGs/connection.c:536
#: ../../WINGs/connection.c:579
msgid "Bad address-service-protocol combination"
msgstr "Ungültige Kombination von Adresse und Dienstprotokoll"
#: ../../WINGs/error.c:54
#, c-format
msgid "Unknown error %d"
msgstr "Unbekannter Fehler %d"
#: ../../WINGs/error.c:59
#, c-format
msgid "Error %d"
msgstr "Fehler %d"
#: ../../WINGs/error.c:110
msgid " warning: "
msgstr " Warnung: "
#: ../../WINGs/error.c:137
msgid " fatal error: "
msgstr " fataler Fehler: "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: "
msgstr " Fehler: "
#: ../../WINGs/findfile.c:48
#, c-format
msgid "could not get password entry for UID %i"
msgstr "Passworteintrag für UID %i konnte nicht ermittelt werden"
#: ../../WINGs/findfile.c:66
#, c-format
msgid "could not get password entry for user %s"
msgstr "Passworteintrag für Benutzer %s konnte nicht ermittelt werden"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "Aktueller Hostname kann nicht ermittelt werden"
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "Syntaxfehler in %s %s, Zeile %i: %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr ""
"Nur Zeichenketten oder Binärdaten werden als Schlüssel für ein PropList-Dictionary "
"unterstützt"
#: ../../WINGs/proplist.c:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "PropList-Funktionen werden auf nicht-WMPropList-Objekte angewendet"
#: ../../WINGs/proplist.c:630
msgid "unterminated PropList string"
msgstr "nicht terminierte PropList-Zeichenkette"
#: ../../WINGs/proplist.c:670
msgid "unterminated PropList data"
msgstr "nicht terminierte PropList-Binärdaten"
#: ../../WINGs/proplist.c:678
msgid "unterminated PropList data (missing hexdigit)"
msgstr "nicht terminierte PropList-Binärdaten (fehlendes Hex-Zeichen)"
#: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data"
msgstr "falsches Hex-Zeichen in PropList-Binärdaten"
#: ../../WINGs/proplist.c:729
msgid "unterminated PropList array"
msgstr "nicht terminiertes PropList-Array"
#: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array"
msgstr "fehlendes oder nicht terminiertes PropList-Array"
#: ../../WINGs/proplist.c:747
msgid "could not get PropList array element"
msgstr "PropList-Array-Element konnte nicht gelesen werden"
#: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary"
msgstr "nicht terminiertes PropList-Dictionary"
#: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key"
msgstr "fehlender Schlüssel in PropList-Dictionary"
#: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "fehlender Schlüssel in PropList-Dictionary oder fehlende Terminierung"
#: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key"
msgstr "Fehler beim Parsen eines PropList-Dictionary-Schlüssels"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "fehlendes \"=\" in PropList-Dictionary-Schlüssel"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr "Fehler beim Parsen eines PropList-Dictionary-Wertes"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "fehlendes \";\" in PropList-Dictionary-Eintrag"
#: ../../WINGs/proplist.c:888
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr ""
"Zeichenkette, Binärdaten, Array oder Dictionary erwartet. Zeichenketten ggf. mit \" "
"einklammern."
#: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Kommentare sind in Domänendaten von WindowMaker nicht erlaubt."
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1630
msgid "extra data after end of property list"
msgstr "zusätzliche Daten hinter dem Ende der Propertyliste"
#: ../../WINGs/proplist.c:1606
#, c-format
msgid "could not get size for file '%s'"
msgstr "Dateigröße von '%s' konnte nicht ermittelt werden"
#: ../../WINGs/proplist.c:1619
#, c-format
msgid "error reading from file '%s'"
msgstr "Fehler beim Lesen der Datei '%s'"
#: ../../WINGs/proplist.c:1671
#, c-format
msgid "mkstemp (%s) failed"
msgstr "mkstemp (%s) fehlgeschlagen"
#: ../../WINGs/proplist.c:1682
#, c-format
msgid "mktemp (%s) failed"
msgstr "mktemp (%s) fehlgeschlagen"
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "open (%s) failed"
msgstr "open (%s) fehlgeschlagen"
#: ../../WINGs/proplist.c:1700
#, c-format
msgid "writing to file: %s failed"
msgstr "Schreiben in Datei: %s fehlgeschlagen"
#: ../../WINGs/proplist.c:1708
#, c-format
msgid "fclose (%s) failed"
msgstr "fclose (%s) fehlgeschlagen"
#: ../../WINGs/proplist.c:1717
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "rename ('%s' nach '%s') fehlgeschlagen"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:188 ../../WINGs/userdefaults.c:204
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "Bei der Synchronisation konnte nicht aus der Datei '%s' gelesen werden"
#: ../../WINGs/wcolor.c:237 ../../WINGs/wcolor.c:249 ../../WINGs/wcolor.c:288
#: ../../WINGs/wcolor.c:329
#, c-format
msgid "could not allocate %s color"
msgstr "Farbe %s konnte nicht erzeugt werden"
#: ../../WINGs/wcolor.c:237
msgid "white"
msgstr "Weiß"
#: ../../WINGs/wcolor.c:249
msgid "black"
msgstr "Schwarz"
#: ../../WINGs/wcolor.c:288
msgid "gray"
msgstr "Grau"
#: ../../WINGs/wcolor.c:329
msgid "dark gray"
msgstr "Dunkelgrau"
#: ../../WINGs/wcolorpanel.c:420
msgid "Colors"
msgstr "Farben"
#: ../../WINGs/wcolorpanel.c:610 ../../WINGs/wcolorpanel.c:2829
msgid "Brightness"
msgstr "Helligkeit"
#: ../../WINGs/wcolorpanel.c:612 ../../WINGs/wcolorpanel.c:688
#: ../../WINGs/wcolorpanel.c:721 ../../WINGs/wcolorpanel.c:755
#: ../../WINGs/wcolorpanel.c:815 ../../WINGs/wcolorpanel.c:849
#: ../../WINGs/wcolorpanel.c:883 ../../WINGs/wcolorpanel.c:918
#: ../../WINGs/wcolorpanel.c:2169 ../../WINGs/wcolorpanel.c:2831
#: ../../WINGs/wcolorpanel.c:2867 ../../WINGs/wcolorpanel.c:2903
#: ../../WINGs/wcolorpanel.c:3745
msgid "Color Panel: Could not allocate memory"
msgstr "Farb-Panel: Speicher konnte nicht reserviert werden"
#: ../../WINGs/wcolorpanel.c:685 ../../WINGs/wcolorpanel.c:686
msgid "Red"
msgstr "Rot"
#: ../../WINGs/wcolorpanel.c:718 ../../WINGs/wcolorpanel.c:719
msgid "Green"
msgstr "Grün"
#: ../../WINGs/wcolorpanel.c:752 ../../WINGs/wcolorpanel.c:753
msgid "Blue"
msgstr "Blau"
#: ../../WINGs/wcolorpanel.c:812 ../../WINGs/wcolorpanel.c:813
msgid "Cyan"
msgstr ""
#: ../../WINGs/wcolorpanel.c:846 ../../WINGs/wcolorpanel.c:847
msgid "Magenta"
msgstr ""
#: ../../WINGs/wcolorpanel.c:880 ../../WINGs/wcolorpanel.c:881
msgid "Yellow"
msgstr "Gelb"
#: ../../WINGs/wcolorpanel.c:915 ../../WINGs/wcolorpanel.c:916
msgid "Black"
msgstr "Schwarz"
#: ../../WINGs/wcolorpanel.c:996
msgid "Spectrum"
msgstr "Spektrum"
#: ../../WINGs/wcolorpanel.c:1026
msgid "Palette"
msgstr ""
#: ../../WINGs/wcolorpanel.c:1032
msgid "New from File..."
msgstr "Neu aus Datei..."
#: ../../WINGs/wcolorpanel.c:1033 ../../WINGs/wcolorpanel.c:1081
#: ../../WINGs/wcolorpanel.c:1098
msgid "Rename..."
msgstr "Umbenennen..."
#: ../../WINGs/wcolorpanel.c:1034 ../../WINGs/wcolorpanel.c:1082
#: ../../WINGs/wcolorpanel.c:1099 ../../WINGs/wcolorpanel.c:3326
msgid "Remove"
msgstr "Entfernen"
#: ../../WINGs/wcolorpanel.c:1035
msgid "Copy"
msgstr "Kopieren"
#: ../../WINGs/wcolorpanel.c:1036
msgid "New from Clipboard"
msgstr "Neu aus Zwischenablage"
#: ../../WINGs/wcolorpanel.c:1057
msgid "X11-Colors"
msgstr "X11-Farben"
#: ../../WINGs/wcolorpanel.c:1074
msgid "Color"
msgstr "Farbe"
#: ../../WINGs/wcolorpanel.c:1080
msgid "Add..."
msgstr "Hinzufügen..."
#: ../../WINGs/wcolorpanel.c:1090
msgid "List"
msgstr "Liste"
#: ../../WINGs/wcolorpanel.c:1097
msgid "New..."
msgstr "Neu..."
#: ../../WINGs/wcolorpanel.c:1236
#, c-format
msgid "Color Panel: Could not create directory %s needed to store configurations"
msgstr "Farb-Panel: Verzeichnis %s konnte zum Speichern der Konfiguration nicht erzeugt werden"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1242 ../../WINGs/wcolorpanel.c:3212
#: ../../WINGs/wcolorpanel.c:3216
msgid "File Error"
msgstr "Dateifehler"
#: ../../WINGs/wcolorpanel.c:1243
msgid "Could not create ColorPanel configuration directory"
msgstr "Konfigurationsverzeichnis für Farb-Panel konnte nicht erzeugt werden"
#: ../../WINGs/wcolorpanel.c:1244 ../../WINGs/wcolorpanel.c:3213
#: ../../WINGs/wcolorpanel.c:3218 ../../WINGs/wcolorpanel.c:3245
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:650
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
#: ../../WINGs/wfilepanel.c:974 ../../WINGs/wfontpanel.c:591
msgid "OK"
msgstr ""
#: ../../WINGs/wcolorpanel.c:1250 ../../WINGs/wcolorpanel.c:1286
#: ../../WINGs/wcolorpanel.c:1304
msgid "Color Panel: Could not find file"
msgstr "Farb-Panel: Datei konnte nicht gefunden werden"
#: ../../WINGs/wcolorpanel.c:1491 ../../WINGs/wcolorpanel.c:1556
#: ../../WINGs/wcolorpanel.c:1620
msgid "Color Panel: X failed request"
msgstr "Farb-Panel: X-Anfrage fehlgeschlagen"
#: ../../WINGs/wcolorpanel.c:2865
msgid "Saturation"
msgstr "Sättigung"
#: ../../WINGs/wcolorpanel.c:2901
msgid "Hue"
msgstr "Farbton"
#: ../../WINGs/wcolorpanel.c:3151
msgid "Open Palette"
msgstr "Palette öffnen"
#: ../../WINGs/wcolorpanel.c:3213
msgid "Invalid file format !"
msgstr "Ungültiges Dateiformat!"
#: ../../WINGs/wcolorpanel.c:3215
#, c-format
msgid "can't remove file %s"
msgstr "Datei %s konnte nicht entfert werden"
#: ../../WINGs/wcolorpanel.c:3217
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Datei konnte nicht aus Konfigurationsverzeichnis entfernt werden!"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename"
msgstr "Umbenennen"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename palette to:"
msgstr "Palette umbenennen in:"
#: ../../WINGs/wcolorpanel.c:3245 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
msgid "Cancel"
msgstr "Abbrechen"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3261 ../../WINGs/wfilepanel.c:763
msgid "Warning"
msgstr "Warnung"
#: ../../WINGs/wcolorpanel.c:3262
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Palette existiert bereits!\n"
"\n"
"Überschreiben?"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "No"
msgstr "Nein"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "Yes"
msgstr "Ja"
#: ../../WINGs/wcolorpanel.c:3294
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "Palette %s konnte nicht nach %s umbenannt werden\n"
#: ../../WINGs/wcolorpanel.c:3320
msgid "This will permanently remove the palette "
msgstr "Hiermit wird die Palette unwiderruflich gelöscht "
#: ../../WINGs/wcolorpanel.c:3323
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Sind Sie sicher, dass Sie die Palette löschen wollen?"
#: ../../WINGs/wcolorpanel.c:3348
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "Palette %s konnte nicht gelöscht werden\n"
#: ../../WINGs/wcolorpanel.c:3647
#, c-format
msgid "Could not open %s"
msgstr "%s konnte nicht geöffnet werden"
#: ../../WINGs/wcolorpanel.c:3654
#, c-format
msgid "Could not create %s"
msgstr "%s konnte nicht erzeugt werden"
#: ../../WINGs/wcolorpanel.c:3665
#, c-format
msgid "Write error on file %s"
msgstr "Schreibfehler bei Datei %s"
#: ../../WINGs/wcolorpanel.c:3710
msgid "Color Panel: Color unspecified"
msgstr "Farb-Panel: Farbe nicht spezifiziert"
#: ../../WINGs/wfilepanel.c:235
msgid "Name:"
msgstr "Name:"
#: ../../WINGs/wfilepanel.c:332 ../../WINGs/wfilepanel.c:396
msgid "Open"
msgstr "Öffnen"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save"
msgstr "Speichern"
#: ../../WINGs/wfilepanel.c:565
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: Verzeichnis %s konnte nicht geöffnet werden\n"
#: ../../WINGs/wfilepanel.c:583
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: Dateistatus von %s unbestimmbar\n"
#: ../../WINGs/wfilepanel.c:650 ../../WINGs/wfilepanel.c:973
#: ../../WINGs/wfontpanel.c:590
msgid "Error"
msgstr "Fehler"
#: ../../WINGs/wfilepanel.c:661
msgid "Create Directory"
msgstr "Verzeichnis anlegen"
#: ../../WINGs/wfilepanel.c:662
msgid "Enter directory name"
msgstr "Verzeichnisname eingeben"
#: ../../WINGs/wfilepanel.c:698 ../../WINGs/wfilepanel.c:737
#: ../../WINGs/wfilepanel.c:768 ../../WINGs/wfilepanel.c:796
msgid "Permission denied."
msgstr "Zugriff verweigert."
#: ../../WINGs/wfilepanel.c:701
#, c-format
msgid "'%s' already exists."
msgstr "'%s' existiert bereits."
#: ../../WINGs/wfilepanel.c:704
msgid "Path does not exist."
msgstr "Pfad existiert nicht."
#: ../../WINGs/wfilepanel.c:734 ../../WINGs/wfilepanel.c:793
#, c-format
msgid "'%s' does not exist."
msgstr "'%s' existiert nicht."
#: ../../WINGs/wfilepanel.c:741 ../../WINGs/wfilepanel.c:800
msgid "Insufficient memory available."
msgstr "Nicht genügend Speicher verfügbar."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:804
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "'%s' liegt auf einem nur lesbaren Dateisystem."
#: ../../WINGs/wfilepanel.c:748 ../../WINGs/wfilepanel.c:780
#: ../../WINGs/wfilepanel.c:807
#, c-format
msgid "Can not delete '%s'."
msgstr "Kann %s nicht löschen."
#: ../../WINGs/wfilepanel.c:755
#, c-format
msgid "Delete directory %s ?"
msgstr "Verzeichnis %s löschen?"
#: ../../WINGs/wfilepanel.c:759
#, c-format
msgid "Delete file %s ?"
msgstr "Datei %s löschen?"
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' does not exist."
msgstr "Verzeichnis '%s' existiert nicht."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is not empty."
msgstr "Verzeichnis '%s' ist nicht leer."
#: ../../WINGs/wfilepanel.c:777
#, c-format
msgid "Directory '%s' is busy."
msgstr "Verzeichnis '%s' wird benutz."
#: ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' is a directory."
msgstr "'%s' ist ein Verzeichnis."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgstr "Fehler beim Lesen von '%s'."
#: ../../WINGs/wfilepanel.c:836
#, c-format
msgid "'%s' is not a directory."
msgstr "'%s' ist kein Verzeichnis."
#: ../../WINGs/wfilepanel.c:973
msgid "File does not exist."
msgstr "Datei existiert nicht."
#: ../../WINGs/wfont.c:40
#, c-format
msgid "invalid font: %s. Trying '%s'"
msgstr "Ungültige Schriftart: %s. Wird ersetzt durch %s."
#: ../../WINGs/wfont.c:257 ../../WINGs/wfont.c:277
#, c-format
msgid "could not load font: %s."
msgstr "Schriftart konnte nicht geladen werden: %s"
#. WMSetWidgetBackgroundColor(panel->win, WMWhiteColor(scr));
#: ../../WINGs/wfontpanel.c:203
msgid "Font Panel"
msgstr "Schrift-Panel"
#: ../../WINGs/wfontpanel.c:239
msgid "The quick brown fox jumps over the lazy dog"
msgstr ""
#: ../../WINGs/wfontpanel.c:245
msgid "Family"
msgstr "Familie"
#: ../../WINGs/wfontpanel.c:256
msgid "Typeface"
msgstr "Schriftart"
#: ../../WINGs/wfontpanel.c:267
msgid "Size"
msgstr "Größe"
#: ../../WINGs/wfontpanel.c:286
msgid "Set"
msgstr "Setzen"
#: ../../WINGs/wfontpanel.c:292
msgid "Revert"
msgstr "Zurücksetzen"
#: ../../WINGs/wfontpanel.c:591
msgid "Could not init font config library\n"
msgstr "\"font-config\"-Bibliothek konnte nicht initialisiert werden\n"
#: ../../WINGs/widgets.c:419
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: Widget-Bilderdatei konnte nicht geladen werden: %s"
#: ../../WINGs/widgets.c:767
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr ""
"Keine Schrifen konnten geladen werden. Überprüfen Sie, ob Ihre Schrifteninstallation und -"
"Lokalisierungseinstellungen korrekt sind."
#: ../../WINGs/wruler.c:192
msgid "0 inches"
msgstr "0 Inch"

View File

@@ -1,739 +0,0 @@
# KTranslator Generated File
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.80.0\n"
"POT-Creation-Date: 2003-05-02 15:39+0200\n"
"PO-Revision-Date: 2002-01-09 21:20+0100\n"
"Last-Translator: Emmanuel Benoit <tseeker@neptune.fr>\n"
"Language-Team: Français <fr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: unknown\n"
#: ../../WINGs/connection.c:467 ../../WINGs/connection.c:532
#: ../../WINGs/connection.c:575
msgid "Bad address-service-protocol combination"
msgstr "Mauvaise combinaison adresse-service-protocole"
#: ../../WINGs/error.c:54
#, c-format
msgid "Unknown error %d"
msgstr "Erreur inconnue %d"
#: ../../WINGs/error.c:59
#, c-format
msgid "Error %d"
msgstr "Erreur %d"
#: ../../WINGs/error.c:110
msgid " warning: "
msgstr " Avertissement : "
#: ../../WINGs/error.c:137
msgid " fatal error: "
msgstr " erreur fatale : "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: "
msgstr " erreur : "
#: ../../WINGs/findfile.c:48
#, c-format
msgid "could not get password entry for UID %i"
msgstr "Impossible de lire le mot de passe de l'UID %i"
#: ../../WINGs/findfile.c:66
#, c-format
msgid "could not get password entry for user %s"
msgstr "Impossible de lire le mot de passe de l'utilisateur %s"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "Impossible de déterminer le nom de la machine"
# TODO pas de traduction correcte possible, cf source.
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "Faute de syntaxe dans %s %s, ligne %i : %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr ""
"Seuls les types string ou data sont supportés pour une clé de dictionnaire "
"Proplist"
#: ../../WINGs/proplist.c:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "Une fonction Proplist a été utilisée sur des objets non-WMPropList"
#: ../../WINGs/proplist.c:630
msgid "unterminated PropList string"
msgstr "chaîne PropList sans fin"
#: ../../WINGs/proplist.c:670
msgid "unterminated PropList data"
msgstr "données PropList sans fin"
#: ../../WINGs/proplist.c:678
msgid "unterminated PropList data (missing hexdigit)"
msgstr "données PropList sans fin (il manque un chiffre hexadécimal)"
#: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data"
msgstr "caractère non-hexadécimal dans les données PropList"
#: ../../WINGs/proplist.c:729
msgid "unterminated PropList array"
msgstr "tableau PropList sans fin"
#: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array"
msgstr "tableau PropList manquant ou sans fin"
#: ../../WINGs/proplist.c:747
msgid "could not get PropList array element"
msgstr "impossible de lire l'élément du tableau PropList"
#: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary"
msgstr "dictionnaire PropList sans fin"
#: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key"
msgstr "clef du dictionnaire PropList manquante"
#: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "clef du dictionnaire PropList manquante ou dictionnaire sans fin"
#: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key"
msgstr "erreur lors de l'analyse de la clef de dictionnaire PropList"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "signe '=' manquant dans l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr ""
"erreur lors de l'analyse de la valeur de l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "signe ';' manquant dans l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:888
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr ""
"une chaine, des données, un tableau ou un dictionnaire étaient attendus. "
"S'il s'agit d'une chaîne, essayez de la délimiter grâce à '\"'."
#: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr ""
"Les commentaires ne sont pas autorisés dans les fichiers appartenant au "
"domaine de Window Maker."
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1628
msgid "extra data after end of property list"
msgstr "données excédentaires après la fin de la liste de propriétés"
#: ../../WINGs/proplist.c:1606
#, c-format
msgid "could not get size for file '%s'"
msgstr "impossible de déterminer la taille du fichier '%s'"
#: ../../WINGs/proplist.c:1618
#, c-format
msgid "error reading from file '%s'"
msgstr "erreur pendant la lecture du fichier '%s'"
#: ../../WINGs/proplist.c:1669
#, c-format
msgid "mkstemp (%s) failed"
msgstr "mkstemp (%s) a échoué"
#: ../../WINGs/proplist.c:1680
#, c-format
msgid "mktemp (%s) failed"
msgstr "mktemp (%s) a échoué"
#: ../../WINGs/proplist.c:1691
#, c-format
msgid "open (%s) failed"
msgstr "open (%s) a échoué"
#: ../../WINGs/proplist.c:1698
#, c-format
msgid "writing to file: %s failed"
msgstr "erreur pendant l'écriture dans le fichier '%s'"
#: ../../WINGs/proplist.c:1706
#, c-format
msgid "fclose (%s) failed"
msgstr "erreur lors de la fermeture du fichier '%s'"
#: ../../WINGs/proplist.c:1715
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "impossible de renommer '%s' en '%s'"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:188 ../../WINGs/userdefaults.c:204
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr ""
"impossible de lire le domaine depuis le fichier '%s' pendant la "
"synchronisation"
#: ../../WINGs/wcolor.c:224 ../../WINGs/wcolor.c:236 ../../WINGs/wcolor.c:275
#: ../../WINGs/wcolor.c:316
#, c-format
msgid "could not allocate %s color"
msgstr "impossible d'allouer la couleur %s"
#: ../../WINGs/wcolor.c:224
msgid "white"
msgstr "blanc"
#: ../../WINGs/wcolor.c:236
msgid "black"
msgstr "noir"
#: ../../WINGs/wcolor.c:275
msgid "gray"
msgstr "gris"
#: ../../WINGs/wcolor.c:316
msgid "dark gray"
msgstr "gris sombre"
#: ../../WINGs/wcolorpanel.c:420
msgid "Colors"
msgstr "Couleurs"
#: ../../WINGs/wcolorpanel.c:610 ../../WINGs/wcolorpanel.c:2829
msgid "Brightness"
msgstr "Luminosité"
#: ../../WINGs/wcolorpanel.c:612 ../../WINGs/wcolorpanel.c:688
#: ../../WINGs/wcolorpanel.c:721 ../../WINGs/wcolorpanel.c:755
#: ../../WINGs/wcolorpanel.c:815 ../../WINGs/wcolorpanel.c:849
#: ../../WINGs/wcolorpanel.c:883 ../../WINGs/wcolorpanel.c:918
#: ../../WINGs/wcolorpanel.c:2169 ../../WINGs/wcolorpanel.c:2831
#: ../../WINGs/wcolorpanel.c:2867 ../../WINGs/wcolorpanel.c:2903
#: ../../WINGs/wcolorpanel.c:3745
msgid "Color Panel: Could not allocate memory"
msgstr "Panneau de Sélection des Couleur: impossible d'allouer la mémoire"
#: ../../WINGs/wcolorpanel.c:685 ../../WINGs/wcolorpanel.c:686
msgid "Red"
msgstr "Rouge"
#: ../../WINGs/wcolorpanel.c:718 ../../WINGs/wcolorpanel.c:719
msgid "Green"
msgstr "Vert"
#: ../../WINGs/wcolorpanel.c:752 ../../WINGs/wcolorpanel.c:753
msgid "Blue"
msgstr "Bleu"
#: ../../WINGs/wcolorpanel.c:812 ../../WINGs/wcolorpanel.c:813
msgid "Cyan"
msgstr "Cyan"
#: ../../WINGs/wcolorpanel.c:846 ../../WINGs/wcolorpanel.c:847
msgid "Magenta"
msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:880 ../../WINGs/wcolorpanel.c:881
msgid "Yellow"
msgstr "Jaune"
#: ../../WINGs/wcolorpanel.c:915 ../../WINGs/wcolorpanel.c:916
msgid "Black"
msgstr "Noir"
#: ../../WINGs/wcolorpanel.c:996
msgid "Spectrum"
msgstr "Spectre"
#: ../../WINGs/wcolorpanel.c:1026
msgid "Palette"
msgstr "Palette"
#: ../../WINGs/wcolorpanel.c:1032
msgid "New from File..."
msgstr "Nouveau d'après le fichier..."
#: ../../WINGs/wcolorpanel.c:1033 ../../WINGs/wcolorpanel.c:1081
#: ../../WINGs/wcolorpanel.c:1098
msgid "Rename..."
msgstr "Renommer..."
#: ../../WINGs/wcolorpanel.c:1034 ../../WINGs/wcolorpanel.c:1082
#: ../../WINGs/wcolorpanel.c:1099 ../../WINGs/wcolorpanel.c:3326
msgid "Remove"
msgstr "Supprimer"
#: ../../WINGs/wcolorpanel.c:1035
msgid "Copy"
msgstr "Copier"
#: ../../WINGs/wcolorpanel.c:1036
msgid "New from Clipboard"
msgstr "Nouveau d'après le presse-papier"
#: ../../WINGs/wcolorpanel.c:1057
msgid "X11-Colors"
msgstr "Couleurs X11"
#: ../../WINGs/wcolorpanel.c:1074
msgid "Color"
msgstr "Couleur"
#: ../../WINGs/wcolorpanel.c:1080
msgid "Add..."
msgstr "Ajouter..."
#: ../../WINGs/wcolorpanel.c:1090
msgid "List"
msgstr "Liste"
#: ../../WINGs/wcolorpanel.c:1097
msgid "New..."
msgstr "Nouveau..."
#: ../../WINGs/wcolorpanel.c:1236
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Panneau de sélection des couleurs : impossible de créer le répertoire %s "
"requis pour enregistrer les configurations."
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1242 ../../WINGs/wcolorpanel.c:3212
#: ../../WINGs/wcolorpanel.c:3216
msgid "File Error"
msgstr "Erreur de fichier"
#: ../../WINGs/wcolorpanel.c:1243
msgid "Could not create ColorPanel configuration directory"
msgstr ""
"Impossible de créer le répertoire pour la configuration du panneau de "
"sélection des couleurs."
#: ../../WINGs/wcolorpanel.c:1244 ../../WINGs/wcolorpanel.c:3213
#: ../../WINGs/wcolorpanel.c:3218 ../../WINGs/wcolorpanel.c:3245
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:650
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
#: ../../WINGs/wfilepanel.c:974 ../../WINGs/wfontpanel.c:751
msgid "OK"
msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1250 ../../WINGs/wcolorpanel.c:1286
#: ../../WINGs/wcolorpanel.c:1304
msgid "Color Panel: Could not find file"
msgstr "Panneau de sélection des couleurs : Impossible de trouver le fichier."
#: ../../WINGs/wcolorpanel.c:1491 ../../WINGs/wcolorpanel.c:1556
#: ../../WINGs/wcolorpanel.c:1620
msgid "Color Panel: X failed request"
msgstr "Panneau de sélection des couleurs : échec d'une requête X"
#: ../../WINGs/wcolorpanel.c:2865
msgid "Saturation"
msgstr "Saturation"
#: ../../WINGs/wcolorpanel.c:2901
msgid "Hue"
msgstr "Teinte"
#: ../../WINGs/wcolorpanel.c:3151
msgid "Open Palette"
msgstr "Ouvrir une palette"
#: ../../WINGs/wcolorpanel.c:3213
msgid "Invalid file format !"
msgstr "Format de fichier invalide !"
#: ../../WINGs/wcolorpanel.c:3215
#, c-format
msgid "can't remove file %s"
msgstr "Impossible de supprimer le fichier %s."
#: ../../WINGs/wcolorpanel.c:3217
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Impossible de supprimer le fichier du répertoire de configuration !"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename"
msgstr "Renommer"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename palette to:"
msgstr "Renommer la palette en :"
#: ../../WINGs/wcolorpanel.c:3245 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
msgid "Cancel"
msgstr "Annuler"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3261 ../../WINGs/wfilepanel.c:763
msgid "Warning"
msgstr "Avertissement"
#: ../../WINGs/wcolorpanel.c:3262
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"La palette existe déjà !\n"
"\n"
"Écraser ?"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "No"
msgstr "Non"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "Yes"
msgstr "Oui"
#: ../../WINGs/wcolorpanel.c:3294
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "Impossible de renommer la palette %s en %s.\n"
#: ../../WINGs/wcolorpanel.c:3320
msgid "This will permanently remove the palette "
msgstr "Ceci détruira définitivement la palette "
#: ../../WINGs/wcolorpanel.c:3323
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Êtes-vous sûr de vouloir supprimer cette palette ?"
#: ../../WINGs/wcolorpanel.c:3348
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "Impossible de détruire la palette %s.\n"
#: ../../WINGs/wcolorpanel.c:3647
#, c-format
msgid "Could not open %s"
msgstr "Impossible d'ouvrir %s."
#: ../../WINGs/wcolorpanel.c:3654
#, c-format
msgid "Could not create %s"
msgstr "Impossible de créer %s."
#: ../../WINGs/wcolorpanel.c:3665
#, c-format
msgid "Write error on file %s"
msgstr "Erreur d'écriture dans le fichier %s."
#: ../../WINGs/wcolorpanel.c:3710
msgid "Color Panel: Color unspecified"
msgstr "Panneau de sélection des couleurs: couleur non spécifiée."
#: ../../WINGs/wfilepanel.c:235
msgid "Name:"
msgstr "Nom :"
#: ../../WINGs/wfilepanel.c:332 ../../WINGs/wfilepanel.c:396
msgid "Open"
msgstr "Ouvrir"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save"
msgstr "Enregistrer"
#: ../../WINGs/wfilepanel.c:565
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs : Impossible d'ouvrir le répertoire %s.\n"
#: ../../WINGs/wfilepanel.c:583
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs : impossible de lire l'état du fichier %s.\n"
#: ../../WINGs/wfilepanel.c:650 ../../WINGs/wfilepanel.c:973
#: ../../WINGs/wfontpanel.c:750
msgid "Error"
msgstr "Erreur"
#: ../../WINGs/wfilepanel.c:661
msgid "Create Directory"
msgstr "Créer un répertoire"
#: ../../WINGs/wfilepanel.c:662
msgid "Enter directory name"
msgstr "Saisissez le nom du répertoire"
#: ../../WINGs/wfilepanel.c:698 ../../WINGs/wfilepanel.c:737
#: ../../WINGs/wfilepanel.c:768 ../../WINGs/wfilepanel.c:796
msgid "Permission denied."
msgstr "Permission refusée."
#: ../../WINGs/wfilepanel.c:701
#, c-format
msgid "'%s' already exists."
msgstr "'%s' existe déjà."
#: ../../WINGs/wfilepanel.c:704
msgid "Path does not exist."
msgstr "Le chemin n'existe pas."
#: ../../WINGs/wfilepanel.c:734 ../../WINGs/wfilepanel.c:793
#, c-format
msgid "'%s' does not exist."
msgstr "'%s' n'existe pas."
#: ../../WINGs/wfilepanel.c:741 ../../WINGs/wfilepanel.c:800
msgid "Insufficient memory available."
msgstr "Mémoire disponible insuffisante."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:804
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "'%s' est sur un système de fichiers en lecture seule."
#: ../../WINGs/wfilepanel.c:748 ../../WINGs/wfilepanel.c:780
#: ../../WINGs/wfilepanel.c:807
#, c-format
msgid "Can not delete '%s'."
msgstr "Impossible de supprimer '%s'."
#: ../../WINGs/wfilepanel.c:755
#, c-format
msgid "Delete directory %s ?"
msgstr "Supprimer le répertoire %s ?"
#: ../../WINGs/wfilepanel.c:759
#, c-format
msgid "Delete file %s ?"
msgstr "Supprimer le fichier %s ?"
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' does not exist."
msgstr "Le répertoire '%s' n'existe pas."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is not empty."
msgstr "Le répertoire '%s' n'est pas vide."
#: ../../WINGs/wfilepanel.c:777
#, c-format
msgid "Directory '%s' is busy."
msgstr "Le répertoire '%s' est occupé."
#: ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' is a directory."
msgstr "'%s' est un répertoire."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgstr "Une erreur s'est produite pendant le parcours de '%s'."
#: ../../WINGs/wfilepanel.c:836
#, c-format
msgid "'%s' is not a directory."
msgstr "'%s' n'est pas un répertoire."
#: ../../WINGs/wfilepanel.c:973
msgid "File does not exist."
msgstr "Le fichier n'existe pas."
#: ../../WINGs/wfont.c:133 ../../WINGs/wfont.c:143
#, c-format
msgid "Invalid size specification '%s' in %s. Using default %d\n"
msgstr ""
"Taille invalide dans %2$s : '%1$s'. Utilisation de la valeur par défaut %3"
"$d\n"
#: ../../WINGs/wfont.c:187
#, c-format
msgid "the following character sets are missing in %s:"
msgstr "Les jeux de caractères suivants manquent dans %s :"
#: ../../WINGs/wfont.c:193
#, c-format
msgid ""
"the string \"%s\" will be used in place of any characters from those sets."
msgstr ""
"La chaîne « %s » sera utilisée à la place de tous les caractères de ces jeux."
#. is arial a good fallback for multibyte?
#: ../../WINGs/wfont.c:599 ../../WINGs/wfont.c:614
#, c-format
msgid "could not load font %s. Trying arial."
msgstr ""
"Impossible de charger la police de caractères %s, essai de la police "
 arial »."
#: ../../WINGs/wfont.c:606
msgid "could not load antialiased font set. Reverting to standard font sets."
msgstr ""
"Impossible de charger les polices lissées, utilisation des polices normales."
#: ../../WINGs/wfont.c:609
#, c-format
msgid "could not load FontSet %s. Trying fixed."
msgstr ""
"Impossible de charger la famille de polices %s, essai de la famille "
 fixed »."
#: ../../WINGs/wfont.c:621
msgid "could not load antialiased fonts. Reverting to normal fonts."
msgstr ""
"Impossible de charger les polices lissées, utilisation des polices normales."
#: ../../WINGs/wfont.c:624 ../../WINGs/wfont.c:635
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr ""
"Impossible de charger la police de caractères %s, essai de la police "
 fixed »."
#: ../../WINGs/wfont.c:629
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr ""
"Impossible de charger la famille de polices %s, essai de la famille "
 fixed »."
#: ../../WINGs/wfont.c:639
msgid "could not load fixed font!"
msgstr "Impossible de charger la police de caractères « fixed » !"
#: ../../WINGs/wfont.c:704 ../../WINGs/wfont.c:765 ../../WINGs/wfont.c:836
#, c-format
msgid ""
"Conversion to widechar failed (possible invalid multibyte sequence): '%s':"
"(pos %d)\n"
msgstr ""
"Échec de la conversion en widechar (probablement une séquence d'octets "
"erronée) : « %s » (pos %d)\n"
#: ../../WINGs/wfont.c:887
#, c-format
msgid "font description %s is too large."
msgstr "La description de la police de caractères %s est trop volumineuse."
#. // remove warning later. or maybe not
#: ../../WINGs/wfont.c:935
#, c-format
msgid "Invalid font specification: '%s'\n"
msgstr "Déclaration de police invalide : « %s »\n"
#: ../../WINGs/wfontpanel.c:235
msgid "Test!!!"
msgstr "Test !"
#: ../../WINGs/wfontpanel.c:241
msgid "Family"
msgstr "Famille"
#: ../../WINGs/wfontpanel.c:252
msgid "Typeface"
msgstr "Caractère"
#: ../../WINGs/wfontpanel.c:263
msgid "Size"
msgstr "Taille"
#: ../../WINGs/wfontpanel.c:282
msgid "Set"
msgstr "Famille"
#: ../../WINGs/wfontpanel.c:288
msgid "Revert"
msgstr "Revenir"
#: ../../WINGs/wfontpanel.c:751
msgid "Could not retrieve font list"
msgstr "Impossible de lire la liste des polices de caractères."
#: ../../WINGs/wfontpanel.c:765
#, c-format
msgid "font name %s is longer than 256, which is invalid."
msgstr ""
"Le nom de police %s a plus de 256 caractères et est par conséquent invalide."
#: ../../WINGs/wfontpanel.c:913
msgid "Roman"
msgstr "Roman"
#: ../../WINGs/wfontpanel.c:916
msgid "Italic"
msgstr "Italique"
#: ../../WINGs/wfontpanel.c:918
msgid "Oblique"
msgstr "Penché"
#: ../../WINGs/wfontpanel.c:920
msgid "Rev Italic"
msgstr "Italique inverse"
#: ../../WINGs/wfontpanel.c:922
msgid "Rev Oblique"
msgstr "Penché inverse"
#: ../../WINGs/wfontpanel.c:928
msgid "Normal"
msgstr "Normal"
#: ../../WINGs/widgets.c:419
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs : impossible de charger le fichier d'images de widget '%s'."
#: ../../WINGs/widgets.c:770
msgid ""
"Text antialiasing is enabled in the configuration but the X server doesn't "
"have the required capabilities (missing RENDER extension). Disabling text "
"antialiasing."
msgstr ""
"Le lissage du texte est activé dans la configuration mais le serveur X ne "
"dispose pas de l'extension adéquate (extension RENDER). Desactivation du "
"lissage."
#: ../../WINGs/widgets.c:787
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr ""
"Aucune police n'a pu être chargée. Veuillez vérifier que vos polices sont "
"correctement installées et que votre langue est bien configurée."
#: ../../WINGs/wruler.c:192
msgid "0 inches"
msgstr "0 pouces"

View File

@@ -1,719 +0,0 @@
# Slovak messages for WINGs
# (C) 2001 Jan "judas" Tomka
#
# Original translation by Jan "judas" Tomka on Feb 25 2001
# Currently maintained by Jan "judas" Tomka <judas@linux.sk>
#
# Version history:
# WM-ver author email date
# 0.65.1 Jan "judas" Tomka <judas@linux.sk> Aug 08 2001
# 0.70.0 Jan "judas" Tomka <judas@linux.sk> Oct 15 2001
# 0.70.1 Jan "judas" Tomka <judas@linux.sk> Nov 02 2001
# 0.80.0 Jan "judas" Tomka <judas@linux.sk> Dec 20 2001
# 0.80.2 Jan "judas" Tomka <judas@linux.sk> Jan 31 2004
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.80.0\n"
"POT-Creation-Date: 2004-01-31 18:36+0100\n"
"PO-Revision-Date: 2001-12-20 04:00+0100\n"
"Last-Translator: Jan \"judas\" Tomka <judas@linux.sk>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../WINGs/connection.c:467 ../../WINGs/connection.c:532
#: ../../WINGs/connection.c:575
msgid "Bad address-service-protocol combination"
msgstr "Nesprávna kombinácia adresa-služba-protokol"
#: ../../WINGs/error.c:54
#, c-format
msgid "Unknown error %d"
msgstr "Nezmána chyba %d"
#: ../../WINGs/error.c:59
#, c-format
msgid "Error %d"
msgstr "Chyba %d"
#: ../../WINGs/error.c:110
msgid " warning: "
msgstr " varovanie: "
#: ../../WINGs/error.c:137
msgid " fatal error: "
msgstr " fatálna chyba: "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: "
msgstr " chyba: "
#: ../../WINGs/findfile.c:48
#, c-format
msgid "could not get password entry for UID %i"
msgstr "nemožno zistiť informácie o UID %i"
#: ../../WINGs/findfile.c:66
#, c-format
msgid "could not get password entry for user %s"
msgstr "nemožno zistiť informácie o užívateľovi %s"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "Nemožno zistiť aktuálne meno počítača"
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "chyba syntaxe v %s %s, riadok %i: %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr "Pre kľúč slovníka proplist je podporovaný len reťazec alebo dáta"
#: ../../WINGs/proplist.c:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects"
msgstr "Použitá proplist funkcia na iných ako WMPropLists objektoch"
#: ../../WINGs/proplist.c:630
msgid "unterminated PropList string"
msgstr "neukončený PropList reťazec"
#: ../../WINGs/proplist.c:670
msgid "unterminated PropList data"
msgstr "neukončené PropList dáta"
#: ../../WINGs/proplist.c:678
msgid "unterminated PropList data (missing hexdigit)"
msgstr "neukončené PropList dáta (chýbajúca hex číslica)"
#: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data"
msgstr "v PropList dátach je znak, ktorý nie je hex číslicou"
#: ../../WINGs/proplist.c:729
msgid "unterminated PropList array"
msgstr "neukončené PropList pole"
#: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array"
msgstr "chýbajúce alebo neukončené PropList pole"
#: ../../WINGs/proplist.c:747
msgid "could not get PropList array element"
msgstr "nemožno zistiť prvok PropList poľa"
#: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary"
msgstr "neukončený PropList slovník"
#: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key"
msgstr "chýbajúci kľúč PropList slovníka"
#: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "chýbajúci kľúč položky PropList slovníka alebo neukončený slovník"
#: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key"
msgstr "chyba pri parsovaní kľúča PropList slovníka"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "chýbajúce = v položke PropList slovníka"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr "chyba pri parsovaní hodnoty položky PropList slovníka"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "chýbajúca ; v položke PropList slovníka"
#: ../../WINGs/proplist.c:888
msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"."
msgstr ""
"očakávaný bol reťazec, dáta, pole alebo slovník. Ak je to reťazec, skúste ho "
"uzavrieť medzi \"."
#: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "Komentáre v doménových súboroch Window Makera nie sú povolené."
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1630
msgid "extra data after end of property list"
msgstr "prebytočné dáta na konci property listu"
#: ../../WINGs/proplist.c:1606
#, c-format
msgid "could not get size for file '%s'"
msgstr "nemožno zistiť veľkosť súboru '%s'"
#: ../../WINGs/proplist.c:1619
#, c-format
msgid "error reading from file '%s'"
msgstr "chyba pri čítaní zo súboru '%s'"
#: ../../WINGs/proplist.c:1671
#, c-format
msgid "mkstemp (%s) failed"
msgstr "chyba mkstemp (%s)"
#: ../../WINGs/proplist.c:1682
#, c-format
msgid "mktemp (%s) failed"
msgstr "chyba mktemp(%s)"
#: ../../WINGs/proplist.c:1693
#, c-format
msgid "open (%s) failed"
msgstr "chyba pri otváraní (%s)"
#: ../../WINGs/proplist.c:1700
#, c-format
msgid "writing to file: %s failed"
msgstr "chyba pri zápise do súboru: %s"
#: ../../WINGs/proplist.c:1708
#, c-format
msgid "fclose (%s) failed"
msgstr "chyba fclose (%s)"
#: ../../WINGs/proplist.c:1717
#, c-format
msgid "rename ('%s' to '%s') failed"
msgstr "chyba rename ('%s' na '%s')"
#. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:188 ../../WINGs/userdefaults.c:204
#, c-format
msgid "cannot read domain from file '%s' when syncing"
msgstr "nemožno čítať doménu zo súboru '%s' pri synchronizácii"
#: ../../WINGs/wcolor.c:224 ../../WINGs/wcolor.c:236 ../../WINGs/wcolor.c:275
#: ../../WINGs/wcolor.c:316
#, c-format
msgid "could not allocate %s color"
msgstr "nemožno alokovať %s farbu"
#: ../../WINGs/wcolor.c:224
msgid "white"
msgstr "bielu"
#: ../../WINGs/wcolor.c:236
msgid "black"
msgstr "čiernu"
#: ../../WINGs/wcolor.c:275
msgid "gray"
msgstr "šedú"
#: ../../WINGs/wcolor.c:316
msgid "dark gray"
msgstr "tmavošedú"
#: ../../WINGs/wcolorpanel.c:420
msgid "Colors"
msgstr "Farby"
#: ../../WINGs/wcolorpanel.c:610 ../../WINGs/wcolorpanel.c:2829
msgid "Brightness"
msgstr "Svetlosť"
#: ../../WINGs/wcolorpanel.c:612 ../../WINGs/wcolorpanel.c:688
#: ../../WINGs/wcolorpanel.c:721 ../../WINGs/wcolorpanel.c:755
#: ../../WINGs/wcolorpanel.c:815 ../../WINGs/wcolorpanel.c:849
#: ../../WINGs/wcolorpanel.c:883 ../../WINGs/wcolorpanel.c:918
#: ../../WINGs/wcolorpanel.c:2169 ../../WINGs/wcolorpanel.c:2831
#: ../../WINGs/wcolorpanel.c:2867 ../../WINGs/wcolorpanel.c:2903
#: ../../WINGs/wcolorpanel.c:3745
msgid "Color Panel: Could not allocate memory"
msgstr "Panel farieb: Nemožno alokovať pamäť"
#: ../../WINGs/wcolorpanel.c:685 ../../WINGs/wcolorpanel.c:686
msgid "Red"
msgstr "Červená"
#: ../../WINGs/wcolorpanel.c:718 ../../WINGs/wcolorpanel.c:719
msgid "Green"
msgstr "Zelená"
#: ../../WINGs/wcolorpanel.c:752 ../../WINGs/wcolorpanel.c:753
msgid "Blue"
msgstr "Modrá"
#: ../../WINGs/wcolorpanel.c:812 ../../WINGs/wcolorpanel.c:813
msgid "Cyan"
msgstr "Azúrová"
#: ../../WINGs/wcolorpanel.c:846 ../../WINGs/wcolorpanel.c:847
msgid "Magenta"
msgstr "Purpurová"
#: ../../WINGs/wcolorpanel.c:880 ../../WINGs/wcolorpanel.c:881
msgid "Yellow"
msgstr "Žltá"
#: ../../WINGs/wcolorpanel.c:915 ../../WINGs/wcolorpanel.c:916
msgid "Black"
msgstr "Čierna"
#: ../../WINGs/wcolorpanel.c:996
msgid "Spectrum"
msgstr "Spektrum"
#: ../../WINGs/wcolorpanel.c:1026
msgid "Palette"
msgstr "Paleta"
#: ../../WINGs/wcolorpanel.c:1032
msgid "New from File..."
msgstr "Nová zo súboru..."
#: ../../WINGs/wcolorpanel.c:1033 ../../WINGs/wcolorpanel.c:1081
#: ../../WINGs/wcolorpanel.c:1098
msgid "Rename..."
msgstr "Premenovať..."
#: ../../WINGs/wcolorpanel.c:1034 ../../WINGs/wcolorpanel.c:1082
#: ../../WINGs/wcolorpanel.c:1099 ../../WINGs/wcolorpanel.c:3326
msgid "Remove"
msgstr "Odstrániť"
#: ../../WINGs/wcolorpanel.c:1035
msgid "Copy"
msgstr "Kopírovať"
#: ../../WINGs/wcolorpanel.c:1036
msgid "New from Clipboard"
msgstr "Nová z nástenky"
#: ../../WINGs/wcolorpanel.c:1057
msgid "X11-Colors"
msgstr "Farby X11"
#: ../../WINGs/wcolorpanel.c:1074
msgid "Color"
msgstr "Farba"
#: ../../WINGs/wcolorpanel.c:1080
msgid "Add..."
msgstr "Pridať..."
#: ../../WINGs/wcolorpanel.c:1090
msgid "List"
msgstr "Zoznam"
#: ../../WINGs/wcolorpanel.c:1097
msgid "New..."
msgstr "Nový..."
#: ../../WINGs/wcolorpanel.c:1236
#, c-format
msgid ""
"Color Panel: Could not create directory %s needed to store configurations"
msgstr ""
"Panel farieb: Nemožno vytvoriť adresár %s potrebný na uloženie nastavení"
#. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1242 ../../WINGs/wcolorpanel.c:3212
#: ../../WINGs/wcolorpanel.c:3216
msgid "File Error"
msgstr "Chyba súboru"
#: ../../WINGs/wcolorpanel.c:1243
msgid "Could not create ColorPanel configuration directory"
msgstr "Nemožno vytvoriť konfiguračný adresár panelu farieb"
#: ../../WINGs/wcolorpanel.c:1244 ../../WINGs/wcolorpanel.c:3213
#: ../../WINGs/wcolorpanel.c:3218 ../../WINGs/wcolorpanel.c:3245
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:650
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
#: ../../WINGs/wfilepanel.c:974 ../../WINGs/wfontpanel.c:751
msgid "OK"
msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1250 ../../WINGs/wcolorpanel.c:1286
#: ../../WINGs/wcolorpanel.c:1304
msgid "Color Panel: Could not find file"
msgstr "Panel farieb: Nemožno nájsť súbor"
#: ../../WINGs/wcolorpanel.c:1491 ../../WINGs/wcolorpanel.c:1556
#: ../../WINGs/wcolorpanel.c:1620
msgid "Color Panel: X failed request"
msgstr "Panel farieb: chyba požiadavky X"
#: ../../WINGs/wcolorpanel.c:2865
msgid "Saturation"
msgstr "Saturácia"
#: ../../WINGs/wcolorpanel.c:2901
msgid "Hue"
msgstr "Odtieň"
#: ../../WINGs/wcolorpanel.c:3151
msgid "Open Palette"
msgstr "Otvoriť paletu"
#: ../../WINGs/wcolorpanel.c:3213
msgid "Invalid file format !"
msgstr "Nesprávny súborový formát!"
#: ../../WINGs/wcolorpanel.c:3215
#, c-format
msgid "can't remove file %s"
msgstr "namožno odstrániť súbor %s"
#: ../../WINGs/wcolorpanel.c:3217
msgid "Couldn't remove file from Configuration Directory !"
msgstr "Nemožno odstrániť súbor z konfiguračného adresára!"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename"
msgstr "Premenovať"
#: ../../WINGs/wcolorpanel.c:3244
msgid "Rename palette to:"
msgstr "Premenovať paletu:"
#: ../../WINGs/wcolorpanel.c:3245 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
msgid "Cancel"
msgstr "Zrušiť"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3261 ../../WINGs/wfilepanel.c:763
msgid "Warning"
msgstr "Varovanie"
#: ../../WINGs/wcolorpanel.c:3262
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"Paleta už existuje!\n"
"\n"
"Prepísať?"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "No"
msgstr "Nie"
#: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "Yes"
msgstr "Áno"
#: ../../WINGs/wcolorpanel.c:3294
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "Nemožno premenovať paletu %s na %s\n"
#: ../../WINGs/wcolorpanel.c:3320
msgid "This will permanently remove the palette "
msgstr "Paleta bude natrvalo zmazaná"
#: ../../WINGs/wcolorpanel.c:3323
msgid ""
".\n"
"\n"
"Are you sure you want to remove this palette ?"
msgstr ""
".\n"
"\n"
"Ste si istý, že chcete odstrániť túto paletu?"
#: ../../WINGs/wcolorpanel.c:3348
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "Nemožno odstrániť paletu %s\n"
#: ../../WINGs/wcolorpanel.c:3647
#, c-format
msgid "Could not open %s"
msgstr "Nemožno otvoriť %s"
#: ../../WINGs/wcolorpanel.c:3654
#, c-format
msgid "Could not create %s"
msgstr "Nemožno vytvoriť %s"
#: ../../WINGs/wcolorpanel.c:3665
#, c-format
msgid "Write error on file %s"
msgstr "Chyba zápisu do súboru %s"
#: ../../WINGs/wcolorpanel.c:3710
msgid "Color Panel: Color unspecified"
msgstr "Panel farieb: Nešpecifikovaná farba"
#: ../../WINGs/wfilepanel.c:235
msgid "Name:"
msgstr "Meno:"
#: ../../WINGs/wfilepanel.c:332 ../../WINGs/wfilepanel.c:396
msgid "Open"
msgstr "Otvoriť"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save"
msgstr "Uložiť"
#: ../../WINGs/wfilepanel.c:565
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: nemožno otvoriť adresár %s\n"
#: ../../WINGs/wfilepanel.c:583
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: nemožno zistiť informácie o %s\n"
#: ../../WINGs/wfilepanel.c:650 ../../WINGs/wfilepanel.c:973
#: ../../WINGs/wfontpanel.c:750
msgid "Error"
msgstr "Chyba"
#: ../../WINGs/wfilepanel.c:661
msgid "Create Directory"
msgstr "Vytvoriť adresár"
#: ../../WINGs/wfilepanel.c:662
msgid "Enter directory name"
msgstr "Meno adresára"
#: ../../WINGs/wfilepanel.c:698 ../../WINGs/wfilepanel.c:737
#: ../../WINGs/wfilepanel.c:768 ../../WINGs/wfilepanel.c:796
msgid "Permission denied."
msgstr "Prístup zamietnutý."
#: ../../WINGs/wfilepanel.c:701
#, c-format
msgid "'%s' already exists."
msgstr "'%s' už existuje"
#: ../../WINGs/wfilepanel.c:704
msgid "Path does not exist."
msgstr "Cesta neexistuje."
#: ../../WINGs/wfilepanel.c:734 ../../WINGs/wfilepanel.c:793
#, c-format
msgid "'%s' does not exist."
msgstr "'%s' neexistuje."
#: ../../WINGs/wfilepanel.c:741 ../../WINGs/wfilepanel.c:800
msgid "Insufficient memory available."
msgstr "Nedostatok pamäti."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:804
#, c-format
msgid "'%s' is on a read-only filesystem."
msgstr "'%s' je na súborovom systéme len pre čítanie."
#: ../../WINGs/wfilepanel.c:748 ../../WINGs/wfilepanel.c:780
#: ../../WINGs/wfilepanel.c:807
#, c-format
msgid "Can not delete '%s'."
msgstr "Nemožno odstrániť '%s'."
#: ../../WINGs/wfilepanel.c:755
#, c-format
msgid "Delete directory %s ?"
msgstr "Odstrániť adresár %s?"
#: ../../WINGs/wfilepanel.c:759
#, c-format
msgid "Delete file %s ?"
msgstr "Odstrániť súbor %s?"
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' does not exist."
msgstr "Adresár '%s' neexistuje."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is not empty."
msgstr "Adresár '%s' nie je prázdny."
#: ../../WINGs/wfilepanel.c:777
#, c-format
msgid "Directory '%s' is busy."
msgstr "Adresár '%s' je používaný."
#: ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' is a directory."
msgstr "'%s' je adresár."
#: ../../WINGs/wfilepanel.c:832
#, c-format
msgid "An error occured browsing '%s'."
msgstr "Pri prehliadaní '%s' nastala chyba."
#: ../../WINGs/wfilepanel.c:836
#, c-format
msgid "'%s' is not a directory."
msgstr "'%s' nie je adresár."
#: ../../WINGs/wfilepanel.c:973
msgid "File does not exist."
msgstr "Súbor neexistuje."
#: ../../WINGs/wfont.c:324 ../../WINGs/wfont.c:344
#, c-format
msgid "could not load font %s."
msgstr "nemožno načítať font %s."
#: ../../WINGs/wfont.c:375 ../../WINGs/wfont.c:420 ../../WINGs/wfont.c:475
#: ../../WINGs/wfont.c:1337 ../../WINGs/wfont.c:1398 ../../WINGs/wfont.c:1469
#, c-format
msgid ""
"Conversion to widechar failed (possible invalid multibyte sequence): '%s':"
"(pos %d)\n"
msgstr ""
"Konverzia do widechar zlyhala (možno nesprávna multibyte sekvencia): '%s':"
"(pos %d)\n"
#. // remove warning later. or maybe not
#: ../../WINGs/wfont.c:591 ../../WINGs/wfont.c:1568
#, c-format
msgid "Invalid font specification: '%s'\n"
msgstr "Chybná špecifikácia fontu: '%s'\n"
#: ../../WINGs/wfont.c:770 ../../WINGs/wfont.c:780
#, c-format
msgid "Invalid size specification '%s' in %s. Using default %d\n"
msgstr "Chybná špecifikácia veľkosti '%s' v %s. Použije sa implicitná %d\n"
#: ../../WINGs/wfont.c:824
#, c-format
msgid "the following character sets are missing in %s:"
msgstr "nasledujúce sady znakov chýbajú v %s:"
#: ../../WINGs/wfont.c:830
#, c-format
msgid ""
"the string \"%s\" will be used in place of any characters from those sets."
msgstr "reťazec \"%s\" bude použitý namiesto znakov z týchto sád."
#. is arial a good fallback for multibyte?
#: ../../WINGs/wfont.c:1232 ../../WINGs/wfont.c:1247
#, c-format
msgid "could not load font %s. Trying arial."
msgstr "nemožno načítať font %s. Skúša sa načítať arial."
#: ../../WINGs/wfont.c:1239
msgid "could not load antialiased font set. Reverting to standard font sets."
msgstr "nemožno načítať antialiasovanú sadu fontov. Späť k štandardnej sade fontov."
#: ../../WINGs/wfont.c:1242
#, c-format
msgid "could not load FontSet %s. Trying fixed."
msgstr "nemožno načítať sadu fontov %s. Skúša sa načítať fixed."
#: ../../WINGs/wfont.c:1254
msgid "could not load antialiased fonts. Reverting to normal fonts."
msgstr "nemožno zaviesť antialiasovaný font. Návrat k normálnemu fontu."
#: ../../WINGs/wfont.c:1257 ../../WINGs/wfont.c:1268
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr "nemožno načítať font %s. Skúša sa načítať fixed."
#: ../../WINGs/wfont.c:1262
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr "nemožno načítať font %s. Skúša sa načítať fixed."
#: ../../WINGs/wfont.c:1272
msgid "could not load fixed font!"
msgstr "nemožno načítať font fixed!"
#: ../../WINGs/wfont.c:1520
#, c-format
msgid "font description %s is too large."
msgstr "popis fontu %s je príliš veľký."
#: ../../WINGs/wfontpanel.c:235
msgid "Test!!!"
msgstr "Skúška!!!"
#: ../../WINGs/wfontpanel.c:241
msgid "Family"
msgstr "Rodina"
#: ../../WINGs/wfontpanel.c:252
msgid "Typeface"
msgstr "Vzhľad"
#: ../../WINGs/wfontpanel.c:263
msgid "Size"
msgstr "Veľkosť"
#: ../../WINGs/wfontpanel.c:282
msgid "Set"
msgstr "Sada"
#: ../../WINGs/wfontpanel.c:288
msgid "Revert"
msgstr "Obrátiť"
#: ../../WINGs/wfontpanel.c:751
msgid "Could not retrieve font list"
msgstr "Nemožno obdržať zoznam fontov"
#: ../../WINGs/wfontpanel.c:765
#, c-format
msgid "font name %s is longer than 256, which is invalid."
msgstr "meno fontu %s je dlhšie ako 256, čo je nesprávne."
#: ../../WINGs/wfontpanel.c:913
msgid "Roman"
msgstr "roman"
#: ../../WINGs/wfontpanel.c:916
msgid "Italic"
msgstr "kurzíva"
#: ../../WINGs/wfontpanel.c:918
msgid "Oblique"
msgstr "šikmé"
#: ../../WINGs/wfontpanel.c:920
msgid "Rev Italic"
msgstr "obr. kurzíva"
#: ../../WINGs/wfontpanel.c:922
msgid "Rev Oblique"
msgstr "obr. šikmé"
#: ../../WINGs/wfontpanel.c:928
msgid "Normal"
msgstr "normálne"
#: ../../WINGs/widgets.c:419
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: nemožno načítať súbor s obrázkami pre widgety: %s"
#: ../../WINGs/widgets.c:772
msgid ""
"could not load any fonts. Make sure your font installation and locale "
"settings are correct."
msgstr ""
"nemožno načítať žiadny font. Ubezpečte sa, že inštalácia fontov a miestne "
"nastavenia sú v poriadku."
#: ../../WINGs/wruler.c:192
msgid "0 inches"
msgstr "0 palcov"

File diff suppressed because it is too large Load Diff

View File

@@ -1,771 +0,0 @@
/* Automatically generated file. Do NOT edit. Regenerate it using make-rgb */
#ifndef RGB_H_
#define RGB_H_
#include <wraster.h>
typedef struct RGBColor {
RColor color;
char *name;
} RGBColor;
RGBColor rgbColors[] = {
{{255, 250, 250, 0}, "snow"},
{{248, 248, 255, 0}, "ghost"},
{{248, 248, 255, 0}, "GhostWhite"},
{{245, 245, 245, 0}, "white"},
{{245, 245, 245, 0}, "WhiteSmoke"},
{{220, 220, 220, 0}, "gainsboro"},
{{255, 250, 240, 0}, "floral"},
{{255, 250, 240, 0}, "FloralWhite"},
{{253, 245, 230, 0}, "old"},
{{253, 245, 230, 0}, "OldLace"},
{{250, 240, 230, 0}, "linen"},
{{250, 235, 215, 0}, "antique"},
{{250, 235, 215, 0}, "AntiqueWhite"},
{{255, 239, 213, 0}, "papaya"},
{{255, 239, 213, 0}, "PapayaWhip"},
{{255, 235, 205, 0}, "blanched"},
{{255, 235, 205, 0}, "BlanchedAlmond"},
{{255, 228, 196, 0}, "bisque"},
{{255, 218, 185, 0}, "peach"},
{{255, 218, 185, 0}, "PeachPuff"},
{{255, 222, 173, 0}, "navajo"},
{{255, 222, 173, 0}, "NavajoWhite"},
{{255, 228, 181, 0}, "moccasin"},
{{255, 248, 220, 0}, "cornsilk"},
{{255, 255, 240, 0}, "ivory"},
{{255, 250, 205, 0}, "lemon"},
{{255, 250, 205, 0}, "LemonChiffon"},
{{255, 245, 238, 0}, "seashell"},
{{240, 255, 240, 0}, "honeydew"},
{{245, 255, 250, 0}, "mint"},
{{245, 255, 250, 0}, "MintCream"},
{{240, 255, 255, 0}, "azure"},
{{240, 248, 255, 0}, "alice"},
{{240, 248, 255, 0}, "AliceBlue"},
{{230, 230, 250, 0}, "lavender"},
{{255, 240, 245, 0}, "lavender"},
{{255, 240, 245, 0}, "LavenderBlush"},
{{255, 228, 225, 0}, "misty"},
{{255, 228, 225, 0}, "MistyRose"},
{{255, 255, 255, 0}, "white"},
{{ 0, 0, 0, 0}, "black"},
{{ 47, 79, 79, 0}, "dark"},
{{ 47, 79, 79, 0}, "DarkSlateGray"},
{{ 47, 79, 79, 0}, "dark"},
{{ 47, 79, 79, 0}, "DarkSlateGrey"},
{{105, 105, 105, 0}, "dim"},
{{105, 105, 105, 0}, "DimGray"},
{{105, 105, 105, 0}, "dim"},
{{105, 105, 105, 0}, "DimGrey"},
{{112, 128, 144, 0}, "slate"},
{{112, 128, 144, 0}, "SlateGray"},
{{112, 128, 144, 0}, "slate"},
{{112, 128, 144, 0}, "SlateGrey"},
{{119, 136, 153, 0}, "light"},
{{119, 136, 153, 0}, "LightSlateGray"},
{{119, 136, 153, 0}, "light"},
{{119, 136, 153, 0}, "LightSlateGrey"},
{{190, 190, 190, 0}, "gray"},
{{190, 190, 190, 0}, "grey"},
{{211, 211, 211, 0}, "light"},
{{211, 211, 211, 0}, "LightGrey"},
{{211, 211, 211, 0}, "light"},
{{211, 211, 211, 0}, "LightGray"},
{{ 25, 25, 112, 0}, "midnight"},
{{ 25, 25, 112, 0}, "MidnightBlue"},
{{ 0, 0, 128, 0}, "navy"},
{{ 0, 0, 128, 0}, "navy"},
{{ 0, 0, 128, 0}, "NavyBlue"},
{{100, 149, 237, 0}, "cornflower"},
{{100, 149, 237, 0}, "CornflowerBlue"},
{{ 72, 61, 139, 0}, "dark"},
{{ 72, 61, 139, 0}, "DarkSlateBlue"},
{{106, 90, 205, 0}, "slate"},
{{106, 90, 205, 0}, "SlateBlue"},
{{123, 104, 238, 0}, "medium"},
{{123, 104, 238, 0}, "MediumSlateBlue"},
{{132, 112, 255, 0}, "light"},
{{132, 112, 255, 0}, "LightSlateBlue"},
{{ 0, 0, 205, 0}, "medium"},
{{ 0, 0, 205, 0}, "MediumBlue"},
{{ 65, 105, 225, 0}, "royal"},
{{ 65, 105, 225, 0}, "RoyalBlue"},
{{ 0, 0, 255, 0}, "blue"},
{{ 30, 144, 255, 0}, "dodger"},
{{ 30, 144, 255, 0}, "DodgerBlue"},
{{ 0, 191, 255, 0}, "deep"},
{{ 0, 191, 255, 0}, "DeepSkyBlue"},
{{135, 206, 235, 0}, "sky"},
{{135, 206, 235, 0}, "SkyBlue"},
{{135, 206, 250, 0}, "light"},
{{135, 206, 250, 0}, "LightSkyBlue"},
{{ 70, 130, 180, 0}, "steel"},
{{ 70, 130, 180, 0}, "SteelBlue"},
{{176, 196, 222, 0}, "light"},
{{176, 196, 222, 0}, "LightSteelBlue"},
{{173, 216, 230, 0}, "light"},
{{173, 216, 230, 0}, "LightBlue"},
{{176, 224, 230, 0}, "powder"},
{{176, 224, 230, 0}, "PowderBlue"},
{{175, 238, 238, 0}, "pale"},
{{175, 238, 238, 0}, "PaleTurquoise"},
{{ 0, 206, 209, 0}, "dark"},
{{ 0, 206, 209, 0}, "DarkTurquoise"},
{{ 72, 209, 204, 0}, "medium"},
{{ 72, 209, 204, 0}, "MediumTurquoise"},
{{ 64, 224, 208, 0}, "turquoise"},
{{ 0, 255, 255, 0}, "cyan"},
{{224, 255, 255, 0}, "light"},
{{224, 255, 255, 0}, "LightCyan"},
{{ 95, 158, 160, 0}, "cadet"},
{{ 95, 158, 160, 0}, "CadetBlue"},
{{102, 205, 170, 0}, "medium"},
{{102, 205, 170, 0}, "MediumAquamarine"},
{{127, 255, 212, 0}, "aquamarine"},
{{ 0, 100, 0, 0}, "dark"},
{{ 0, 100, 0, 0}, "DarkGreen"},
{{ 85, 107, 47, 0}, "dark"},
{{ 85, 107, 47, 0}, "DarkOliveGreen"},
{{143, 188, 143, 0}, "dark"},
{{143, 188, 143, 0}, "DarkSeaGreen"},
{{ 46, 139, 87, 0}, "sea"},
{{ 46, 139, 87, 0}, "SeaGreen"},
{{ 60, 179, 113, 0}, "medium"},
{{ 60, 179, 113, 0}, "MediumSeaGreen"},
{{ 32, 178, 170, 0}, "light"},
{{ 32, 178, 170, 0}, "LightSeaGreen"},
{{152, 251, 152, 0}, "pale"},
{{152, 251, 152, 0}, "PaleGreen"},
{{ 0, 255, 127, 0}, "spring"},
{{ 0, 255, 127, 0}, "SpringGreen"},
{{124, 252, 0, 0}, "lawn"},
{{124, 252, 0, 0}, "LawnGreen"},
{{ 0, 255, 0, 0}, "green"},
{{127, 255, 0, 0}, "chartreuse"},
{{ 0, 250, 154, 0}, "medium"},
{{ 0, 250, 154, 0}, "MediumSpringGreen"},
{{173, 255, 47, 0}, "green"},
{{173, 255, 47, 0}, "GreenYellow"},
{{ 50, 205, 50, 0}, "lime"},
{{ 50, 205, 50, 0}, "LimeGreen"},
{{154, 205, 50, 0}, "yellow"},
{{154, 205, 50, 0}, "YellowGreen"},
{{ 34, 139, 34, 0}, "forest"},
{{ 34, 139, 34, 0}, "ForestGreen"},
{{107, 142, 35, 0}, "olive"},
{{107, 142, 35, 0}, "OliveDrab"},
{{189, 183, 107, 0}, "dark"},
{{189, 183, 107, 0}, "DarkKhaki"},
{{240, 230, 140, 0}, "khaki"},
{{238, 232, 170, 0}, "pale"},
{{238, 232, 170, 0}, "PaleGoldenrod"},
{{250, 250, 210, 0}, "light"},
{{250, 250, 210, 0}, "LightGoldenrodYellow"},
{{255, 255, 224, 0}, "light"},
{{255, 255, 224, 0}, "LightYellow"},
{{255, 255, 0, 0}, "yellow"},
{{255, 215, 0, 0}, "gold"},
{{238, 221, 130, 0}, "light"},
{{238, 221, 130, 0}, "LightGoldenrod"},
{{218, 165, 32, 0}, "goldenrod"},
{{184, 134, 11, 0}, "dark"},
{{184, 134, 11, 0}, "DarkGoldenrod"},
{{188, 143, 143, 0}, "rosy"},
{{188, 143, 143, 0}, "RosyBrown"},
{{205, 92, 92, 0}, "indian"},
{{205, 92, 92, 0}, "IndianRed"},
{{139, 69, 19, 0}, "saddle"},
{{139, 69, 19, 0}, "SaddleBrown"},
{{160, 82, 45, 0}, "sienna"},
{{205, 133, 63, 0}, "peru"},
{{222, 184, 135, 0}, "burlywood"},
{{245, 245, 220, 0}, "beige"},
{{245, 222, 179, 0}, "wheat"},
{{244, 164, 96, 0}, "sandy"},
{{244, 164, 96, 0}, "SandyBrown"},
{{210, 180, 140, 0}, "tan"},
{{210, 105, 30, 0}, "chocolate"},
{{178, 34, 34, 0}, "firebrick"},
{{165, 42, 42, 0}, "brown"},
{{233, 150, 122, 0}, "dark"},
{{233, 150, 122, 0}, "DarkSalmon"},
{{250, 128, 114, 0}, "salmon"},
{{255, 160, 122, 0}, "light"},
{{255, 160, 122, 0}, "LightSalmon"},
{{255, 165, 0, 0}, "orange"},
{{255, 140, 0, 0}, "dark"},
{{255, 140, 0, 0}, "DarkOrange"},
{{255, 127, 80, 0}, "coral"},
{{240, 128, 128, 0}, "light"},
{{240, 128, 128, 0}, "LightCoral"},
{{255, 99, 71, 0}, "tomato"},
{{255, 69, 0, 0}, "orange"},
{{255, 69, 0, 0}, "OrangeRed"},
{{255, 0, 0, 0}, "red"},
{{255, 105, 180, 0}, "hot"},
{{255, 105, 180, 0}, "HotPink"},
{{255, 20, 147, 0}, "deep"},
{{255, 20, 147, 0}, "DeepPink"},
{{255, 192, 203, 0}, "pink"},
{{255, 182, 193, 0}, "light"},
{{255, 182, 193, 0}, "LightPink"},
{{219, 112, 147, 0}, "pale"},
{{219, 112, 147, 0}, "PaleVioletRed"},
{{176, 48, 96, 0}, "maroon"},
{{199, 21, 133, 0}, "medium"},
{{199, 21, 133, 0}, "MediumVioletRed"},
{{208, 32, 144, 0}, "violet"},
{{208, 32, 144, 0}, "VioletRed"},
{{255, 0, 255, 0}, "magenta"},
{{238, 130, 238, 0}, "violet"},
{{221, 160, 221, 0}, "plum"},
{{218, 112, 214, 0}, "orchid"},
{{186, 85, 211, 0}, "medium"},
{{186, 85, 211, 0}, "MediumOrchid"},
{{153, 50, 204, 0}, "dark"},
{{153, 50, 204, 0}, "DarkOrchid"},
{{148, 0, 211, 0}, "dark"},
{{148, 0, 211, 0}, "DarkViolet"},
{{138, 43, 226, 0}, "blue"},
{{138, 43, 226, 0}, "BlueViolet"},
{{160, 32, 240, 0}, "purple"},
{{147, 112, 219, 0}, "medium"},
{{147, 112, 219, 0}, "MediumPurple"},
{{216, 191, 216, 0}, "thistle"},
{{255, 250, 250, 0}, "snow1"},
{{238, 233, 233, 0}, "snow2"},
{{205, 201, 201, 0}, "snow3"},
{{139, 137, 137, 0}, "snow4"},
{{255, 245, 238, 0}, "seashell1"},
{{238, 229, 222, 0}, "seashell2"},
{{205, 197, 191, 0}, "seashell3"},
{{139, 134, 130, 0}, "seashell4"},
{{255, 239, 219, 0}, "AntiqueWhite1"},
{{238, 223, 204, 0}, "AntiqueWhite2"},
{{205, 192, 176, 0}, "AntiqueWhite3"},
{{139, 131, 120, 0}, "AntiqueWhite4"},
{{255, 228, 196, 0}, "bisque1"},
{{238, 213, 183, 0}, "bisque2"},
{{205, 183, 158, 0}, "bisque3"},
{{139, 125, 107, 0}, "bisque4"},
{{255, 218, 185, 0}, "PeachPuff1"},
{{238, 203, 173, 0}, "PeachPuff2"},
{{205, 175, 149, 0}, "PeachPuff3"},
{{139, 119, 101, 0}, "PeachPuff4"},
{{255, 222, 173, 0}, "NavajoWhite1"},
{{238, 207, 161, 0}, "NavajoWhite2"},
{{205, 179, 139, 0}, "NavajoWhite3"},
{{139, 121, 94, 0}, "NavajoWhite4"},
{{255, 250, 205, 0}, "LemonChiffon1"},
{{238, 233, 191, 0}, "LemonChiffon2"},
{{205, 201, 165, 0}, "LemonChiffon3"},
{{139, 137, 112, 0}, "LemonChiffon4"},
{{255, 248, 220, 0}, "cornsilk1"},
{{238, 232, 205, 0}, "cornsilk2"},
{{205, 200, 177, 0}, "cornsilk3"},
{{139, 136, 120, 0}, "cornsilk4"},
{{255, 255, 240, 0}, "ivory1"},
{{238, 238, 224, 0}, "ivory2"},
{{205, 205, 193, 0}, "ivory3"},
{{139, 139, 131, 0}, "ivory4"},
{{240, 255, 240, 0}, "honeydew1"},
{{224, 238, 224, 0}, "honeydew2"},
{{193, 205, 193, 0}, "honeydew3"},
{{131, 139, 131, 0}, "honeydew4"},
{{255, 240, 245, 0}, "LavenderBlush1"},
{{238, 224, 229, 0}, "LavenderBlush2"},
{{205, 193, 197, 0}, "LavenderBlush3"},
{{139, 131, 134, 0}, "LavenderBlush4"},
{{255, 228, 225, 0}, "MistyRose1"},
{{238, 213, 210, 0}, "MistyRose2"},
{{205, 183, 181, 0}, "MistyRose3"},
{{139, 125, 123, 0}, "MistyRose4"},
{{240, 255, 255, 0}, "azure1"},
{{224, 238, 238, 0}, "azure2"},
{{193, 205, 205, 0}, "azure3"},
{{131, 139, 139, 0}, "azure4"},
{{131, 111, 255, 0}, "SlateBlue1"},
{{122, 103, 238, 0}, "SlateBlue2"},
{{105, 89, 205, 0}, "SlateBlue3"},
{{ 71, 60, 139, 0}, "SlateBlue4"},
{{ 72, 118, 255, 0}, "RoyalBlue1"},
{{ 67, 110, 238, 0}, "RoyalBlue2"},
{{ 58, 95, 205, 0}, "RoyalBlue3"},
{{ 39, 64, 139, 0}, "RoyalBlue4"},
{{ 0, 0, 255, 0}, "blue1"},
{{ 0, 0, 238, 0}, "blue2"},
{{ 0, 0, 205, 0}, "blue3"},
{{ 0, 0, 139, 0}, "blue4"},
{{ 30, 144, 255, 0}, "DodgerBlue1"},
{{ 28, 134, 238, 0}, "DodgerBlue2"},
{{ 24, 116, 205, 0}, "DodgerBlue3"},
{{ 16, 78, 139, 0}, "DodgerBlue4"},
{{ 99, 184, 255, 0}, "SteelBlue1"},
{{ 92, 172, 238, 0}, "SteelBlue2"},
{{ 79, 148, 205, 0}, "SteelBlue3"},
{{ 54, 100, 139, 0}, "SteelBlue4"},
{{ 0, 191, 255, 0}, "DeepSkyBlue1"},
{{ 0, 178, 238, 0}, "DeepSkyBlue2"},
{{ 0, 154, 205, 0}, "DeepSkyBlue3"},
{{ 0, 104, 139, 0}, "DeepSkyBlue4"},
{{135, 206, 255, 0}, "SkyBlue1"},
{{126, 192, 238, 0}, "SkyBlue2"},
{{108, 166, 205, 0}, "SkyBlue3"},
{{ 74, 112, 139, 0}, "SkyBlue4"},
{{176, 226, 255, 0}, "LightSkyBlue1"},
{{164, 211, 238, 0}, "LightSkyBlue2"},
{{141, 182, 205, 0}, "LightSkyBlue3"},
{{ 96, 123, 139, 0}, "LightSkyBlue4"},
{{198, 226, 255, 0}, "SlateGray1"},
{{185, 211, 238, 0}, "SlateGray2"},
{{159, 182, 205, 0}, "SlateGray3"},
{{108, 123, 139, 0}, "SlateGray4"},
{{202, 225, 255, 0}, "LightSteelBlue1"},
{{188, 210, 238, 0}, "LightSteelBlue2"},
{{162, 181, 205, 0}, "LightSteelBlue3"},
{{110, 123, 139, 0}, "LightSteelBlue4"},
{{191, 239, 255, 0}, "LightBlue1"},
{{178, 223, 238, 0}, "LightBlue2"},
{{154, 192, 205, 0}, "LightBlue3"},
{{104, 131, 139, 0}, "LightBlue4"},
{{224, 255, 255, 0}, "LightCyan1"},
{{209, 238, 238, 0}, "LightCyan2"},
{{180, 205, 205, 0}, "LightCyan3"},
{{122, 139, 139, 0}, "LightCyan4"},
{{187, 255, 255, 0}, "PaleTurquoise1"},
{{174, 238, 238, 0}, "PaleTurquoise2"},
{{150, 205, 205, 0}, "PaleTurquoise3"},
{{102, 139, 139, 0}, "PaleTurquoise4"},
{{152, 245, 255, 0}, "CadetBlue1"},
{{142, 229, 238, 0}, "CadetBlue2"},
{{122, 197, 205, 0}, "CadetBlue3"},
{{ 83, 134, 139, 0}, "CadetBlue4"},
{{ 0, 245, 255, 0}, "turquoise1"},
{{ 0, 229, 238, 0}, "turquoise2"},
{{ 0, 197, 205, 0}, "turquoise3"},
{{ 0, 134, 139, 0}, "turquoise4"},
{{ 0, 255, 255, 0}, "cyan1"},
{{ 0, 238, 238, 0}, "cyan2"},
{{ 0, 205, 205, 0}, "cyan3"},
{{ 0, 139, 139, 0}, "cyan4"},
{{151, 255, 255, 0}, "DarkSlateGray1"},
{{141, 238, 238, 0}, "DarkSlateGray2"},
{{121, 205, 205, 0}, "DarkSlateGray3"},
{{ 82, 139, 139, 0}, "DarkSlateGray4"},
{{127, 255, 212, 0}, "aquamarine1"},
{{118, 238, 198, 0}, "aquamarine2"},
{{102, 205, 170, 0}, "aquamarine3"},
{{ 69, 139, 116, 0}, "aquamarine4"},
{{193, 255, 193, 0}, "DarkSeaGreen1"},
{{180, 238, 180, 0}, "DarkSeaGreen2"},
{{155, 205, 155, 0}, "DarkSeaGreen3"},
{{105, 139, 105, 0}, "DarkSeaGreen4"},
{{ 84, 255, 159, 0}, "SeaGreen1"},
{{ 78, 238, 148, 0}, "SeaGreen2"},
{{ 67, 205, 128, 0}, "SeaGreen3"},
{{ 46, 139, 87, 0}, "SeaGreen4"},
{{154, 255, 154, 0}, "PaleGreen1"},
{{144, 238, 144, 0}, "PaleGreen2"},
{{124, 205, 124, 0}, "PaleGreen3"},
{{ 84, 139, 84, 0}, "PaleGreen4"},
{{ 0, 255, 127, 0}, "SpringGreen1"},
{{ 0, 238, 118, 0}, "SpringGreen2"},
{{ 0, 205, 102, 0}, "SpringGreen3"},
{{ 0, 139, 69, 0}, "SpringGreen4"},
{{ 0, 255, 0, 0}, "green1"},
{{ 0, 238, 0, 0}, "green2"},
{{ 0, 205, 0, 0}, "green3"},
{{ 0, 139, 0, 0}, "green4"},
{{127, 255, 0, 0}, "chartreuse1"},
{{118, 238, 0, 0}, "chartreuse2"},
{{102, 205, 0, 0}, "chartreuse3"},
{{ 69, 139, 0, 0}, "chartreuse4"},
{{192, 255, 62, 0}, "OliveDrab1"},
{{179, 238, 58, 0}, "OliveDrab2"},
{{154, 205, 50, 0}, "OliveDrab3"},
{{105, 139, 34, 0}, "OliveDrab4"},
{{202, 255, 112, 0}, "DarkOliveGreen1"},
{{188, 238, 104, 0}, "DarkOliveGreen2"},
{{162, 205, 90, 0}, "DarkOliveGreen3"},
{{110, 139, 61, 0}, "DarkOliveGreen4"},
{{255, 246, 143, 0}, "khaki1"},
{{238, 230, 133, 0}, "khaki2"},
{{205, 198, 115, 0}, "khaki3"},
{{139, 134, 78, 0}, "khaki4"},
{{255, 236, 139, 0}, "LightGoldenrod1"},
{{238, 220, 130, 0}, "LightGoldenrod2"},
{{205, 190, 112, 0}, "LightGoldenrod3"},
{{139, 129, 76, 0}, "LightGoldenrod4"},
{{255, 255, 224, 0}, "LightYellow1"},
{{238, 238, 209, 0}, "LightYellow2"},
{{205, 205, 180, 0}, "LightYellow3"},
{{139, 139, 122, 0}, "LightYellow4"},
{{255, 255, 0, 0}, "yellow1"},
{{238, 238, 0, 0}, "yellow2"},
{{205, 205, 0, 0}, "yellow3"},
{{139, 139, 0, 0}, "yellow4"},
{{255, 215, 0, 0}, "gold1"},
{{238, 201, 0, 0}, "gold2"},
{{205, 173, 0, 0}, "gold3"},
{{139, 117, 0, 0}, "gold4"},
{{255, 193, 37, 0}, "goldenrod1"},
{{238, 180, 34, 0}, "goldenrod2"},
{{205, 155, 29, 0}, "goldenrod3"},
{{139, 105, 20, 0}, "goldenrod4"},
{{255, 185, 15, 0}, "DarkGoldenrod1"},
{{238, 173, 14, 0}, "DarkGoldenrod2"},
{{205, 149, 12, 0}, "DarkGoldenrod3"},
{{139, 101, 8, 0}, "DarkGoldenrod4"},
{{255, 193, 193, 0}, "RosyBrown1"},
{{238, 180, 180, 0}, "RosyBrown2"},
{{205, 155, 155, 0}, "RosyBrown3"},
{{139, 105, 105, 0}, "RosyBrown4"},
{{255, 106, 106, 0}, "IndianRed1"},
{{238, 99, 99, 0}, "IndianRed2"},
{{205, 85, 85, 0}, "IndianRed3"},
{{139, 58, 58, 0}, "IndianRed4"},
{{255, 130, 71, 0}, "sienna1"},
{{238, 121, 66, 0}, "sienna2"},
{{205, 104, 57, 0}, "sienna3"},
{{139, 71, 38, 0}, "sienna4"},
{{255, 211, 155, 0}, "burlywood1"},
{{238, 197, 145, 0}, "burlywood2"},
{{205, 170, 125, 0}, "burlywood3"},
{{139, 115, 85, 0}, "burlywood4"},
{{255, 231, 186, 0}, "wheat1"},
{{238, 216, 174, 0}, "wheat2"},
{{205, 186, 150, 0}, "wheat3"},
{{139, 126, 102, 0}, "wheat4"},
{{255, 165, 79, 0}, "tan1"},
{{238, 154, 73, 0}, "tan2"},
{{205, 133, 63, 0}, "tan3"},
{{139, 90, 43, 0}, "tan4"},
{{255, 127, 36, 0}, "chocolate1"},
{{238, 118, 33, 0}, "chocolate2"},
{{205, 102, 29, 0}, "chocolate3"},
{{139, 69, 19, 0}, "chocolate4"},
{{255, 48, 48, 0}, "firebrick1"},
{{238, 44, 44, 0}, "firebrick2"},
{{205, 38, 38, 0}, "firebrick3"},
{{139, 26, 26, 0}, "firebrick4"},
{{255, 64, 64, 0}, "brown1"},
{{238, 59, 59, 0}, "brown2"},
{{205, 51, 51, 0}, "brown3"},
{{139, 35, 35, 0}, "brown4"},
{{255, 140, 105, 0}, "salmon1"},
{{238, 130, 98, 0}, "salmon2"},
{{205, 112, 84, 0}, "salmon3"},
{{139, 76, 57, 0}, "salmon4"},
{{255, 160, 122, 0}, "LightSalmon1"},
{{238, 149, 114, 0}, "LightSalmon2"},
{{205, 129, 98, 0}, "LightSalmon3"},
{{139, 87, 66, 0}, "LightSalmon4"},
{{255, 165, 0, 0}, "orange1"},
{{238, 154, 0, 0}, "orange2"},
{{205, 133, 0, 0}, "orange3"},
{{139, 90, 0, 0}, "orange4"},
{{255, 127, 0, 0}, "DarkOrange1"},
{{238, 118, 0, 0}, "DarkOrange2"},
{{205, 102, 0, 0}, "DarkOrange3"},
{{139, 69, 0, 0}, "DarkOrange4"},
{{255, 114, 86, 0}, "coral1"},
{{238, 106, 80, 0}, "coral2"},
{{205, 91, 69, 0}, "coral3"},
{{139, 62, 47, 0}, "coral4"},
{{255, 99, 71, 0}, "tomato1"},
{{238, 92, 66, 0}, "tomato2"},
{{205, 79, 57, 0}, "tomato3"},
{{139, 54, 38, 0}, "tomato4"},
{{255, 69, 0, 0}, "OrangeRed1"},
{{238, 64, 0, 0}, "OrangeRed2"},
{{205, 55, 0, 0}, "OrangeRed3"},
{{139, 37, 0, 0}, "OrangeRed4"},
{{255, 0, 0, 0}, "red1"},
{{238, 0, 0, 0}, "red2"},
{{205, 0, 0, 0}, "red3"},
{{139, 0, 0, 0}, "red4"},
{{255, 20, 147, 0}, "DeepPink1"},
{{238, 18, 137, 0}, "DeepPink2"},
{{205, 16, 118, 0}, "DeepPink3"},
{{139, 10, 80, 0}, "DeepPink4"},
{{255, 110, 180, 0}, "HotPink1"},
{{238, 106, 167, 0}, "HotPink2"},
{{205, 96, 144, 0}, "HotPink3"},
{{139, 58, 98, 0}, "HotPink4"},
{{255, 181, 197, 0}, "pink1"},
{{238, 169, 184, 0}, "pink2"},
{{205, 145, 158, 0}, "pink3"},
{{139, 99, 108, 0}, "pink4"},
{{255, 174, 185, 0}, "LightPink1"},
{{238, 162, 173, 0}, "LightPink2"},
{{205, 140, 149, 0}, "LightPink3"},
{{139, 95, 101, 0}, "LightPink4"},
{{255, 130, 171, 0}, "PaleVioletRed1"},
{{238, 121, 159, 0}, "PaleVioletRed2"},
{{205, 104, 137, 0}, "PaleVioletRed3"},
{{139, 71, 93, 0}, "PaleVioletRed4"},
{{255, 52, 179, 0}, "maroon1"},
{{238, 48, 167, 0}, "maroon2"},
{{205, 41, 144, 0}, "maroon3"},
{{139, 28, 98, 0}, "maroon4"},
{{255, 62, 150, 0}, "VioletRed1"},
{{238, 58, 140, 0}, "VioletRed2"},
{{205, 50, 120, 0}, "VioletRed3"},
{{139, 34, 82, 0}, "VioletRed4"},
{{255, 0, 255, 0}, "magenta1"},
{{238, 0, 238, 0}, "magenta2"},
{{205, 0, 205, 0}, "magenta3"},
{{139, 0, 139, 0}, "magenta4"},
{{255, 131, 250, 0}, "orchid1"},
{{238, 122, 233, 0}, "orchid2"},
{{205, 105, 201, 0}, "orchid3"},
{{139, 71, 137, 0}, "orchid4"},
{{255, 187, 255, 0}, "plum1"},
{{238, 174, 238, 0}, "plum2"},
{{205, 150, 205, 0}, "plum3"},
{{139, 102, 139, 0}, "plum4"},
{{224, 102, 255, 0}, "MediumOrchid1"},
{{209, 95, 238, 0}, "MediumOrchid2"},
{{180, 82, 205, 0}, "MediumOrchid3"},
{{122, 55, 139, 0}, "MediumOrchid4"},
{{191, 62, 255, 0}, "DarkOrchid1"},
{{178, 58, 238, 0}, "DarkOrchid2"},
{{154, 50, 205, 0}, "DarkOrchid3"},
{{104, 34, 139, 0}, "DarkOrchid4"},
{{155, 48, 255, 0}, "purple1"},
{{145, 44, 238, 0}, "purple2"},
{{125, 38, 205, 0}, "purple3"},
{{ 85, 26, 139, 0}, "purple4"},
{{171, 130, 255, 0}, "MediumPurple1"},
{{159, 121, 238, 0}, "MediumPurple2"},
{{137, 104, 205, 0}, "MediumPurple3"},
{{ 93, 71, 139, 0}, "MediumPurple4"},
{{255, 225, 255, 0}, "thistle1"},
{{238, 210, 238, 0}, "thistle2"},
{{205, 181, 205, 0}, "thistle3"},
{{139, 123, 139, 0}, "thistle4"},
{{ 0, 0, 0, 0}, "gray0"},
{{ 0, 0, 0, 0}, "grey0"},
{{ 3, 3, 3, 0}, "gray1"},
{{ 3, 3, 3, 0}, "grey1"},
{{ 5, 5, 5, 0}, "gray2"},
{{ 5, 5, 5, 0}, "grey2"},
{{ 8, 8, 8, 0}, "gray3"},
{{ 8, 8, 8, 0}, "grey3"},
{{ 10, 10, 10, 0}, "gray4"},
{{ 10, 10, 10, 0}, "grey4"},
{{ 13, 13, 13, 0}, "gray5"},
{{ 13, 13, 13, 0}, "grey5"},
{{ 15, 15, 15, 0}, "gray6"},
{{ 15, 15, 15, 0}, "grey6"},
{{ 18, 18, 18, 0}, "gray7"},
{{ 18, 18, 18, 0}, "grey7"},
{{ 20, 20, 20, 0}, "gray8"},
{{ 20, 20, 20, 0}, "grey8"},
{{ 23, 23, 23, 0}, "gray9"},
{{ 23, 23, 23, 0}, "grey9"},
{{ 26, 26, 26, 0}, "gray10"},
{{ 26, 26, 26, 0}, "grey10"},
{{ 28, 28, 28, 0}, "gray11"},
{{ 28, 28, 28, 0}, "grey11"},
{{ 31, 31, 31, 0}, "gray12"},
{{ 31, 31, 31, 0}, "grey12"},
{{ 33, 33, 33, 0}, "gray13"},
{{ 33, 33, 33, 0}, "grey13"},
{{ 36, 36, 36, 0}, "gray14"},
{{ 36, 36, 36, 0}, "grey14"},
{{ 38, 38, 38, 0}, "gray15"},
{{ 38, 38, 38, 0}, "grey15"},
{{ 41, 41, 41, 0}, "gray16"},
{{ 41, 41, 41, 0}, "grey16"},
{{ 43, 43, 43, 0}, "gray17"},
{{ 43, 43, 43, 0}, "grey17"},
{{ 46, 46, 46, 0}, "gray18"},
{{ 46, 46, 46, 0}, "grey18"},
{{ 48, 48, 48, 0}, "gray19"},
{{ 48, 48, 48, 0}, "grey19"},
{{ 51, 51, 51, 0}, "gray20"},
{{ 51, 51, 51, 0}, "grey20"},
{{ 54, 54, 54, 0}, "gray21"},
{{ 54, 54, 54, 0}, "grey21"},
{{ 56, 56, 56, 0}, "gray22"},
{{ 56, 56, 56, 0}, "grey22"},
{{ 59, 59, 59, 0}, "gray23"},
{{ 59, 59, 59, 0}, "grey23"},
{{ 61, 61, 61, 0}, "gray24"},
{{ 61, 61, 61, 0}, "grey24"},
{{ 64, 64, 64, 0}, "gray25"},
{{ 64, 64, 64, 0}, "grey25"},
{{ 66, 66, 66, 0}, "gray26"},
{{ 66, 66, 66, 0}, "grey26"},
{{ 69, 69, 69, 0}, "gray27"},
{{ 69, 69, 69, 0}, "grey27"},
{{ 71, 71, 71, 0}, "gray28"},
{{ 71, 71, 71, 0}, "grey28"},
{{ 74, 74, 74, 0}, "gray29"},
{{ 74, 74, 74, 0}, "grey29"},
{{ 77, 77, 77, 0}, "gray30"},
{{ 77, 77, 77, 0}, "grey30"},
{{ 79, 79, 79, 0}, "gray31"},
{{ 79, 79, 79, 0}, "grey31"},
{{ 82, 82, 82, 0}, "gray32"},
{{ 82, 82, 82, 0}, "grey32"},
{{ 84, 84, 84, 0}, "gray33"},
{{ 84, 84, 84, 0}, "grey33"},
{{ 87, 87, 87, 0}, "gray34"},
{{ 87, 87, 87, 0}, "grey34"},
{{ 89, 89, 89, 0}, "gray35"},
{{ 89, 89, 89, 0}, "grey35"},
{{ 92, 92, 92, 0}, "gray36"},
{{ 92, 92, 92, 0}, "grey36"},
{{ 94, 94, 94, 0}, "gray37"},
{{ 94, 94, 94, 0}, "grey37"},
{{ 97, 97, 97, 0}, "gray38"},
{{ 97, 97, 97, 0}, "grey38"},
{{ 99, 99, 99, 0}, "gray39"},
{{ 99, 99, 99, 0}, "grey39"},
{{102, 102, 102, 0}, "gray40"},
{{102, 102, 102, 0}, "grey40"},
{{105, 105, 105, 0}, "gray41"},
{{105, 105, 105, 0}, "grey41"},
{{107, 107, 107, 0}, "gray42"},
{{107, 107, 107, 0}, "grey42"},
{{110, 110, 110, 0}, "gray43"},
{{110, 110, 110, 0}, "grey43"},
{{112, 112, 112, 0}, "gray44"},
{{112, 112, 112, 0}, "grey44"},
{{115, 115, 115, 0}, "gray45"},
{{115, 115, 115, 0}, "grey45"},
{{117, 117, 117, 0}, "gray46"},
{{117, 117, 117, 0}, "grey46"},
{{120, 120, 120, 0}, "gray47"},
{{120, 120, 120, 0}, "grey47"},
{{122, 122, 122, 0}, "gray48"},
{{122, 122, 122, 0}, "grey48"},
{{125, 125, 125, 0}, "gray49"},
{{125, 125, 125, 0}, "grey49"},
{{127, 127, 127, 0}, "gray50"},
{{127, 127, 127, 0}, "grey50"},
{{130, 130, 130, 0}, "gray51"},
{{130, 130, 130, 0}, "grey51"},
{{133, 133, 133, 0}, "gray52"},
{{133, 133, 133, 0}, "grey52"},
{{135, 135, 135, 0}, "gray53"},
{{135, 135, 135, 0}, "grey53"},
{{138, 138, 138, 0}, "gray54"},
{{138, 138, 138, 0}, "grey54"},
{{140, 140, 140, 0}, "gray55"},
{{140, 140, 140, 0}, "grey55"},
{{143, 143, 143, 0}, "gray56"},
{{143, 143, 143, 0}, "grey56"},
{{145, 145, 145, 0}, "gray57"},
{{145, 145, 145, 0}, "grey57"},
{{148, 148, 148, 0}, "gray58"},
{{148, 148, 148, 0}, "grey58"},
{{150, 150, 150, 0}, "gray59"},
{{150, 150, 150, 0}, "grey59"},
{{153, 153, 153, 0}, "gray60"},
{{153, 153, 153, 0}, "grey60"},
{{156, 156, 156, 0}, "gray61"},
{{156, 156, 156, 0}, "grey61"},
{{158, 158, 158, 0}, "gray62"},
{{158, 158, 158, 0}, "grey62"},
{{161, 161, 161, 0}, "gray63"},
{{161, 161, 161, 0}, "grey63"},
{{163, 163, 163, 0}, "gray64"},
{{163, 163, 163, 0}, "grey64"},
{{166, 166, 166, 0}, "gray65"},
{{166, 166, 166, 0}, "grey65"},
{{168, 168, 168, 0}, "gray66"},
{{168, 168, 168, 0}, "grey66"},
{{171, 171, 171, 0}, "gray67"},
{{171, 171, 171, 0}, "grey67"},
{{173, 173, 173, 0}, "gray68"},
{{173, 173, 173, 0}, "grey68"},
{{176, 176, 176, 0}, "gray69"},
{{176, 176, 176, 0}, "grey69"},
{{179, 179, 179, 0}, "gray70"},
{{179, 179, 179, 0}, "grey70"},
{{181, 181, 181, 0}, "gray71"},
{{181, 181, 181, 0}, "grey71"},
{{184, 184, 184, 0}, "gray72"},
{{184, 184, 184, 0}, "grey72"},
{{186, 186, 186, 0}, "gray73"},
{{186, 186, 186, 0}, "grey73"},
{{189, 189, 189, 0}, "gray74"},
{{189, 189, 189, 0}, "grey74"},
{{191, 191, 191, 0}, "gray75"},
{{191, 191, 191, 0}, "grey75"},
{{194, 194, 194, 0}, "gray76"},
{{194, 194, 194, 0}, "grey76"},
{{196, 196, 196, 0}, "gray77"},
{{196, 196, 196, 0}, "grey77"},
{{199, 199, 199, 0}, "gray78"},
{{199, 199, 199, 0}, "grey78"},
{{201, 201, 201, 0}, "gray79"},
{{201, 201, 201, 0}, "grey79"},
{{204, 204, 204, 0}, "gray80"},
{{204, 204, 204, 0}, "grey80"},
{{207, 207, 207, 0}, "gray81"},
{{207, 207, 207, 0}, "grey81"},
{{209, 209, 209, 0}, "gray82"},
{{209, 209, 209, 0}, "grey82"},
{{212, 212, 212, 0}, "gray83"},
{{212, 212, 212, 0}, "grey83"},
{{214, 214, 214, 0}, "gray84"},
{{214, 214, 214, 0}, "grey84"},
{{217, 217, 217, 0}, "gray85"},
{{217, 217, 217, 0}, "grey85"},
{{219, 219, 219, 0}, "gray86"},
{{219, 219, 219, 0}, "grey86"},
{{222, 222, 222, 0}, "gray87"},
{{222, 222, 222, 0}, "grey87"},
{{224, 224, 224, 0}, "gray88"},
{{224, 224, 224, 0}, "grey88"},
{{227, 227, 227, 0}, "gray89"},
{{227, 227, 227, 0}, "grey89"},
{{229, 229, 229, 0}, "gray90"},
{{229, 229, 229, 0}, "grey90"},
{{232, 232, 232, 0}, "gray91"},
{{232, 232, 232, 0}, "grey91"},
{{235, 235, 235, 0}, "gray92"},
{{235, 235, 235, 0}, "grey92"},
{{237, 237, 237, 0}, "gray93"},
{{237, 237, 237, 0}, "grey93"},
{{240, 240, 240, 0}, "gray94"},
{{240, 240, 240, 0}, "grey94"},
{{242, 242, 242, 0}, "gray95"},
{{242, 242, 242, 0}, "grey95"},
{{245, 245, 245, 0}, "gray96"},
{{245, 245, 245, 0}, "grey96"},
{{247, 247, 247, 0}, "gray97"},
{{247, 247, 247, 0}, "grey97"},
{{250, 250, 250, 0}, "gray98"},
{{250, 250, 250, 0}, "grey98"},
{{252, 252, 252, 0}, "gray99"},
{{252, 252, 252, 0}, "grey99"},
{{255, 255, 255, 0}, "gray100"},
{{255, 255, 255, 0}, "grey100"},
{{169, 169, 169, 0}, "dark"},
{{169, 169, 169, 0}, "DarkGrey"},
{{169, 169, 169, 0}, "dark"},
{{169, 169, 169, 0}, "DarkGray"},
{{ 0, 0, 139, 0}, "dark"},
{{ 0, 0, 139, 0}, "DarkBlue"},
{{ 0, 139, 139, 0}, "dark"},
{{ 0, 139, 139, 0}, "DarkCyan"},
{{139, 0, 139, 0}, "dark"},
{{139, 0, 139, 0}, "DarkMagenta"},
{{139, 0, 0, 0}, "dark"},
{{139, 0, 0, 0}, "DarkRed"},
{{144, 238, 144, 0}, "light"},
{{144, 238, 144, 0}, "LightGreen"},
{{ 0, 0, 0, 0}, NULL}
};
#endif

View File

@@ -1,389 +1,293 @@
#include <stdlib.h> #include <stdlib.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include "WINGsP.h" #include "WINGsP.h"
#define MAX_PROPERTY_SIZE 8*1024 #if 0
char *WMSelectionOwnerDidChangeNotification = "WMSelectionOwnerDidChange"; typedef struct W_SelectionHandler {
WMWidget *widget;
typedef struct SelectionHandler {
WMView *view;
Atom selection; Atom selection;
Time timestamp; void *clientData;
WMSelectionProcs procs; WMSelectionProc *proc;
void *data; WMHandlerID timerID;
W_SelectionHandler *next;
W_SelectionHandler *prev;
} W_SelectionHandler;
#endif
struct { #define SELECTION_TIMEOUT 2000
unsigned delete_pending:1; #define MAX_PROPERTY_SIZE 10*1024
unsigned done_pending:1; #if 0
} flags;
} SelectionHandler;
typedef struct SelectionCallback {
WMView *view;
Atom selection;
Atom target;
Time timestamp;
WMSelectionCallback *callback;
void *data;
struct { void
unsigned delete_pending:1; WMWriteSelectionToClipboard(WMSelection *selection)
unsigned done_pending:1;
} flags;
} SelectionCallback;
static WMArray *selCallbacks = NULL;
static WMArray *selHandlers = NULL;
static Bool gotXError = False;
void WMDeleteSelectionHandler(WMView * view, Atom selection, Time timestamp)
{ {
SelectionHandler *handler; }
Display *dpy = W_VIEW_SCREEN(view)->display;
Window win = W_VIEW_DRAWABLE(view);
WMArrayIterator iter;
if (!selHandlers)
return;
/*//printf("deleting selection handler for %d", win); */ WMSelection*
WMCreateSelectionWithData(WMData *data, Atom type)
{
WM_ITERATE_ARRAY(selHandlers, handler, iter) { }
if (handler->view == view && (handler->selection == selection || selection == None) #endif
&& (handler->timestamp == timestamp || timestamp == CurrentTime)) {
if (handler->flags.done_pending) { #if 0
handler->flags.delete_pending = 1;
/*//puts(": postponed because still pending"); */ #define MAX_PROPERTY_SIZE 100*1024
static void
handleSelectionEvent(XEvent *event, void *data)
{
W_SelectionHandler *handler = (W_SelectionHandler*)data;
char *data = NULL;
Atom type;
int format, result;
unsigned long numItems, bytesAfter;
WMScreen *scr = WMWidgetScreen(handler->widget);
WMDeleteTimerHandler(handler->timerID);
if (handler->next)
handler->next->prev = handler->prev;
if (handler->prev)
handler->prev->next = handler->next;
if (handler == WMWidgetScreen(handler->widget)->selectionHandlerList)
WMWidgetScreen(handler->widget)->selectionHandlerList = handler->next;
if (event->xselection.property == None) {
char *name = XGetAtomName(event->xselection.display,
handler->selection);
char *form = XGetAtomName(event->xselection.display, handler->type);
wwarning("error retrieving selection %s with form %s\n", name, form);
if (name)
XFree(name);
if (form)
XFree(form);
free(handler);
return; return;
} }
/*//printf(": found & removed"); */
WMRemoveFromArray(selHandlers, handler); if (XGetWindowProperty(event->xselection.display,
event->xselection.requestor, handler->property,
0, MAX_PROPERTY_SIZE, False, AnyPropertyType,
&type, &format, &numItems, &bytesAfter,
&data) != Success || type == None) {
if (data)
XFree(data);
free(handler);
return;
}
if (bytesAfter!=0) {
wwarning("data in selection is too large");
if (data)
XFree(data);
free(handler);
return;
}
if (type == XA_STRING || type == scr->compoundTextAtom) {
if (format!=8) {
wwarning("string in selection has format %i, which is invalid",
format);
if (data)
XFree(data);
free(handler);
return;
}
(*handler->proc)();
}
}
static void
timeoutHandler(void *data)
{
W_SelectionHandler *handler = (W_SelectionHandler*)data;
wwarning("selection timed out");
WMDeleteEventHandler(WMWidgetView(handler->widget), SelectionNotifyMask,
handleSelectionEvent, data);
if (handler->next)
handler->next->prev = handler->prev;
if (handler->prev)
handler->prev->next = handler->next;
if (handler == WMWidgetScreen(handler->widget)->selectionHandlerList)
WMWidgetScreen(handler->widget)->selectionHandlerList = handler->next;
}
void
WMGetSelection(WMWidget *widget, Atom selection, Atom type, Atom property,
WMSelectionProc *proc, void *clientData, Time time)
{
WMScreen *scr = WMWidgetScreen(widget);
void *data;
Atom rtype;
int bits;
unsigned long len, bytes;
unsigned char *data;
int buffer = -1;
switch (selection) {
case XA_CUT_BUFFER0:
buffer = 0;
break;
case XA_CUT_BUFFER1:
buffer = 1;
break;
case XA_CUT_BUFFER2:
buffer = 2;
break;
case XA_CUT_BUFFER3:
buffer = 3;
break;
case XA_CUT_BUFFER4:
buffer = 4;
break;
case XA_CUT_BUFFER5:
buffer = 5;
break;
case XA_CUT_BUFFER6:
buffer = 6;
break;
case XA_CUT_BUFFER7:
buffer = 7;
break; break;
} }
if (buffer >= 0) {
char *data;
int size;
data = XFetchBuffer(scr->display, &size, buffer);
} else {
W_SelectionHandler *handler;
XDeleteProperty(scr->display, WMWidgetXID(widget), selection);
XConvertSelection(scr->display, selection, type, property,
WMWidgetXID(widget), time);
handler = wmalloc(sizeof(W_SelectionHandler));
handler->widget = widget;
handler->selection = selection;
handler->type = type;
handler->property = property;
handler->clientData = clientData;
handler->proc = proc;
handler->timerID = WMAddTimerHandler(SELECTION_TIMEOUT,
timeoutHandler, handler);
handler->next = scr->selectionHandlerList;
handler->prev = NULL;
if (scr->selectionHandlerList)
scr->selectionHandlerList->prev = handler;
scr->selectionHandlerList = handler;
WMCreateEventHandler(WMWidgetView(widget), SelectionNotifyMask,
handleSelectionEvent, handler);
}
} }
/*//printf("\n"); */ #endif
XGrabServer(dpy);
if (XGetSelectionOwner(dpy, selection) == win) {
XSetSelectionOwner(dpy, selection, None, timestamp);
}
XUngrabServer(dpy);
}
void WMDeleteSelectionCallback(WMView * view, Atom selection, Time timestamp)
static void
timeoutHandler(void *data)
{ {
SelectionCallback *handler; *(int*)data = 1;
WMArrayIterator iter;
if (!selCallbacks)
return;
WM_ITERATE_ARRAY(selCallbacks, handler, iter) {
if (handler->view == view && (handler->selection == selection || selection == None)
&& (handler->timestamp == timestamp || timestamp == CurrentTime)) {
if (handler->flags.done_pending) {
handler->flags.delete_pending = 1;
return;
} }
WMRemoveFromArray(selCallbacks, handler);
char*
W_GetTextSelection(WMScreen *scr, Atom selection)
{
int buffer = -1;
switch (selection) {
case XA_CUT_BUFFER0:
buffer = 0;
break;
case XA_CUT_BUFFER1:
buffer = 1;
break;
case XA_CUT_BUFFER2:
buffer = 2;
break;
case XA_CUT_BUFFER3:
buffer = 3;
break;
case XA_CUT_BUFFER4:
buffer = 4;
break;
case XA_CUT_BUFFER5:
buffer = 5;
break;
case XA_CUT_BUFFER6:
buffer = 6;
break;
case XA_CUT_BUFFER7:
buffer = 7;
break; break;
} }
} if (buffer >= 0) {
} char *data;
int size;
static int handleXError(Display * dpy, XErrorEvent * ev) data = XFetchBuffer(scr->display, &size, buffer);
{
gotXError = True;
return 1; return data;
} } else {
unsigned char *data;
static Bool writeSelection(Display * dpy, Window requestor, Atom property, Atom type, WMData * data) int bits;
{ Atom rtype;
static void *oldHandler; unsigned long len, bytes;
int format, bpi; WMHandlerID timer;
int timeout = 0;
format = WMGetDataFormat(data);
if (format == 0)
format = 8;
bpi = format / 8;
/* printf("write to %x: %s\n", requestor, XGetAtomName(dpy, property)); */
oldHandler = XSetErrorHandler(handleXError);
gotXError = False;
XChangeProperty(dpy, requestor, property, type, format, PropModeReplace,
WMDataBytes(data), WMGetDataLength(data) / bpi);
XFlush(dpy);
XSetErrorHandler(oldHandler);
return !gotXError;
}
static void notifySelection(XEvent * event, Atom prop)
{
XEvent ev; XEvent ev;
/* printf("event to %x\n", event->xselectionrequest.requestor); */ XDeleteProperty(scr->display, scr->groupLeader, scr->clipboardAtom);
XConvertSelection(scr->display, selection, XA_STRING,
scr->clipboardAtom, scr->groupLeader,
scr->lastEventTime);
ev.xselection.type = SelectionNotify; timer = WMAddTimerHandler(1000, timeoutHandler, &timeout);
ev.xselection.serial = 0;
ev.xselection.send_event = True;
ev.xselection.display = event->xselectionrequest.display;
ev.xselection.requestor = event->xselectionrequest.requestor;
ev.xselection.target = event->xselectionrequest.target;
ev.xselection.selection = event->xselectionrequest.selection;
ev.xselection.property = prop;
ev.xselection.time = event->xselectionrequest.time;
XSendEvent(event->xany.display, event->xselectionrequest.requestor, False, 0, &ev); while (!XCheckTypedWindowEvent(scr->display, scr->groupLeader,
XFlush(event->xany.display); SelectionNotify, &ev) && !timeout);
}
static void handleRequestEvent(XEvent * event) if (!timeout) {
{ WMDeleteTimerHandler(timer);
SelectionHandler *handler; } else {
WMArrayIterator iter; wwarning("selection retrieval timed out");
WMArray *copy;
Bool handledRequest;
WM_ITERATE_ARRAY(selHandlers, handler, iter) {
switch (event->type) {
case SelectionClear:
if (W_VIEW_DRAWABLE(handler->view)
!= event->xselectionclear.window) {
break;
}
handler->flags.done_pending = 1;
if (handler->procs.selectionLost)
handler->procs.selectionLost(handler->view, handler->selection, handler->data);
handler->flags.done_pending = 0;
handler->flags.delete_pending = 1;
break;
case SelectionRequest:
if (W_VIEW_DRAWABLE(handler->view) != event->xselectionrequest.owner) {
break;
}
if (handler->procs.convertSelection != NULL
&& handler->selection == event->xselectionrequest.selection) {
Atom atom;
WMData *data;
Atom prop;
/* they're requesting for something old.. maybe another handler
* can handle it */
if (event->xselectionrequest.time < handler->timestamp
&& event->xselectionrequest.time != CurrentTime) {
break;
}
handledRequest = False;
handler->flags.done_pending = 1;
data = handler->procs.convertSelection(handler->view,
handler->selection,
event->xselectionrequest.target,
handler->data, &atom);
prop = event->xselectionrequest.property;
/* obsolete clients that don't set the property field */
if (prop == None)
prop = event->xselectionrequest.target;
if (data) {
if (writeSelection(event->xselectionrequest.display,
event->xselectionrequest.requestor, prop, atom, data)) {
handledRequest = True;
}
WMReleaseData(data);
}
notifySelection(event, (handledRequest == True ? prop : None));
if (handler->procs.selectionDone != NULL) {
handler->procs.selectionDone(handler->view,
handler->selection,
event->xselectionrequest.target,
handler->data);
}
handler->flags.done_pending = 0;
}
break;
}
}
/* delete handlers */
copy = WMDuplicateArray(selHandlers);
WM_ITERATE_ARRAY(copy, handler, iter) {
if (handler && handler->flags.delete_pending) {
WMDeleteSelectionHandler(handler->view, handler->selection, handler->timestamp);
}
}
WMFreeArray(copy);
}
static WMData *getSelectionData(Display * dpy, Window win, Atom where)
{
WMData *wdata;
unsigned char *data;
Atom rtype;
int bits, bpi;
unsigned long len, bytes;
if (XGetWindowProperty(dpy, win, where, 0, MAX_PROPERTY_SIZE,
False, AnyPropertyType, &rtype, &bits, &len, &bytes, &data) != Success) {
return NULL; return NULL;
} }
bpi = bits / 8; /* nobody owns the selection */
if (ev.xselection.property == None) {
wdata = WMCreateDataWithBytesNoCopy(data, len * bpi, (WMFreeDataProc *) XFree); return NULL;
WMSetDataFormat(wdata, bits);
return wdata;
} }
static void handleNotifyEvent(XEvent * event) if (XGetWindowProperty(scr->display, scr->groupLeader,
{ scr->clipboardAtom, 0, MAX_PROPERTY_SIZE,
SelectionCallback *handler; False, XA_STRING, &rtype, &bits, &len,
WMArrayIterator iter; &bytes, &data)!=Success) {
WMArray *copy; return NULL;
WMData *data;
WM_ITERATE_ARRAY(selCallbacks, handler, iter) {
if (W_VIEW_DRAWABLE(handler->view) != event->xselection.requestor
|| handler->selection != event->xselection.selection) {
continue;
} }
handler->flags.done_pending = 1; if (rtype!=XA_STRING || bits!=8) {
wwarning("invalid data in text selection");
if (event->xselection.property == None) { if (data)
data = NULL; XFree(data);
} else { return NULL;
data = getSelectionData(event->xselection.display,
event->xselection.requestor, event->xselection.property);
} }
return data;
(*handler->callback) (handler->view, handler->selection,
handler->target, handler->timestamp, handler->data, data);
if (data != NULL) {
WMReleaseData(data);
}
handler->flags.done_pending = 0;
handler->flags.delete_pending = 1;
}
/* delete callbacks */
copy = WMDuplicateArray(selCallbacks);
WM_ITERATE_ARRAY(copy, handler, iter) {
if (handler && handler->flags.delete_pending) {
WMDeleteSelectionCallback(handler->view, handler->selection, handler->timestamp);
}
}
WMFreeArray(copy);
}
void W_HandleSelectionEvent(XEvent * event)
{
/*//printf("%d received selection ", event->xany.window); */
/*//switch(event->type) {
case SelectionNotify:
puts("notify"); break;
case SelectionRequest:
puts("request"); break;
case SelectionClear:
puts("clear"); break;
default:
puts("unknown"); break;
} */
if (event->type == SelectionNotify) {
handleNotifyEvent(event);
} else {
handleRequestEvent(event);
} }
} }
Bool WMCreateSelectionHandler(WMView * view, Atom selection, Time timestamp, WMSelectionProcs * procs, void *cdata)
{
SelectionHandler *handler;
Display *dpy = W_VIEW_SCREEN(view)->display;
XSetSelectionOwner(dpy, selection, W_VIEW_DRAWABLE(view), timestamp);
if (XGetSelectionOwner(dpy, selection) != W_VIEW_DRAWABLE(view)) {
return False;
}
WMPostNotificationName(WMSelectionOwnerDidChangeNotification, (void *)selection, (void *)view);
/*//printf("created selection handler for %d\n", W_VIEW_DRAWABLE(view)); */
handler = wmalloc(sizeof(SelectionHandler));
handler->view = view;
handler->selection = selection;
handler->timestamp = timestamp;
handler->procs = *procs;
handler->data = cdata;
memset(&handler->flags, 0, sizeof(handler->flags));
if (selHandlers == NULL) {
selHandlers = WMCreateArrayWithDestructor(4, wfree);
}
WMAddToArray(selHandlers, handler);
return True;
}
Bool
WMRequestSelection(WMView * view, Atom selection, Atom target, Time timestamp,
WMSelectionCallback * callback, void *cdata)
{
SelectionCallback *handler;
if (XGetSelectionOwner(W_VIEW_SCREEN(view)->display, selection) == None)
return False;
if (!XConvertSelection(W_VIEW_SCREEN(view)->display, selection, target,
W_VIEW_SCREEN(view)->clipboardAtom, W_VIEW_DRAWABLE(view), timestamp)) {
return False;
}
handler = wmalloc(sizeof(SelectionCallback));
handler->view = view;
handler->selection = selection;
handler->target = target;
handler->timestamp = timestamp;
handler->callback = callback;
handler->data = cdata;
if (selCallbacks == NULL) {
selCallbacks = WMCreateArrayWithDestructor(4, wfree);
}
WMAddToArray(selCallbacks, handler);
return True;
}

View File

@@ -1,427 +0,0 @@
/*
* Until FreeBSD gets their act together;
* http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg69469.html
*/
#if defined( FREEBSD )
# undef _XOPEN_SOURCE
#endif
#include "wconfig.h"
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif
#include "WUtil.h"
#define PRC_ALPHA 0
#define PRC_BLANK 1
#define PRC_ESCAPE 2
#define PRC_DQUOTE 3
#define PRC_EOS 4
#define PRC_SQUOTE 5
typedef struct {
short nstate;
short output;
} DFA;
static DFA mtable[9][6] = {
{{3, 1}, {0, 0}, {4, 0}, {1, 0}, {8, 0}, {6, 0}},
{{1, 1}, {1, 1}, {2, 0}, {3, 0}, {5, 0}, {1, 1}},
{{1, 1}, {1, 1}, {1, 1}, {1, 1}, {5, 0}, {1, 1}},
{{3, 1}, {5, 0}, {4, 0}, {1, 0}, {5, 0}, {6, 0}},
{{3, 1}, {3, 1}, {3, 1}, {3, 1}, {5, 0}, {3, 1}},
{{-1, -1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, /* final state */
{{6, 1}, {6, 1}, {7, 0}, {6, 1}, {5, 0}, {3, 0}},
{{6, 1}, {6, 1}, {6, 1}, {6, 1}, {5, 0}, {6, 1}},
{{-1, -1}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}, /* final state */
};
char *wtokennext(char *word, char **next)
{
char *ptr;
char *ret, *t;
int state, ctype;
t = ret = wmalloc(strlen(word) + 1);
ptr = word;
state = 0;
while (1) {
if (*ptr == 0)
ctype = PRC_EOS;
else if (*ptr == '\\')
ctype = PRC_ESCAPE;
else if (*ptr == '"')
ctype = PRC_DQUOTE;
else if (*ptr == '\'')
ctype = PRC_SQUOTE;
else if (*ptr == ' ' || *ptr == '\t')
ctype = PRC_BLANK;
else
ctype = PRC_ALPHA;
if (mtable[state][ctype].output) {
*t = *ptr;
t++;
*t = 0;
}
state = mtable[state][ctype].nstate;
ptr++;
if (mtable[state][0].output < 0) {
break;
}
}
if (*ret == 0)
t = NULL;
else
t = wstrdup(ret);
wfree(ret);
if (ctype == PRC_EOS)
*next = NULL;
else
*next = ptr;
return t;
}
/* separate a string in tokens, taking " and ' into account */
void wtokensplit(char *command, char ***argv, int *argc)
{
char *token, *line;
int count;
count = 0;
line = command;
do {
token = wtokennext(line, &line);
if (token) {
if (count == 0)
*argv = wmalloc(sizeof(char **));
else
*argv = wrealloc(*argv, (count + 1) * sizeof(char **));
(*argv)[count++] = token;
}
} while (token != NULL && line != NULL);
*argc = count;
}
char *wtokenjoin(char **list, int count)
{
int i, j;
char *flat_string, *wspace;
j = 0;
for (i = 0; i < count; i++) {
if (list[i] != NULL && list[i][0] != 0) {
j += strlen(list[i]);
if (strpbrk(list[i], " \t"))
j += 2;
}
}
flat_string = wmalloc(j + count + 1);
for (i = 0; i < count; i++) {
if (list[i] != NULL && list[i][0] != 0) {
if (i > 0 &&
wstrlcat(flat_string, " ", j + count + 1) >= j + count + 1)
goto error;
wspace = strpbrk(list[i], " \t");
if (wspace &&
wstrlcat(flat_string, "\"", j + count + 1) >= j + count + 1)
goto error;
if (wstrlcat(flat_string, list[i], j + count + 1) >= j + count + 1)
goto error;
if (wspace &&
wstrlcat(flat_string, "\"", j + count + 1) >= j + count + 1)
goto error;
}
}
return flat_string;
error:
wfree(flat_string);
return NULL;
}
void wtokenfree(char **tokens, int count)
{
while (count--)
wfree(tokens[count]);
wfree(tokens);
}
char *wtrimspace(const char *s)
{
char *t;
if (s == NULL)
return NULL;
while (isspace(*s) && *s)
s++;
t = (char *)s + strlen(s) - 1;
while (t > s && isspace(*t))
t--;
return wstrndup(s, t - s + 1);
}
char *wstrdup(const char *str)
{
assert(str != NULL);
return strcpy(wmalloc(strlen(str) + 1), str);
}
char *wstrndup(const char *str, size_t len)
{
char *copy;
assert(str != NULL);
len = WMIN(len, strlen(str));
copy = strncpy(wmalloc(len + 1), str, len);
copy[len] = 0;
return copy;
}
char *wstrconcat(char *str1, char *str2)
{
char *str;
size_t slen;
if (!str1)
return wstrdup(str2);
else if (!str2)
return wstrdup(str1);
slen = strlen(str1) + strlen(str2) + 1;
str = wmalloc(slen);
if (wstrlcpy(str, str1, slen) >= slen ||
wstrlcat(str, str2, slen) >= slen) {
wfree(str);
return NULL;
}
return str;
}
char *wstrappend(char *dst, char *src)
{
size_t slen;
if (!dst)
return wstrdup(src);
else if (!src || *src == 0)
return dst;
slen = strlen(dst) + strlen(src) + 1;
dst = wrealloc(dst, slen);
if (wstrlcat(dst, src, slen) >= slen)
return NULL;
return dst;
}
#if HAVE_STRLCAT
size_t
wstrlcat(char *dst, const char *src, size_t siz)
{
return strlcat(dst, src, siz);
}
#else
/* $OpenBSD: strlcat.c,v 1.13 2005/08/08 08:05:37 espie Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
size_t
wstrlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0') {
if (n != 1) {
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}
#endif /* HAVE_STRLCAT */
#if HAVE_STRLCPY
size_t
wstrlcpy(char *dst, const char *src, size_t siz)
{
return strlcpy(dst, src, siz);
}
#else
/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
wstrlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0) {
while (--n != 0) {
if ((*d++ = *s++) == '\0')
break;
}
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}
#endif /* HAVE_STRLCPY */
/* transform `s' so that the result is safe to pass to the shell as an argument.
* returns a newly allocated string.
* with very heavy inspirations from NetBSD's shquote(3).
*/
char *wshellquote(const char *s)
{
char *p, *r, *last, *ret;
size_t slen;
int needs_quoting;
if (!s)
return NULL;
needs_quoting = !*s; /* the empty string does need quoting */
/* do not quote if consists only of the following characters */
for (p = (char *)s; *p && !needs_quoting; p++) {
needs_quoting = !(isalnum(*p) || (*p == '+') || (*p == '/') ||
(*p == '.') || (*p == ',') || (*p == '-'));
}
if (!needs_quoting)
return wstrdup(s);
for (slen = 0, p = (char *)s; *p; p++) /* count space needed (worst case) */
slen += *p == '\'' ? 4 : 1; /* every single ' becomes ''\' */
slen += 2 /* leading + trailing "'" */ + 1 /* NULL */;
ret = r = wmalloc(slen);
p = (char *)s;
last = p;
if (*p != '\'') /* if string doesn't already begin with "'" */
*r++ ='\''; /* start putting it in quotes */
while (*p) {
last = p;
if (*p == '\'') { /* turn each ' into ''\' */
if (p != s) /* except if it's the first ', in which case */
*r++ = '\''; /* only escape it */
*r++ = '\\';
*r++ = '\'';
while (*++p && *p == '\'') { /* keep turning each consecutive 's into \' */
*r++ = '\\';
*r++ = '\'';
}
if (*p) /* if more input follows, terminate */
*r++ = '\''; /* what we have so far */
} else {
*r++ = *p++;
}
}
if (*last != '\'') /* if the last one isn't already a ' */
*r++ = '\''; /* terminate the whole shebang */
*r = '\0';
return ret; /* technically, we lose (but not leak) a couple of */
/* bytes (twice the number of consecutive 's in the */
/* input or so), but since these are relatively rare */
/* and short-lived strings, not sure if a trip to */
/* wstrdup+wfree worths the gain. */
}

51
WINGs/testmywidget.c Normal file
View File

@@ -0,0 +1,51 @@
#include <WINGs.h>
#include <WUtil.h>
#include "mywidget.h"
void
wAbort()
{
exit(1);
}
int main(int argc, char **argv)
{
Display *dpy = XOpenDisplay("");
WMScreen *scr;
WMWindow *win;
MyWidget *thing;
WMInitializeApplication("Test", &argc, argv);
if (!dpy) {
wfatal("could not open display");
exit(1);
}
scr = WMCreateSimpleApplicationScreen(dpy);
/* init our widget */
InitMyWidget(scr);
win = WMCreateWindow(scr, "test");
WMResizeWidget(win, 150, 50);
thing = CreateMyWidget(win);
SetMyWidgetText(thing, "The Test");
WMResizeWidget(thing, 100, 20);
WMMoveWidget(thing, 10, 10);
WMRealizeWidget(win);
WMMapSubwidgets(win);
WMMapWidget(win);
WMScreenMainLoop(scr);
return 0;
}

View File

@@ -1,255 +0,0 @@
#include <string.h>
#include "WUtil.h"
typedef struct W_TreeNode {
void *data;
/*unsigned int uflags:16; */
WMArray *leaves;
int depth;
struct W_TreeNode *parent;
WMFreeDataProc *destructor;
} W_TreeNode;
void destroyNode(void *data)
{
WMTreeNode *aNode = (WMTreeNode *) data;
if (aNode->destructor) {
(*aNode->destructor) (aNode->data);
}
if (aNode->leaves) {
WMFreeArray(aNode->leaves);
}
wfree(aNode);
}
WMTreeNode *WMCreateTreeNode(void *data)
{
return WMCreateTreeNodeWithDestructor(data, NULL);
}
WMTreeNode *WMCreateTreeNodeWithDestructor(void *data, WMFreeDataProc * destructor)
{
WMTreeNode *aNode;
aNode = (WMTreeNode *) wmalloc(sizeof(W_TreeNode));
aNode->destructor = destructor;
aNode->data = data;
aNode->parent = NULL;
aNode->depth = 0;
aNode->leaves = NULL;
/*aNode->leaves = WMCreateArrayWithDestructor(1, destroyNode); */
return aNode;
}
WMTreeNode *WMInsertItemInTree(WMTreeNode * parent, int index, void *item)
{
WMTreeNode *aNode;
wassertrv(parent != NULL, NULL);
aNode = WMCreateTreeNodeWithDestructor(item, parent->destructor);
aNode->parent = parent;
aNode->depth = parent->depth + 1;
if (!parent->leaves) {
parent->leaves = WMCreateArrayWithDestructor(1, destroyNode);
}
if (index < 0) {
WMAddToArray(parent->leaves, aNode);
} else {
WMInsertInArray(parent->leaves, index, aNode);
}
return aNode;
}
static void updateNodeDepth(WMTreeNode * aNode, int depth)
{
int i;
aNode->depth = depth;
if (aNode->leaves) {
for (i = 0; i < WMGetArrayItemCount(aNode->leaves); i++) {
updateNodeDepth(WMGetFromArray(aNode->leaves, i), depth + 1);
}
}
}
WMTreeNode *WMInsertNodeInTree(WMTreeNode * parent, int index, WMTreeNode * aNode)
{
wassertrv(parent != NULL, NULL);
wassertrv(aNode != NULL, NULL);
aNode->parent = parent;
updateNodeDepth(aNode, parent->depth + 1);
if (!parent->leaves) {
parent->leaves = WMCreateArrayWithDestructor(1, destroyNode);
}
if (index < 0) {
WMAddToArray(parent->leaves, aNode);
} else {
WMInsertInArray(parent->leaves, index, aNode);
}
return aNode;
}
void WMDestroyTreeNode(WMTreeNode * aNode)
{
wassertr(aNode != NULL);
if (aNode->parent && aNode->parent->leaves) {
WMRemoveFromArray(aNode->parent->leaves, aNode);
} else {
destroyNode(aNode);
}
}
void WMDeleteLeafForTreeNode(WMTreeNode * aNode, int index)
{
wassertr(aNode != NULL);
wassertr(aNode->leaves != NULL);
WMDeleteFromArray(aNode->leaves, index);
}
static int sameData(const void *item, const void *data)
{
return (((WMTreeNode *) item)->data == data);
}
void WMRemoveLeafForTreeNode(WMTreeNode * aNode, void *leaf)
{
int index;
wassertr(aNode != NULL);
wassertr(aNode->leaves != NULL);
index = WMFindInArray(aNode->leaves, sameData, leaf);
if (index != WANotFound) {
WMDeleteFromArray(aNode->leaves, index);
}
}
void *WMReplaceDataForTreeNode(WMTreeNode * aNode, void *newData)
{
void *old;
wassertrv(aNode != NULL, NULL);
old = aNode->data;
aNode->data = newData;
return old;
}
void *WMGetDataForTreeNode(WMTreeNode * aNode)
{
return aNode->data;
}
int WMGetTreeNodeDepth(WMTreeNode * aNode)
{
return aNode->depth;
}
WMTreeNode *WMGetParentForTreeNode(WMTreeNode * aNode)
{
return aNode->parent;
}
void WMSortLeavesForTreeNode(WMTreeNode * aNode, WMCompareDataProc * comparer)
{
wassertr(aNode != NULL);
if (aNode->leaves) {
WMSortArray(aNode->leaves, comparer);
}
}
static void sortLeavesForNode(WMTreeNode * aNode, WMCompareDataProc * comparer)
{
int i;
if (!aNode->leaves)
return;
WMSortArray(aNode->leaves, comparer);
for (i = 0; i < WMGetArrayItemCount(aNode->leaves); i++) {
sortLeavesForNode(WMGetFromArray(aNode->leaves, i), comparer);
}
}
void WMSortTree(WMTreeNode * aNode, WMCompareDataProc * comparer)
{
wassertr(aNode != NULL);
sortLeavesForNode(aNode, comparer);
}
static WMTreeNode *findNodeInTree(WMTreeNode * aNode, WMMatchDataProc * match, void *cdata, int limit)
{
if (match == NULL && aNode->data == cdata)
return aNode;
else if ((*match) (aNode->data, cdata))
return aNode;
if (aNode->leaves && limit != 0) {
WMTreeNode *leaf;
int i;
for (i = 0; i < WMGetArrayItemCount(aNode->leaves); i++) {
leaf = findNodeInTree(WMGetFromArray(aNode->leaves, i),
match, cdata, limit > 0 ? limit - 1 : limit);
if (leaf)
return leaf;
}
}
return NULL;
}
WMTreeNode *WMFindInTree(WMTreeNode * aTree, WMMatchDataProc * match, void *cdata)
{
wassertrv(aTree != NULL, NULL);
return findNodeInTree(aTree, match, cdata, -1);
}
WMTreeNode *WMFindInTreeWithDepthLimit(WMTreeNode * aTree, WMMatchDataProc * match, void *cdata, int limit)
{
wassertrv(aTree != NULL, NULL);
wassertrv(limit >= 0, NULL);
return findNodeInTree(aTree, match, cdata, limit);
}
void WMTreeWalk(WMTreeNode * aNode, WMTreeWalkProc * walk, void *data, Bool DepthFirst)
{
int i;
WMTreeNode *leaf;
wassertr(aNode != NULL);
if (DepthFirst)
(*walk)(aNode, data);
if (aNode->leaves) {
for (i = 0; i < WMGetArrayItemCount(aNode->leaves); i++) {
leaf = (WMTreeNode *)WMGetFromArray(aNode->leaves, i);
WMTreeWalk(leaf, walk, data, DepthFirst);
}
}
if (!DepthFirst)
(*walk)(aNode, data);
}

View File

@@ -1,485 +1,248 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <strings.h> #include <strings.h>
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#include <unistd.h>
#include <sys/stat.h>
#include "wconfig.h" #include "WUtil.h"
#include <proplist.h>
#include "WINGs.h"
typedef struct W_UserDefaults { typedef struct W_UserDefaults {
WMPropList *defaults; proplist_t defaults;
WMPropList *appDomain; proplist_t appDomain;
WMPropList *searchListArray; proplist_t searchListArray;
WMPropList **searchList; /* cache for searchListArray */ proplist_t *searchList; /* cache for searchListArray */
char dirty; char dirty;
char dontSync;
char *path; /* where is db located */
time_t timestamp; /* last modification time */
struct W_UserDefaults *next;
} UserDefaults; } UserDefaults;
static UserDefaults *sharedUserDefaults = NULL; static UserDefaults *sharedUserDefaults = NULL;
char *WMUserDefaultsDidChangeNotification = "WMUserDefaultsDidChangeNotification";
static void synchronizeUserDefaults(void *foo);
extern char *WMGetApplicationName(); extern char *WMGetApplicationName();
#define DEFAULTS_DIR "/Defaults" #define DEFAULTS_DIR "/Defaults"
#ifndef HAVE_INOTIFY
/* Check defaults database for changes every this many milliseconds */
/* XXX: this is shared with src/ stuff, put it in some common header */
#define UD_SYNC_INTERVAL 2000
#endif
char *wusergnusteppath()
char*
wusergnusteppath()
{ {
static char *path = NULL; char *path;
char *gspath; char *gspath;
int pathlen; int pathlen;
gspath = getenv("GNUSTEP_USER_ROOT"); gspath = getenv("GNUSTEP_USER_ROOT");
if (gspath) { if (gspath) {
gspath = wexpandpath(gspath); gspath = wexpandpath(gspath);
if (gspath) {
pathlen = strlen(gspath) + 4; pathlen = strlen(gspath) + 4;
path = wmalloc(pathlen); path = wmalloc(pathlen);
if (wstrlcpy(path, gspath, pathlen) >= pathlen) { strcpy(path, gspath);
wfree(gspath); free(gspath);
return NULL;
}
wfree(gspath);
}
} else { } else {
char *h = wgethomedir(); pathlen = strlen(wgethomedir()) + 10;
if (!h)
return NULL;
pathlen = strlen(h) + 8 /* /GNUstep */ + 1;
path = wmalloc(pathlen); path = wmalloc(pathlen);
if (wstrlcpy(path, h, pathlen) >= pathlen || strcpy(path, wgethomedir());
wstrlcat(path, "/GNUstep", pathlen) >= pathlen) { strcat(path, "/GNUstep");
wfree(path);
return NULL;
}
} }
return path; return path;
} }
char *wdefaultspathfordomain(char *domain)
char*
wdefaultspathfordomain(char *domain)
{ {
char *path; char *path;
char *gspath; char *gspath;
size_t slen;
gspath = wusergnusteppath(); gspath = wusergnusteppath();
slen = strlen(gspath) + strlen(DEFAULTS_DIR) + strlen(domain) + 4; path = wmalloc(strlen(gspath)+strlen(DEFAULTS_DIR)+strlen(domain)+4);
path = wmalloc(slen); strcpy(path, gspath);
free(gspath);
if (wstrlcpy(path, gspath, slen) >= slen || strcat(path, DEFAULTS_DIR);
wstrlcat(path, DEFAULTS_DIR, slen) >= slen || strcat(path, "/");
wstrlcat(path, "/", slen) >= slen || strcat(path, domain);
wstrlcat(path, domain, slen) >= slen) {
wfree(path);
return NULL;
}
return path; return path;
} }
/* XXX: doesn't quite belong to *user*defaults.c */
#ifndef GLOBAL_DEFAULTS_SUBDIR
#define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
#endif
char *wglobaldefaultspathfordomain(const char *domain)
{
char *t = NULL;
size_t len;
len = strlen( SYSCONFDIR ) + strlen( GLOBAL_DEFAULTS_SUBDIR ) + strlen(domain) + 3;
t = wmalloc(len);
snprintf(t, len, "%s/%s/%s", SYSCONFDIR, GLOBAL_DEFAULTS_SUBDIR, domain);
return t;
}
static void static void
saveDefaultsChanges(void) saveDefaultsChanges(void)
{ {
/* save the user defaults databases */ if (sharedUserDefaults && sharedUserDefaults->dirty) {
synchronizeUserDefaults(NULL); PLSave(sharedUserDefaults->appDomain, YES);
}
} }
/* set to save changes in defaults when program is exited */
static void registerSaveOnExit(void) WMUserDefaults*
{ WMGetStandardUserDefaults(void)
static Bool registeredSaveOnExit = False;
if (!registeredSaveOnExit) {
atexit(saveDefaultsChanges);
registeredSaveOnExit = True;
}
}
static void synchronizeUserDefaults(void *foo)
{
UserDefaults *database = sharedUserDefaults;
while (database) {
if (!database->dontSync)
WMSynchronizeUserDefaults(database);
database = database->next;
}
}
#ifndef HAVE_INOTIFY
static void addSynchronizeTimerHandler(void)
{
static Bool initialized = False;
if (!initialized) {
WMAddPersistentTimerHandler(UD_SYNC_INTERVAL,
synchronizeUserDefaults, NULL);
initialized = True;
}
}
#endif
void WMEnableUDPeriodicSynchronization(WMUserDefaults * database, Bool enable)
{
database->dontSync = !enable;
}
void WMSynchronizeUserDefaults(WMUserDefaults * database)
{
Bool fileIsNewer = False, release = False, notify = False;
WMPropList *plF, *key;
char *path;
struct stat stbuf;
if (!database->path) {
path = wdefaultspathfordomain(WMGetApplicationName());
release = True;
} else {
path = database->path;
}
if (stat(path, &stbuf) >= 0 && stbuf.st_mtime > database->timestamp)
fileIsNewer = True;
if (database->appDomain && (database->dirty || fileIsNewer)) {
if (database->dirty && fileIsNewer) {
plF = WMReadPropListFromFile(path);
if (plF) {
plF = WMMergePLDictionaries(plF, database->appDomain, False);
WMReleasePropList(database->appDomain);
database->appDomain = plF;
key = database->searchList[0];
WMPutInPLDictionary(database->defaults, key, plF);
notify = True;
} else {
/* something happened with the file. just overwrite it */
wwarning(_("cannot read domain from file '%s' when syncing"), path);
WMWritePropListToFile(database->appDomain, path);
}
} else if (database->dirty) {
WMWritePropListToFile(database->appDomain, path);
} else if (fileIsNewer) {
plF = WMReadPropListFromFile(path);
if (plF) {
WMReleasePropList(database->appDomain);
database->appDomain = plF;
key = database->searchList[0];
WMPutInPLDictionary(database->defaults, key, plF);
notify = True;
} else {
/* something happened with the file. just overwrite it */
wwarning(_("cannot read domain from file '%s' when syncing"), path);
WMWritePropListToFile(database->appDomain, path);
}
}
database->dirty = 0;
if (stat(path, &stbuf) >= 0)
database->timestamp = stbuf.st_mtime;
if (notify) {
WMPostNotificationName(WMUserDefaultsDidChangeNotification, database, NULL);
}
}
if (release)
wfree(path);
}
void WMSaveUserDefaults(WMUserDefaults * database)
{
if (database->appDomain) {
struct stat stbuf;
char *path;
Bool release = False;
if (!database->path) {
path = wdefaultspathfordomain(WMGetApplicationName());
release = True;
} else {
path = database->path;
}
WMWritePropListToFile(database->appDomain, path);
database->dirty = 0;
if (stat(path, &stbuf) >= 0)
database->timestamp = stbuf.st_mtime;
if (release)
wfree(path);
}
}
WMUserDefaults *WMGetStandardUserDefaults(void)
{ {
if (!sharedUserDefaults) {
WMUserDefaults *defaults; WMUserDefaults *defaults;
WMPropList *domain;
WMPropList *key; proplist_t domain;
struct stat stbuf; proplist_t key;
char *path; char *path;
int i; int i;
if (sharedUserDefaults) {
defaults = sharedUserDefaults;
while (defaults) {
/* path == NULL only for StandardUserDefaults db */
if (defaults->path == NULL)
return defaults;
defaults = defaults->next;
}
}
/* we didn't found the database we are looking for. Go read it. XXX: wtf? */
defaults = wmalloc(sizeof(WMUserDefaults)); defaults = wmalloc(sizeof(WMUserDefaults));
defaults->defaults = WMCreatePLDictionary(NULL, NULL); memset(defaults, 0, sizeof(WMUserDefaults));
defaults->searchList = wmalloc(sizeof(WMPropList *) * 3);
defaults->defaults = PLMakeDictionaryFromEntries(NULL, NULL, NULL);
defaults->searchList = wmalloc(sizeof(proplist_t)*3);
/* application domain */ /* application domain */
key = WMCreatePLString(WMGetApplicationName()); key = PLMakeString(WMGetApplicationName());
defaults->searchList[0] = key; defaults->searchList[0] = key;
/* temporary kluge. wmaker handles synchronization itself */ /* temporary kluge */
if (strcmp(WMGetApplicationName(), "WindowMaker")==0) { if (strcmp(WMGetApplicationName(), "WindowMaker")==0) {
defaults->dontSync = 1; domain = NULL;
path = NULL;
} else {
path = wdefaultspathfordomain(PLGetString(key));
domain = PLGetProplistWithPath(path);
} }
if (!domain) {
proplist_t p;
path = wdefaultspathfordomain(WMGetFromPLString(key)); domain = PLMakeDictionaryFromEntries(NULL, NULL, NULL);
if (path) {
if (stat(path, &stbuf) >= 0) p = PLMakeString(path);
defaults->timestamp = stbuf.st_mtime; PLSetFilename(domain, p);
PLRelease(p);
domain = WMReadPropListFromFile(path); }
}
if (!domain)
domain = WMCreatePLDictionary(NULL, NULL);
if (path) if (path)
wfree(path); free(path);
defaults->appDomain = domain; defaults->appDomain = domain;
if (domain) if (domain)
WMPutInPLDictionary(defaults->defaults, key, domain); PLInsertDictionaryEntry(defaults->defaults, key, domain);
PLRelease(key);
/* global domain */ /* global domain */
key = WMCreatePLString("WMGLOBAL"); key = PLMakeString("WMGLOBAL");
defaults->searchList[1] = key; defaults->searchList[1] = key;
path = wdefaultspathfordomain(WMGetFromPLString(key)); path = wdefaultspathfordomain(PLGetString(key));
domain = WMReadPropListFromFile(path); domain = PLGetProplistWithPath(path);
wfree(path); free(path);
if (!domain) if (!domain)
domain = WMCreatePLDictionary(NULL, NULL); domain = PLMakeDictionaryFromEntries(NULL, NULL, NULL);
if (domain) if (domain)
WMPutInPLDictionary(defaults->defaults, key, domain); PLInsertDictionaryEntry(defaults->defaults, key, domain);
PLRelease(key);
/* terminate list */ /* terminate list */
defaults->searchList[2] = NULL; defaults->searchList[2] = NULL;
defaults->searchListArray = WMCreatePLArray(NULL, NULL); defaults->searchListArray=PLMakeArrayFromElements(NULL,NULL);
i = 0; i = 0;
while (defaults->searchList[i]) { while (defaults->searchList[i]) {
WMAddToPLArray(defaults->searchListArray, defaults->searchList[i]); PLAppendArrayElement(defaults->searchListArray,
defaults->searchList[i]);
i++; i++;
} }
if (sharedUserDefaults)
defaults->next = sharedUserDefaults;
sharedUserDefaults = defaults; sharedUserDefaults = defaults;
#ifndef HAVE_INOTIFY /* set to save changes in defaults when program is exited */
addSynchronizeTimerHandler(); atexit(saveDefaultsChanges);
#endif
registerSaveOnExit();
return defaults;
} }
WMUserDefaults *WMGetDefaultsFromPath(char *path) return sharedUserDefaults;
}
proplist_t
WMGetUDObjectForKey(WMUserDefaults *database, char *defaultName)
{ {
WMUserDefaults *defaults; proplist_t domainName, domain;
WMPropList *domain; proplist_t object = NULL;
WMPropList *key; proplist_t key = PLMakeString(defaultName);
struct stat stbuf;
char *name;
int i;
assert(path != NULL);
if (sharedUserDefaults) {
defaults = sharedUserDefaults;
while (defaults) {
if (defaults->path && strcmp(defaults->path, path) == 0)
return defaults;
defaults = defaults->next;
}
}
/* we didn't found the database we are looking for. Go read it. XXX wtf? */
defaults = wmalloc(sizeof(WMUserDefaults));
defaults->defaults = WMCreatePLDictionary(NULL, NULL);
defaults->searchList = wmalloc(sizeof(WMPropList *) * 2);
/* the domain we want, go in the first position */
name = strrchr(path, '/');
if (!name)
name = path;
else
name++;
key = WMCreatePLString(name);
defaults->searchList[0] = key;
if (stat(path, &stbuf) >= 0)
defaults->timestamp = stbuf.st_mtime;
domain = WMReadPropListFromFile(path);
if (!domain)
domain = WMCreatePLDictionary(NULL, NULL);
defaults->path = wstrdup(path);
defaults->appDomain = domain;
if (domain)
WMPutInPLDictionary(defaults->defaults, key, domain);
/* terminate list */
defaults->searchList[1] = NULL;
defaults->searchListArray = WMCreatePLArray(NULL, NULL);
i = 0;
while (defaults->searchList[i]) {
WMAddToPLArray(defaults->searchListArray, defaults->searchList[i]);
i++;
}
if (sharedUserDefaults)
defaults->next = sharedUserDefaults;
sharedUserDefaults = defaults;
#ifndef HAVE_INOTIFY
addSynchronizeTimerHandler();
#endif
registerSaveOnExit();
return defaults;
}
/* Returns a WMPropList array with all keys in the user defaults database.
* Free the array with WMReleasePropList() when no longer needed,
* but do not free the elements of the array! They're just references. */
WMPropList *WMGetUDKeys(WMUserDefaults * database)
{
return WMGetPLDictionaryKeys(database->appDomain);
}
WMPropList *WMGetUDObjectForKey(WMUserDefaults * database, char *defaultName)
{
WMPropList *domainName, *domain;
WMPropList *object = NULL;
WMPropList *key = WMCreatePLString(defaultName);
int i = 0; int i = 0;
while (database->searchList[i] && !object) { while (database->searchList[i] && !object) {
domainName = database->searchList[i]; domainName = database->searchList[i];
domain = WMGetFromPLDictionary(database->defaults, domainName); domain = PLGetDictionaryEntry(database->defaults, domainName);
if (domain) { if (domain) {
object = WMGetFromPLDictionary(domain, key); object = PLGetDictionaryEntry(domain, key);
} }
i++; i++;
} }
WMReleasePropList(key); PLRelease(key);
return object; return object;
} }
void WMSetUDObjectForKey(WMUserDefaults * database, WMPropList * object, char *defaultName)
void
WMSetUDObjectForKey(WMUserDefaults *database, proplist_t object,
char *defaultName)
{ {
WMPropList *key = WMCreatePLString(defaultName); proplist_t key = PLMakeString(defaultName);
database->dirty = 1; database->dirty = 1;
WMPutInPLDictionary(database->appDomain, key, object); PLInsertDictionaryEntry(database->appDomain, key, object);
WMReleasePropList(key); PLRelease(key);
} }
void WMRemoveUDObjectForKey(WMUserDefaults * database, char *defaultName)
void
WMRemoveUDObjectForKey(WMUserDefaults *database, char *defaultName)
{ {
WMPropList *key = WMCreatePLString(defaultName); proplist_t key = PLMakeString(defaultName);
database->dirty = 1; database->dirty = 1;
WMRemoveFromPLDictionary(database->appDomain, key); PLRemoveDictionaryEntry(database->appDomain, key);
WMReleasePropList(key); PLRelease(key);
} }
char *WMGetUDStringForKey(WMUserDefaults * database, char *defaultName)
char*
WMGetUDStringForKey(WMUserDefaults *database, char *defaultName)
{ {
WMPropList *val; proplist_t val;
val = WMGetUDObjectForKey(database, defaultName); val = WMGetUDObjectForKey(database, defaultName);
if (!val) if (!val)
return NULL; return NULL;
if (!WMIsPLString(val)) if (!PLIsString(val))
return NULL; return NULL;
return WMGetFromPLString(val); return wstrdup(PLGetString(val));
} }
int WMGetUDIntegerForKey(WMUserDefaults * database, char *defaultName)
int
WMGetUDIntegerForKey(WMUserDefaults *database, char *defaultName)
{ {
WMPropList *val; proplist_t val;
char *str; char *str;
int value; int value;
@@ -488,10 +251,10 @@ int WMGetUDIntegerForKey(WMUserDefaults * database, char *defaultName)
if (!val) if (!val)
return 0; return 0;
if (!WMIsPLString(val)) if (!PLIsString(val))
return 0; return 0;
str = WMGetFromPLString(val); str = PLGetString(val);
if (!str) if (!str)
return 0; return 0;
@@ -501,18 +264,25 @@ int WMGetUDIntegerForKey(WMUserDefaults * database, char *defaultName)
return value; return value;
} }
float WMGetUDFloatForKey(WMUserDefaults * database, char *defaultName)
int
WMGetUDFloatForKey(WMUserDefaults *database, char *defaultName)
{ {
WMPropList *val; proplist_t val;
char *str; char *str;
float value; float value;
val = WMGetUDObjectForKey(database, defaultName); val = WMGetUDObjectForKey(database, defaultName);
if (!val || !WMIsPLString(val)) if (!val)
return 0.0; return 0.0;
if (!(str = WMGetFromPLString(val))) if (!PLIsString(val))
return 0.0;
str = PLGetString(val);
if (!str)
return 0.0; return 0.0;
if (sscanf(str, "%f", &value)!=1) if (sscanf(str, "%f", &value)!=1)
@@ -521,9 +291,12 @@ float WMGetUDFloatForKey(WMUserDefaults * database, char *defaultName)
return value; return value;
} }
Bool WMGetUDBoolForKey(WMUserDefaults * database, char *defaultName)
Bool
WMGetUDBoolForKey(WMUserDefaults *database, char *defaultName)
{ {
WMPropList *val; proplist_t val;
int value; int value;
char *str; char *str;
@@ -532,10 +305,10 @@ Bool WMGetUDBoolForKey(WMUserDefaults * database, char *defaultName)
if (!val) if (!val)
return False; return False;
if (!WMIsPLString(val)) if (!PLIsString(val))
return False; return False;
str = WMGetFromPLString(val); str = PLGetString(val);
if (!str) if (!str)
return False; return False;
@@ -551,80 +324,97 @@ Bool WMGetUDBoolForKey(WMUserDefaults * database, char *defaultName)
return False; return False;
} }
void WMSetUDIntegerForKey(WMUserDefaults * database, int value, char *defaultName)
void
WMSetUDIntegerForKey(WMUserDefaults *database, int value, char *defaultName)
{ {
WMPropList *object; proplist_t object;
char buffer[128]; char buffer[128];
sprintf(buffer, "%i", value); sprintf(buffer, "%i", value);
object = WMCreatePLString(buffer); object = PLMakeString(buffer);
WMSetUDObjectForKey(database, object, defaultName); WMSetUDObjectForKey(database, object, defaultName);
WMReleasePropList(object); PLRelease(object);
} }
void WMSetUDStringForKey(WMUserDefaults * database, char *value, char *defaultName)
{
WMPropList *object;
object = WMCreatePLString(value);
void
WMSetUDStringForKey(WMUserDefaults *database, char *value, char *defaultName)
{
proplist_t object;
object = PLMakeString(value);
WMSetUDObjectForKey(database, object, defaultName); WMSetUDObjectForKey(database, object, defaultName);
WMReleasePropList(object); PLRelease(object);
} }
void WMSetUDFloatForKey(WMUserDefaults * database, float value, char *defaultName)
void
WMSetUDFloatForKey(WMUserDefaults *database, float value, char *defaultName)
{ {
WMPropList *object; proplist_t object;
char buffer[128]; char buffer[128];
sprintf(buffer, "%f", value); sprintf(buffer, "%f", value);
object = WMCreatePLString(buffer); object = PLMakeString(buffer);
WMSetUDObjectForKey(database, object, defaultName); WMSetUDObjectForKey(database, object, defaultName);
WMReleasePropList(object); PLRelease(object);
} }
void WMSetUDBoolForKey(WMUserDefaults * database, Bool value, char *defaultName)
void
WMSetUDBoolForKey(WMUserDefaults *database, Bool value, char *defaultName)
{ {
static WMPropList *yes = NULL, *no = NULL; static proplist_t yes = NULL, no = NULL;
if (!yes) { if (!yes) {
yes = WMCreatePLString("YES"); yes = PLMakeString("YES");
no = WMCreatePLString("NO"); no = PLMakeString("NO");
} }
WMSetUDObjectForKey(database, value ? yes : no, defaultName); WMSetUDObjectForKey(database, value ? yes : no, defaultName);
} }
WMPropList *WMGetUDSearchList(WMUserDefaults * database)
proplist_t
WMGetUDSearchList(WMUserDefaults *database)
{ {
return database->searchListArray; return database->searchListArray;
} }
void WMSetUDSearchList(WMUserDefaults * database, WMPropList * list)
void
WMSetUDSearchList(WMUserDefaults *database, proplist_t list)
{ {
int i, c; int i, c;
if (database->searchList) { if (database->searchList) {
i = 0; i = 0;
while (database->searchList[i]) { while (database->searchList[i]) {
WMReleasePropList(database->searchList[i]); PLRelease(database->searchList[i]);
i++; i++;
} }
wfree(database->searchList); free(database->searchList);
} }
if (database->searchListArray) { if (database->searchListArray) {
WMReleasePropList(database->searchListArray); PLRelease(database->searchListArray);
} }
c = WMGetPropListItemCount(list); c = PLGetNumberOfElements(list);
database->searchList = wmalloc(sizeof(WMPropList *) * (c + 1)); database->searchList = wmalloc(sizeof(proplist_t)*(c+1));
for (i=0; i<c; i++) { for (i=0; i<c; i++) {
database->searchList[i] = WMGetFromPLArray(list, i); database->searchList[i] = PLGetArrayElement(list, i);
} }
database->searchList[c] = NULL;
database->searchListArray = WMDeepCopyPropList(list); database->searchListArray = PLDeepCopy(list);
} }

View File

@@ -1,25 +1,50 @@
#include <errno.h>
#include <time.h>
#include "wconfig.h" #include "../src/config.h"
void wusleep(unsigned int usec)
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef _AIX
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if defined(HAVE_SELECT)
void
wusleep(unsigned int microsecs)
{ {
struct timespec tm; struct timeval tv;
fd_set rd, wr, ex;
/* An arbitrary limit of 10 minutes -- in WM, if FD_ZERO(&rd);
* somethings wants to sleep anything even close to FD_ZERO(&wr);
* this, it's most likely an error. FD_ZERO(&ex);
*/ tv.tv_sec = microsecs / 1000000u;
if (usec > 600000000) tv.tv_usec = microsecs % 1000000u;
return; select(1, &rd, &wr, &ex, &tv);
tm.tv_sec = usec / 1000000;
tm.tv_nsec = (usec % 1000000) * 1000;
while (nanosleep(&tm, &tm) == -1 && errno == EINTR)
;
} }
#else /* not HAVE_SELECT */
# ifdef HAVE_POLL
void
wusleep(unsigned int microsecs)
{
poll((struct poll *) 0, (size_t) 0, microsecs/1000);
}
# else /* ! HAVE_POLL */
oops!
# endif /* !HAVE_POLL */
#endif /* !HAVE_SELECT */

View File

@@ -1,22 +1,57 @@
#include <unistd.h> #include <unistd.h>
#include <X11/Xlocale.h>
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <X11/Xutil.h>
/* Xmd.h which is indirectly included by GNUstep.h defines BOOL,
* but libPropList also defines it. So we do this kluge to get rid of BOOL
* temporarily */
#ifdef BOOL
# define WINGS_BOOL
# undef BOOL
#endif
#include "GNUstep.h"
#ifdef WINGS_BOOL
# define BOOL
# undef WINGS_BOOL
#endif
extern void W_ReadConfigurations(void);
extern void W_InitNotificationCenter(void); extern void W_InitNotificationCenter(void);
typedef struct W_Application {
char *applicationName;
int argc;
char **argv;
char *resourcePath;
} W_Application;
struct W_Application WMApplication; struct W_Application WMApplication;
char *_WINGS_progname = NULL; char *_WINGS_progname = NULL;
Bool W_ApplicationInitialized(void)
Bool
W_ApplicationInitialized(void)
{ {
return _WINGS_progname!=NULL; return _WINGS_progname!=NULL;
} }
void WMInitializeApplication(char *applicationName, int *argc, char **argv)
void
WMInitializeApplication(char *applicationName, int *argc, char **argv)
{ {
int i; int i;
@@ -24,16 +59,6 @@ void WMInitializeApplication(char *applicationName, int *argc, char **argv)
assert(argv!=NULL); assert(argv!=NULL);
assert(applicationName!=NULL); assert(applicationName!=NULL);
setlocale(LC_ALL, "");
#ifdef I18N
if (getenv("NLSPATH"))
bindtextdomain("WINGs", getenv("NLSPATH"));
else
bindtextdomain("WINGs", LOCALEDIR);
bind_textdomain_codeset("WINGs", "UTF-8");
#endif
_WINGS_progname = argv[0]; _WINGS_progname = argv[0];
WMApplication.applicationName = wstrdup(applicationName); WMApplication.applicationName = wstrdup(applicationName);
@@ -47,85 +72,80 @@ void WMInitializeApplication(char *applicationName, int *argc, char **argv)
/* initialize notification center */ /* initialize notification center */
W_InitNotificationCenter(); W_InitNotificationCenter();
/* read general configuration data for WINGs */
W_ReadConfigurations();
} }
void WMSetResourcePath(char *path)
void
WMSetResourcePath(char *path)
{ {
if (WMApplication.resourcePath) if (WMApplication.resourcePath)
wfree(WMApplication.resourcePath); free(WMApplication.resourcePath);
WMApplication.resourcePath = wstrdup(path); WMApplication.resourcePath = wstrdup(path);
} }
char *WMGetApplicationName()
char*
WMGetApplicationName()
{ {
return WMApplication.applicationName; return WMApplication.applicationName;
} }
static char *checkFile(char *path, char *folder, char *ext, char *resource)
static char*
checkFile(char *path, char *folder, char *ext, char *resource)
{ {
char *ret; char *ret;
int extralen; int extralen;
size_t slen;
if (!path || !resource) extralen = (ext ? strlen(ext) : 0) + (folder ? strlen(folder) : 0) + 4;
return NULL; ret = wmalloc(strlen(path)+strlen(resource)+extralen+8);
strcpy(ret, path);
if (folder) {
strcat(ret, "/");
strcat(ret, folder);
}
if (ext) {
strcat(ret, "/");
strcat(ret, ext);
}
strcat(ret, "/");
strcat(ret, resource);
extralen = (ext ? strlen(ext) + 1 : 0) + (folder ? strlen(folder) + 1 : 0) + 1; if (access(ret, F_OK)!=0) {
slen = strlen(path) + strlen(resource) + 1 + extralen; free(ret);
ret = wmalloc(slen); ret = NULL;
if (wstrlcpy(ret, path, slen) >= slen)
goto error;
if (folder &&
(wstrlcat(ret, "/", slen) >= slen ||
wstrlcat(ret, folder, slen) >= slen))
goto error;
if (ext &&
(wstrlcat(ret, "/", slen) >= slen ||
wstrlcat(ret, ext, slen) >= slen))
goto error;
if (wstrlcat(ret, "/", slen) >= slen ||
wstrlcat(ret, resource, slen) >= slen)
goto error;
if (access(ret, F_OK) != 0)
goto error;
return ret;
error:
if (ret)
wfree(ret);
return NULL;
} }
char *WMPathForResourceOfType(char *resource, char *ext) return ret;
{ }
char *path, *tmp, *appdir;
int i;
size_t slen;
path = tmp = appdir = NULL;
char*
WMPathForResourceOfType(char *resource, char *ext)
{
char *path = NULL;
char *tmp, *appdir;
int i;
/* /*
* Paths are searched in this order: * Paths are searched in this order:
* - resourcePath/ext * - resourcePath/ext
* - dirname(argv[0])/ext * - argv[0]/ext
* - GNUSTEP_USER_ROOT/Applications/ApplicationName.app/ext * - GNUSTEP_USER_ROOT/Apps/ApplicationName.app/ext
* - ~/GNUstep/Applications/ApplicationName.app/ext * - ~/GNUstep/Apps/ApplicationName.app/ext
* - GNUSTEP_LOCAL_ROOT/Applications/ApplicationName.app/ext * - GNUSTEP_LOCAL_ROOT/Apps/ApplicationName.app/ext
* - /usr/local/GNUstep/Applications/ApplicationName.app/ext * - /usr/local/GNUstep/Apps/ApplicationName.app/ext
* - GNUSTEP_SYSTEM_ROOT/Applications/ApplicationName.app/ext * - GNUSTEP_SYSTEM_ROOT/Apps/ApplicationName.app/ext
* - /usr/GNUstep/Applications/ApplicationName.app/ext * - /usr/GNUstep/Apps/ApplicationName.app/ext
*/ */
if (WMApplication.resourcePath) { if (WMApplication.resourcePath) {
path = checkFile(WMApplication.resourcePath, NULL, ext, resource); path = checkFile(WMApplication.resourcePath, NULL, ext, resource);
if (path) if (path)
goto out; return path;
} }
if (WMApplication.argv[0]) { if (WMApplication.argv[0]) {
@@ -139,42 +159,143 @@ char *WMPathForResourceOfType(char *resource, char *ext)
} else { } else {
path = NULL; path = NULL;
} }
goto out; free(tmp);
if (path)
return path;
} }
slen = strlen(WMApplication.applicationName) + sizeof("Applications/.app"); appdir = wmalloc(strlen(WMApplication.applicationName)+8);
appdir = wmalloc(slen); sprintf(appdir, "Apps/%s.app", WMApplication.applicationName);
if (snprintf(appdir, slen, "Applications/%s.app", WMApplication.applicationName) >= slen)
goto out;
if (getenv("GNUSTEP_USER_ROOT")) {
path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource); path = checkFile(getenv("GNUSTEP_USER_ROOT"), appdir, ext, resource);
if (path) if (path) {
goto out; free(appdir);
return path;
}
}
path = checkFile(wusergnusteppath(), appdir, ext, resource); tmp = wusergnusteppath();
if (path) if (tmp) {
goto out; path = checkFile(tmp, appdir, ext, resource);
free(tmp);
if (path) {
free(appdir);
return path;
}
}
if (getenv("GNUSTEP_LOCAL_ROOT")) {
path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource); path = checkFile(getenv("GNUSTEP_LOCAL_ROOT"), appdir, ext, resource);
if (path) if (path) {
goto out; free(appdir);
return path;
}
}
path = checkFile("/usr/local/GNUstep", appdir, ext, resource); path = checkFile("/usr/local/GNUstep", appdir, ext, resource);
if (path) if (path) {
goto out; free(appdir);
path = checkFile(getenv("GNUSTEP_SYSTEM_ROOT"), appdir, ext, resource);
if (path)
goto out;
path = checkFile("/usr/GNUstep", appdir, ext, resource); /* falls through */
out:
if (tmp)
wfree(tmp);
if (appdir)
wfree(appdir);
return path; return path;
} }
if (getenv("GNUSTEP_SYSTEM_ROOT")) {
path = checkFile(getenv("GNUSTEP_SYSTEM_ROOT"), appdir, ext, resource);
if (path) {
free(appdir);
return path;
}
}
path = checkFile("/usr/GNUstep", appdir, ext, resource);
if (path) {
free(appdir);
return path;
}
return NULL;
}
/********************* WMScreen related stuff ********************/
void
WMSetApplicationIconImage(WMScreen *scr, WMPixmap *icon)
{
if (scr->applicationIcon)
WMReleasePixmap(scr->applicationIcon);
scr->applicationIcon = WMRetainPixmap(icon);
if (scr->groupLeader) {
XWMHints *hints;
hints = XGetWMHints(scr->display, scr->groupLeader);
hints->flags |= IconPixmapHint|IconMaskHint;
hints->icon_pixmap = icon->pixmap;
hints->icon_mask = icon->mask;
XSetWMHints(scr->display, scr->groupLeader, hints);
XFree(hints);
}
}
WMPixmap*
WMGetApplicationIconImage(WMScreen *scr)
{
return scr->applicationIcon;
}
void
WMSetApplicationHasAppIcon(WMScreen *scr, Bool flag)
{
scr->aflags.hasAppIcon = flag;
}
void
W_InitApplication(WMScreen *scr)
{
Window leader;
XClassHint *classHint;
XWMHints *hints;
leader = XCreateSimpleWindow(scr->display, scr->rootWin, -1, -1,
1, 1, 0, 0, 0);
if (!scr->aflags.simpleApplication) {
classHint = XAllocClassHint();
classHint->res_name = "groupLeader";
classHint->res_class = WMApplication.applicationName;
XSetClassHint(scr->display, leader, classHint);
XFree(classHint);
XSetCommand(scr->display, leader, WMApplication.argv,
WMApplication.argc);
hints = XAllocWMHints();
hints->flags = WindowGroupHint;
hints->window_group = leader;
if (scr->applicationIcon) {
hints->flags |= IconPixmapHint;
hints->icon_pixmap = scr->applicationIcon->pixmap;
if (scr->applicationIcon->mask) {
hints->flags |= IconMaskHint;
hints->icon_mask = scr->applicationIcon->mask;
}
}
XSetWMHints(scr->display, leader, hints);
XFree(hints);
}
scr->groupLeader = leader;
}

View File

@@ -1,149 +0,0 @@
#include <unistd.h>
#include "WINGsP.h"
#include <X11/Xutil.h>
#include "GNUstep.h"
extern struct W_Application WMApplication;
void WMSetApplicationIconWindow(WMScreen * scr, Window window)
{
scr->applicationIconWindow = window;
if (scr->groupLeader) {
XWMHints *hints;
hints = XGetWMHints(scr->display, scr->groupLeader);
hints->flags |= IconWindowHint;
hints->icon_window = window;
XSetWMHints(scr->display, scr->groupLeader, hints);
XFree(hints);
}
}
void WMSetApplicationIconImage(WMScreen * scr, RImage * image)
{
WMPixmap *icon;
if (scr->applicationIconImage == image)
return;
if (scr->applicationIconImage)
RReleaseImage(scr->applicationIconImage);
scr->applicationIconImage = RRetainImage(image);
/* TODO: check whether we should set the pixmap only if there's none yet */
if (image != NULL && (icon = WMCreatePixmapFromRImage(scr, image, 128)) != NULL) {
WMSetApplicationIconPixmap(scr, icon);
WMReleasePixmap(icon);
}
}
RImage *WMGetApplicationIconImage(WMScreen * scr)
{
return scr->applicationIconImage;
}
void WMSetApplicationIconPixmap(WMScreen * scr, WMPixmap * icon)
{
if (scr->applicationIconPixmap == icon)
return;
if (scr->applicationIconPixmap)
WMReleasePixmap(scr->applicationIconPixmap);
scr->applicationIconPixmap = WMRetainPixmap(icon);
if (scr->groupLeader) {
XWMHints *hints;
hints = XGetWMHints(scr->display, scr->groupLeader);
hints->flags |= IconPixmapHint | IconMaskHint;
hints->icon_pixmap = (icon != NULL ? icon->pixmap : None);
hints->icon_mask = (icon != NULL ? icon->mask : None);
XSetWMHints(scr->display, scr->groupLeader, hints);
XFree(hints);
}
}
WMPixmap *WMGetApplicationIconPixmap(WMScreen * scr)
{
return scr->applicationIconPixmap;
}
WMPixmap *WMCreateApplicationIconBlendedPixmap(WMScreen * scr, RColor * color)
{
WMPixmap *pix;
if (scr->applicationIconImage) {
RColor gray;
gray.red = 0xae;
gray.green = 0xaa;
gray.blue = 0xae;
gray.alpha = 0xff;
if (!color)
color = &gray;
pix = WMCreateBlendedPixmapFromRImage(scr, scr->applicationIconImage, color);
} else {
pix = NULL;
}
return pix;
}
void WMSetApplicationHasAppIcon(WMScreen * scr, Bool flag)
{
scr->aflags.hasAppIcon = ((flag == 0) ? 0 : 1);
}
void W_InitApplication(WMScreen * scr)
{
Window leader;
XClassHint *classHint;
XWMHints *hints;
leader = XCreateSimpleWindow(scr->display, scr->rootWin, -1, -1, 1, 1, 0, 0, 0);
if (!scr->aflags.simpleApplication) {
classHint = XAllocClassHint();
classHint->res_name = "groupLeader";
classHint->res_class = WMApplication.applicationName;
XSetClassHint(scr->display, leader, classHint);
XFree(classHint);
XSetCommand(scr->display, leader, WMApplication.argv, WMApplication.argc);
hints = XAllocWMHints();
hints->flags = WindowGroupHint;
hints->window_group = leader;
/* This code will never actually be reached, because to have
* scr->applicationIconPixmap set we need to have a screen first,
* but this function is called in the screen creation process.
* -Dan
*/
if (scr->applicationIconPixmap) {
hints->flags |= IconPixmapHint;
hints->icon_pixmap = scr->applicationIconPixmap->pixmap;
if (scr->applicationIconPixmap->mask) {
hints->flags |= IconMaskHint;
hints->icon_mask = scr->applicationIconPixmap->mask;
}
}
XSetWMHints(scr->display, leader, hints);
XFree(hints);
}
scr->groupLeader = leader;
}

Some files were not shown because too many files have changed in this diff Show More