1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-05-08 09:42:57 +02:00

Compare commits

..

106 Commits

Author SHA1 Message Date
dan 0852957ea1 update before moving to xft2 2003-08-06 23:58:54 +00:00
dan 7efcf57c18 fixed the 'focus flicker' problem, seen with GTK2 applications 2003-08-03 00:00:11 +00:00
dan 44f636e91e doc update; don't use clip's inactive collors for arrows when collapsed 2003-08-02 21:36:45 +00:00
dan 8457611316 fixes to comply to ANSI C 2003-07-16 20:58:49 +00:00
dan bd7943d9a7 - Implemented a better logic to preserve the window's old geometry when
maximizing to support succesive maximizations in different directions
  without the need to do an intermediary un-maximize step (eliminates flicker)
- Made keyboard/mouse maximization behavior consinstent relative to each other
2003-07-05 02:39:37 +00:00
dan b0d72a3db2 - Fixed aspect of window list menu (window name was too close to workspace
indicator)
- Fixed menu panel in WPrefs.app. Explanatory text did not fit into the label
2003-07-01 23:00:25 +00:00
dan 396b011610 Fixed bug with focusing a deminiaturized window with sloppy focus mode 2003-06-14 21:13:34 +00:00
dan c131f14d3e - Fixed bug with wrong text wrapping (Alexey Voinov <voins@voins.program.ru>) 2003-06-12 23:19:00 +00:00
dan a4c986fa1b _ fixed bug in resizing a scrollview
- read both XLFDs and XFT style font names from config files (xft case only)
2003-06-12 21:21:57 +00:00
dan 64468fcf63 support for compiling with xft2 2003-06-10 01:56:26 +00:00
kojima 8904783aee show whether aa text is enabled in info panel 2003-06-09 05:37:38 +00:00
kojima 40c89b3399 Fix by vlaad to the tableview click callback that was getting bad row info 2003-06-08 21:53:00 +00:00
dan 27a396d7ed - Fixed sloppy focus bug
- Made maximizing behaves differently with keyboard/mouse for xinerama
  (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- A few leftover xinerama fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Extended the 'strut' to multiple heads
  (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon placement now takes into account the new xinerama extended 'strut'
  (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon arrangement that takes the new extended xinerama 'strut' into account
  (Peter Zijlstra <a.p.zijlstra@chello.nl>)
2003-06-06 04:11:00 +00:00
kojima 2cf5931890 fixed silly typo in workspace.c
added system wide menu configuration
2003-06-06 02:51:47 +00:00
kojima d159da8671 fixed little prob with header define 2003-06-06 02:47:46 +00:00
kojima ed0d234d7f solaris xinerama fixes, wmsetbg updated for xinerama 2003-06-04 20:40:00 +00:00
kojima 4d701d8306 small fix in description 2003-06-04 19:02:10 +00:00
kojima 5dbb770aa4 xinerama stuff for solaris 2003-06-04 18:57:03 +00:00
kojima 479ccbda82 updated french translations 2003-05-23 21:47:48 +00:00
kojima 001cb65271 updated single click patch 2003-05-20 04:43:19 +00:00
kojima bc3ab27364 patch from Vitaly Ovtchinnikov <ov@rbcmail.ru> for
double/triple-click selection in textfield
2003-05-06 03:36:21 +00:00
dan 669d542408 - added imporved wsetfonr from (Mike FABIAN <mfabian@suse.de>)
- added small language fix from ("Marcelo E. Magallon" <mmagallo@debian.org>)
2003-04-23 21:21:38 +00:00
dan 3dcab96180 - Support for multiline balloons (Vitaly Ovtchinnikov <ov@rbcmail.ru>) 2003-04-21 03:34:43 +00:00
dan 7f1d621f43 updated cvs-ignored-files list 2003-04-18 01:16:50 +00:00
dan b0063c83c7 added support fo generating pkgconfig files for WINGs, wrlib and wmlib ("Marcelo E. Magallon" <mmagallo@debian.org>) 2003-04-18 01:15:07 +00:00
dan f06c9a1953 - Fixed 2 syntax errors in plmenu.zh_TW.Big5 (Mike FABIAN <mfabian@suse.de>)
- Some .po file fixes (Mike FABIAN <mfabian@suse.de>)
- Fixed the problem with the root menu code changing the locale setting as
  a side effect of loading a localized menu
- Fixed e memory leak in the code that reads a localized root menu
2003-04-15 22:04:49 +00:00
dan e1958b22c5 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)
2003-04-11 21:22:59 +00:00
dan 528243bb98 Added bulgarian translations 2003-04-06 23:18:07 +00:00
dan f058fdf72c - Fixed small memory leak in the WINGs' font panel code.
- Fixed call to qsort in WMSortArray.
- Fixed a memleak in the WINGs' file panel.
2003-04-02 11:37:04 +00:00
dan 5f79f1bcde - Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
a WINGs textfield widget.
2003-03-20 13:11:13 +00:00
kojima 18ed046356 - Added WMSetTableViewHasHorizontalScroller() 2003-03-13 21:36:34 +00:00
dan 277d0055fd Fixed bug with scrolling menus (introduced by xinerama patch) 2003-03-04 13:14:55 +00:00
dan e727cbadb6 - Fixed Clip's workspace menu mapping to be consistent with the others
- Fixed bug in wmsetbg that caused scale and maxscale to both do maxscale
  (Alexey Voinov <voins@voins.program.ru>)
2003-02-28 12:42:16 +00:00
dan fdeb749da7 Autoarrange icons after unhiding an application that has miniaturized
windows, else they may cover other icons which are now in the positions
they have occupied before hiding
2003-02-27 07:42:46 +00:00
dan dee8c6e770 - Also fixed a bug with not showing shaded window frames when the application
is hidden and another window belonging to the app is selected in the window
  list menu
2003-02-24 04:08:21 +00:00
dan fe4cd695af - Fixed a bug with deminiaturizing windows when the application is hidden and
the miniaturized window is selected from the window list menu
2003-02-24 04:06:20 +00:00
dan 1902325087 Reverted German translations 2003-02-24 01:44:59 +00:00
kojima 5b28616212 ops 2003-02-24 01:43:16 +00:00
kojima ad05cc3b44 updated german translation
added catalan translation
2003-02-23 22:12:20 +00:00
dan 56f73aa4b9 - a few simplifications and cleanups in the WINGs python code 2003-02-20 23:02:28 +00:00
dan 40111188ec - Fixed bug with cursor locked in drag mode after Alt-dragging a window 2003-02-19 23:26:41 +00:00
dan 80c09f1075 - Fixed wrong display position for the move/resize widgets
patch (Peter Zijlstra <a.p.zijlstra@chello.nl>)
2003-02-18 00:35:54 +00:00
dan b5ef388711 - Fixed edge resistance and move/resize frame drawing for borderless windows 2003-02-16 01:47:58 +00:00
kojima 7a8bde44fa fixed bug in tpixmap after xinerama patch 2003-02-13 16:27:45 +00:00
dan b381674375 - Fixed incorrect focusing of application's windows after an unhide (sometimes
the incorrect window got focus instead of the apps's last focused window)
- Unshade application's shaded windows when Dbl-MiddleClick-ing its appicon.
  (this is to be consistent with deminiaturizing application's miniwindows
  which also happens in this case, since shading is a form of miniaturization)
- misc fixes
2003-02-11 00:32:17 +00:00
dan e54a0954e6 added fixed german translations 2003-02-05 01:42:02 +00:00
dan c0965cd48b - Fixed a problem in the stacking code which could lead to segmentation faults
(Jeff Teunissen <deek@d2dc.net>)
2003-01-17 01:10:51 +00:00
dan 4153e2fde4 - Fixed crashing bug in menu.c
- Updated year from 2002 to 2003
2003-01-16 23:30:45 +00:00
dan f3487c1ea2 new german translations 2003-01-16 01:47:35 +00:00
dan 0898a3d475 added python wrapper files to dist tarball 2002-12-20 22:41:30 +00:00
dan 064f79ebae - Fixed focus handling for windows that set WM_HINTS.take_focus = False.
- Misc fixes.
- Improved a bit the python wrapper.
- Build po files before 'make install'
2002-12-20 17:47:31 +00:00
kojima 55d37178a0 added cback for set button in fontpanel 2002-12-04 15:40:32 +00:00
dan 90e8cfc5b8 - Properly fixed the color change in the Appearance panel preview box
in WPrefs.app. Also uses less resources.
2002-12-03 04:49:37 +00:00
dan ab511aca5e small update to display if xinerama is supported in the configure summary. nicer display for the summary too. 2002-12-02 04:42:13 +00:00
dan 39d250888e - Fixed Window Maker to compile with xinerama disabled.
- Replaced --disable-xinerama with --enable-xinerama in configure
  (xinerama needs to be enabled when Window Maker is build because
   it's no longer enabled by default)
2002-12-02 03:44:10 +00:00
dan 00638fa5d3 - Fixed a problem with image artifacts in the Appearance preview box
when color is changed and antialiased fonts are used.
2002-12-02 01:22:14 +00:00
dan ca43aba088 - Added wstrndup() and WMGetFontName() 2002-12-02 00:01:05 +00:00
dan 96c64e15ef - Added a python wrapper module for WINGs 2002-12-01 06:01:08 +00:00
dan dd1ccd2fd6 - enabled the use of SHAPE extension in the color panel. without it the
magnifying glass captured image was shifted and unusable
- removed some comments left in the code for later reviewal
2002-12-01 05:49:13 +00:00
dan c0442b1c59 - WMGetTextDefaultColor() won't retain the returned color anymore, and you
shouldn't release it. It is just a reference to the internal WMText color.
  This should make all the functions returning colors from widgets behave
  consistently
2002-11-30 03:00:34 +00:00
dan bde9b8a21a forgot to add these in cvs 2002-11-30 02:19:46 +00:00
dan 83d3625e1a - Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings
panel. (Temporary until the Font Settings panel in WPrefs is finished).
- Added a check that only %d is used in a font specification in WMGLOBAL and at
  most once for each font in a fontset (eliminates a possible security exploit)
- Added README.antialiasing describing the steps needed to get antialiased
  fonts working with WINGs/Window Maker.
- Added Sample.XftConfig
2002-11-30 02:13:36 +00:00
dan 5ad557c6c8 fixed a memleak in the font panel in WINGs 2002-11-29 02:47:33 +00:00
dan 1fa3937001 fixed wmaker failing to compile with gnome support enabled after the xinerama add 2002-11-29 02:37:40 +00:00
kojima a10214a502 - Fixed sloppy focus bug (Pawel S. Veselov <pv76716@druid.SFBay.Sun.COM>)
- Applied Xinerama patch (after fixes) from (Peter Zijlstra
  <a.p.zijlstra@chello.nl>)
2002-11-28 22:04:07 +00:00
dan 0fe70d2b4e - Fixed a bug with empty frame titles (Alexey Voinov <voins@voins.program.ru>)
- Added WMGetWidgetBackgroundColor()
- Code cleanup in wtext.c
- Renamed WFANonBold and WFANonEmphasized to WFANotBold and WFANotEmphasized
2002-11-25 04:46:00 +00:00
dan 18b3753227 - added WMCopyFontWithChanges() a more generic and powerful function, meant
to replace WMNormalizeFont(), WMEmphasizeFont(), WMStrenghtenFont(),
  WMUnemphasizeFont() and WMUnstrenghtenFont() which are now obsolete and
  were removed.
2002-11-22 04:49:05 +00:00
kojima 0bfa12a1fc fixed crash caused by resizebars that appear after reloading configs 2002-11-22 00:11:17 +00:00
dan 4d6cd7f326 added .mo files to cvs ignore list 2002-11-21 05:26:53 +00:00
dan 2fe1b0e3f8 - Added support for antialiased text with multibyte languages too.
(only tested on russian, since that's the only multibyte language
  I can test).
2002-11-21 05:21:42 +00:00
dan 3929660f39 - downgraded zh_TW.Big5 po files to previous versions. Latest failed to
compile
- fixed some charsets in a couple of po files
- remove libPropList question from Install script
2002-11-20 12:04:42 +00:00
dan c2ec1cfe8a - Fixed userdefaults in WINGs not to synchronize on exit a domain that is
marked not to be synchronized.
- WMGLOBAL options can now be set in the WindowMaker configuration files
  to overwrite values in WMGLOBAL.
- 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.
- Replaced AA with Anitialiased in WINGs font creation function names
- Added WMCreateFontWithFlags(), WMHasAntialiasingSupport() and
  WMIsAntialiasingEnabled()
- Created a separate font cacahe for antialiased fonts
- Added test at startup if Xft supports rendering antialiased fonts (in case
  the application was compiled with Xft support, but is run on an X server
  without support for xft rendering (RENDER extension missing). If no Xft
  support antialiasing will be disabled even if it is enabled in the
  configuration file.
- Finished the Info Panel to work with antialiased fonts.
- Code cleanup in dialog.c. Remade part of Info Panel drawing the Window Maker
  logo.
- Fixed technical style drawing of window resizing.
2002-11-13 15:13:48 +00:00
kojima d597c61cb7 final fix 2002-11-09 14:56:33 +00:00
dan 5e18eadf22 - Fixed wrong colors for text and tile with selected menu items 2002-11-08 21:07:45 +00:00
kojima 19f7fbc949 bleh this one should work 2002-11-08 19:30:53 +00:00
kojima 55f3cb9577 argh! buffer overflow fix, try 3 :P 2002-11-08 18:00:56 +00:00
kojima 811e508c84 fix overflow bug, try2 2002-11-08 17:05:35 +00:00
kojima 60ee69979f fixed buffer overrun bug in wrlib when creating or loading images 2002-11-07 17:18:41 +00:00
dan 4f80ec9178 - removed unnecessary include of WINGsP.h in some places
- smaller space between rows of text in WMText
2002-11-04 20:29:47 +00:00
dan 5e37991b6c Added (forgotten) release for notifications when destroying a WMList. 2002-11-04 06:07:00 +00:00
dan a4bc7f6a07 Better outline when drawing balloons 2002-11-01 13:28:59 +00:00
dan 6724ec5a6d - It seems some versions of automake carry broken missing scripts, so I
put back the missing script to make sure we don't generate packages
  with bad missing scripts
2002-10-28 22:52:18 +00:00
dan 879d13ef45 - Fixed an issue with drawing AA fonts in titlebars
- Removed 'missing' from cvs, since it is copied from automake when autogen.sh
  is run. You need to run autogen.sh after this update to put it back.
2002-10-28 21:56:13 +00:00
dan a1d78d102a fixed broken loading gif images 2002-10-28 05:36:42 +00:00
dan 3af4aa7846 - fix for 0 sized gif images too
- fixed wrong test for 0 size in nxpm.c
2002-10-25 04:21:09 +00:00
kojima 0f0afc48ab fix for 0 sized images 2002-10-25 03:43:57 +00:00
dan 55efa1f268 - Eliminated the double no-position-display gap when switching position
display types with the Shift key while moving windows
- Added be.po to configure.ac
- Changed the default resize window display type to 'Center'
2002-10-25 03:37:51 +00:00
kojima ffa1a610c0 - Fixed problem with long, preset workspace names (Wanderlei Antonio Cavassin
<cavassin@conectiva.com.br>)
- Added kinput2 bug workaround to stock WMWindowAttributes (Seiichi SATO
  <sato@cvs-net.co.jp>)
- Added Belarusian translation (Ihar Viarheichyk <iverg@mail.ru>)
- Fixed wrlib to not try to load braindead images with 0x0 size
2002-10-25 02:42:56 +00:00
dan 0bb76c0a76 made titlebars display titles with double buffering to avoid flickering. needed because aa fonts need clearing area before redrawing to avoid artefacts and clearing area before redraw gives flicker 2002-10-18 22:17:20 +00:00
dan 7be0a97998 - More cleanups for obsoleted xxx_gc's and xxx_pixel's in WScreen 2002-10-18 04:04:41 +00:00
dan 5230a57599 - Added WMCreateNonAAFont() to WINGs 2002-10-18 02:56:59 +00:00
dan 3bed15d673 - fixes for AA fonts
- fixed the workspace name display problem.
- replaced most of scr->xxx_pixel with scr->xxx_color
- removed some obsoleted GC's in the WScreen structure
2002-10-17 20:26:30 +00:00
dan 1e92274495 - Updated WINGs/NEWS with info about hw the API changed how how things
are affected. Fixes for old code too.
- Double buffering in WMList. All widgets or apps using WMList and
  having user drawing porcedures in place will inherit this double
  buffering automatically too.
- New functions in WINGs: WMGetColorAlpha(), WMIsAAFont()
- Misc code cleanups in WINGs and src/dialog.c
2002-10-16 04:05:45 +00:00
dan 2b2fecac12 - Added double buffering when drawing a WMFrame title with an AA font to avoid
flickering.
- Added double buffering when drawing WMList items to avoid flickering
- Shared xft drawable
- Renamed AASystemFont and AABoldSystemFont to AntialiasedSystemFont
  respectively AntialiasedBoldSystemFont in WMGLOBAL
- WMCreateFont falls back to normal fonts if antialiased fonts cannot be
  created (even if enabled)
2002-10-13 18:25:36 +00:00
dan 17f26077b0 Added Xft support in WINGs (for drawing antialiased fonts with transparency)
Details in WINGs/ChangeLog and WINGs/NEWS
2002-10-09 05:14:28 +00:00
dan a2b404b5b3 - API change in WINGs for WMDraw*String().
WMDrawString() and WMDrawImageString() now take WMColor instead of GC as
  arguments. WMDrawImageString() receives 2 colors (text & background).
  This is to allow easy extension for Xft/Xrender and hide X low level details
- Added alpha channel to WMColor. 2 new functions also:
  WMCreateRGBAColor() and WMSetColorAlpha()
- Miscelaneous code cleanups in wtext.c
- Removed obsoleted acconfig.h and implemented its functionality using
  AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
  This will definitely enforce the need to use autoconf 2.5x
2002-10-08 08:26:06 +00:00
dan e98da5a628 updated russian locales 2002-10-04 19:42:30 +00:00
dan b9e7a1d3ca removed obsoleted header file 2002-09-30 12:42:22 +00:00
dan 1941aaf34a - removed hermeslib dependancy
- added back old asm/mmx code
2002-09-30 12:39:22 +00:00
dan 11c466ec26 small fix in wtest 2002-09-29 01:37:10 +00:00
dan feaa80addc Updated French translations 2002-09-18 00:28:17 +00:00
dan 92b012e800 patch to add binary mode on opening files (for Windows+Cygwin compatibility). 2002-09-15 20:37:41 +00:00
dan 3fc803c0d8 - Fixed dock's menu mapping position when dock is on the right side.
- Map clip's menu so that it never gets out of screen on the left or the right.
2002-09-12 03:43:08 +00:00
dan a07b262a87 small annoyance with new autoconf generated directories 2002-09-11 15:04:26 +00:00
dan 851835c7a5 - Fixed empty window list menu, if the window list menu was launched through
the root menu ("Marc-Christian Petersen" <m.c.p@wolk-project.de>)
- A small fix for wmtableview when computing visible columns.
2002-09-11 15:02:43 +00:00
dan d4de3d0a45 - new function in WINGs: WMSetConnectionShutdownOnClose()
- new callback in the ConnectionDelegate structure: canResumeSending
- replaced setpgid() with setsid() when starting kids, to allow them to
  survive if wmaker (the parent) dies.
- a few cleanups.
2002-09-09 04:25:51 +00:00
316 changed files with 35453 additions and 18898 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ Makefile Makefile.in
aclocal.m4 aclocal.m4
configure config.log config.cache config.guess config.status config.sub configure config.log config.cache config.guess config.status config.sub
libtool ltconfig ltmain.sh libtool ltconfig ltmain.sh
.psrc .inslog2 tca.map tca.log autom4te.cache
*.rpt .psrc .inslog2 tca.map tca.log pchdir *.rpt
update update-autoconf update
WindowMaker*.tar.gz WindowMaker*.tar.gz
+121
View File
@@ -1,3 +1,124 @@
Changes since version 0.80.2:
.............................
- Some updates to WINGs WMConnection. See WINGs/ChangeLog for details.
- Fixed empty window list menu, if the window list menu was launched through
the root menu (sent by "Marc-Christian Petersen" <m.c.p@wolk-project.de>)
- Fixed dock's menu mapping position when dock is on the right side.
- Map clip's menu so that it never gets out of screen on the left or the right.
- Patch to add binary mode on opening files (needed for Windows with Cygwin)
(sent by luke <luke@posh.optushome.com.au>)
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
- Removed Hermes lib dependency in wrlib
- Put back asm/MMX code in wrlib
- Updated Russian locale files ("Andrew W. Nosenko" <awn@bcs.zp.ua>)
- API change in WINGs for WMDraw*String(). Details in WINGs/Changelog
- Removed obsoleted acconfig.h and implemented its functionality using
AC_DEFINE and AC_DEFINE_UNQUOTED as autoconf 2.5x recommends.
This will definitely enforce the need to use autoconf 2.5x
- Added Xft support to WINGs, for rendering antialiased fonts with
transparency. Details in WINGs/ChangeLog.
- Fixed problem with long, preset workspace names (Wanderlei Antonio Cavassin
<cavassin@conectiva.com.br>)
- Added kinput2 bug workaround to stock WMWindowAttributes (Seiichi SATO
<sato@cvs-net.co.jp>)
- Added Belarusian translation (Ihar Viarheichyk <iverg@mail.ru>)
- Fixed wrlib not to load braindead images with 0 sized width or height
- Removed double no-position-display when cycling position display types
with Shift key while moving windows.
- Changed the default position display while moving a window to 'Center'.
- Better outline when drawing balloons.
- Fixed wrlib to not accept too large images (fixes buffer overflow)
- Patched FAQ (David Coe <davidc@debian.org>)
- Fixed bug with resizebars appearing out of nothing when reloading configs
- Fixed sloppy focus bug (Pawel S. Veselov <Pawel.Veselov@Sun.COM>)
- Applied Xinerama patch (after fixes) from (Peter Zijlstra
<a.p.zijlstra@chello.nl>)
- Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings
panel. (Temporary until the Font Settings panel in WPrefs is finished).
- Added a check that only %d is used in a font specification in WMGLOBAL and at
most once for each font in a fontset (eliminates a possible security exploit)
- Added fontpanel callback
- Fixed focus handling for windows that set WM_HINTS.take_focus = False.
- Fixed a problem in the stacking code which could lead to segmentation faults
(Jeff Teunissen <deek@d2dc.net>)
- Fixed a crashing bug in the menu code with modal panels involved.
- Fixed incorrect focusing of application's windows after an unhide (sometimes
the incorrect window got focus instead of the apps's last focused window)
- Unshade application's shaded windows when Dbl-MiddleClick-ing its appicon.
(this is to be consistent with deminiaturizing application's miniwindows
which also happens in this case, since shading is a form of miniaturization)
- Fixed bug with tpixmap from previous xinerama patch (reported by g0sh)
- Fixed edge resistance and move/resize frame drawing for borderless windows
- Fixed wrong display position for the move/resize widgets after xinerama
patch (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Fixed bug with cursor locked in drag mode after Alt-dragging a window
- Added Catalan translation (Ernest Adrogué <eadrogue@gmx.net>)
- Fixed a bug with deminiaturizing windows when the application is hidden and
the miniaturized window is selected from the window list menu
- Fixed a bug with not showing shaded window frames when the application is
hidden and another window belonging to the app is selected in the window
list menu
- Autoarrange icons after unhiding an application that has miniaturized
windows, else they may cover other icons which are now in the positions
they have occupied before hiding
- Fixed Clip's workspace menu mapping to be consistent with the others
- Fixed bug in wmsetbg that caused scale and maxscale to both do maxscale
(Alexey Voinov <voins@voins.program.ru>)
- Fixed bug with scrolling menus introduced by the xinerama patch.
- Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
a WINGs textfield widget.
- Fixed small memory leak in WINGs' font panel code.
- Fixed memory leak in WINGs' file panel code.
- Updated Bulgarian translations (Anton Zinoviev <zinoviev@debian.org>)
- Fixed a bug in WINGs' hashtable which free'd the wrong memory in the
WMResetHashTable() function (possible source of SIGSEGVs)
- Fixed 2 syntax errors in plmenu.zh_TW.Big5 (Mike FABIAN <mfabian@suse.de>)
- Some .po file fixes (Mike FABIAN <mfabian@suse.de>)
- Fixed the problem with the root menu code changing the locale setting as
a side effect of loading a localized menu
- Fixed e memory leak in the code that reads a localized root menu
- Added support for generating pkgconfig files for WINGS, wmlib and wrlib.
("Marcelo E. Magallon" <mmagallo@debian.org>)
- Support for multiline balloons (Vitaly Ovtchinnikov <ov@rbcmail.ru>)
- Improved wsetfont (Mike FABIAN <mfabian@suse.de>)
- Updated single-click contrib patch (steve lion <steve.lion@verizon.net>
and vlaad)
- Updated French translations (Antoine Hulin <antoine@origan.fdn.org>)
- Xinerama support for Solaris
- Added global menu support (see NEWS)
- Fixed sloppy focus bug
- Made maximize behave differently with keyboard/mouse for xinerama
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- A few leftover xinerama fixes (Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Extended the 'strut' to multiple heads
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon placement now takes into account the new xinerama extended 'strut'
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Icon arrangement that takes the new extended xinerama 'strut' into account
(Peter Zijlstra <a.p.zijlstra@chello.nl>)
- Fixed the 'KDE omnipresent' bug.
- Fixed bug with focusing a deminiaturized window with sloppy focus mode
- Fixed aspect of window list menu (window name was too close to workspace
indicator)
- Fixed menu panel in WPrefs.app. Explanatory text did not fit into the label
- Implemented a better logic to preserve the window's old geometry when
maximizing to support succesive maximizations in different directions
without the need to do an intermediary un-maximize step (eliminates flicker)
- Made keyboard/mouse maximization behavior consinstent relative to each other
- Enhanced wmsetbg's man page with description for -b | --back-color
(Marcelo E. Magallon <marcelo.magallon@bigfoot.com>)
- Do not use the disabled clip color for the clip's workspace navigation arrows
when the clip is collapsed (it made them look like disabled)
- Fixed the 'focus flicker' problem, seen with GTK2 applications.
Changes since version 0.80.1:
.............................
- Fixed a buffer overflow when allocating an RImage struct.
Changes since version 0.80.0: Changes since version 0.80.0:
............................. .............................
+20 -7
View File
@@ -1074,16 +1074,29 @@ to force the modification time into the future.
4.16 How can I set dock/clip to use single click to launch 4.16 How can I set dock/clip to use single click to launch
applications, instead of double click? applications, instead of double click?
---------------------------------- ----------------------------------
You cannot do this. This is because single click is used to select app-icons, This question was officially answered as follows:
or to raise/lower the app-icon or the dock/clip.
If this is impelmented then you will be unable to select or raise/lower
dock/clip or app-icons, without also launching the application it represents.
So don't ask for this to be implemented, because it will not be. Double You cannot do this. This is because single click is used to select
click is used for a reason, is not just some weird idea we got in a morning app-icons, or to raise/lower the app-icon or the dock/clip. If
when we wake up too early. this is impelmented then you will be unable to select or
raise/lower dock/clip or app-icons, without also launching the
application it represents.
So don't ask for this to be implemented, because it will not
be. Double click is used for a reason, is not just some weird idea
we got in a morning when we wake up too early.
Regardless of that, there is now an option in WPrefs, under "Expert
User Preferences," which allows you to set "Launch applications and
restore windows with a single click." (See the files contrib/README
and contrib/single_click.diff in the source package for details.)
If you set that option, a left button single click will launch or
restore, rather than select, the app-icon. You can use other methods
(or temporarily turn the option off again) to select app-icons or
raise/lower the dock/clip. You can toggle the selected state of any
app-icon via its right button menu, and there are auto-raise and
keep-on-top options for the dock and clip.
4.18 How do I restore the configuration app to the dock? 4.18 How do I restore the configuration app to the dock?
+1 -6
View File
@@ -74,7 +74,7 @@ The following is required to build Window Maker:
These tools are NOT needed, but IF you have one or These tools are NOT needed, but IF you have one or
more of them installed, make sure you have ALL of the following more of them installed, make sure you have ALL of the following
with exactly these versions: with exactly these versions:
autoconf 2.52 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.4.2 libtool 1.4.2
If you have a different version, disable them by temporarily If you have a different version, disable them by temporarily
@@ -115,11 +115,6 @@ might work too.
For GIF image support For GIF image support
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 or newer
For faster pixel conversion in the wraster library
(its used only in some conversions - for TrueColor visuals)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
If you want to use translated messages, you will need GNU gettext. If you want to use translated messages, you will need GNU gettext.
Other versions of gettext are not compatible and will not work. Other versions of gettext are not compatible and will not work.
+2 -7
View File
@@ -64,9 +64,9 @@ N
Tyto nástroje NEJSOU POTŘEBA, ale když máte jeden nebo dva nebo Tyto nástroje NEJSOU POTŘEBA, ale když máte jeden nebo dva nebo
všechny tři nainstalované, tak se UJISTĚTE, že máte přesně všechny tři nainstalované, tak se UJISTĚTE, že máte přesně
následující VERZE: následující VERZE:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Máte-li odlišnou verzi, tak ji dočasně přejmenujte, nebo ji rovnou Máte-li odlišnou verzi, tak ji dočasně přejmenujte, nebo ji rovnou
odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji odinstalujte z vašeho systému. Pokud nebudete programovat, tak ji
stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat. stejně nebudete potřebovat, takže ji můžete bezpečně odinstalovat.
@@ -106,11 +106,6 @@ garantuje,
Pro podporu GIF obrázků Pro podporu GIF obrázků
Dostupné na ftp://prtr-13.ucsc.edu/pub/libungif/ Dostupné na ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 nebo novější
Pro rychlejší konverzi obrázků (používá knihovna wraster)
Používá se pouze v některých konverzích - pro TrueColor zobrazení
http://www.clanlib.org/hermes/
-GNU xgettxt -GNU xgettxt
Když chcete používat češtinu nebo jiné jazyky kromě angličtiny, Když chcete používat češtinu nebo jiné jazyky kromě angličtiny,
tak potřebujete GNU xgettext. tak potřebujete GNU xgettext.
+2 -7
View File
@@ -78,9 +78,9 @@ Lo siguiente se necesita para compilar Window Maker:
instaladas, asegúrese de tener TODO lo siguiente con estas versiones instaladas, asegúrese de tener TODO lo siguiente con estas versiones
exactas: exactas:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Si tiene una versión distinta, desactívelas temporalemte renombrándolas Si tiene una versión distinta, desactívelas temporalemte renombrándolas
a otras cosa o desinstalándolas desde su sistema. Si no desarrolla a otras cosa o desinstalándolas desde su sistema. Si no desarrolla
@@ -122,11 +122,6 @@ Estas bibliotecas no son necesarias para hacer que Window Maker funcione,
Para soporte de imagen GIF. Para soporte de imagen GIF.
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 o más actual
Para conversión a pixel más rápida en la biblioteca wraster.
(se usa solo en algunas conversiones - para visuales Color Verdadero)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
Si quiere usar mensajes traducidos, necesitará GNU gettext. Si quiere usar mensajes traducidos, necesitará GNU gettext.
Otras versiones de gettext no son compatibles y no funcionarán. Otras versiones de gettext no son compatibles y no funcionarán.
+2 -8
View File
@@ -77,9 +77,9 @@ Les
Ces outils ne sont pas indispensables, mais si au moins l'un d'eux Ces outils ne sont pas indispensables, mais si au moins l'un d'eux
est installé sur votre système, assurez-vous que TOUS le sont, et est installé sur votre système, assurez-vous que TOUS le sont, et
que les versions de ces outils sont exactement : que les versions de ces outils sont exactement :
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Si les versions installées sur votre système différent, désactivez-les Si les versions installées sur votre système différent, désactivez-les
provisoirement, par exemple en les renommant, ou en les désinstallant provisoirement, par exemple en les renommant, ou en les désinstallant
de votre système. Si vous ne développez ni de compilez de logiciels, de votre système. Si vous ne développez ni de compilez de logiciels,
@@ -120,12 +120,6 @@ fonctionner aussi bien.
Pour pouvoir utiliser les images au format GIF. Pour pouvoir utiliser les images au format GIF.
ftp://prtr-13.ucsc.edu/pub/libungif/ ftp://prtr-13.ucsc.edu/pub/libungif/
- libHermes 1.3.2 ou plus récent
Pour une conversion de pixels plus rapide dans la librairie wraster.
(utilisé uniquement pour des conversions spécifiques dont les modes
vidéo TrueColor)
http://www.clanlib.org/hermes/
- GNU xgettext - GNU xgettext
Si vous voulez disposer des traductions en d'autres langues, GNU gettext Si vous voulez disposer des traductions en d'autres langues, GNU gettext
est nécessaire. Les autres versions de gettext sont incompatibles et ne est nécessaire. Les autres versions de gettext sont incompatibles et ne
+2 -2
View File
@@ -68,9 +68,9 @@ Para compilar o Window Maker voc
- autoconf, automake and libtool - autoconf, automake and libtool
Estes pacotes não são necessários, mas se você tiver um ou mais deles instalados, Estes pacotes não são necessários, mas se você tiver um ou mais deles instalados,
verifique se todos eles são das seguintes versões: verifique se todos eles são das seguintes versões:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Se você possui uma versão diferente, desative-os mudando os nomes dos arquivos Se você possui uma versão diferente, desative-os mudando os nomes dos arquivos
para outra coisa ou removendo-os do seu sistema. Se você não desenvolve para outra coisa ou removendo-os do seu sistema. Se você não desenvolve
software você não precisa deles, logo, você pode desinstalá-los com segurança. software você não precisa deles, logo, você pode desinstalá-los com segurança.
+2 -2
View File
@@ -71,9 +71,9 @@ Nasledovn
- autoconf, automake a libtool - autoconf, automake a libtool
Tieto nástroje NIE sú potrebné, ale ak máte niektoré z nich nain¹talo- Tieto nástroje NIE sú potrebné, ale ak máte niektoré z nich nain¹talo-
vané, uistite sa, ¾e V©ETKY sú presne nasledovné verzie: vané, uistite sa, ¾e V©ETKY sú presne nasledovné verzie:
autoconf 2.13 autoconf 2.54
automake 1.4 automake 1.4
libtool 1.3 libtool 1.4.2
Ak máte odli¹né verzie, odin¹talujte ich alebo ich doèasne premenujte. Ak máte odli¹né verzie, odin¹talujte ich alebo ich doèasne premenujte.
Ak neprogramujete, nebudete ich potrebova» a teda ich mô¾ete Ak neprogramujete, nebudete ich potrebova» a teda ich mô¾ete
odin¹talova». odin¹talova».
-4
View File
@@ -67,10 +67,6 @@ echo "questions. We will IGNORE any questions that are already"
echo "answered in the documentation." echo "answered in the documentation."
echo echo
perai perai
echo
echo "Did you install libPropList? If not, please install it now."
echo
perai
echo "Did you read the INSTALL file?" echo "Did you read the INSTALL file?"
echo -n "<y/n> " echo -n "<y/n> "
read rtfm read rtfm
+5 -6
View File
@@ -3,12 +3,11 @@
SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\ SUBDIRS = wrlib WINGs src util po WindowMaker wmlib test WPrefs.app doc\
contrib contrib
EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N MIRRORS COPYING.WTFPL \ EXTRA_DIST = TODO BUGS BUGFORM FAQ FAQ.I18N FAQ.I18N.cs FAQ.I18N.sk \
Install acconfig.h INSTALL.pt README.pt\ Install INSTALL.cs INSTALL.fr INSTALL.es INSTALL.pt INSTALL.sk \
FAQ.I18N.cs INSTALL.cs\ README.antialiasing README.definable-cursor README.pt \
mkpatch README.KDE README.GNOME WindowMaker.lsm.in\ README.KDE README.GNOME Sample.XftConfig \
README.definable-cursor \ MIRRORS COPYING.WTFPL mkpatch WindowMaker.lsm.in
FAQ.I18N.sk INSTALL.sk INSTALL.es INSTALL.fr
# libwmfun-0.0.3.tar.gz # libwmfun-0.0.3.tar.gz
WindowMaker.lsm: WindowMaker.lsm.in WindowMaker.lsm: WindowMaker.lsm.in
+52
View File
@@ -2,6 +2,58 @@
NEWS for veteran Window Maker users NEWS for veteran Window Maker users
----------------------------------- -----------------------------------
--- 0.81.0
Antialiased font support
------------------------
With the addition of support for antialiased fonts in the WINGs library, now
Window Maker can also support antialiased fonts. However enabling them may
prove not to be a trivial task to do. This is because enabling antialiased
fonts doesn't depend solely on Window Maker and its configuration files. It
also depends on the X server, the X server extension modules and their
specific configuration files.
For a description of all the steps required to get antialiased fonts on
screen please check the README.antialiasing file which describes all the
things you need to do on a step by step basis. In addition it has extra
useful hints and idea to make your antialiased fonts look nice in different
contexts.
After you have done all the steps described there, you can enable antialiased
fonts either by adding AntialiasedText = Yes; in ~/GNUstep/Defaults/WindowMaker
or by launching WPrefs and checking the "Smooth font edges" in the Expert User
Preferences panel.
As a general note you should always use a True Type font for your fonts if
antialiasing is enabled, or alias a normal font to a True Type in the Xft
configuration (read the details in README.antialiasing). Else you may get
unepleasant results in the look of your screen :P
Global Submenus
---------------
Global menus allow for system wide menus that are added to every users
application menus. They are located in /usr/etc/WindowMaker/,
/usr/local/etc/WindowMaker or whatever is your sysconf directory
for WindowMaker. There are 2 files:
GlobalMenu.pre, which is added to the beginning of the menu and
GlobalMenu.post, which is added to the end of the menu.
These are to be proplist format menus, for example:
(("Foobar", EXEC, foobar),
("Blabla", EXEC, blabla))
or, in case you want a submenu:
(("Submenu",
("Foobar", EXEC, foobar),
("Blabla", EXEC, blabla)))
--- 0.80.0 --- 0.80.0
Shading/Unshading windows using mouse wheel on their titlebar Shading/Unshading windows using mouse wheel on their titlebar
+1 -1
View File
@@ -270,7 +270,7 @@ bellow:
- to reduce memory usage, disable the icon cache, by setting the RIMAGE_CACHE - 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 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 of memory usage, set it's value to a value like the number of different
icons you use. icons you use. Also, disable anti-aliased text support in ~/GNUstep/Defaults/WMGLOBAL.
Keyboard Mouse Control Keyboard Mouse Control
+154
View File
@@ -0,0 +1,154 @@
Here is a step by step mini-HOWTO of the things needed to be done to get
antialiased fonts in Window Maker quickly:
1. Make sure you have a recent XFree server (4.x or newer, but 4.2.x or newer
is preferable). Also make sure it supports the RENDER extension (you can
see this in the output of xdpyinfo) and it has the freetype extension
module (you should have a /usr/X11R6/lib/modules/fonts/libfreetype.a file).
2. Make sure you have the following lines in your XF86Config file in the
"Module" section:
Load "type1"
Load "freetype"
Load "extmod"
(Not sure if extmod is really required for antialiased fonts, but it won't
hurt).
3. Install some True Type fonts say in /usr/X11R6/lib/X11/fonts/TrueType
4. To generate the fonts.scale and fonts.dir files in the directory where the
True Type fonts were installed you need an utility named ttmkfdir. There is
also an utility named mkttfdir but that only supports ISO8859-1 and JIS
encodings. From my experience ttmkfdir will recognize more fonts and works
better so I recommend using this one. You should issue these commands to
generate the fonts.scale and fonts.dir files:
cd /usr/X11R6/lib/X11/fonts/TrueType
ttmkfdir -o fonts.scale
mkfontdir
5. Now add /usr/X11R6/lib/X11/fonts/TrueType to your font path in the
XF86Config file. It goes in the "Files" section as:
FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
I recommend to put this at the top of your font path list.
6. You can restart the X server at this point, to make all these changes take
effect.
7. Edit your /etc/X11/XftConfig file (or ~/.xftconfig if you don't have
access to edit the global file). Make sure that the True Type font path is
_before_ the Type1 font path. You should have something like this:
dir "/usr/X11R6/lib/X11/fonts/TrueType"
dir "/usr/X11R6/lib/X11/fonts/Type1"
If you add extra True type paths, add them before the Type1 path
If the Type1 path is first, and the Xft library fails to find/load the font
you asked for, it will load some very ugly defaults.
A sample XftConfig file is included with the Window Maker source at
toplevel as Sample.XftConfig. You can use that as reference and for ideas.
8. Compile and install Window Maker. No special switches are needed. However
watch the ./configure output and check if it says that Antialiased text
support is enabled in WINGs. If not, probably it failed to find libXft.
Check that you have the development files for your X server installed.
9. Edit ~/GNUstep/Defaults/WMGLOBAL and add entries for the following:
AntialiasedSystemFont = "-*-trebuchet ms-medium-r-normal-*-%d-*-*-*-*-*-*-*";
AntialiasedBoldSystemFont = "-*-trebuchet ms-bold-r-normal-*-%d-*-*-*-*-*-*-*";
AntialiasedText = Yes;
Use a font that you have installed on your system (arial and "trebuchet ms"
are good choices).
If AntialiasedText is enabled in WMGLOBAL, all WINGs based application will
use antialiased fonts by default (this includes Window Maker).
You can then disable the antialiased fonts on the per application basis by
adding an AntialiasedText = No; entry in their specific configuration files
The entry in the application's configuration file will always overwrite the
global setting from WMGLOBAL.
However if you want most of your WINGs applications to use normal fonts,
but just a few to use antialiased fonts, then put AntialiasedText = No; in
WMGLOBAL, and enable antialiased fonts only in the applications you want,
by adding the AntialiasedText = Yes; in their own configuration files
At this point all WINGs based application should be able to use antialiased
fonts. You can check this by enabling antialiasing and starting WPrefs. It
should show nice antialiased text everywhere.
Now to enable antialiased fonts in Window Maker, there are 2 possibilities:
10a. Add entries for all font options in ~/GNUstep/Defaults/WindowMaker
containing True Type fonts ("trebuchet ms", arial or verdana should work
fine). Don't use non True Type fonts like Helvetica, because Xft won't
load them, instead will load some defaults. Depending on the TrueTupe vs
Type1 path order in your XftConfig file and the options declared there,
it can range from "Extremely ugly" (if path to Type1 is before the path
to True Type fonts), to "Acceptable" (if the True Type path comes first).
Also modify all your themes to hold True Type fonts for all the font
options
10b. Leave the fonts as they are (for example leave the default Helvetica) in
~/GNUstep/Defaults/WindowMaker, and add an alias (or more) in the
XftConfig file. This alias should look something like:
match any family == "Helvetica" edit family += "Trebuchet MS";
match any family == "Courier" edit family += "Courier New";
...
Which means that every time the Xft library (which is used the WINGs) gets
a request to load a Helvetica font, it will load the "trebuchet ms" font
instead, keeping all the other font parameters unchanged.
Each of these 2 methods have advantages and disadvantages.
Case 10a:
---------
With the first method, you do more work and you will not be able to use
existing themes by just enabling antialiasing, because it will load default
fonts which may not look as you want. You will need to change the fonts in
every theme you want to use by replacing them with True Type fonts.
If you plan to switch antialiasing on/off, this method has a big disadvantage:
you need to edit your configuration/themes with every switch (at least if you
want Helvetica or other Type1 font for the non-antialiased case). This is
because if you have a font set to (say) Arial and want to switch antialiasing
off, you will get the normal version of Arial and you need to edit your font
options again to see Helvetica.
If you are happy with how the non-antialiased version of your True Type fonts
looks this disadvantage goes away. In this case you will use the same font
(say arial) with both antialiased/normal fonts.
OTOH this method gives you fine tune over the fonts used in Window Maker and
you will be able to set each individual font as you like.
Case 10b:
---------
With the second method, you have almost nothing to do. Just define the proper
aliases in the XftConfig file, and whenever some of the fonts you aliased is
requested it's True Type alias will be loaded.
This way you can use all your old themes and all you have to do except adding
the aliases to the XftConfig file, is to enable or disable antialiasing the
the configuration file.
For example if Helvetica is aliased to Arial, if you have antialiasing
disabled, Helvetica will be used, but if you enable antialiasing Arial will
be used instead. This method is very handy if you want to use existing themes
you don't want to modify, or if you want to switch antialiasing on/off and
don't want to edit your font options with every such switch.
The downside of this method is that if you don't have some font aliased in
the XftConfig file, it will load some default instead.
Also another downside is that you cannot fine tune your fonts. They will be
translated by the alias rules in XftConfig from whatever they are defined in
the theme. Sometimes this is not optimal.
For example if you aliased Helvetica to "Trebuchet MS" and all your screen
fonts are Helvetica (at different sizes). With antialiasing disabled the
Helvetica fonts everywhere looks good. However with antialiasing enabled the
10pt font used by the miniwindow titles looks better if Arial is used. Also
the 10pt font used by the clip looks better with Verdana. Same for the 12pt
font used by balloons which is also better if Arial is used. But with this
method you cannot do such fine tuning, unless you edit your font options in
the Window Maker configuration file, in which case there will be a mix of the
2 methods.
11. At this point if all was properly done, all you have to do is either add
an AntialiasedText = Yes; entry to ~/GNUstep/Defaults/WindowMaker, or
start WPrefs, goto the Expert Settings panel, and check the
"Smooth font edges" option. Currently you need to restart if you switch
antialiasing on/off (this may change in the future)
Final note: antialiased text only looks good if a True Type font is
used for it. Either by directly specifying it, or providing an alias in
the XftConfig file. The idea is that the font Xft loads (after all the
aliases have beed resolved) should point to a True Type font. Else
unpleasant results may show on your screen :P
+15 -15
View File
@@ -22,21 +22,21 @@
Felicitaciones! A adquirido un dispositivo excelentísimo ¡Felicitaciones! Ha adquirido un dispositivo
que le proporcionará miles de años de uso sin problemas excelentísimo que le proporcionará miles de años de uso sin
,si no fuera porque indudablemente lo destruirá a través de alguna problemas, si no fuera porque indudablemente lo destruirá a
maniobra estúpida típica de consumidor. Por eso le pedimos través de alguna maniobra estúpida típica de consumidor. Por
por EL AMOR DE DIOS LEA ESTE MANUAL DEL PROPIETARIO CUIDADOSAMENTE eso le pedimos por EL AMOR DE DIOS LEA ESTE MANUAL DEL
ANTES DE DESEMPAQUETAR EL DISPOSITIVO. ¿YA LO DESEMPAQUETÓ, NO? PROPIETARIO CUIDADOSAMENTE ANTES DE DESEMPAQUETAR EL
DESEMPAQUETELO Y ENCHÚFELO Y ENCIÉNDALO Y DEJE DE TOQUETEAR LAS PERILLAS, DISPOSITIVO. ¿YA LO DESEMPAQUETÓ, NO? LO DESEMPAQUETÓ Y LO
Y AHORA SUS CHICOS, EL MISMO CHICO QUE UNA VEZ METIÓ UNA SALCHICHA EN SU ENCHUFÓ Y LO ENCENDIÓ Y TOQUETEÓ LAS PERILLAS, Y AHORA SU
VIDEOCASETERA Y DEFINIÓ UN "AVANCE RÁPIDO", ¿ESTE CHICO TAMBIÉN ESTÁ CHICO, EL MISMO CHICO QUE UNA VEZ METIÓ UNA SALCHICHA EN SU
TOQUETEANDO LAS PERILLAS, CIERTO? ¿Y RECIEN AHORA ESTÁ COMENZANDO A LEER VIDEOCASETERA Y ACCIONÓ "AVANCE RÁPIDO", ESTE CHICO
LAS INSTRUCCIONES, CIERTO? PODEMOS TAMBIÉN ROMPER ESTOS DISPOSITIVOS TAMBIÉN ESTÁ TUOQUETEANDO LAS PERILLAS, ¿CIERTO? Y RECIÉN
EN LA FÁBRICA ANTES DE DESPACHÁRLOS, SABIA ESO? AHORA ESTÁ COMENZANDO A LEER LAS INSTRUCCIONES, ¿¿¿CIERTO???
NOSOTROS PODRÍAMOS SIMPLEMENTE ROMPER ESTOS DISPOSITIVOS EN LA
FÁBRICA ANTES DE DESPACHARLOS, ¿SABE?
-- Dave Barry, "Lea Esto Primero!" -- Dave Barry, "¡Lea Esto Primero!"
Descripción Descripción
+79
View File
@@ -0,0 +1,79 @@
# $XFree86: xc/lib/Xft/XftConfig.cpp,v 1.8 2001/11/21 23:41:12 keithp Exp $
dir "/usr/share/fonts/truetype"
dir "/usr/X11R6/lib/X11/fonts/TrueType"
dir "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
dir "/usr/X11R6/lib/X11/fonts/Type1"
#
# alias 'fixed' for 'mono'
#
match any family == "fixed" edit family =+ "mono";
#
# Check users config file
#
includeif "~/.xftconfig"
#
# Substitute TrueType fonts for Type1 versions
#
match any family == "Times" edit family += "Times New Roman";
#match any family == "Helvetica" edit family += "Verdana";
#match any family == "Helvetica" edit family += "Arial";
match any family == "Helvetica" edit family += "Trebuchet MS";
match any family == "Courier" edit family += "Courier New";
#
# Use TrueType fonts for defaults
#
match any family == "serif" edit family += "Times New Roman";
match any family == "sans" edit family += "Verdana";
#
# Use monotype.com (andale) face where possible
#
match
any family == "mono"
all slant == roman
all weight < bold
edit
family += "monotype.com";
#
# otherwise, use courier
#
match any family == "mono" edit family += "Courier New";
#
# Alias between XLFD families and font file family name, prefer local fonts
#
match any family == "charter" edit family += "bitstream charter";
match any family == "bitstream charter" edit family =+ "charter";
match any family == "Charter" edit family += "Bitstream Charter";
match any family == "Bitstream Charter" edit family =+ "Charter";
match any family == "Lucidux Serif" edit family += "LuciduxSerif";
match any family == "LuciduxSerif" edit family =+ "Lucidux Serif";
match any family == "Lucidux Sans" edit family += "LuciduxSans";
match any family == "LuciduxSans" edit family =+ "Lucidux Sans";
match any family == "Lucidux Mono" edit family += "LuciduxMono";
match any family == "LuciduxMono" edit family =+ "Lucidux Mono";
#
# TrueType font aliases
#
match any family == "Comic Sans" edit family += "Comic Sans MS";
match any family == "Comic Sans MS" edit family =+ "Comic Sans";
match any family == "Trebuchet" edit family += "Trebuchet MS";
match any family == "Trebuchet MS" edit family =+ "Trebuchet";
match any family == "Monotype" edit family =+ "Monotype.com";
match any family == "Andale Mono" edit family += "Monotype.com";
match any family == "Monotype.com" edit family =+ "Andale Mono";
#
#
match any family == "webdings" edit encoding += "glyphs-fontspecific";
match any family == "symbol" edit encoding += "glyphs-fontspecific";
+2
View File
@@ -14,6 +14,8 @@ Do ASAP:
Need to do: Need to do:
=========== ===========
- 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 - allow user to select/restore default root menu from wprefs
- support for X11R6.4 extension for getting extra visual info in wrlib's - support for X11R6.4 extension for getting extra visual info in wrlib's
automatic best context guessing automatic best context guessing
+2 -3
View File
@@ -1,5 +1,4 @@
Makefile Makefile.in Makefile Makefile.in
get-wings-flags get-wutil-flags get-wings-flags get-wutil-flags
.libs .libs *.pc
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+71 -1
View File
@@ -1,3 +1,72 @@
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 Xft support in WINGs (for drawing antialiased fonts with transparency).
- Added a new function: WMCreateAntialiasedFont() to create a font which will
be drawn antialiased using Xft (if available, else function returns NULL)
- New options in WMGLOBAL: AntialiasedText, AntialiasedSystemFont and
AntialiasedBoldSystemFont. 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 WMIsAntialiasedFont(WMFont *font) to check if a font is antialiased.
- Added WMGetColorAlpha(WMColor *color)
- Better outline when drawing balloons.
- Added WMCreateFontWithFlags()
- 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 WMCreateAntialiasedFontSet() (like WMCreateAntialiasedFont() but for
languages with multibyte text). Note however that these specific font
creating functions (as well as WMCreateNormalFont() and WMCreateFontSet())
are not meant to be called directly except in very special cases.
The more generic WMCreateFont() or WMCreateFontWithFlags() should be used.
- Multibyte languages can now render antialiased text too (only tested on
russian since this is the only multibyte language I can test).
- 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
- Added a check that only %d is used in a font specification in WMGLOBAL and at
most once for each font in a fontset (eliminates a possible security exploit)
- 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()
Changes since wmaker 0.80.0: Changes since wmaker 0.80.0:
............................ ............................
@@ -204,7 +273,8 @@ changes since wmaker 0.62.1:
as a result the shaded windows didn't go away when closed. The non-shaded 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 windows were unmapped on close but not destroyed either so they only
apparently went away, but continued to use memory). 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: changes since wmaker 0.62.0:
+1 -2
View File
@@ -1,3 +1,2 @@
Makefile Makefile.in Makefile Makefile.in
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+1 -2
View File
@@ -1,5 +1,4 @@
Makefile Makefile.in Makefile Makefile.in
connect server fontl puzzle UserTime.plist connect server fontl puzzle UserTime.plist
.libs .libs
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+1 -1
View File
@@ -7,7 +7,7 @@ noinst_PROGRAMS = connect server fontl puzzle
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \ LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
@INTLIBS@ @XFTLIBS@ @INTLIBS@
fontl_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a fontl_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a
+3 -1
View File
@@ -1,12 +1,13 @@
/* /*
* WINGs connect.c: example how to create a network client using WMConnection * WINGs connect.c: example how to create a network client using WMConnection
* *
* Copyright (c) 1999-2002 Dan Pascu * Copyright (c) 1999-2003 Dan Pascu
* *
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
@@ -28,6 +29,7 @@ static void didInitialize(ConnectionDelegate *self, WMConnection *cPtr);
static ConnectionDelegate socketDelegate = { static ConnectionDelegate socketDelegate = {
NULL, /* data */ NULL, /* data */
NULL, /* canResumeSending */
NULL, /* didCatchException */ NULL, /* didCatchException */
connectionDidDie, /* didDie */ connectionDidDie, /* didDie */
didInitialize, /* didInitialize */ didInitialize, /* didInitialize */
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* WINGs demo: font lister * WINGs demo: font lister
* *
* Copyright (c) 1998-2002 Alfredo K. Kojima * Copyright (c) 1998-2003 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
+3 -1
View File
@@ -1,12 +1,13 @@
/* /*
* WINGs server.c: example how to create a network server using WMConnection * WINGs server.c: example how to create a network server using WMConnection
* *
* Copyright (c) 2001-2002 Dan Pascu * Copyright (c) 2001-2003 Dan Pascu
* *
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
@@ -42,6 +43,7 @@ static WMConnection *serverPtr = NULL;
static ConnectionDelegate socketDelegate = { static ConnectionDelegate socketDelegate = {
NULL, /* client data */ NULL, /* client data */
NULL, /* canResumeSending */
NULL, /* didCatchException */ NULL, /* didCatchException */
connectionDidDie, /* didDie */ connectionDidDie, /* didDie */
NULL, /* didInitialize */ NULL, /* didInitialize */
+1 -2
View File
@@ -1,5 +1,4 @@
Makefile Makefile.in Makefile Makefile.in
.libs .libs
test test
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+1 -1
View File
@@ -27,7 +27,7 @@ INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG -DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \ LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
@INTLIBS@ @XFTLIBS@ @INTLIBS@
test_LDADD = wtableview.o wtabledelegates.o $(LDADD) test_LDADD = wtableview.o wtabledelegates.o $(LDADD)
+1
View File
@@ -94,6 +94,7 @@ main(int argc, char **argv)
WMMapWidget(win); WMMapWidget(win);
table = WMCreateTableView(win); table = WMCreateTableView(win);
WMSetTableViewHasHorizontalScroller(table, 0);
WMSetViewExpandsToParent(WMWidgetView(table), 10, 10, 10, 10); WMSetViewExpandsToParent(WMWidgetView(table), 10, 10, 10, 10);
WMSetTableViewBackgroundColor(table, WMWhiteColor(scr)); WMSetTableViewBackgroundColor(table, WMWhiteColor(scr));
/*WMSetTableViewGridColor(table, WMGrayColor(scr));*/ /*WMSetTableViewGridColor(table, WMGrayColor(scr));*/
+26 -25
View File
@@ -11,7 +11,7 @@ typedef struct {
WMFont *font; WMFont *font;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} StringData; } StringData;
@@ -28,7 +28,7 @@ typedef struct {
WMFont *font; WMFont *font;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} StringEditorData; } StringEditorData;
@@ -40,7 +40,7 @@ typedef struct {
int count; int count;
GC gc; GC gc;
GC selGC; GC selGC;
GC textGC; WMColor *textColor;
} EnumSelectorData; } EnumSelectorData;
@@ -57,8 +57,8 @@ static char *SelectionColor = "#bbbbcc";
static void stringDraw(WMScreen *scr, Drawable d, GC gc, static void stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc,
GC sgc, GC stgc, WMFont *font, void *data, WMColor *textColor, WMFont *font, void *data,
WMRect rect, Bool selected) WMRect rect, Bool selected)
{ {
int x, y; int x, y;
@@ -77,12 +77,12 @@ static void stringDraw(WMScreen *scr, Drawable d, GC gc,
if (!selected) { if (!selected) {
XFillRectangles(dpy, d, gc, rects, 1); XFillRectangles(dpy, d, gc, rects, 1);
WMDrawString(scr, d, stgc, font, x, y, WMDrawString(scr, d, textColor, font, x, y,
data, strlen(data)); data, strlen(data));
} else { } else {
XFillRectangles(dpy, d, sgc, rects, 1); XFillRectangles(dpy, d, sgc, rects, 1);
WMDrawString(scr, d, stgc, font, x, y, WMDrawString(scr, d, textColor, font, x, y,
data, strlen(data)); data, strlen(data));
} }
@@ -142,7 +142,7 @@ static void SECellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -156,7 +156,7 @@ static void selectedSECellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -203,9 +203,9 @@ WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *parent)
0, 0); 0, 0);
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = SECellPainter; delegate->drawCell = SECellPainter;
@@ -229,7 +229,7 @@ static void ESCellPainter(WMTableColumnDelegate *self,
int i = (int)WMTableViewDataForCell(table, column, row); int i = (int)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], strdata->options[i],
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -244,7 +244,7 @@ static void selectedESCellPainter(WMTableColumnDelegate *self,
int i = (int)WMTableViewDataForCell(table, column, row); int i = (int)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
strdata->options[i], strdata->options[i],
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -294,9 +294,9 @@ WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *parent)
0, 0); 0, 0);
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
data->count = 0; data->count = 0;
data->options = NULL; data->options = NULL;
@@ -444,7 +444,7 @@ static void SCellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
False); False);
@@ -458,7 +458,7 @@ static void selectedSCellPainter(WMTableColumnDelegate *self,
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
WMTableViewDataForCell(table, column, row), WMTableViewDataForCell(table, column, row),
WMTableViewRectForCell(table, column, row), WMTableViewRectForCell(table, column, row),
True); True);
@@ -473,9 +473,9 @@ WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *parent)
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = SCellPainter; delegate->drawCell = SCellPainter;
@@ -525,8 +525,8 @@ WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table)
StringData *data = wmalloc(sizeof(StringData)); StringData *data = wmalloc(sizeof(StringData));
data->table = table; data->table = table;
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
delegate->data = data; delegate->data = data;
delegate->drawCell = PCellPainter; delegate->drawCell = PCellPainter;
@@ -574,9 +574,8 @@ static void drawPSCell(WMTableColumnDelegate *self, Drawable d,
rect.size.width = owidth-size.width+1; rect.size.width = owidth-size.width+1;
} }
stringDraw(WMWidgetScreen(table), d, stringDraw(WMWidgetScreen(table), d, strdata->gc, strdata->selGC,
strdata->gc, strdata->selGC, strdata->textGC, strdata->font, strdata->textColor, strdata->font, str, rect, selected);
str, rect, selected);
} }
@@ -602,9 +601,9 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
data->table = parent; data->table = parent;
data->font = WMSystemFontOfSize(scr, 12); data->font = WMSystemFontOfSize(scr, 12);
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textGC = WMColorGC(WMBlackColor(scr));
data->gc = WMColorGC(WMWhiteColor(scr)); data->gc = WMColorGC(WMWhiteColor(scr));
data->selGC = WMColorGC(WMCreateNamedColor(scr, SelectionColor, False));
data->textColor = WMBlackColor(scr);
delegate->data = data; delegate->data = data;
delegate->drawCell = PSCellPainter; delegate->drawCell = PSCellPainter;
@@ -614,3 +613,5 @@ WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent)
return delegate; return delegate;
} }
+172 -66
View File
@@ -26,7 +26,6 @@ struct W_TableColumn {
}; };
static void handleResize(W_ViewDelegate *self, WMView *view); static void handleResize(W_ViewDelegate *self, WMView *view);
static void rearrangeHeader(WMTableView *table); static void rearrangeHeader(WMTableView *table);
@@ -168,6 +167,9 @@ struct W_TableView {
unsigned canSelectRow:1; unsigned canSelectRow:1;
unsigned canSelectMultiRows:1; unsigned canSelectMultiRows:1;
unsigned canDeselectRow:1; unsigned canDeselectRow:1;
unsigned int hasVScroller:1;
unsigned int hasHScroller:1;
}; };
static W_Class tableClass = 0; static W_Class tableClass = 0;
@@ -183,6 +185,7 @@ static W_ViewDelegate viewDelegate = {
static void reorganizeInterior(WMTableView *table);
static void handleEvents(XEvent *event, void *data); static void handleEvents(XEvent *event, void *data);
@@ -216,11 +219,21 @@ static WMRect getVisibleRect(WMTableView *table)
WMSize size = getTotalSize(table); WMSize size = getTotalSize(table);
WMRect rect; WMRect rect;
rect.size.height = size.height * WMGetScrollerKnobProportion(table->vscroll); if (table->vscroll) {
rect.size.width = size.width * WMGetScrollerKnobProportion(table->hscroll); rect.size.height = size.height * WMGetScrollerKnobProportion(table->vscroll);
rect.pos.y = (size.height - rect.size.height) * WMGetScrollerValue(table->vscroll);
} else {
rect.size.height = size.height;
rect.pos.y = 0;
}
rect.pos.x = (size.width - rect.size.width) * WMGetScrollerValue(table->hscroll); if (table->hscroll) {
rect.pos.y = (size.height - rect.size.height) * WMGetScrollerValue(table->vscroll); rect.size.width = size.width * WMGetScrollerKnobProportion(table->hscroll);
rect.pos.x = (size.width - rect.size.width) * WMGetScrollerValue(table->hscroll);
} else {
rect.size.width = size.width;
rect.pos.x = 0;
}
return rect; return rect;
} }
@@ -232,26 +245,28 @@ static void scrollToPoint(WMTableView *table, int x, int y)
int i; int i;
float value, prop; float value, prop;
if (size.width > W_VIEW_WIDTH(table->tableView)) { if (table->hscroll) {
prop = (float)W_VIEW_WIDTH(table->tableView) / (float)size.width; if (size.width > W_VIEW_WIDTH(table->tableView)) {
value = (float)x / (float)(size.width - W_VIEW_WIDTH(table->tableView)); prop = (float)W_VIEW_WIDTH(table->tableView) / (float)size.width;
} else { value = (float)x / (float)(size.width - W_VIEW_WIDTH(table->tableView));
prop = 1.0; } else {
value = 0.0; prop = 1.0;
} value = 0.0;
WMSetScrollerParameters(table->hscroll, value, prop); }
WMSetScrollerParameters(table->hscroll, value, prop);
if (size.height > W_VIEW_HEIGHT(table->tableView)) {
prop = (float)W_VIEW_HEIGHT(table->tableView) / (float)size.height;
value = (float)y / (float)(size.height - W_VIEW_HEIGHT(table->tableView));
} else {
prop = 1.0;
value = 0.0;
} }
WMSetScrollerParameters(table->vscroll, value, prop); if (table->vscroll) {
if (size.height > W_VIEW_HEIGHT(table->tableView)) {
prop = (float)W_VIEW_HEIGHT(table->tableView) / (float)size.height;
value = (float)y / (float)(size.height - W_VIEW_HEIGHT(table->tableView));
} else {
prop = 1.0;
value = 0.0;
}
WMSetScrollerParameters(table->vscroll, value, prop);
}
if (table->editingRow >= 0) { if (table->editingRow >= 0) {
@@ -277,34 +292,37 @@ static void adjustScrollers(WMTableView *table)
float prop, value; float prop, value;
float oprop, ovalue; float oprop, ovalue;
if (size.width <= vsize.width) { if (table->hscroll) {
value = 0.0; if (size.width <= vsize.width) {
prop = 1.0; value = 0.0;
} else { prop = 1.0;
oprop = WMGetScrollerKnobProportion(table->hscroll); } else {
if (oprop == 0.0) oprop = WMGetScrollerKnobProportion(table->hscroll);
oprop = 1.0; if (oprop == 0.0)
ovalue = WMGetScrollerValue(table->hscroll); oprop = 1.0;
ovalue = WMGetScrollerValue(table->hscroll);
prop = (float)vsize.width/(float)size.width; prop = (float)vsize.width/(float)size.width;
value = prop*ovalue / oprop; value = prop*ovalue / oprop;
}
WMSetScrollerParameters(table->hscroll, value, prop);
} }
WMSetScrollerParameters(table->hscroll, value, prop);
if (size.height <= vsize.height) { if (table->vscroll) {
value = 0.0; if (size.height <= vsize.height) {
prop = 1.0; value = 0.0;
} else { prop = 1.0;
oprop = WMGetScrollerKnobProportion(table->vscroll); } else {
oprop = WMGetScrollerKnobProportion(table->hscroll); oprop = WMGetScrollerKnobProportion(table->vscroll);
if (oprop == 0.0) if (oprop == 0.0)
oprop = 1.0; oprop = 1.0;
ovalue = WMGetScrollerValue(table->vscroll); ovalue = WMGetScrollerValue(table->vscroll);
prop = (float)vsize.height/(float)size.height; prop = (float)vsize.height/(float)size.height;
value = prop*ovalue / oprop; value = prop*ovalue / oprop;
}
WMSetScrollerParameters(table->vscroll, value, prop);
} }
WMSetScrollerParameters(table->vscroll, value, prop);
} }
@@ -499,12 +517,15 @@ WMTableView *WMCreateTableView(WMWidget *parent)
WMMoveWidget(table->hscroll, 1, 2+table->headerHeight); WMMoveWidget(table->hscroll, 1, 2+table->headerHeight);
WMMapWidget(table->hscroll); WMMapWidget(table->hscroll);
table->hasHScroller = 1;
table->vscroll = WMCreateScroller(table); table->vscroll = WMCreateScroller(table);
WMSetScrollerArrowsPosition(table->vscroll, WSAMaxEnd); WMSetScrollerArrowsPosition(table->vscroll, WSAMaxEnd);
WMSetScrollerAction(table->vscroll, doScroll, table); WMSetScrollerAction(table->vscroll, doScroll, table);
WMMoveWidget(table->vscroll, 1, 2+table->headerHeight); WMMoveWidget(table->vscroll, 1, 2+table->headerHeight);
WMMapWidget(table->vscroll); WMMapWidget(table->vscroll);
table->hasVScroller = 1;
table->header = WMCreateFrame(table); table->header = WMCreateFrame(table);
WMMoveWidget(table->header, 22, 2); WMMoveWidget(table->header, 22, 2);
@@ -733,6 +754,76 @@ void *WMGetTableViewDataSource(WMTableView *table)
} }
void WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag)
{
if (flag) {
if (tPtr->hasHScroller)
return;
tPtr->hasHScroller = 1;
tPtr->hscroll = WMCreateScroller(tPtr);
WMSetScrollerAction(tPtr->hscroll, doScroll, tPtr);
WMSetScrollerArrowsPosition(tPtr->hscroll, WSAMaxEnd);
/* make it a horiz. scroller */
WMResizeWidget(tPtr->hscroll, 1, 2);
if (W_VIEW_REALIZED(tPtr->view)) {
WMRealizeWidget(tPtr->hscroll);
}
reorganizeInterior(tPtr);
WMMapWidget(tPtr->hscroll);
} else {
if (!tPtr->hasHScroller)
return;
tPtr->hasHScroller = 0;
WMUnmapWidget(tPtr->hscroll);
WMDestroyWidget(tPtr->hscroll);
tPtr->hscroll = NULL;
reorganizeInterior(tPtr);
}
}
#if 0
/* not supported by now */
void WMSetTableViewHasVerticalScroller(WMTableView *tPtr, Bool flag)
{
if (flag) {
if (tPtr->hasVScroller)
return;
tPtr->hasVScroller = 1;
tPtr->vscroll = WMCreateScroller(tPtr);
WMSetScrollerAction(tPtr->vscroll, doScroll, tPtr);
WMSetScrollerArrowsPosition(tPtr->vscroll, WSAMaxEnd);
/* make it a vert. scroller */
WMResizeWidget(tPtr->vscroll, 1, 2);
if (W_VIEW_REALIZED(tPtr->view)) {
WMRealizeWidget(tPtr->vscroll);
}
reorganizeInterior(tPtr);
WMMapWidget(tPtr->vscroll);
} else {
if (!tPtr->hasVScroller)
return;
tPtr->hasVScroller = 0;
WMUnmapWidget(tPtr->vscroll);
WMDestroyWidget(tPtr->vscroll);
tPtr->vscroll = NULL;
reorganizeInterior(tPtr);
}
}
#endif
void WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color) void WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color)
{ {
W_SetViewBackgroundColor(table->tableView, color); W_SetViewBackgroundColor(table->tableView, color);
@@ -846,27 +937,28 @@ static void drawGrid(WMTableView *table, WMRect rect)
static WMRange columnsInRect(WMTableView *table, WMRect rect) static WMRange columnsInRect(WMTableView *table, WMRect rect)
{ {
WMTableColumn *column; WMTableColumn *column;
int width; int pos;
int i , j; int i, found;
int totalColumns = WMGetArrayItemCount(table->columns); int totalColumns = WMGetArrayItemCount(table->columns);
WMRange range; WMRange range;
j = 0; pos = 0;
width = 0; found = 0;
for (i = 0; i < totalColumns; i++) { for (i = 0; i < totalColumns; i++) {
column = WMGetFromArray(table->columns, i); column = WMGetFromArray(table->columns, i);
if (j == 0) { if (!found) {
if (width <= rect.pos.x && width + column->width > rect.pos.x) { if (rect.pos.x >= pos && rect.pos.x < pos + column->width) {
range.position = i; range.position = i;
j = 1; range.count = 1;
found = 1;
} }
} else { } else {
if (pos > rect.pos.x + rect.size.width) {
break;
}
range.count++; range.count++;
if (width > rect.pos.x + rect.size.width) {
break;
}
} }
width += column->width; pos += column->width;
} }
range.count = WMAX(1, WMIN(range.count, totalColumns - range.position)); range.count = WMAX(1, WMIN(range.count, totalColumns - range.position));
return range; return range;
@@ -1066,12 +1158,11 @@ void WMReloadTableView(WMTableView *table)
WMEmptyArray(table->selectedRows); WMEmptyArray(table->selectedRows);
if (table->clickedRow >= 0) { if (table->clickedRow >= 0) {
table->clickedRow = -1;
if (table->action) if (table->action)
(*table->action)(table, table->clientData); (*table->action)(table, table->clientData);
WMPostNotificationName(WMTableViewSelectionDidChangeNotification, WMPostNotificationName(WMTableViewSelectionDidChangeNotification,
table, NULL); table, NULL);
table->clickedRow = -1;
} }
if (table->delegate && table->delegate->numberOfRows) { if (table->delegate && table->delegate->numberOfRows) {
@@ -1159,12 +1250,24 @@ static void handleEvents(XEvent *event, void *data)
static void handleResize(W_ViewDelegate *self, WMView *view) static void handleResize(W_ViewDelegate *self, WMView *view)
{
reorganizeInterior(view->self);
}
static void reorganizeInterior(WMTableView *table)
{ {
int width; int width;
int height; int height;
WMTableView *table = view->self;
WMSize size = getTotalSize(table); WMSize size = getTotalSize(table);
WMView *view = table->view;
int vw, vh; int vw, vh;
int hsThickness, vsThickness;
if (table->vscroll)
vsThickness = WMWidgetWidth(table->vscroll);
if (table->hscroll)
hsThickness = WMWidgetHeight(table->hscroll);
width = W_VIEW_WIDTH(view) - 2; width = W_VIEW_WIDTH(view) - 2;
height = W_VIEW_HEIGHT(view) - 3; height = W_VIEW_HEIGHT(view) - 3;
@@ -1177,24 +1280,27 @@ static void handleResize(W_ViewDelegate *self, WMView *view)
WMMoveWidget(table->vscroll, 1, table->headerHeight + 1); WMMoveWidget(table->vscroll, 1, table->headerHeight + 1);
WMResizeWidget(table->vscroll, 20, height + 1); WMResizeWidget(table->vscroll, 20, height + 1);
WMMoveWidget(table->hscroll, 20, W_VIEW_HEIGHT(view) - 20 - 1); if (table->hscroll) {
WMResizeWidget(table->hscroll, width-20+1, 20); WMMoveWidget(table->hscroll, vsThickness, W_VIEW_HEIGHT(view) - hsThickness - 1);
WMResizeWidget(table->hscroll, width-(vsThickness+1), hsThickness);
}
if (table->header) if (table->header)
WMResizeWidget(table->header, width - 21, table->headerHeight); WMResizeWidget(table->header, width-(vsThickness+1), table->headerHeight);
if (table->viewBuffer) { if (table->viewBuffer) {
WMReleasePixmap(table->viewBuffer); WMReleasePixmap(table->viewBuffer);
table->viewBuffer = NULL; table->viewBuffer = NULL;
} }
width -= 20; width -= vsThickness;
height -= 20; height -= hsThickness;
vw = WMIN(size.width, width); vw = WMIN(size.width, width);
vh = WMIN(size.height, height); vh = WMIN(size.height, height);
W_MoveView(table->tableView, 21, 1+table->headerHeight+1); W_MoveView(table->tableView, vsThickness+1, 1+table->headerHeight+1);
W_ResizeView(table->tableView, WMAX(vw, 1), WMAX(vh, 1)+1); W_ResizeView(table->tableView, WMAX(vw, 1), WMAX(vh, 1)+1);
adjustScrollers(table); adjustScrollers(table);
+4
View File
@@ -109,6 +109,10 @@ void WMReloadTableView(WMTableView *table);
void WMNoteTableViewNumberOfRowsChanged(WMTableView *table); void WMNoteTableViewNumberOfRowsChanged(WMTableView *table);
void WMScrollTableViewRowToVisible(WMTableView *table, int row); void WMScrollTableViewRowToVisible(WMTableView *table, int row);
void WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
+16 -2
View File
@@ -16,7 +16,9 @@ lib_LIBRARIES = libWINGs.a libWUtil.a
LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @INTLIBS@ LDADD= libWINGs.a $(top_builddir)/wrlib/libwraster.la @INTLIBS@
EXTRA_DIST = BUGS EXTRA_DIST = BUGS python/Makefile python/README python/WINGs.i \
python/WINGs.py python/setup.py python/test.py
# wbutton.c # wbutton.c
libWINGs_a_SOURCES = \ libWINGs_a_SOURCES = \
@@ -108,8 +110,20 @@ libWUtil_a_SOURCES = \
CPPFLAGS = @CPPFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\" CPPFLAGS = @CPPFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\"
INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \ INCLUDES = -I$(top_srcdir)/WINGs/WINGs -I$(top_srcdir)/wrlib -I$(top_srcdir)/src \
-DRESOURCE_PATH=\"$(datadir)/WINGs\" @HEADER_SEARCH_PATH@ -DDEBUG -DRESOURCE_PATH=\"$(datadir)/WINGs\" @XFTFLAGS@ @HEADER_SEARCH_PATH@ -DDEBUG
wcolorpanel.o: wcolorpanel.c wcolorpanel.o: wcolorpanel.c
$(COMPILE) -c -DRGBTXT="\"@X_LIBRARY_PATH@/X11/rgb.txt\"" $< $(COMPILE) -c -DRGBTXT="\"@X_LIBRARY_PATH@/X11/rgb.txt\"" $<
DISTCLEANFILES = WINGs.pc
install-exec-local:
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)/pkgconfig
@list='WINGs.pc'; for p in $$list; do \
if test -f $$p; then \
echo "$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/pkgconfig/"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/pkgconfig/; \
else :; fi; \
done
+252
View File
@@ -1,3 +1,255 @@
*** 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 text. 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.
The pixels that constitute the antialias around the text are partially
transparent pixels, which let part of the background be visible through them.
If antialiased text is drawn over and over again, whithout first erasing the
old one, the partially transparent pixels of the antialias will no longer
see the background through them, but some of them will see the old pixels of
the antialias around the old text that was there before. This for example
will make a black antialiased text over a white background get thicker as
the pixels of the antialias around it, combine with semitransparent black
pixels of the old antialias instead of combining with the white background.
The result is that the antialias will get darker (in this case) and the text
will be altered.
Because of this the area where text is drawn needs to be cleared before
antialiased text can be drawn again. But between the moment whent he area is
cleared and the moment when the text is drawn again there is a small time
gap that results in flickering. This doesn't happen with normal text where
one doesn't need to clear the area before drawing the text, but instead can
simply draw over and over again.
To avoid this situation, a double buffering tehnique was used. Instead of
drawing directly in the wisget's window (which is mapped and will flicker as
described above), we draw in a pixmap (unmapped) and after all is done we
XCopyArea() from that pixmap to the real window.
Since all this takes place off-screen, no flickering will be observed in
this case.
This is a change that that will be automatically available for your
applications and will require no change from you.
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 your list item drawing code used to contain these to clear the
item area before drawing it needs to change, else the application will die
when it tires to XClearArea() on a pixmap.
This means that in your application if you ever used WMSetListUserDrawProc()
so set a userspace routine which draws WMList items in a particular fashion,
you need to make sure your function will not call XClearArea() or
XClearWindow() on the drawable that was passed to draw in.
Instead you should use XFillRectangle().
This change also means that you no longer need to do double buffering in
your code, if you ever used to do. It is not done by WINGs and you benefit
from it automatically.
*** 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 Xft 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
Xft support in WINGs
--------------------
If Xft is detected when configure it is run, support for drawing antialiased
fonts with transparency will be compiled into WINGs.
You need at least Xfree86 version 4.0.x for this but at least 4.1.x is
recommended.
For Xft support there are 2 new functions to create a font that will render
using antialiasing and transparency: WMCreateAntialiasedFont() and
WMCreateAntialiasedFontSet(). Later is for multibyte languages.
Passing such a font to WMDrawString() or WMDrawImageString() will result
in antialiased text displayed on screen. Modifying the alpha value for the
WMColor passed to WMDrawString() or WMDrawImageString() will result in text
being displayed with the appropriate transparency.
To control antialiased font behavior, there are 3 new options that go into
WMGLOBAL. Two of them are to set the system font used when an antialiased
font is required. They operate in a similar way as SystemFont and
BoldSystemFont, just they are used when antialiased fonts are requested.
They are named AntialiasedSystemFont respectively AntialiasedBoldSystemFont.
They are kept separate from SystemFont and BoldSystemFont because the same
fonts don't render well as both normal and antialiased if they are not
TrueType fonts. Even though you can specify any font in the XLFD format for
these new options, it is recomended to use TrueType fonts for the antialiased
case since other fonts (standard X fonts) don't render well and give ugly
results.
The third option is an option that globally controls if WINGs uses or not
antialiased fonts. It is named AntialiasedText and it has a boolean Yes/No
value. If set to Yes, WINGs will try to use antialiased fonts (if support
was compiled in, and antialiased fonts can be found) then revert to normal
fonts if not possible. Note that this applies if WMCreateFont(),
WMSystemFont(), WMSystemFontOfSize(), WMBoldSystemFont() or
WMBoldSystemFontOFize() are used. If any of the direct creation functions
are used, such as WMCreateAntialiasedFont() or WMCreateNormalFont(), then
that kind of font is returned independently of the value of AntialiasedText.
(However note that an antialiased font cannot be created if Xft support was
no compiled into WINGs, even if you call WMCreateAntialiasedFont() directly.
In this case WMCreateAntialiasedFont() will always return NULL)
These 3 options from WMGLOBAL (which apply to all WINGs applications) can be
overwritten on a per application basis by putting them in the application's
specific domain file (usually ~/GNUstep/Defaults/application_name).
There is also another new font creation function available.
WMCreateFontWithFlags(screen, fontName, flags)
flags will specify what kind of font to create. They are defined in WINGs.h
as an enum: WMFontFlags
If WFDefaultFont is passed then the function will work exactly like
WMCreateFont() by creating a font according to the options from the
configuration.
However if some specific flag is passed than that option will be altered. All
the other options will keep their default values.
There are 2 font options available (at this time):
1. Font type (if a normal font or a font set)
2. Font antialiasing (if it's an antialiased font or not)
If flags specifies a value for each of the available options then a specific
font which only takes into account those flag values will be created and all
the font options specified in the configuration (like MultiByte or Antialiasing)
will be ignored.
However if only some of the options are specified, then for the missing options
the default values from the configuration will be used.
For example if antialiasing is enabled in the configuration and you pass
WFNotAntialiased as the flag, then a font with all the properties defined in
the configuration (except antialiasing) will be created. This means that if
MultiByte is defined a fontset will be created, else a normal font will be
created and you don't have to worry about the rest of the flags you didn't
specify.
*** 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 *** Thu Oct 04 06:00:09 EEST 2001 -Dan
+1 -1
View File
@@ -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 like configuration manager and a notification system. User Defaults alike 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
+1 -2
View File
@@ -1,3 +1,2 @@
Makefile Makefile.in Makefile Makefile.in
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+1 -2
View File
@@ -1,5 +1,4 @@
Makefile Makefile.in Makefile Makefile.in
testtext testcolorpanel testmywidget wmfile wmquery wtest testtext testcolorpanel testmywidget wmfile wmquery wtest
.libs .libs
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
+1 -1
View File
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = no-dependencies
noinst_PROGRAMS = wtest wmquery wmfile testmywidget noinst_PROGRAMS = wtest wmquery wmfile testmywidget
LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \ LDADD= $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la \
@INTLIBS@ @XFTLIBS@ @INTLIBS@
testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h testmywidget_SOURCES = testmywidget.c mywidget.c mywidget.h
+1 -1
View File
@@ -150,7 +150,7 @@ paintMyWidget(_MyWidget *mPtr)
color = WMWhiteColor(scr); color = WMWhiteColor(scr);
W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0, W_PaintText(mPtr->view, mPtr->view->window, scr->normalFont, 0, 0,
mPtr->view->size.width, WACenter, WMColorGC(color), mPtr->view->size.width, WACenter, color,
False, mPtr->text, strlen(mPtr->text)); False, mPtr->text, strlen(mPtr->text));
WMReleaseColor(color); WMReleaseColor(color);
+1
View File
@@ -1,6 +1,7 @@
#include <WINGs/WINGs.h> #include <WINGs/WINGs.h>
#include <stdlib.h>
#include "mywidget.h" #include "mywidget.h"
+6 -4
View File
@@ -17,6 +17,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "logo.xpm" #include "logo.xpm"
@@ -70,14 +71,15 @@ int main(int argc, char **argv)
extern char *optarg; extern char *optarg;
extern int optind; extern int optind;
WMInitializeApplication("WMFile", &argc, argv);
ProgName = argv[0];
if (!dpy) { if (!dpy) {
puts("could not open display"); puts("could not open display");
exit(1); exit(1);
} }
WMInitializeApplication("WMFile", &argc, argv);
ProgName = argv[0];
while((ch = getopt(argc, argv, "si:ht:")) != -1) while((ch = getopt(argc, argv, "si:ht:")) != -1)
switch(ch) switch(ch)
{ {
+1
View File
@@ -8,6 +8,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "logo.xpm" #include "logo.xpm"
+37 -30
View File
@@ -5,13 +5,14 @@
#include <WINGs/WINGs.h> #include <WINGs/WINGs.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
/* /*
* You need to define this function to link any program to WINGs. * You need to define this function to link any program to WINGs.
* (this is no longer required as there is a default abort handler in WINGs)
* This will be called when the application will be terminated because * This will be called when the application will be terminated because
* on a fatal error. * of a fatal error (only for memory allocation failures ATM).
*/ */
void void
wAbort() wAbort()
@@ -104,7 +105,7 @@ testFrame(WMScreen *scr)
frame = WMCreateFrame(win); frame = WMCreateFrame(win);
WMMoveWidget(frame, 8+(i%3)*130, 8+(i/3)*130); WMMoveWidget(frame, 8+(i%3)*130, 8+(i/3)*130);
WMResizeWidget(frame, 120, 120); WMResizeWidget(frame, 120, 120);
WMSetFrameTitle(frame, titles[i]); WMSetFrameTitle(frame, titles[i]);
WMSetFrameTitlePosition(frame, pos[i]); WMSetFrameTitlePosition(frame, pos[i]);
} }
@@ -240,7 +241,7 @@ testList(WMScreen *scr)
list = WMCreateList(win); list = WMCreateList(win);
/*WMSetListAllowEmptySelection(list, True);*/ /*WMSetListAllowEmptySelection(list, True);*/
WMMoveWidget(list, 10, 40); WMMoveWidget(list, 10, 40);
for (i=0; i<50; i++) { for (i=0; i<105; i++) {
sprintf(text, "Item %i", i); sprintf(text, "Item %i", i);
WMAddListItem(list, text); WMAddListItem(list, text);
} }
@@ -337,6 +338,9 @@ testGradientButtons(WMScreen *scr)
WMSetWindowTitle(win, "Gradiented Button Demo"); WMSetWindowTitle(win, "Gradiented Button Demo");
WMResizeWidget(win, 300, 200); WMResizeWidget(win, 300, 200);
WMSetWindowCloseAction(win, closeAction, NULL);
light.red = 0x90; light.red = 0x90;
light.green = 0x85; light.green = 0x85;
light.blue = 0x90; light.blue = 0x90;
@@ -586,7 +590,7 @@ testText(WMScreen *scr)
{ {
WMWindow *win; WMWindow *win;
WMText *text; WMText *text;
FILE *file = fopen("wm.html", "r"); FILE *file = fopen("wm.html", "rb");
windowCount++; windowCount++;
@@ -601,6 +605,20 @@ testText(WMScreen *scr)
WMSetTextHasVerticalScroller(text, True); WMSetTextHasVerticalScroller(text, True);
WMSetTextEditable(text, False); WMSetTextEditable(text, False);
{
WMFont *font, *ifont;
font = WMDefaultSystemFont(scr);
ifont = WMCopyFontWithChanges(scr, font, WFAEmphasized);
if (ifont) {
WMSetTextDefaultFont(text, ifont);
WMReleaseFont(ifont);
} else {
WMSetTextDefaultFont(text, font);
}
WMReleaseFont(font);
}
if(file) { if(file) {
char buf[1024]; char buf[1024];
@@ -1261,7 +1279,7 @@ main(int argc, char **argv)
* Do NOT use it unless when debugging. It will cause a major * Do NOT use it unless when debugging. It will cause a major
* slowdown in your application * slowdown in your application
*/ */
#if 1 #if 0
XSynchronize(dpy, True); XSynchronize(dpy, True);
#endif #endif
/* /*
@@ -1286,38 +1304,27 @@ main(int argc, char **argv)
*/ */
testDragAndDrop(scr);
testText(scr); testText(scr);
#if 0
testColorPanel(scr);
testScrollView(scr);
testTabView(scr);
testBox(scr);
testText(scr);
testList(scr);
testProgressIndicator(scr);
testColorWell(scr);
testTextField(scr);
testDragAndDrop(scr);
testFontPanel(scr); testFontPanel(scr);
#if 0
testBox(scr);
testButton(scr); testButton(scr);
testColorPanel(scr);
testColorWell(scr);
testDragAndDrop(scr);
testFrame(scr); testFrame(scr);
testSplitView(scr);
testGradientButtons(scr); testGradientButtons(scr);
testList(scr);
testOpenFilePanel(scr); testOpenFilePanel(scr);
testProgressIndicator(scr);
testSlider(scr);
testPullDown(scr); testPullDown(scr);
testScrollView(scr);
testSlider(scr);
testSplitView(scr);
testTabView(scr);
testTextField(scr);
#endif #endif
/* /*
* The main event loop. * The main event loop.
+157 -91
View File
@@ -7,7 +7,7 @@
#include <WINGs/WUtil.h> #include <WINGs/WUtil.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#define WINGS_H_VERSION 20020104 #define WINGS_H_VERSION 20021124
#ifdef __cplusplus #ifdef __cplusplus
@@ -85,58 +85,74 @@ enum {
/* button types */ /* button types */
typedef enum { typedef enum {
/* 0 is reserved for internal use */ /* 0 is reserved for internal use */
WBTMomentaryPush = 1, WBTMomentaryPush = 1,
WBTPushOnPushOff = 2, WBTPushOnPushOff = 2,
WBTToggle = 3, WBTToggle = 3,
WBTSwitch = 4, WBTSwitch = 4,
WBTRadio = 5, WBTRadio = 5,
WBTMomentaryChange = 6, WBTMomentaryChange = 6,
WBTOnOff = 7, WBTOnOff = 7,
WBTMomentaryLight = 8 WBTMomentaryLight = 8
} WMButtonType; } WMButtonType;
/* button behaviour masks */ /* button behaviour masks */
enum { enum {
WBBSpringLoadedMask = (1 << 0), WBBSpringLoadedMask = (1 << 0),
WBBPushInMask = (1 << 1), WBBPushInMask = (1 << 1),
WBBPushChangeMask = (1 << 2), WBBPushChangeMask = (1 << 2),
WBBPushLightMask = (1 << 3), WBBPushLightMask = (1 << 3),
WBBStateLightMask = (1 << 5), WBBStateLightMask = (1 << 5),
WBBStateChangeMask = (1 << 6), WBBStateChangeMask = (1 << 6),
WBBStatePushMask = (1 << 7) WBBStatePushMask = (1 << 7)
};
/* Font flags */
typedef enum {
WFDefaultFont = 0,
WFNormalFont = (1<<0),
WFFontSet = (1<<1),
WFAntialiased = (1<<2),
WFNotAntialiased = (1<<3)
} WMFontFlags;
/* Use default system font size in system font name */
enum {
WFDefaultSize = -1
}; };
/* frame title positions */ /* frame title positions */
typedef enum { typedef enum {
WTPNoTitle, WTPNoTitle,
WTPAboveTop, WTPAboveTop,
WTPAtTop, WTPAtTop,
WTPBelowTop, WTPBelowTop,
WTPAboveBottom, WTPAboveBottom,
WTPAtBottom, WTPAtBottom,
WTPBelowBottom WTPBelowBottom
} WMTitlePosition; } WMTitlePosition;
/* relief types */ /* relief types */
typedef enum { typedef enum {
WRFlat, WRFlat,
WRSimple, WRSimple,
WRRaised, WRRaised,
WRSunken, WRSunken,
WRGroove, WRGroove,
WRRidge, WRRidge,
WRPushed WRPushed
} WMReliefType; } WMReliefType;
/* alignment types */ /* alignment types */
typedef enum { typedef enum {
WALeft, WALeft,
WACenter, WACenter,
WARight, WARight,
WAJustified /* not valid for textfields */ WAJustified /* not valid for textfields */
} WMAlignment; } WMAlignment;
@@ -155,58 +171,58 @@ typedef enum {
/* scroller arrow position */ /* scroller arrow position */
typedef enum { typedef enum {
WSAMaxEnd, WSAMaxEnd,
WSAMinEnd, WSAMinEnd,
WSANone WSANone
} WMScrollArrowPosition; } WMScrollArrowPosition;
/* scroller parts */ /* scroller parts */
typedef enum { typedef enum {
WSNoPart, WSNoPart,
WSDecrementPage, WSDecrementPage,
WSIncrementPage, WSIncrementPage,
WSDecrementLine, WSDecrementLine,
WSIncrementLine, WSIncrementLine,
WSDecrementWheel, WSDecrementWheel,
WSIncrementWheel, WSIncrementWheel,
WSKnob, WSKnob,
WSKnobSlot WSKnobSlot
} WMScrollerPart; } WMScrollerPart;
/* usable scroller parts */ /* usable scroller parts */
typedef enum { typedef enum {
WSUNoParts, WSUNoParts,
WSUOnlyArrows, WSUOnlyArrows,
WSUAllParts WSUAllParts
} WMUsableScrollerParts; } WMUsableScrollerParts;
/* matrix types */ /* matrix types */
typedef enum { typedef enum {
WMRadioMode, WMRadioMode,
WMHighlightMode, WMHighlightMode,
WMListMode, WMListMode,
WMTrackMode WMTrackMode
} WMMatrixTypes; } WMMatrixTypes;
typedef enum { typedef enum {
WTTopTabsBevelBorder, WTTopTabsBevelBorder,
WTNoTabsBevelBorder, WTNoTabsBevelBorder,
WTNoTabsLineBorder, WTNoTabsLineBorder,
WTNoTabsNoBorder WTNoTabsNoBorder
} WMTabViewType; } WMTabViewType;
/* text movement types */ /* text movement types */
enum { enum {
WMIllegalTextMovement, WMIllegalTextMovement,
WMReturnTextMovement, WMReturnTextMovement,
WMEscapeTextMovement, WMEscapeTextMovement,
WMTabTextMovement, WMTabTextMovement,
WMBacktabTextMovement, WMBacktabTextMovement,
WMLeftTextMovement, WMLeftTextMovement,
WMRightTextMovement, WMRightTextMovement,
WMUpTextMovement, WMUpTextMovement,
WMDownTextMovement WMDownTextMovement
}; };
/* text field special events */ /* text field special events */
@@ -233,13 +249,13 @@ typedef enum {
typedef enum { typedef enum {
WMGrayModeColorPanel = 1, WMGrayModeColorPanel = 1,
WMRGBModeColorPanel = 2, WMRGBModeColorPanel = 2,
WMCMYKModeColorPanel = 3, WMCMYKModeColorPanel = 3,
WMHSBModeColorPanel = 4, WMHSBModeColorPanel = 4,
WMCustomPaletteModeColorPanel = 5, WMCustomPaletteModeColorPanel = 5,
WMColorListModeColorPanel = 6, WMColorListModeColorPanel = 6,
WMWheelModeColorPanel = 7 WMWheelModeColorPanel = 7
} WMColorPanelMode; } WMColorPanelMode;
@@ -260,17 +276,17 @@ typedef enum {
enum { enum {
WLDSSelected = (1 << 16), WLDSSelected = (1 << 16),
WLDSDisabled = (1 << 17), WLDSDisabled = (1 << 17),
WLDSFocused = (1 << 18), WLDSFocused = (1 << 18),
WLDSIsBranch = (1 << 19) WLDSIsBranch = (1 << 19)
}; };
/* alert panel return values */ /* alert panel return values */
enum { enum {
WAPRDefault = 0, WAPRDefault = 0,
WAPRAlternate = 1, WAPRAlternate = 1,
WAPROther = -1, WAPROther = -1,
WAPRError = -2 WAPRError = -2
}; };
@@ -278,8 +294,8 @@ enum {
/* types of input observers */ /* types of input observers */
enum { enum {
WIReadMask = (1 << 0), WIReadMask = (1 << 0),
WIWriteMask = (1 << 1), WIWriteMask = (1 << 1),
WIExceptMask = (1 << 2) WIExceptMask = (1 << 2)
}; };
@@ -416,8 +432,6 @@ typedef struct WMGenericPanel {
} WMGenericPanel; } WMGenericPanel;
typedef struct WMInputPanel { typedef struct WMInputPanel {
WMWindow *win; /* window */ WMWindow *win; /* window */
WMButton *defBtn; /* default button */ WMButton *defBtn; /* default button */
@@ -429,6 +443,35 @@ typedef struct WMInputPanel {
} WMInputPanel; } WMInputPanel;
#define WFAUnchanged (NULL)
/* Struct for font change operations */
typedef struct WMFontAttributes {
char *foundry;
char *family;
char *weight;
char *slant;
char *setWidth;
char *addStyle;
char *pixelSize;
char *pointSize;
char *resolutionX;
char *resolutionY;
char *spacing;
char *averageWidth;
char *registry;
char *encoding;
} WMFontAttributes;
/* A few useful constant font attributes masks */
extern const WMFontAttributes *WFANormal;
extern const WMFontAttributes *WFABold;
extern const WMFontAttributes *WFANotBold;
extern const WMFontAttributes *WFAEmphasized;
extern const WMFontAttributes *WFANotEmphasized;
extern const WMFontAttributes *WFABoldEmphasized;
/* WMRuler: */ /* WMRuler: */
typedef struct { typedef struct {
WMArray *tabs; /* a growable array of tabstops */ WMArray *tabs; /* a growable array of tabstops */
@@ -582,6 +625,8 @@ WMPoint wmkpoint(int x, int y);
WMSize wmksize(unsigned int width, unsigned int height); WMSize wmksize(unsigned int width, unsigned int height);
WMRect wmkrect(int x, int y, unsigned int width, unsigned int height);
#ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY #ifdef ANSI_C_DOESNT_LIKE_IT_THIS_WAY
#define wmksize(width, height) (WMSize){(width), (height)} #define wmksize(width, height) (WMSize){(width), (height)}
#define wmkpoint(x, y) (WMPoint){(x), (y)} #define wmkpoint(x, y) (WMPoint){(x), (y)}
@@ -695,18 +740,38 @@ WMPoint WMGetDraggingInfoImageLocation(WMDraggingInfo *info);
/* ....................................................................... */ /* ....................................................................... */
WMFont* WMCreateFontSet(WMScreen *scrPtr, char *fontName); Bool WMHasAntialiasingSupport(WMScreen *scrPtr);
Bool WMIsAntialiasingEnabled(WMScreen *scrPtr);
/* ....................................................................... */
WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName); WMFont* WMCreateNormalFont(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateFontSet(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateAntialiasedFont(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateAntialiasedFontSet(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName); WMFont* WMCreateFont(WMScreen *scrPtr, char *fontName);
WMFont* WMCreateFontWithFlags(WMScreen *scrPtr, char *fontName,
WMFontFlags flags);
WMFont* WMCopyFontWithChanges(WMScreen *scrPtr, WMFont *font,
const WMFontAttributes *changes);
WMFont* WMRetainFont(WMFont *font); WMFont* WMRetainFont(WMFont *font);
void WMReleaseFont(WMFont *font); void WMReleaseFont(WMFont *font);
char* WMGetFontName(WMFont *font);
unsigned int WMFontHeight(WMFont *font); unsigned int WMFontHeight(WMFont *font);
Bool WMIsAntialiasedFont(WMFont *font);
/* /*
WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size); WMFont* WMUserFontOfSize(WMScreen *scrPtr, int size);
@@ -728,18 +793,6 @@ WMFont* WMBoldSystemFontOfSize(WMScreen *scrPtr, int size);
XFontSet WMGetFontFontSet(WMFont *font); XFontSet WMGetFontFontSet(WMFont *font);
WMFont* WMNormalizeFont(WMScreen *scr, WMFont *font);
WMFont* WMStrengthenFont(WMScreen *scr, WMFont *font);
WMFont* WMUnstrengthenFont(WMScreen *scr, WMFont *font);
WMFont* WMEmphasizeFont(WMScreen *scr, WMFont *font);
WMFont* WMUnemphasizeFont(WMScreen *scr, WMFont *font);
WMFont* WMGetFontOfSize(WMScreen *scr, WMFont *font, int size);
/* ....................................................................... */ /* ....................................................................... */
WMPixmap* WMRetainPixmap(WMPixmap *pixmap); WMPixmap* WMRetainPixmap(WMPixmap *pixmap);
@@ -804,24 +857,33 @@ WMColor* WMCreateRGBColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue, unsigned short green, unsigned short blue,
Bool exact); Bool exact);
WMColor* WMCreateRGBAColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue,
unsigned short alpha, Bool exact);
WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact); WMColor* WMCreateNamedColor(WMScreen *scr, char *name, Bool exact);
void WMSetColorAlpha(WMColor *color, unsigned short alpha);
unsigned short WMRedComponentOfColor(WMColor *color); unsigned short WMRedComponentOfColor(WMColor *color);
unsigned short WMGreenComponentOfColor(WMColor *color); unsigned short WMGreenComponentOfColor(WMColor *color);
unsigned short WMBlueComponentOfColor(WMColor *color); unsigned short WMBlueComponentOfColor(WMColor *color);
unsigned short WMGetColorAlpha(WMColor *color);
char* WMGetColorRGBDescription(WMColor *color); char* WMGetColorRGBDescription(WMColor *color);
/* ....................................................................... */ /* ....................................................................... */
void WMDrawString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, void WMDrawString(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
int y, char *text, int length); int x, int y, char *text, int length);
void WMDrawImageString(WMScreen *scr, Drawable d, GC gc, WMFont *font, int x, void WMDrawImageString(WMScreen *scr, Drawable d, WMColor *color,
int y, char *text, int length); WMColor *background, WMFont *font, int x, int y,
char *text, int length);
int WMWidthOfString(WMFont *font, char *text, int length); int WMWidthOfString(WMFont *font, char *text, int length);
@@ -851,6 +913,8 @@ void WMResizeWidget(WMWidget *w, unsigned int width, unsigned int height);
void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color); void WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color);
WMColor* WMGetWidgetBackgroundColor(WMWidget *w);
void WMMapSubwidgets(WMWidget *w); void WMMapSubwidgets(WMWidget *w);
void WMUnmapSubwidgets(WMWidget *w); void WMUnmapSubwidgets(WMWidget *w);
@@ -1803,6 +1867,8 @@ void WMShowFontPanel(WMFontPanel *panel);
void WMHideFontPanel(WMFontPanel *panel); void WMHideFontPanel(WMFontPanel *panel);
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font); void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
/* you can free the returned string */ /* you can free the returned string */
+25 -7
View File
@@ -8,7 +8,7 @@
#include <WINGs/WINGs.h> #include <WINGs/WINGs.h>
#if WINGS_H_VERSION < 20020104 #if WINGS_H_VERSION < 20021124
#error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it. #error There_is_an_old_WINGs.h_file_somewhere_in_your_system._Please_remove_it.
#endif #endif
@@ -50,13 +50,15 @@ typedef struct W_Font {
union { union {
XFontSet set; XFontSet set;
XFontStruct *normal; XFontStruct *normal;
struct _XftFont *xft;
} font; } font;
short height; short height;
short y; short y;
short refCount; short refCount;
char *name; char *name;
unsigned int notFontSet:1; unsigned int notFontSet:1;
unsigned int antialiased:1;
} W_Font; } W_Font;
@@ -75,6 +77,7 @@ typedef struct W_Color {
struct W_Screen *screen; struct W_Screen *screen;
XColor color; XColor color;
unsigned short alpha;
short refCount; short refCount;
GC gc; GC gc;
struct { struct {
@@ -134,6 +137,10 @@ typedef struct W_Screen {
struct W_IMContext *imctx; struct W_IMContext *imctx;
struct _XftDraw *xftdraw; /* shared XftDraw */
Bool hasXftSupport; /* if it can antialias text */
/* application related */ /* application related */
W_FocusInfo *focusInfo; W_FocusInfo *focusInfo;
@@ -183,7 +190,9 @@ typedef struct W_Screen {
GC ixorGC; /* IncludeInferiors XOR */ GC ixorGC; /* IncludeInferiors XOR */
GC textFieldGC; GC drawStringGC; /* for WMDrawString() */
GC drawImStringGC; /* for WMDrawImageString() */
W_Font *normalFont; W_Font *normalFont;
@@ -191,10 +200,16 @@ typedef struct W_Screen {
WMHashTable *fontCache; WMHashTable *fontCache;
WMHashTable *xftFontCache;
WMHashTable *fontSetCache; WMHashTable *fontSetCache;
WMHashTable *xftFontSetCache;
Bool useMultiByte; Bool useMultiByte;
Bool antialiasedText;
unsigned int ignoredModifierMask; /* modifiers to ignore when typing txt */ unsigned int ignoredModifierMask; /* modifiers to ignore when typing txt */
struct W_Balloon *balloon; struct W_Balloon *balloon;
@@ -401,7 +416,10 @@ typedef struct W_EventHandler {
typedef struct _WINGsConfiguration { typedef struct _WINGsConfiguration {
char *systemFont; char *systemFont;
char *boldSystemFont; char *boldSystemFont;
char *antialiasedSystemFont;
char *antialiasedBoldSystemFont;
int defaultFontSize; int defaultFontSize;
Bool antialiasedText;
Bool useMultiByte; Bool useMultiByte;
char *floppyPath; char *floppyPath;
unsigned doubleClickDelay; unsigned doubleClickDelay;
@@ -488,13 +506,13 @@ void W_DrawReliefWithGC(W_Screen *scr, Drawable d, int x, int y,
void W_CallDestroyHandlers(W_View *view); void W_CallDestroyHandlers(W_View *view);
void W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, void W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor,
WMReliefType relief, char *text, W_Font *font, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image, WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, GC backGC, int ofs); WMImagePosition position, WMColor *backColor, int ofs);
void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y, void W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
int width, WMAlignment alignment, GC gc, int width, WMAlignment alignment, WMColor *color,
int wrap, char *text, int length); int wrap, char *text, int length);
int W_GetTextHeight(WMFont *font, char *text, int width, int wrap); int W_GetTextHeight(WMFont *font, char *text, int width, int wrap);
+13 -7
View File
@@ -19,11 +19,13 @@
#endif #endif
#if (!defined (__GNUC__) || __GNUC__ < 2 || \ #ifndef __ASSERT_FUNCTION
__GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)) # if (!defined (__GNUC__) || (__GNUC__ < 2 && \
#define __ASSERT_FUNCTION ((char *) 0) __GNUC_MINOR__ < (defined (__cplusplus) ? 6 : 4)))
#else # define __ASSERT_FUNCTION ((char *) 0)
#define __ASSERT_FUNCTION __PRETTY_FUNCTION__ # else
# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
# endif
#endif #endif
@@ -184,8 +186,9 @@ typedef struct {
typedef struct ConnectionDelegate { typedef struct ConnectionDelegate {
void *data; void *data;
void (*didCatchException)(struct ConnectionDelegate *self, void (*canResumeSending)(struct ConnectionDelegate *self, WMConnection *cPtr);
WMConnection *cPtr);
void (*didCatchException)(struct ConnectionDelegate *self, WMConnection *cPtr);
void (*didDie)(struct ConnectionDelegate *self, WMConnection *cPtr); void (*didDie)(struct ConnectionDelegate *self, WMConnection *cPtr);
@@ -239,6 +242,7 @@ void wrelease(void *ptr);
void* wretain(void *ptr); void* wretain(void *ptr);
char* wstrdup(char *str); char* wstrdup(char *str);
char* wstrndup(char *str, size_t len);
/* Concatenate str1 with str2 and return that in a newly malloc'ed string. /* 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 can be any strings including static and constant strings.
@@ -977,6 +981,8 @@ Bool WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag);
Bool WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag); Bool WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag);
void WMSetConnectionShutdownOnClose(WMConnection *cPtr, Bool flag);
void* WMGetConnectionClientData(WMConnection *cPtr); void* WMGetConnectionClientData(WMConnection *cPtr);
void WMSetConnectionClientData(WMConnection *cPtr, void *data); void WMSetConnectionClientData(WMConnection *cPtr, void *data);
+3 -1
View File
@@ -274,7 +274,9 @@ WMCountInArray(WMArray *array, void *item)
void void
WMSortArray(WMArray *array, WMCompareDataProc *comparer) WMSortArray(WMArray *array, WMCompareDataProc *comparer)
{ {
qsort(array->items, array->itemCount, sizeof(void*), comparer); if (array->itemCount > 1) { /* Don't sort empty or single element arrays */
qsort(array->items, array->itemCount, sizeof(void*), comparer);
}
} }
+73 -4
View File
@@ -1,6 +1,7 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h"
#include <X11/Xlocale.h> #include <X11/Xlocale.h>
@@ -13,6 +14,10 @@ _WINGsConfiguration WINGsConfiguration;
#define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-*-*-%d-*-*-*-*-*-*-*" #define BOLD_SYSTEM_FONT "-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-bold-r-*-*-%d-*-*-*-*-*-*-*"
#define XFTSYSTEM_FONT "-*-arial-medium-r-normal-*-%d-*-*-*-*-*-*-*"
#define XFTBOLD_SYSTEM_FONT "-*-arial-bold-r-normal-*-%d-*-*-*-*-*-*-*"
#define FLOPPY_PATH "/floppy" #define FLOPPY_PATH "/floppy"
@@ -40,6 +45,51 @@ getButtonWithName(const char *name, unsigned defaultButton)
} }
static Bool
missingOrInvalidXLFD(char *xlfd)
{
char *ptr = xlfd;
Bool broken = False;
int count = 0;
if (!xlfd)
return True;
while (*ptr) {
if (*ptr=='%') {
ptr++;
if ((*ptr=='d' || *ptr=='i') && count==0) {
count++;
} else {
broken = True;
break;
}
} else if (*ptr==',') {
count = 0;
}
ptr++;
}
if (broken) {
if (xlfd == WINGsConfiguration.systemFont) {
ptr = "system font";
} else if (xlfd == WINGsConfiguration.boldSystemFont) {
ptr = "bold system font";
} else if (xlfd == WINGsConfiguration.antialiasedSystemFont) {
ptr = "antialiased system font";
} else if (xlfd == WINGsConfiguration.antialiasedBoldSystemFont) {
ptr = "antialiased bold system font";
} else {
ptr = "Unknown System Font";
}
wwarning(_("Invalid %s specification: '%s' (only %%d is allowed and "
"at most once for each font in a fontset)."), ptr, xlfd);
}
return broken;
}
void void
W_ReadConfigurations(void) W_ReadConfigurations(void)
{ {
@@ -60,6 +110,19 @@ W_ReadConfigurations(void)
WINGsConfiguration.boldSystemFont = WINGsConfiguration.boldSystemFont =
WMGetUDStringForKey(defaults, "BoldSystemFont"); WMGetUDStringForKey(defaults, "BoldSystemFont");
WINGsConfiguration.antialiasedSystemFont =
WMGetUDStringForKey(defaults, "AntialiasedSystemFont");
WINGsConfiguration.antialiasedBoldSystemFont =
WMGetUDStringForKey(defaults, "AntialiasedBoldSystemFont");
#ifdef XFT
WINGsConfiguration.antialiasedText =
WMGetUDBoolForKey(defaults, "AntialiasedText");
#else
WINGsConfiguration.antialiasedText = False;
#endif
WINGsConfiguration.useMultiByte = False; WINGsConfiguration.useMultiByte = False;
str = WMGetUDStringForKey(defaults, "MultiByteText"); str = WMGetUDStringForKey(defaults, "MultiByteText");
if (str) { if (str) {
@@ -74,6 +137,7 @@ W_ReadConfigurations(void)
if (locale != NULL if (locale != NULL
&& (strncmp(locale, "ja", 2) == 0 && (strncmp(locale, "ja", 2) == 0
|| strncmp(locale, "zh", 2) == 0 || strncmp(locale, "zh", 2) == 0
|| strncmp(locale, "ru", 2) == 0
|| strncmp(locale, "ko", 2) == 0)) { || strncmp(locale, "ko", 2) == 0)) {
WINGsConfiguration.useMultiByte = True; WINGsConfiguration.useMultiByte = True;
@@ -114,13 +178,18 @@ W_ReadConfigurations(void)
WMGetUDIntegerForKey(defaults, "DefaultFontSize"); WMGetUDIntegerForKey(defaults, "DefaultFontSize");
} }
if (missingOrInvalidXLFD(WINGsConfiguration.systemFont)) {
if (!WINGsConfiguration.systemFont) { WINGsConfiguration.systemFont = SYSTEM_FONT;
WINGsConfiguration.systemFont = SYSTEM_FONT;
} }
if (!WINGsConfiguration.boldSystemFont) { if (missingOrInvalidXLFD(WINGsConfiguration.boldSystemFont)) {
WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT; WINGsConfiguration.boldSystemFont = BOLD_SYSTEM_FONT;
} }
if (missingOrInvalidXLFD(WINGsConfiguration.antialiasedSystemFont)) {
WINGsConfiguration.antialiasedSystemFont = XFTSYSTEM_FONT;
}
if (missingOrInvalidXLFD(WINGsConfiguration.antialiasedBoldSystemFont)) {
WINGsConfiguration.antialiasedBoldSystemFont = XFTBOLD_SYSTEM_FONT;
}
if (!WINGsConfiguration.floppyPath) { if (!WINGsConfiguration.floppyPath) {
WINGsConfiguration.floppyPath = FLOPPY_PATH; WINGsConfiguration.floppyPath = FLOPPY_PATH;
} }
+40 -13
View File
@@ -1,7 +1,7 @@
/* /*
* WINGs WMConnection function library * WINGs WMConnection function library
* *
* Copyright (c) 1999-2002 Dan Pascu * Copyright (c) 1999-2003 Dan Pascu
* *
* 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
@@ -121,6 +121,7 @@ typedef struct W_Connection {
char *protocol; char *protocol;
Bool closeOnRelease; Bool closeOnRelease;
Bool shutdownOnClose;
Bool wasNonBlocking; Bool wasNonBlocking;
Bool isNonBlocking; Bool isNonBlocking;
@@ -192,9 +193,10 @@ inputHandler(int fd, int mask, void *clientData)
return; return;
if ((mask & WIWriteMask)) { if ((mask & WIWriteMask)) {
int result;
if (cPtr->state == WCInProgress) { if (cPtr->state == WCInProgress) {
Bool failed; Bool failed;
int result;
int len = sizeof(result); int len = sizeof(result);
WCErrorCode = 0; WCErrorCode = 0;
@@ -228,7 +230,10 @@ inputHandler(int fd, int mask, void *clientData)
if (failed) if (failed)
return; return;
} else if (cPtr->state == WCConnected) { } else if (cPtr->state == WCConnected) {
WMFlushConnection(cPtr); result = WMFlushConnection(cPtr);
if (result>0 && cPtr->delegate && cPtr->delegate->canResumeSending) {
(*cPtr->delegate->canResumeSending)(cPtr->delegate, cPtr);
}
} }
} }
@@ -376,6 +381,7 @@ createConnectionWithSocket(int sock, Bool closeOnRelease)
cPtr->sendTimeout.timeout = DefaultTimeout; cPtr->sendTimeout.timeout = DefaultTimeout;
cPtr->sendTimeout.handler = NULL; cPtr->sendTimeout.handler = NULL;
cPtr->closeOnRelease = closeOnRelease; cPtr->closeOnRelease = closeOnRelease;
cPtr->shutdownOnClose = 1;
cPtr->outputQueue = cPtr->outputQueue =
WMCreateArrayWithDestructor(16, (WMFreeDataProc*)WMReleaseData); WMCreateArrayWithDestructor(16, (WMFreeDataProc*)WMReleaseData);
cPtr->state = WCNotConnected; cPtr->state = WCNotConnected;
@@ -627,7 +633,9 @@ void
WMDestroyConnection(WMConnection *cPtr) WMDestroyConnection(WMConnection *cPtr)
{ {
if (cPtr->closeOnRelease && cPtr->sock>=0) { if (cPtr->closeOnRelease && cPtr->sock>=0) {
shutdown(cPtr->sock, SHUT_RDWR); if (cPtr->shutdownOnClose) {
shutdown(cPtr->sock, SHUT_RDWR);
}
close(cPtr->sock); close(cPtr->sock);
} }
@@ -648,7 +656,9 @@ void
WMCloseConnection(WMConnection *cPtr) WMCloseConnection(WMConnection *cPtr)
{ {
if (cPtr->sock>=0) { if (cPtr->sock>=0) {
shutdown(cPtr->sock, SHUT_RDWR); if (cPtr->shutdownOnClose) {
shutdown(cPtr->sock, SHUT_RDWR);
}
close(cPtr->sock); close(cPtr->sock);
cPtr->sock = -1; cPtr->sock = -1;
} }
@@ -743,10 +753,18 @@ WMEnqueueConnectionData(WMConnection *cPtr, WMData *data)
} }
/*
* Return value:
* -1 - not connected or connection died while sending
* 0 - couldn't send the data (or part of it). data is saved in a queue
* and will be sent when possible. after it is sent the canResumeSending
* callback will be called.
* 1 - data was succesfully sent
*/
int int
WMSendConnectionData(WMConnection *cPtr, WMData *data) WMSendConnectionData(WMConnection *cPtr, WMData *data)
{ {
int bytes, pos, len, totalTransfer; int bytes, pos, len;
TimeoutData *tPtr = &cPtr->sendTimeout; TimeoutData *tPtr = &cPtr->sendTimeout;
const unsigned char *dataBytes; const unsigned char *dataBytes;
@@ -767,8 +785,6 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data)
return 0; return 0;
} }
totalTransfer = 0;
while (WMGetArrayItemCount(cPtr->outputQueue) > 0) { while (WMGetArrayItemCount(cPtr->outputQueue) > 0) {
data = WMGetFromArray(cPtr->outputQueue, 0); data = WMGetFromArray(cPtr->outputQueue, 0);
dataBytes = (const unsigned char *)WMDataBytes(data); dataBytes = (const unsigned char *)WMDataBytes(data);
@@ -793,7 +809,7 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data)
WMAddInputHandler(cPtr->sock, WIWriteMask, WMAddInputHandler(cPtr->sock, WIWriteMask,
inputHandler, cPtr); inputHandler, cPtr);
} }
return totalTransfer; return 0;
default: default:
WCErrorCode = errno; WCErrorCode = errno;
cPtr->state = WCDied; cPtr->state = WCDied;
@@ -804,7 +820,6 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data)
} }
} }
pos += bytes; pos += bytes;
totalTransfer += bytes;
} }
WMDeleteFromArray(cPtr->outputQueue, 0); WMDeleteFromArray(cPtr->outputQueue, 0);
cPtr->bufPos = 0; cPtr->bufPos = 0;
@@ -812,13 +827,18 @@ WMSendConnectionData(WMConnection *cPtr, WMData *data)
WMDeleteTimerHandler(tPtr->handler); WMDeleteTimerHandler(tPtr->handler);
tPtr->handler = NULL; tPtr->handler = NULL;
} }
if (cPtr->handler.write) { /*if (cPtr->handler.write) {
WMDeleteInputHandler(cPtr->handler.write); WMDeleteInputHandler(cPtr->handler.write);
cPtr->handler.write = NULL; cPtr->handler.write = NULL;
} }*/
} }
return totalTransfer; if (cPtr->handler.write) {
WMDeleteInputHandler(cPtr->handler.write);
cPtr->handler.write = NULL;
}
return 1;
} }
@@ -952,6 +972,13 @@ WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag)
} }
void
WMSetConnectionShutdownOnClose(WMConnection *cPtr, Bool flag)
{
cPtr->shutdownOnClose = ((flag==0) ? 0 : 1);
}
void* void*
WMGetConnectionClientData(WMConnection *cPtr) WMGetConnectionClientData(WMConnection *cPtr)
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* WINGs WMData function library * WINGs WMData function library
* *
* Copyright (c) 1999-2002 Dan Pascu * Copyright (c) 1999-2003 Dan Pascu
* *
* 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
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* Window Maker miscelaneous function library * Window Maker miscelaneous function library
* *
* Copyright (c) 1997-2002 Alfredo K. Kojima * Copyright (c) 1997-2003 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
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* Window Maker miscelaneous function library * Window Maker miscelaneous function library
* *
* Copyright (c) 1997-2002 Alfredo K. Kojima * Copyright (c) 1997-2003 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
-1
View File
@@ -603,7 +603,6 @@ W_HandleInputEvents(Bool waitForInput, int inputfd)
W_FlushASAPNotificationQueue(); W_FlushASAPNotificationQueue();
/* --oldway-- return ((inputfd < 0) ? (count > 0) : FD_ISSET(inputfd, &rset));*/
return (count > 0); return (count > 0);
#else /* not HAVE_SELECT, not HAVE_POLL */ #else /* not HAVE_SELECT, not HAVE_POLL */
Neither select nor poll. You lose. Neither select nor poll. You lose.
+10 -10
View File
@@ -148,7 +148,7 @@ WMResetHashTable(WMHashTable *table)
item = table->table[i]; item = table->table[i];
while (item) { while (item) {
tmp = item->next; tmp = item->next;
RELKEY(table, item); RELKEY(table, item->key);
wfree(item); wfree(item);
item = tmp; item = tmp;
} }
@@ -477,24 +477,24 @@ typedef void (*releaseFunc)(const void*);
const WMHashTableCallbacks WMIntHashCallbacks = { const WMHashTableCallbacks WMIntHashCallbacks = {
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL NULL
}; };
const WMHashTableCallbacks WMStringHashCallbacks = { const WMHashTableCallbacks WMStringHashCallbacks = {
(hashFunc)hashString, (hashFunc)hashString,
(isEqualFunc)compareStrings, (isEqualFunc)compareStrings,
(retainFunc)wstrdup, (retainFunc)wstrdup,
(releaseFunc)wfree (releaseFunc)wfree
}; };
const WMHashTableCallbacks WMStringPointerHashCallbacks = { const WMHashTableCallbacks WMStringPointerHashCallbacks = {
(hashFunc)hashString, (hashFunc)hashString,
(isEqualFunc)compareStrings, (isEqualFunc)compareStrings,
NULL, NULL,
NULL NULL
}; };
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* WINGs WMHost function library * WINGs WMHost function library
* *
* Copyright (c) 1999-2002 Dan Pascu * Copyright (c) 1999-2003 Dan Pascu
* *
* 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
+1 -1
View File
@@ -1,7 +1,7 @@
/* /*
* Window Maker miscelaneous function library * Window Maker miscelaneous function library
* *
* Copyright (c) 1997-2002 Alfredo K. Kojima * Copyright (c) 1997-2003 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
+2 -2
View File
@@ -1,4 +1,4 @@
Makefile Makefile.in Makefile Makefile.in
.psrc .inslog2 tca.map tca.log .psrc .inslog2 tca.map tca.log pchdir *.rpt
*.rpt
*.pot *.pot
*.mo
+3 -1
View File
@@ -4,7 +4,7 @@ CATALOGS = @WINGSMOFILES@
CLEANFILES = $(CATALOGS) WINGs.pot CLEANFILES = $(CATALOGS) WINGs.pot
EXTRA_DIST = cs.po de.po sk.po fr.po EXTRA_DIST = bg.po ca.po cs.po de.po fr.po sk.po
POTFILES = \ POTFILES = \
$(top_builddir)/WINGs/connection.c \ $(top_builddir)/WINGs/connection.c \
@@ -27,6 +27,8 @@ SUFFIXES = .po .mo
msgfmt -o $@ $< msgfmt -o $@ $<
all-local: $(CATALOGS)
WINGs.pot: $(POTFILES) WINGs.pot: $(POTFILES)
xgettext --default-domain=WINGs \ xgettext --default-domain=WINGs \
--add-comments --keyword=_ $(POTFILES) --add-comments --keyword=_ $(POTFILES)
+4 -1
View File
@@ -4,10 +4,13 @@ in the top of the WindowMaker source tree.
File Language Note Current Maintainer File Language Note Current Maintainer
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
ca.po Catalan Ernest Adrogué <eadrogue@gmx.net>
cs.po Czech 1 Jiri Hnidek <Jiri.Hnidek@vslib.cz cs.po Czech 1 Jiri Hnidek <Jiri.Hnidek@vslib.cz
de.po German 1 Guido Scholz <guido.scholz@bayernline.de> de.po German 1 Guido Scholz <guido.scholz@bayernline.de>
sk.po Slovak 1 Jan 'judas' Tomka <judas@linux.sk>
fr.po French Emmanuel Benoit <tseeker@neptune.fr> fr.po French Emmanuel Benoit <tseeker@neptune.fr>
Antoine Hulin <antoine@origan.fdn.org>
sk.po Slovak 1 Jan 'judas' Tomka <judas@linux.sk>
bg.po Bulgarian Anton Zinoviev <zinoviev@debian.org>
Notes Notes
----- -----
+660
View File
@@ -0,0 +1,660 @@
# 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=CP1251\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 öîëà"
+675
View File
@@ -0,0 +1,675 @@
# Catalan messages for WINGs.
# Copyright (C) 2003 Free Software Foundation, Inc.
# This file is distributed under the same license as GNU Window Maker.
# Ernest Adrogué <eadrogue@gmx.net>, 2003.
#
# Version history:
# WM-ver author email date
# 0.80.2 Ernest Adrogué eadrogue@gmx.net 23 Feb 2003
#
msgid ""
msgstr ""
"Project-Id-Version: WINGs 0.80.2\n"
"POT-Creation-Date: 2003-02-23 16:54+0100\n"
"PO-Revision-Date: 2002-12-06 14:15+0100\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=iso-8859-1\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 "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ó d'usuari per 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ó d'usuari per l'usuari %s"
#: ../../WINGs/host.c:114
msgid "Cannot get current host name"
msgstr "No s'ha pogut obtenir el nom de host actual"
#: ../../WINGs/proplist.c:91
#, c-format
msgid "syntax error in %s %s, line %i: %s"
msgstr "error de sintaxi en %s %s, línia %i: %s"
#: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key"
msgstr ""
"Les entrades de diccionari PropList només poden 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 analitzant l'entrada PropList de diccionari"
#: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry"
msgstr "falta un \"=\" a l'entrada de diccionari PropList"
#: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value"
msgstr "error analitzant el valor de l'entrada de diccionari PropList"
#: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry"
msgstr "falta un \";\" en l'entrada de diccionari PropList"
#: ../../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 Window Maker."
#: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1628
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:1618
#, c-format
msgid "error reading from file '%s'"
msgstr "error llegint el fitxer \"%s\""
#: ../../WINGs/proplist.c:1669
#, c-format
msgid "mkstemp (%s) failed"
msgstr "la rutina mkstemp (%s) ha fallat"
#: ../../WINGs/proplist.c:1680
#, c-format
msgid "mktemp (%s) failed"
msgstr "la rutina mktemp (%s) ha fallat"
#: ../../WINGs/proplist.c:1691
#, c-format
msgid "open (%s) failed"
msgstr "la rutina open (%s) ha fallat"
#: ../../WINGs/proplist.c:1698
#, c-format
msgid "writing to file: %s failed"
msgstr "l'escriptura del fitxer \"%s\" ha fallat"
#: ../../WINGs/proplist.c:1706
#, c-format
msgid "fclose (%s) failed"
msgstr "la rutina fclose (%s) ha fallat"
#: ../../WINGs/proplist.c:1715
#, 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:192 ../../WINGs/userdefaults.c:208
#, 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:198 ../../WINGs/wcolor.c:211 ../../WINGs/wcolor.c:250
#: ../../WINGs/wcolor.c:291
#, c-format
msgid "could not allocate %s color"
msgstr "no s'ha pogut assignar espai pel color \"%s\""
#: ../../WINGs/wcolor.c:198
msgid "white"
msgstr "blanc"
#: ../../WINGs/wcolor.c:211
msgid "black"
msgstr "negre"
#: ../../WINGs/wcolor.c:250
msgid "gray"
msgstr "gris"
#: ../../WINGs/wcolor.c:291
msgid "dark gray"
msgstr "gris fosc"
#: ../../WINGs/wcolorpanel.c:415
msgid "Colors"
msgstr "Colors"
#: ../../WINGs/wcolorpanel.c:605 ../../WINGs/wcolorpanel.c:2824
msgid "Brightness"
msgstr "Claror"
#: ../../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 "Panell de color: No s'ha pogut assignar memòria"
#: ../../WINGs/wcolorpanel.c:680 ../../WINGs/wcolorpanel.c:681
msgid "Red"
msgstr "Roig"
#: ../../WINGs/wcolorpanel.c:713 ../../WINGs/wcolorpanel.c:714
msgid "Green"
msgstr "Verd"
#: ../../WINGs/wcolorpanel.c:747 ../../WINGs/wcolorpanel.c:748
msgid "Blue"
msgstr "Blau"
#: ../../WINGs/wcolorpanel.c:807 ../../WINGs/wcolorpanel.c:808
msgid "Cyan"
msgstr "Cian"
#: ../../WINGs/wcolorpanel.c:841 ../../WINGs/wcolorpanel.c:842
msgid "Magenta"
msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:875 ../../WINGs/wcolorpanel.c:876
msgid "Yellow"
msgstr "Groc"
#: ../../WINGs/wcolorpanel.c:910 ../../WINGs/wcolorpanel.c:911
msgid "Black"
msgstr "Negre"
#: ../../WINGs/wcolorpanel.c:991
msgid "Spectrum"
msgstr "Espectre"
#: ../../WINGs/wcolorpanel.c:1021
msgid "Palette"
msgstr "Paleta"
#: ../../WINGs/wcolorpanel.c:1027
msgid "New from File..."
msgstr "Obté d'un fitxer..."
#: ../../WINGs/wcolorpanel.c:1028 ../../WINGs/wcolorpanel.c:1076
#: ../../WINGs/wcolorpanel.c:1093
msgid "Rename..."
msgstr "Reanomena..."
#: ../../WINGs/wcolorpanel.c:1029 ../../WINGs/wcolorpanel.c:1077
#: ../../WINGs/wcolorpanel.c:1094 ../../WINGs/wcolorpanel.c:3321
msgid "Remove"
msgstr "Elimina"
#: ../../WINGs/wcolorpanel.c:1030
msgid "Copy"
msgstr "Copia"
#: ../../WINGs/wcolorpanel.c:1031
msgid "New from Clipboard"
msgstr "Obté del porta-retalls..."
#: ../../WINGs/wcolorpanel.c:1052
msgid "X11-Colors"
msgstr "Colors-X11"
#: ../../WINGs/wcolorpanel.c:1069
msgid "Color"
msgstr "Color"
#: ../../WINGs/wcolorpanel.c:1075
msgid "Add..."
msgstr "Afegeix..."
#: ../../WINGs/wcolorpanel.c:1085
msgid "List"
msgstr "Llista"
#: ../../WINGs/wcolorpanel.c:1092
msgid "New..."
msgstr "Nou..."
#: ../../WINGs/wcolorpanel.c:1231
#, 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:1237 ../../WINGs/wcolorpanel.c:3207
#: ../../WINGs/wcolorpanel.c:3211
msgid "File Error"
msgstr "Error de fitxer"
#: ../../WINGs/wcolorpanel.c:1238
msgid "Could not create ColorPanel configuration directory"
msgstr "No s'ha pogut crear el directori de configuració del Panell de color"
#: ../../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 "D'acord"
#: ../../WINGs/wcolorpanel.c:1245 ../../WINGs/wcolorpanel.c:1281
#: ../../WINGs/wcolorpanel.c:1299
msgid "Color Panel: Could not find file"
msgstr "Panell de color: No s'ha trobat el fitxer"
#: ../../WINGs/wcolorpanel.c:1486 ../../WINGs/wcolorpanel.c:1551
#: ../../WINGs/wcolorpanel.c:1615
msgid "Color Panel: X failed request"
msgstr "Panell de color: petició X fallida"
#: ../../WINGs/wcolorpanel.c:2860
msgid "Saturation"
msgstr "Saturació"
#: ../../WINGs/wcolorpanel.c:2896
msgid "Hue"
msgstr "Matís"
#: ../../WINGs/wcolorpanel.c:3146
msgid "Open Palette"
msgstr "Obrir paleta"
#: ../../WINGs/wcolorpanel.c:3208
msgid "Invalid file format !"
msgstr "El format del fitxer no és vàlid !"
#: ../../WINGs/wcolorpanel.c:3210
#, c-format
msgid "can't remove file %s"
msgstr "no s'ha pogut eliminar el fitxer \"%s\""
#: ../../WINGs/wcolorpanel.c:3212
msgid "Couldn't remove file from Configuration Directory !"
msgstr "No s'ha pogut eliminar el fitxer del directori de configuració !"
#: ../../WINGs/wcolorpanel.c:3239
msgid "Rename"
msgstr "Reanomena"
#: ../../WINGs/wcolorpanel.c:3239
msgid "Rename palette to:"
msgstr "Reanomenar la paleta a:"
#: ../../WINGs/wcolorpanel.c:3240 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:659 ../../WINGs/wfilepanel.c:760
msgid "Cancel"
msgstr "Cancel·la"
#. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3256 ../../WINGs/wfilepanel.c:760
msgid "Warning"
msgstr "Atenció"
#: ../../WINGs/wcolorpanel.c:3257
msgid ""
"Palette already exists !\n"
"\n"
"Overwrite ?"
msgstr ""
"La paleta existeix!\n"
"\n"
"La voleu sobreescriure?"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321
msgid "No"
msgstr "No"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321
msgid "Yes"
msgstr "Sí"
#: ../../WINGs/wcolorpanel.c:3289
#, c-format
msgid "Couldn't rename palette %s to %s\n"
msgstr "No s'ha pogut reanomenar la paleta %s a %s\n"
#: ../../WINGs/wcolorpanel.c:3315
msgid "This will permanently remove the palette "
msgstr "Això eliminarà la paleta per sempre "
#: ../../WINGs/wcolorpanel.c:3318
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:3343
#, c-format
msgid "Couldn't remove palette %s\n"
msgstr "No s'ha pogut eliminar la paleta %s\n"
#: ../../WINGs/wcolorpanel.c:3648
#, c-format
msgid "Could not open %s"
msgstr "No s'ha pogut obrir %s"
#: ../../WINGs/wcolorpanel.c:3655
#, c-format
msgid "Could not create %s"
msgstr "No s'ha pogut crear %s"
#: ../../WINGs/wcolorpanel.c:3666
#, c-format
msgid "Write error on file %s"
msgstr "Error d'escriptura en el fitxer %s"
#: ../../WINGs/wcolorpanel.c:3711
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:562
#, c-format
msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: no s'ha pogut obrir el directori %s\n"
#: ../../WINGs/wfilepanel.c:580
#, c-format
msgid "WINGs: could not stat %s\n"
msgstr "WINGs: no s'ha pogut determinar l'estat de %s\n"
#: ../../WINGs/wfilepanel.c:647 ../../WINGs/wfilepanel.c:970
#: ../../WINGs/wfontpanel.c:708
msgid "Error"
msgstr "Error"
#: ../../WINGs/wfilepanel.c:658
msgid "Create Directory"
msgstr "Crear directori"
#: ../../WINGs/wfilepanel.c:659
msgid "Enter directory name"
msgstr "Entreu el nom del directori"
#: ../../WINGs/wfilepanel.c:695 ../../WINGs/wfilepanel.c:734
#: ../../WINGs/wfilepanel.c:765 ../../WINGs/wfilepanel.c:793
msgid "Permission denied."
msgstr "Permís denegat."
#: ../../WINGs/wfilepanel.c:698
#, c-format
msgid "'%s' already exists."
msgstr "\"%s\" existia prèviament."
#: ../../WINGs/wfilepanel.c:701
msgid "Path does not exist."
msgstr "El camí no existeix."
#: ../../WINGs/wfilepanel.c:731 ../../WINGs/wfilepanel.c:790
#, c-format
msgid "'%s' does not exist."
msgstr "\"%s\" no existeix."
#: ../../WINGs/wfilepanel.c:738 ../../WINGs/wfilepanel.c:797
msgid "Insufficient memory available."
msgstr "No hi ha prou memòria disponible."
#: ../../WINGs/wfilepanel.c:742 ../../WINGs/wfilepanel.c:801
#, 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:745 ../../WINGs/wfilepanel.c:777
#: ../../WINGs/wfilepanel.c:804
#, c-format
msgid "Can not delete '%s'."
msgstr "No s'ha pogut eliminar \"%s\"."
#: ../../WINGs/wfilepanel.c:752
#, c-format
msgid "Delete directory %s ?"
msgstr "Eliminar el directori %s ?"
#: ../../WINGs/wfilepanel.c:756
#, c-format
msgid "Delete file %s ?"
msgstr "Eliminar el fitxer %s ?"
#: ../../WINGs/wfilepanel.c:768
#, c-format
msgid "Directory '%s' does not exist."
msgstr "El directori \"%s\" no existeix."
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Directory '%s' is not empty."
msgstr "El directori \"%s\" no està buit."
#: ../../WINGs/wfilepanel.c:774
#, c-format
msgid "Directory '%s' is busy."
msgstr "El directori \"%s\" es troba ocupat."
#: ../../WINGs/wfilepanel.c:787
#, c-format
msgid "'%s' is a directory."
msgstr "\"%s\" és un directori."
#: ../../WINGs/wfilepanel.c:829
#, c-format
msgid "An error occured browsing '%s'."
msgstr "S'ha produït un error mentre s'explorava \"%s\"."
#: ../../WINGs/wfilepanel.c:833
#, c-format
msgid "'%s' is not a directory."
msgstr "\"%s\" no és un directori."
#: ../../WINGs/wfilepanel.c:970
msgid "File does not exist."
msgstr "El fitxer no existeix."
#: ../../WINGs/wfont.c:129
#, 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:136
#, 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."
#: ../../WINGs/wfont.c:300 ../../WINGs/wfont.c:336
#, c-format
msgid "could not load font set %s. Trying fixed."
msgstr "no s'ha pogut carregar el tipus de lletra %s. Provant amb \"fixed\"."
#: ../../WINGs/wfont.c:306 ../../WINGs/wfont.c:342
#, c-format
msgid "could not load font %s. Trying fixed."
msgstr "no s'ha pogut carregar el tipus de lletra %s. Provant amb \"fixed\"."
#: ../../WINGs/wfont.c:310 ../../WINGs/wfont.c:346
msgid "could not load fixed font!"
msgstr "no s'ha pogut carregar el tipus de lletra \"fixed\" !"
#: ../../WINGs/wfont.c:441
#, c-format
msgid "font description %s is too large."
msgstr "la descripció de tipus de lletra %s és massa gran."
#: ../../WINGs/wfontpanel.c:205
msgid "Test!!!"
msgstr "Prova!!!"
#: ../../WINGs/wfontpanel.c:211
msgid "Family"
msgstr "Familia"
#: ../../WINGs/wfontpanel.c:222
msgid "Typeface"
msgstr "Fosa"
#: ../../WINGs/wfontpanel.c:233
msgid "Size"
msgstr "Mida"
#: ../../WINGs/wfontpanel.c:252
msgid "Set"
msgstr "Conjunt"
#: ../../WINGs/wfontpanel.c:257
msgid "Revert"
msgstr "Torna"
#: ../../WINGs/wfontpanel.c:709
msgid "Could not retrieve font list"
msgstr "No s'ha pogut obtenir la llista de tipus de lletra"
#: ../../WINGs/wfontpanel.c:721
#, 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:868
msgid "Roman"
msgstr "Romana"
#: ../../WINGs/wfontpanel.c:871
msgid "Italic"
msgstr "Itàlica"
#: ../../WINGs/wfontpanel.c:873
msgid "Oblique"
msgstr "Obliqua"
#: ../../WINGs/wfontpanel.c:875
msgid "Rev Italic"
msgstr "Itàlica rev"
#: ../../WINGs/wfontpanel.c:877
msgid "Rev Oblique"
msgstr "Obliqua rev"
#: ../../WINGs/wfontpanel.c:883
msgid "Normal"
msgstr "Normal"
#: ../../WINGs/widgets.c:415
#, c-format
msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: no s'ha pogut carregar el fitxer d'imatges dels elements: %s"
#: ../../WINGs/widgets.c:763
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 l'instal·lació dels tipus "
"de lletra i la configuració del local és adquada."
#: ../../WINGs/wruler.c:189
msgid "0 inches"
msgstr "0 polzades"
+272 -205
View File
@@ -3,11 +3,10 @@
# Copyright (C) YEAR Free Software Foundation, Inc. # Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WINGs 0.80.0\n" "Project-Id-Version: WINGs 0.80.0\n"
"POT-Creation-Date: 2002-01-09 21:06+0100\n" "POT-Creation-Date: 2003-05-02 15:39+0200\n"
"PO-Revision-Date: 2002-01-09 21:20+0100\n" "PO-Revision-Date: 2002-01-09 21:20+0100\n"
"Last-Translator: Emmanuel Benoit <tseeker@neptune.fr>\n" "Last-Translator: Emmanuel Benoit <tseeker@neptune.fr>\n"
"Language-Team: Français <fr@li.org>\n" "Language-Team: Français <fr@li.org>\n"
@@ -15,10 +14,10 @@ msgstr ""
"Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: unknown\n" "Content-Transfer-Encoding: unknown\n"
#: ../../WINGs/connection.c:461 ../../WINGs/connection.c:526 #: ../../WINGs/connection.c:467 ../../WINGs/connection.c:532
#: ../../WINGs/connection.c:569 #: ../../WINGs/connection.c:575
msgid "Bad address-service-protocol combination" msgid "Bad address-service-protocol combination"
msgstr "Mauvaise combinaison Adresse-Service-Protocole" msgstr "Mauvaise combinaison adresse-service-protocole"
#: ../../WINGs/error.c:54 #: ../../WINGs/error.c:54
#, c-format #, c-format
@@ -32,42 +31,49 @@ msgstr "Erreur %d"
#: ../../WINGs/error.c:110 #: ../../WINGs/error.c:110
msgid " warning: " msgid " warning: "
msgstr " Avertissement: " msgstr " Avertissement : "
#: ../../WINGs/error.c:137 #: ../../WINGs/error.c:137
msgid " fatal error: " msgid " fatal error: "
msgstr " erreur fatale: " msgstr " erreur fatale : "
#: ../../WINGs/error.c:163 ../../WINGs/error.c:192 #: ../../WINGs/error.c:163 ../../WINGs/error.c:192
msgid " error: " msgid " error: "
msgstr " erreur: " msgstr " erreur : "
#: ../../WINGs/findfile.c:48 #: ../../WINGs/findfile.c:48
#, c-format #, c-format
msgid "could not get password entry for UID %i" msgid "could not get password entry for UID %i"
msgstr "Impossible de lire l'entrée password pour l'UID %i" msgstr "Impossible de lire le mot de passe de l'UID %i"
#: ../../WINGs/findfile.c:66 #: ../../WINGs/findfile.c:66
#, c-format #, c-format
msgid "could not get password entry for user %s" msgid "could not get password entry for user %s"
msgstr "Impossible de lire l'entrée password pour l'utilisateur %s" msgstr "Impossible de lire le mot de passe de l'utilisateur %i"
#: ../../WINGs/host.c:114 #: ../../WINGs/host.c:114
msgid "Cannot get current host name" msgid "Cannot get current host name"
msgstr "Impossible de déterminer le nom de machine actuel" 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 #: ../../WINGs/proplist.c:150
msgid "Only string or data is supported for a proplist dictionary key" msgid "Only string or data is supported for a proplist dictionary key"
msgstr "" msgstr ""
"Seuls string ou data sont supportés pour une clée de dictionnaire proplist" "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:184 ../../WINGs/proplist.c:236
#: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474 #: ../../WINGs/proplist.c:394 ../../WINGs/proplist.c:474
#: ../../WINGs/proplist.c:1071 ../../WINGs/proplist.c:1123 #: ../../WINGs/proplist.c:1075 ../../WINGs/proplist.c:1127
#: ../../WINGs/proplist.c:1289 ../../WINGs/proplist.c:1368 #: ../../WINGs/proplist.c:1293 ../../WINGs/proplist.c:1372
#: ../../WINGs/proplist.c:1489 ../../WINGs/proplist.c:1536 #: ../../WINGs/proplist.c:1493 ../../WINGs/proplist.c:1540
msgid "Used proplist functions on non-WMPropLists objects" msgid "Used proplist functions on non-WMPropLists objects"
msgstr "Une fonction proplist a été utilisée sur des objets non-WMPropList" msgstr "Une fonction Proplist a été utilisée sur des objets non-WMPropList"
#: ../../WINGs/proplist.c:630 #: ../../WINGs/proplist.c:630
msgid "unterminated PropList string" msgid "unterminated PropList string"
@@ -81,52 +87,52 @@ msgstr "donn
msgid "unterminated PropList data (missing hexdigit)" msgid "unterminated PropList data (missing hexdigit)"
msgstr "données PropList sans fin (il manque un chiffre hexadécimal)" msgstr "données PropList sans fin (il manque un chiffre hexadécimal)"
#: ../../WINGs/proplist.c:690 #: ../../WINGs/proplist.c:690 ../../WINGs/proplist.c:695
msgid "non hexdigit character in PropList data" msgid "non hexdigit character in PropList data"
msgstr "caractère non-hexadécimal dans les données PropList" msgstr "caractère non-hexadécimal dans les données PropList"
#: ../../WINGs/proplist.c:725 #: ../../WINGs/proplist.c:729
msgid "unterminated PropList array" msgid "unterminated PropList array"
msgstr "tableau PropList sans fin" msgstr "tableau PropList sans fin"
#: ../../WINGs/proplist.c:733 #: ../../WINGs/proplist.c:737
msgid "missing or unterminated PropList array" msgid "missing or unterminated PropList array"
msgstr "tableau PropList manquant ou sans fin" msgstr "tableau PropList manquant ou sans fin"
#: ../../WINGs/proplist.c:743 #: ../../WINGs/proplist.c:747
msgid "could not get PropList array element" msgid "could not get PropList array element"
msgstr "impossible de lire l'élément du tableau PropList" msgstr "impossible de lire l'élément du tableau PropList"
#: ../../WINGs/proplist.c:772 #: ../../WINGs/proplist.c:776
msgid "unterminated PropList dictionary" msgid "unterminated PropList dictionary"
msgstr "dictionnaire PropList sans fin" msgstr "dictionnaire PropList sans fin"
#: ../../WINGs/proplist.c:789 #: ../../WINGs/proplist.c:793
msgid "missing PropList dictionary key" msgid "missing PropList dictionary key"
msgstr "clef du dictionnaire PropList manquante" msgstr "clef du dictionnaire PropList manquante"
#: ../../WINGs/proplist.c:791 #: ../../WINGs/proplist.c:795
msgid "missing PropList dictionary entry key or unterminated dictionary" msgid "missing PropList dictionary entry key or unterminated dictionary"
msgstr "clef du dictionnaire PropList manquante ou dictionnaire sans fin" msgstr "clef du dictionnaire PropList manquante ou dictionnaire sans fin"
#: ../../WINGs/proplist.c:799 #: ../../WINGs/proplist.c:803
msgid "error parsing PropList dictionary key" msgid "error parsing PropList dictionary key"
msgstr "erreur lors de l'analyse de la clef de dictionnaire PropList" msgstr "erreur lors de l'analyse de la clef de dictionnaire PropList"
#: ../../WINGs/proplist.c:807 #: ../../WINGs/proplist.c:811
msgid "missing = in PropList dictionary entry" msgid "missing = in PropList dictionary entry"
msgstr "signe '=' manquant dans l'entrée du dictionnaire PropList" msgstr "signe '=' manquant dans l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:815 #: ../../WINGs/proplist.c:819
msgid "error parsing PropList dictionary entry value" msgid "error parsing PropList dictionary entry value"
msgstr "" msgstr ""
"erreur lors de l'analyse de la valeur de l'entrée du dictionnaire PropList" "erreur lors de l'analyse de la valeur de l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:823 #: ../../WINGs/proplist.c:827
msgid "missing ; in PropList dictionary entry" msgid "missing ; in PropList dictionary entry"
msgstr "signe ';' manquant dans l'entrée du dictionnaire PropList" msgstr "signe ';' manquant dans l'entrée du dictionnaire PropList"
#: ../../WINGs/proplist.c:884 #: ../../WINGs/proplist.c:888
msgid "" msgid ""
"was expecting a string, data, array or dictionary. If it's a string, try " "was expecting a string, data, array or dictionary. If it's a string, try "
"enclosing it with \"." "enclosing it with \"."
@@ -134,264 +140,264 @@ msgstr ""
"une chaine, des données, un tableau ou un dictionnaire étaient attendus. " "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 à '\"'." "S'il s'agit d'une chaîne, essayez de la délimiter grâce à '\"'."
#: ../../WINGs/proplist.c:888 #: ../../WINGs/proplist.c:892
msgid "Comments are not allowed inside WindowMaker owned domain files." msgid "Comments are not allowed inside WindowMaker owned domain files."
msgstr "" msgstr ""
"Les commentaires ne sont pas autorisés dans les fichiers appartenant au" "Les commentaires ne sont pas autorisés dans les fichiers appartenant au "
"domaine de WindowMaker." "domaine de Window Maker."
#: ../../WINGs/proplist.c:1559 ../../WINGs/proplist.c:1624 #: ../../WINGs/proplist.c:1563 ../../WINGs/proplist.c:1628
msgid "extra data after end of property list" msgid "extra data after end of property list"
msgstr "données excédentaires après la fin de la liste de propriétés" msgstr "données excédentaires après la fin de la liste de propriétés"
#: ../../WINGs/proplist.c:1602 #: ../../WINGs/proplist.c:1606
#, c-format #, c-format
msgid "could not get size for file '%s'" msgid "could not get size for file '%s'"
msgstr "impossible de déterminer la taille du fichier '%s'" msgstr "impossible de déterminer la taille du fichier '%s'"
#: ../../WINGs/proplist.c:1614 #: ../../WINGs/proplist.c:1618
#, c-format #, c-format
msgid "error reading from file '%s'" msgid "error reading from file '%s'"
msgstr "erreur pendant la lecture du fichier '%s'" msgstr "erreur pendant la lecture du fichier '%s'"
#: ../../WINGs/proplist.c:1665 #: ../../WINGs/proplist.c:1669
#, c-format #, c-format
msgid "mkstemp (%s) failed" msgid "mkstemp (%s) failed"
msgstr "mkstemp (%s) a échoué" msgstr "mkstemp (%s) a échoué"
#: ../../WINGs/proplist.c:1676 #: ../../WINGs/proplist.c:1680
#, c-format #, c-format
msgid "mktemp (%s) failed" msgid "mktemp (%s) failed"
msgstr "mktemp (%s) a échoué" msgstr "mktemp (%s) a échoué"
#: ../../WINGs/proplist.c:1687 #: ../../WINGs/proplist.c:1691
#, c-format #, c-format
msgid "open (%s) failed" msgid "open (%s) failed"
msgstr "open (%s) a échoué" msgstr "open (%s) a échoué"
#: ../../WINGs/proplist.c:1694 #: ../../WINGs/proplist.c:1698
#, c-format #, c-format
msgid "writing to file: %s failed" msgid "writing to file: %s failed"
msgstr "erreur pendant l'écriture dans le fichier '%s'" msgstr "erreur pendant l'écriture dans le fichier '%s'"
#: ../../WINGs/proplist.c:1702 #: ../../WINGs/proplist.c:1706
#, c-format #, c-format
msgid "fclose (%s) failed" msgid "fclose (%s) failed"
msgstr "erreur lors de la fermeture du fichier '%s'" msgstr "erreur lors de la fermeture du fichier '%s'"
#: ../../WINGs/proplist.c:1711 #: ../../WINGs/proplist.c:1715
#, c-format #, c-format
msgid "rename ('%s' to '%s') failed" msgid "rename ('%s' to '%s') failed"
msgstr "impossible de renommer '%s' en '%s'" msgstr "impossible de renommer '%s' en '%s'"
#. something happened with the file. just overwrite it #. something happened with the file. just overwrite it
#: ../../WINGs/userdefaults.c:192 ../../WINGs/userdefaults.c:208 #: ../../WINGs/userdefaults.c:188 ../../WINGs/userdefaults.c:204
#, c-format #, c-format
msgid "cannot read domain from file '%s' when syncing" msgid "cannot read domain from file '%s' when syncing"
msgstr "" msgstr ""
"impossible de lire le domaine depuis le fichier '%s' pendant la " "impossible de lire le domaine depuis le fichier '%s' pendant la "
"synchronisation" "synchronisation"
#: ../../WINGs/wcolor.c:198 ../../WINGs/wcolor.c:211 ../../WINGs/wcolor.c:250 #: ../../WINGs/wcolor.c:224 ../../WINGs/wcolor.c:236 ../../WINGs/wcolor.c:275
#: ../../WINGs/wcolor.c:291 #: ../../WINGs/wcolor.c:316
#, c-format #, c-format
msgid "could not allocate %s color" msgid "could not allocate %s color"
msgstr "impossible d'allouer la couleur %s" msgstr "impossible d'allouer la couleur %s"
#: ../../WINGs/wcolor.c:198 #: ../../WINGs/wcolor.c:224
msgid "white" msgid "white"
msgstr "blanc" msgstr "blanc"
#: ../../WINGs/wcolor.c:211 #: ../../WINGs/wcolor.c:236
msgid "black" msgid "black"
msgstr "noir" msgstr "noir"
#: ../../WINGs/wcolor.c:250 #: ../../WINGs/wcolor.c:275
msgid "gray" msgid "gray"
msgstr "gris" msgstr "gris"
#: ../../WINGs/wcolor.c:291 #: ../../WINGs/wcolor.c:316
msgid "dark gray" msgid "dark gray"
msgstr "gris sombre" msgstr "gris sombre"
#: ../../WINGs/wcolorpanel.c:415 #: ../../WINGs/wcolorpanel.c:420
msgid "Colors" msgid "Colors"
msgstr "Couleurs" msgstr "Couleurs"
#: ../../WINGs/wcolorpanel.c:605 ../../WINGs/wcolorpanel.c:2824 #: ../../WINGs/wcolorpanel.c:610 ../../WINGs/wcolorpanel.c:2829
msgid "Brightness" msgid "Brightness"
msgstr "Luminosité" msgstr "Luminosité"
#: ../../WINGs/wcolorpanel.c:607 ../../WINGs/wcolorpanel.c:683 #: ../../WINGs/wcolorpanel.c:612 ../../WINGs/wcolorpanel.c:688
#: ../../WINGs/wcolorpanel.c:716 ../../WINGs/wcolorpanel.c:750 #: ../../WINGs/wcolorpanel.c:721 ../../WINGs/wcolorpanel.c:755
#: ../../WINGs/wcolorpanel.c:810 ../../WINGs/wcolorpanel.c:844 #: ../../WINGs/wcolorpanel.c:815 ../../WINGs/wcolorpanel.c:849
#: ../../WINGs/wcolorpanel.c:878 ../../WINGs/wcolorpanel.c:913 #: ../../WINGs/wcolorpanel.c:883 ../../WINGs/wcolorpanel.c:918
#: ../../WINGs/wcolorpanel.c:2164 ../../WINGs/wcolorpanel.c:2826 #: ../../WINGs/wcolorpanel.c:2169 ../../WINGs/wcolorpanel.c:2831
#: ../../WINGs/wcolorpanel.c:2862 ../../WINGs/wcolorpanel.c:2898 #: ../../WINGs/wcolorpanel.c:2867 ../../WINGs/wcolorpanel.c:2903
#: ../../WINGs/wcolorpanel.c:3746 #: ../../WINGs/wcolorpanel.c:3745
msgid "Color Panel: Could not allocate memory" msgid "Color Panel: Could not allocate memory"
msgstr "Panneau de Sélection des Couleur: impossible d'allouer la mémoire" msgstr "Panneau de Sélection des Couleur: impossible d'allouer la mémoire"
#: ../../WINGs/wcolorpanel.c:680 ../../WINGs/wcolorpanel.c:681 #: ../../WINGs/wcolorpanel.c:685 ../../WINGs/wcolorpanel.c:686
msgid "Red" msgid "Red"
msgstr "Rouge" msgstr "Rouge"
#: ../../WINGs/wcolorpanel.c:713 ../../WINGs/wcolorpanel.c:714 #: ../../WINGs/wcolorpanel.c:718 ../../WINGs/wcolorpanel.c:719
msgid "Green" msgid "Green"
msgstr "Vert" msgstr "Vert"
#: ../../WINGs/wcolorpanel.c:747 ../../WINGs/wcolorpanel.c:748 #: ../../WINGs/wcolorpanel.c:752 ../../WINGs/wcolorpanel.c:753
msgid "Blue" msgid "Blue"
msgstr "Bleu" msgstr "Bleu"
#: ../../WINGs/wcolorpanel.c:807 ../../WINGs/wcolorpanel.c:808 #: ../../WINGs/wcolorpanel.c:812 ../../WINGs/wcolorpanel.c:813
msgid "Cyan" msgid "Cyan"
msgstr "" msgstr "Cyan"
#: ../../WINGs/wcolorpanel.c:841 ../../WINGs/wcolorpanel.c:842 #: ../../WINGs/wcolorpanel.c:846 ../../WINGs/wcolorpanel.c:847
msgid "Magenta" msgid "Magenta"
msgstr "" msgstr "Magenta"
#: ../../WINGs/wcolorpanel.c:875 ../../WINGs/wcolorpanel.c:876 #: ../../WINGs/wcolorpanel.c:880 ../../WINGs/wcolorpanel.c:881
msgid "Yellow" msgid "Yellow"
msgstr "Jaune" msgstr "Jaune"
#: ../../WINGs/wcolorpanel.c:910 ../../WINGs/wcolorpanel.c:911 #: ../../WINGs/wcolorpanel.c:915 ../../WINGs/wcolorpanel.c:916
msgid "Black" msgid "Black"
msgstr "Noir" msgstr "Noir"
#: ../../WINGs/wcolorpanel.c:991 #: ../../WINGs/wcolorpanel.c:996
msgid "Spectrum" msgid "Spectrum"
msgstr "Spectre" msgstr "Spectre"
#: ../../WINGs/wcolorpanel.c:1021 #: ../../WINGs/wcolorpanel.c:1026
msgid "Palette" msgid "Palette"
msgstr "" msgstr "Palette"
#: ../../WINGs/wcolorpanel.c:1027 #: ../../WINGs/wcolorpanel.c:1032
msgid "New from File..." msgid "New from File..."
msgstr "Nouveau d'après le fichier..." msgstr "Nouveau d'après le fichier..."
#: ../../WINGs/wcolorpanel.c:1028 ../../WINGs/wcolorpanel.c:1076 #: ../../WINGs/wcolorpanel.c:1033 ../../WINGs/wcolorpanel.c:1081
#: ../../WINGs/wcolorpanel.c:1093 #: ../../WINGs/wcolorpanel.c:1098
msgid "Rename..." msgid "Rename..."
msgstr "Renommer..." msgstr "Renommer..."
#: ../../WINGs/wcolorpanel.c:1029 ../../WINGs/wcolorpanel.c:1077 #: ../../WINGs/wcolorpanel.c:1034 ../../WINGs/wcolorpanel.c:1082
#: ../../WINGs/wcolorpanel.c:1094 ../../WINGs/wcolorpanel.c:3321 #: ../../WINGs/wcolorpanel.c:1099 ../../WINGs/wcolorpanel.c:3326
msgid "Remove" msgid "Remove"
msgstr "Supprimer" msgstr "Supprimer"
#: ../../WINGs/wcolorpanel.c:1030 #: ../../WINGs/wcolorpanel.c:1035
msgid "Copy" msgid "Copy"
msgstr "Copier" msgstr "Copier"
#: ../../WINGs/wcolorpanel.c:1031 #: ../../WINGs/wcolorpanel.c:1036
msgid "New from Clipboard" msgid "New from Clipboard"
msgstr "Nouveau d'après le Presse-Papier" msgstr "Nouveau d'après le presse-papier"
#: ../../WINGs/wcolorpanel.c:1052 #: ../../WINGs/wcolorpanel.c:1057
msgid "X11-Colors" msgid "X11-Colors"
msgstr "Couleurs X11" msgstr "Couleurs X11"
#: ../../WINGs/wcolorpanel.c:1069 #: ../../WINGs/wcolorpanel.c:1074
msgid "Color" msgid "Color"
msgstr "Couleur" msgstr "Couleur"
#: ../../WINGs/wcolorpanel.c:1075 #: ../../WINGs/wcolorpanel.c:1080
msgid "Add..." msgid "Add..."
msgstr "Ajouter..." msgstr "Ajouter..."
#: ../../WINGs/wcolorpanel.c:1085 #: ../../WINGs/wcolorpanel.c:1090
msgid "List" msgid "List"
msgstr "Liste" msgstr "Liste"
#: ../../WINGs/wcolorpanel.c:1092 #: ../../WINGs/wcolorpanel.c:1097
msgid "New..." msgid "New..."
msgstr "Nouveau..." msgstr "Nouveau..."
#: ../../WINGs/wcolorpanel.c:1231 #: ../../WINGs/wcolorpanel.c:1236
#, c-format #, c-format
msgid "" msgid ""
"Color Panel: Could not create directory %s needed to store configurations" "Color Panel: Could not create directory %s needed to store configurations"
msgstr "" msgstr ""
"Panneau de Sélection des Couleurs: impossible de créer le répertoire %s " "Panneau de sélection des couleurs : impossible de créer le répertoire %s "
"requis pour enregistrer les configurations" "requis pour enregistrer les configurations."
#. Delete the file, it doesn't belong here #. Delete the file, it doesn't belong here
#: ../../WINGs/wcolorpanel.c:1237 ../../WINGs/wcolorpanel.c:3207 #: ../../WINGs/wcolorpanel.c:1242 ../../WINGs/wcolorpanel.c:3212
#: ../../WINGs/wcolorpanel.c:3211 #: ../../WINGs/wcolorpanel.c:3216
msgid "File Error" msgid "File Error"
msgstr "Erreur de fichier" msgstr "Erreur de fichier"
#: ../../WINGs/wcolorpanel.c:1238 #: ../../WINGs/wcolorpanel.c:1243
msgid "Could not create ColorPanel configuration directory" msgid "Could not create ColorPanel configuration directory"
msgstr "" msgstr ""
"Impossible de créer le répertoire de configuration pour le Panneau " "Impossible de créer le répertoire pour la configuration du panneau de "
"de configuration des couleurs" "sélection des couleurs."
#: ../../WINGs/wcolorpanel.c:1239 ../../WINGs/wcolorpanel.c:3208 #: ../../WINGs/wcolorpanel.c:1244 ../../WINGs/wcolorpanel.c:3213
#: ../../WINGs/wcolorpanel.c:3213 ../../WINGs/wcolorpanel.c:3240 #: ../../WINGs/wcolorpanel.c:3218 ../../WINGs/wcolorpanel.c:3245
#: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:647 #: ../../WINGs/wfilepanel.c:250 ../../WINGs/wfilepanel.c:650
#: ../../WINGs/wfilepanel.c:659 ../../WINGs/wfilepanel.c:760 #: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
#: ../../WINGs/wfilepanel.c:971 ../../WINGs/wfontpanel.c:709 #: ../../WINGs/wfilepanel.c:974 ../../WINGs/wfontpanel.c:751
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
#: ../../WINGs/wcolorpanel.c:1245 ../../WINGs/wcolorpanel.c:1281 #: ../../WINGs/wcolorpanel.c:1250 ../../WINGs/wcolorpanel.c:1286
#: ../../WINGs/wcolorpanel.c:1299 #: ../../WINGs/wcolorpanel.c:1304
msgid "Color Panel: Could not find file" msgid "Color Panel: Could not find file"
msgstr "Panneau de Sélection des Couleurs: Impossible de trouver le fichier" msgstr "Panneau de sélection des couleurs : Impossible de trouver le fichier."
#: ../../WINGs/wcolorpanel.c:1486 ../../WINGs/wcolorpanel.c:1551 #: ../../WINGs/wcolorpanel.c:1491 ../../WINGs/wcolorpanel.c:1556
#: ../../WINGs/wcolorpanel.c:1615 #: ../../WINGs/wcolorpanel.c:1620
msgid "Color Panel: X failed request" msgid "Color Panel: X failed request"
msgstr "Panneau de Sélection des Couleurs: échec d'une requête X" msgstr "Panneau de sélection des couleurs : échec d'une requête X"
#: ../../WINGs/wcolorpanel.c:2860 #: ../../WINGs/wcolorpanel.c:2865
msgid "Saturation" msgid "Saturation"
msgstr "" msgstr "Saturation"
#: ../../WINGs/wcolorpanel.c:2896 #: ../../WINGs/wcolorpanel.c:2901
msgid "Hue" msgid "Hue"
msgstr "Teinte" msgstr "Teinte"
#: ../../WINGs/wcolorpanel.c:3146 #: ../../WINGs/wcolorpanel.c:3151
msgid "Open Palette" msgid "Open Palette"
msgstr "Ouvrir une palette" msgstr "Ouvrir une palette"
#: ../../WINGs/wcolorpanel.c:3208 #: ../../WINGs/wcolorpanel.c:3213
msgid "Invalid file format !" msgid "Invalid file format !"
msgstr "Format de fichier invalide!" msgstr "Format de fichier invalide !"
#: ../../WINGs/wcolorpanel.c:3210 #: ../../WINGs/wcolorpanel.c:3215
#, c-format #, c-format
msgid "can't remove file %s" msgid "can't remove file %s"
msgstr "impossible de supprimer le fichier %s" msgstr "Impossible de supprimer le fichier %s."
#: ../../WINGs/wcolorpanel.c:3212 #: ../../WINGs/wcolorpanel.c:3217
msgid "Couldn't remove file from Configuration Directory !" msgid "Couldn't remove file from Configuration Directory !"
msgstr "Impossible de supprimer le fichier du répertoire de configuration !" msgstr "Impossible de supprimer le fichier du répertoire de configuration !"
#: ../../WINGs/wcolorpanel.c:3239 #: ../../WINGs/wcolorpanel.c:3244
msgid "Rename" msgid "Rename"
msgstr "Renommer" msgstr "Renommer"
#: ../../WINGs/wcolorpanel.c:3239 #: ../../WINGs/wcolorpanel.c:3244
msgid "Rename palette to:" msgid "Rename palette to:"
msgstr "Renommer la palette en :" msgstr "Renommer la palette en :"
#: ../../WINGs/wcolorpanel.c:3240 ../../WINGs/wfilepanel.c:259 #: ../../WINGs/wcolorpanel.c:3245 ../../WINGs/wfilepanel.c:259
#: ../../WINGs/wfilepanel.c:659 ../../WINGs/wfilepanel.c:760 #: ../../WINGs/wfilepanel.c:662 ../../WINGs/wfilepanel.c:763
msgid "Cancel" msgid "Cancel"
msgstr "Annuler" msgstr "Annuler"
#. Careful, this palette exists already #. Careful, this palette exists already
#: ../../WINGs/wcolorpanel.c:3256 ../../WINGs/wfilepanel.c:760 #: ../../WINGs/wcolorpanel.c:3261 ../../WINGs/wfilepanel.c:763
msgid "Warning" msgid "Warning"
msgstr "Avertissement" msgstr "Avertissement"
#: ../../WINGs/wcolorpanel.c:3257 #: ../../WINGs/wcolorpanel.c:3262
msgid "" msgid ""
"Palette already exists !\n" "Palette already exists !\n"
"\n" "\n"
@@ -401,24 +407,24 @@ msgstr ""
"\n" "\n"
"Écraser ?" "Écraser ?"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321 #: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "No" msgid "No"
msgstr "Non" msgstr "Non"
#: ../../WINGs/wcolorpanel.c:3257 ../../WINGs/wcolorpanel.c:3321 #: ../../WINGs/wcolorpanel.c:3262 ../../WINGs/wcolorpanel.c:3326
msgid "Yes" msgid "Yes"
msgstr "Oui" msgstr "Oui"
#: ../../WINGs/wcolorpanel.c:3289 #: ../../WINGs/wcolorpanel.c:3294
#, c-format #, c-format
msgid "Couldn't rename palette %s to %s\n" msgid "Couldn't rename palette %s to %s\n"
msgstr "Impossible de renommer la palette %s en %s\n" msgstr "Impossible de renommer la palette %s en %s.\n"
#: ../../WINGs/wcolorpanel.c:3315 #: ../../WINGs/wcolorpanel.c:3320
msgid "This will permanently remove the palette " msgid "This will permanently remove the palette "
msgstr "Cela va détruire la palette irrécupérablement " msgstr "Ceci détruira définitivement la palette "
#: ../../WINGs/wcolorpanel.c:3318 #: ../../WINGs/wcolorpanel.c:3323
msgid "" msgid ""
".\n" ".\n"
"\n" "\n"
@@ -426,31 +432,31 @@ msgid ""
msgstr "" msgstr ""
".\n" ".\n"
"\n" "\n"
"Êtes-vous sur de vouloir supprimer cette palette ?" "Êtes-vous sûr de vouloir supprimer cette palette ?"
#: ../../WINGs/wcolorpanel.c:3343 #: ../../WINGs/wcolorpanel.c:3348
#, c-format #, c-format
msgid "Couldn't remove palette %s\n" msgid "Couldn't remove palette %s\n"
msgstr "Impossible de détruire la palette %s\n" msgstr "Impossible de détruire la palette %s.\n"
#: ../../WINGs/wcolorpanel.c:3648 #: ../../WINGs/wcolorpanel.c:3647
#, c-format #, c-format
msgid "Could not open %s" msgid "Could not open %s"
msgstr "Impossible d'ouvrir %s" msgstr "Impossible d'ouvrir %s."
#: ../../WINGs/wcolorpanel.c:3655 #: ../../WINGs/wcolorpanel.c:3654
#, c-format #, c-format
msgid "Could not create %s" msgid "Could not create %s"
msgstr "Impossible de créer %s" msgstr "Impossible de créer %s."
#: ../../WINGs/wcolorpanel.c:3666 #: ../../WINGs/wcolorpanel.c:3665
#, c-format #, c-format
msgid "Write error on file %s" msgid "Write error on file %s"
msgstr "Erreur d'écriture dans le fichier %s" msgstr "Erreur d'écriture dans le fichier %s."
#: ../../WINGs/wcolorpanel.c:3711 #: ../../WINGs/wcolorpanel.c:3710
msgid "Color Panel: Color unspecified" msgid "Color Panel: Color unspecified"
msgstr "Panneau de Sélection des Couleurs: couleur non spécifiée" msgstr "Panneau de sélection des couleurs: couleur non spécifiée."
#: ../../WINGs/wfilepanel.c:235 #: ../../WINGs/wfilepanel.c:235
msgid "Name:" msgid "Name:"
@@ -462,211 +468,272 @@ msgstr "Ouvrir"
#: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402 #: ../../WINGs/wfilepanel.c:350 ../../WINGs/wfilepanel.c:402
msgid "Save" msgid "Save"
msgstr "Sauvegarder" msgstr "Enregistrer"
#: ../../WINGs/wfilepanel.c:562 #: ../../WINGs/wfilepanel.c:565
#, c-format #, c-format
msgid "WINGs: could not open directory %s\n" msgid "WINGs: could not open directory %s\n"
msgstr "WINGs: Impossible d'ouvrir le répertoire %s\n" msgstr "WINGs : Impossible d'ouvrir le répertoire %s.\n"
#: ../../WINGs/wfilepanel.c:580 #: ../../WINGs/wfilepanel.c:583
#, c-format #, c-format
msgid "WINGs: could not stat %s\n" msgid "WINGs: could not stat %s\n"
msgstr "WINGs: impossible de lire l'état du fichier %s\n" msgstr "WINGs : impossible de lire l'état du fichier %s.\n"
#: ../../WINGs/wfilepanel.c:647 ../../WINGs/wfilepanel.c:970 #: ../../WINGs/wfilepanel.c:650 ../../WINGs/wfilepanel.c:973
#: ../../WINGs/wfontpanel.c:708 #: ../../WINGs/wfontpanel.c:750
msgid "Error" msgid "Error"
msgstr "Erreur" msgstr "Erreur"
#: ../../WINGs/wfilepanel.c:658 #: ../../WINGs/wfilepanel.c:661
msgid "Create Directory" msgid "Create Directory"
msgstr "Créer un répertoire" msgstr "Créer un répertoire"
#: ../../WINGs/wfilepanel.c:659 #: ../../WINGs/wfilepanel.c:662
msgid "Enter directory name" msgid "Enter directory name"
msgstr "Saisissez le nom du répertoire" msgstr "Saisissez le nom du répertoire"
#: ../../WINGs/wfilepanel.c:695 ../../WINGs/wfilepanel.c:734 #: ../../WINGs/wfilepanel.c:698 ../../WINGs/wfilepanel.c:737
#: ../../WINGs/wfilepanel.c:765 ../../WINGs/wfilepanel.c:793 #: ../../WINGs/wfilepanel.c:768 ../../WINGs/wfilepanel.c:796
msgid "Permission denied." msgid "Permission denied."
msgstr "Permission refusée." msgstr "Permission refusée."
#: ../../WINGs/wfilepanel.c:698 #: ../../WINGs/wfilepanel.c:701
#, c-format #, c-format
msgid "'%s' already exists." msgid "'%s' already exists."
msgstr "'%s' existe déjà." msgstr "'%s' existe déjà."
#: ../../WINGs/wfilepanel.c:701 #: ../../WINGs/wfilepanel.c:704
msgid "Path does not exist." msgid "Path does not exist."
msgstr "Le chemin n'existe pas." msgstr "Le chemin n'existe pas."
#: ../../WINGs/wfilepanel.c:731 ../../WINGs/wfilepanel.c:790 #: ../../WINGs/wfilepanel.c:734 ../../WINGs/wfilepanel.c:793
#, c-format #, c-format
msgid "'%s' does not exist." msgid "'%s' does not exist."
msgstr "'%s' n'existe pas." msgstr "'%s' n'existe pas."
#: ../../WINGs/wfilepanel.c:738 ../../WINGs/wfilepanel.c:797 #: ../../WINGs/wfilepanel.c:741 ../../WINGs/wfilepanel.c:800
msgid "Insufficient memory available." msgid "Insufficient memory available."
msgstr "Mémoire disponible insuffisante." msgstr "Mémoire disponible insuffisante."
#: ../../WINGs/wfilepanel.c:742 ../../WINGs/wfilepanel.c:801 #: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:804
#, c-format #, c-format
msgid "'%s' is on a read-only filesystem." msgid "'%s' is on a read-only filesystem."
msgstr "'%s' est sur un système de fichiers en lecture seule." msgstr "'%s' est sur un système de fichiers en lecture seule."
#: ../../WINGs/wfilepanel.c:745 ../../WINGs/wfilepanel.c:777 #: ../../WINGs/wfilepanel.c:748 ../../WINGs/wfilepanel.c:780
#: ../../WINGs/wfilepanel.c:804 #: ../../WINGs/wfilepanel.c:807
#, c-format #, c-format
msgid "Can not delete '%s'." msgid "Can not delete '%s'."
msgstr "Impossible de supprimer '%s'." msgstr "Impossible de supprimer '%s'."
#: ../../WINGs/wfilepanel.c:752 #: ../../WINGs/wfilepanel.c:755
#, c-format #, c-format
msgid "Delete directory %s ?" msgid "Delete directory %s ?"
msgstr "Supprimer le répertoire %s ?" msgstr "Supprimer le répertoire %s ?"
#: ../../WINGs/wfilepanel.c:756 #: ../../WINGs/wfilepanel.c:759
#, c-format #, c-format
msgid "Delete file %s ?" msgid "Delete file %s ?"
msgstr "Supprimer le fichier %s ?" msgstr "Supprimer le fichier %s ?"
#: ../../WINGs/wfilepanel.c:768 #: ../../WINGs/wfilepanel.c:771
#, c-format #, c-format
msgid "Directory '%s' does not exist." msgid "Directory '%s' does not exist."
msgstr "Le répertoire '%s' n'existe pas." msgstr "Le répertoire '%s' n'existe pas."
#: ../../WINGs/wfilepanel.c:771
#, c-format
msgid "Le répertoire '%s' n'est pas vide."
msgstr "Verzeichnis '%s' ist nicht leer."
#: ../../WINGs/wfilepanel.c:774 #: ../../WINGs/wfilepanel.c:774
#, c-format #, 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." msgid "Directory '%s' is busy."
msgstr "Le répertoire '%s' est occupé." msgstr "Le répertoire '%s' est occupé."
#: ../../WINGs/wfilepanel.c:787 #: ../../WINGs/wfilepanel.c:790
#, c-format #, c-format
msgid "'%s' is a directory." msgid "'%s' is a directory."
msgstr "'%s' est un répertoire." msgstr "'%s' est un répertoire."
#: ../../WINGs/wfilepanel.c:829 #: ../../WINGs/wfilepanel.c:832
#, c-format #, c-format
msgid "An error occured browsing '%s'." msgid "An error occured browsing '%s'."
msgstr "Une erreur s'est produite pendant le parcours de '%s'." msgstr "Une erreur s'est produite pendant le parcours de '%s'."
#: ../../WINGs/wfilepanel.c:833 #: ../../WINGs/wfilepanel.c:836
#, c-format #, c-format
msgid "'%s' is not a directory." msgid "'%s' is not a directory."
msgstr "'%s' n'est pas un répertoire." msgstr "'%s' n'est pas un répertoire."
#: ../../WINGs/wfilepanel.c:970 #: ../../WINGs/wfilepanel.c:973
msgid "File does not exist." msgid "File does not exist."
msgstr "Le fichier n'existe pas." msgstr "Le fichier n'existe pas."
#: ../../WINGs/wfont.c:129 #: ../../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 #, c-format
msgid "the following character sets are missing in %s:" msgid "the following character sets are missing in %s:"
msgstr "les jeux de caractères suivants manquent dans %s:" msgstr "Les jeux de caractères suivants manquent dans %s :"
#: ../../WINGs/wfont.c:136 #: ../../WINGs/wfont.c:193
#, c-format #, c-format
msgid "" msgid ""
"the string \"%s\" will be used in place of any characters from those sets." "the string \"%s\" will be used in place of any characters from those sets."
msgstr "" msgstr ""
"la chaîne \"%s\" sera utilisée à la place de tous les caractères de ces jeux." "La chaîne « %s » sera utilisée à la place de tous les caractères de ces jeux."
#: ../../WINGs/wfont.c:287 ../../WINGs/wfont.c:323 #. is arial a good fallback for multibyte?
#: ../../WINGs/wfont.c:599 ../../WINGs/wfont.c:614
#, c-format #, c-format
msgid "could not load font set %s. Trying fixed." msgid "could not load font %s. Trying arial."
msgstr "impossible de charger le jeu de fontes %s, essai du jeu 'fixed'." msgstr ""
"Impossible de charger la police de caractères %s, essai de la police "
"« arial »."
#: ../../WINGs/wfont.c:293 ../../WINGs/wfont.c:329 #: ../../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 #, c-format
msgid "could not load font %s. Trying fixed." msgid "could not load font %s. Trying fixed."
msgstr "impossible de charger la fonte %s, essai de la fonte 'fixed'." msgstr ""
"Impossible de charger la police de caractères %s, essai de la police "
"« fixed »."
#: ../../WINGs/wfont.c:297 ../../WINGs/wfont.c:333 #: ../../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!" msgid "could not load fixed font!"
msgstr "impossible de charger la fonte 'fixed' !" msgstr "Impossible de charger la police de caractères « fixed » !"
#: ../../WINGs/wfont.c:428 #: ../../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 #, c-format
msgid "font description %s is too large." msgid "font description %s is too large."
msgstr "description de fonte %s trop grosse" msgstr "La description de la police de caractères %s est trop volumineuse."
#: ../../WINGs/wfontpanel.c:205 #. // 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!!!" msgid "Test!!!"
msgstr "" msgstr "Test !"
#: ../../WINGs/wfontpanel.c:211 #: ../../WINGs/wfontpanel.c:241
msgid "Family" msgid "Family"
msgstr "Famille" msgstr "Famille"
#: ../../WINGs/wfontpanel.c:222 #: ../../WINGs/wfontpanel.c:252
msgid "Typeface" msgid "Typeface"
msgstr "" msgstr "Caractère"
#: ../../WINGs/wfontpanel.c:233 #: ../../WINGs/wfontpanel.c:263
msgid "Size" msgid "Size"
msgstr "Taille" msgstr "Taille"
#: ../../WINGs/wfontpanel.c:252 #: ../../WINGs/wfontpanel.c:282
msgid "Set" msgid "Set"
msgstr "" msgstr "Famille"
#: ../../WINGs/wfontpanel.c:257 #: ../../WINGs/wfontpanel.c:288
msgid "Revert" msgid "Revert"
msgstr "Revenir" msgstr "Revenir"
#: ../../WINGs/wfontpanel.c:709 #: ../../WINGs/wfontpanel.c:751
msgid "Could not retrieve font list" msgid "Could not retrieve font list"
msgstr "Impossible de lire la liste des fontes" msgstr "Impossible de lire la liste des polices de caractères."
#: ../../WINGs/wfontpanel.c:721 #: ../../WINGs/wfontpanel.c:765
#, c-format #, c-format
msgid "font name %s is longer than 256, which is invalid." msgid "font name %s is longer than 256, which is invalid."
msgstr "" msgstr ""
"Le nom de fonte %s a plus de 256 caractères et est par conséquent invalide." "Le nom de police %s a plus de 256 caractères et est par conséquent invalide."
#: ../../WINGs/wfontpanel.c:868 #: ../../WINGs/wfontpanel.c:913
msgid "Roman" msgid "Roman"
msgstr "Roman" msgstr "Roman"
#: ../../WINGs/wfontpanel.c:871 #: ../../WINGs/wfontpanel.c:916
msgid "Italic" msgid "Italic"
msgstr "Italique" msgstr "Italique"
#: ../../WINGs/wfontpanel.c:873 #: ../../WINGs/wfontpanel.c:918
msgid "Oblique" msgid "Oblique"
msgstr "" msgstr "Penché"
#: ../../WINGs/wfontpanel.c:875 #: ../../WINGs/wfontpanel.c:920
msgid "Rev Italic" msgid "Rev Italic"
msgstr "" msgstr "Italique inverse"
#: ../../WINGs/wfontpanel.c:877 #: ../../WINGs/wfontpanel.c:922
msgid "Rev Oblique" msgid "Rev Oblique"
msgstr "" msgstr "Penché inverse"
#: ../../WINGs/wfontpanel.c:883 #: ../../WINGs/wfontpanel.c:928
msgid "Normal" msgid "Normal"
msgstr "Normal" msgstr "Normal"
#: ../../WINGs/widgets.c:415 #: ../../WINGs/widgets.c:419
#, c-format #, c-format
msgid "WINGs: could not load widget images file: %s" msgid "WINGs: could not load widget images file: %s"
msgstr "WINGs: impossible de charger le fichier d'images de widget '%s'." msgstr "WINGs : impossible de charger le fichier d'images de widget '%s'."
#: ../../WINGs/widgets.c:763 #: ../../WINGs/widgets.c:770
msgid "" msgid ""
"could not load any fonts. Make sure your font installationand locale " "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." "settings are correct."
msgstr "" msgstr ""
"Aucune fonte n'a pu être chargée. Veuillez vérifier que votre installation " "Aucune police n'a pu être chargée. Veuillez vérifier que vos polices sont "
"et vos paramètres d'installation sont corrects." "correctement installées et que votre langue est bien configurée."
#: ../../WINGs/wruler.c:189 #: ../../WINGs/wruler.c:192
msgid "0 inches" msgid "0 inches"
msgstr "0 pouces" msgstr "0 pouces"
+5 -3
View File
@@ -1593,7 +1593,7 @@ WMReadPropListFromFile(char *file)
struct stat stbuf; struct stat stbuf;
size_t length; size_t length;
f = fopen(file, "r"); f = fopen(file, "rb");
if (!f) { if (!f) {
/* let the user print the error message if he really needs to */ /* let the user print the error message if he really needs to */
/*wsyserror(_("could not open domain file '%s' for reading"), file);*/ /*wsyserror(_("could not open domain file '%s' for reading"), file);*/
@@ -1615,7 +1615,9 @@ WMReadPropListFromFile(char *file)
pldata->lineNumber = 1; pldata->lineNumber = 1;
if (fread(pldata->ptr, length, 1, f) != 1) { if (fread(pldata->ptr, length, 1, f) != 1) {
wsyserror(_("error reading from file '%s'"), file); if (ferror(f)) {
wsyserror(_("error reading from file '%s'"), file);
}
plist = NULL; plist = NULL;
goto cleanup; goto cleanup;
} }
@@ -1672,7 +1674,7 @@ WMWritePropListToFile(WMPropList *plist, char *path, Bool atomically)
mask = umask(0); mask = umask(0);
umask(mask); umask(mask);
fchmod(fd, 0644 & ~mask); fchmod(fd, 0644 & ~mask);
if ((theFile = fdopen(fd, "w")) == NULL) { if ((theFile = fdopen(fd, "wb")) == NULL) {
close(fd); close(fd);
} }
#else #else
+5
View File
@@ -0,0 +1,5 @@
build
WINGs.c
wings.so
*.pyc
*.pyo
+17
View File
@@ -0,0 +1,17 @@
all: WINGs.c
python setup.py build
ln -sf `find build/ -name wings.so` .
install: WINGs.c
python setup.py install
clean:
rm -rf build dist WINGs.c *.o *~ *.so MANIFEST wings.py *.pyc *.pyo core
dist:
python setup.py sdist
WINGs.c: WINGs.i
swig -python -noproxy `get-wings-flags --cflags` -I.. -o WINGs.c WINGs.i
+21
View File
@@ -0,0 +1,21 @@
This is a python wrapper for the WINGs library. With it you can write python
based programs which will have WINGs based graphic interfaces.
This module in not built by default. To build it you need python2.1 or later
and swig-1.3.14 or later.
To build it, first compile and install WINGs. after that run 'make' in this
directory. 'make install' will install the python module into the python tree.
run test.py or even WINGs.py for an example.
the code is not yet finished and probably won't do everything you expect it
to do.
Note: currently the module expects WINGs installed to build. it won't take
the WINGs libraries and header files from the source tree. You need to
install WINGs first. Even if an old version of WINGs is already installed,
you still need to nstall the newly built WINGs, else the python module will
be built against the old version
+699
View File
@@ -0,0 +1,699 @@
%module wings
%{
#include "WINGs/WINGsP.h"
%}
%include typemaps.i
// This tells SWIG to treat char ** as a special case
%typemap(python, in) char ** {
/* Check if is a list */
if (PyList_Check($input)) {
int size = PyList_Size($input);
int i = 0;
$1 = (char **) wmalloc((size+1)*sizeof(char *));
for (i = 0; i < size; i++) {
PyObject *o = PyList_GetItem($input, i);
if (PyString_Check(o))
$1[i] = PyString_AsString(PyList_GetItem($input, i));
else {
PyErr_SetString(PyExc_TypeError, "list must contain strings");
wfree($1);
return NULL;
}
}
$1[i] = 0;
} else {
PyErr_SetString(PyExc_TypeError, "not a list");
return NULL;
}
}
// This cleans up the char ** array we malloc-ed before the function call
%typemap(python, freearg) char ** {
wfree($1);
}
// This allows a C function to return a char ** as a Python list
%typemap(python, out) char ** {
int len,i;
len = 0;
while ($1[len]) len++;
$result = PyList_New(len);
for (i = 0; i < len; i++) {
PyList_SetItem($result, i, PyString_FromString($1[i]));
}
}
// Now for some callbacks
%typemap(python, in) PyObject *pyacArgs {
if (PyTuple_Check($input)) {
if (PyTuple_Size($input) != 3) {
PyErr_SetString(PyExc_ValueError,
"wrong number of parameters in tuple. should be 3.");
return NULL;
} else {
PyObject *func = PyTuple_GetItem($input, 1);
if (func!=Py_None && !PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError,
"'action' needs to be a callable object!");
return NULL;
}
}
} else {
PyErr_SetString(PyExc_TypeError, "2nd argument not a tuple!");
return NULL;
}
$1 = $input;
}
%typemap(python, in) PyObject *pycArgs {
if (PyTuple_Check($input)) {
if (PyTuple_Size($input) != 2) {
PyErr_SetString(PyExc_ValueError,
"wrong number of parameters in tuple. should be 2.");
return NULL;
} else {
PyObject *func = PyTuple_GetItem($input, 0);
if (func!=Py_None && !PyCallable_Check(func)) {
PyErr_SetString(PyExc_TypeError,
"'action' needs to be a callable object!");
return NULL;
}
}
} else {
PyErr_SetString(PyExc_TypeError, "2nd argument not a tuple!");
return NULL;
}
$1 = $input;
}
// Type mapping for grabbing a FILE * from Python
%typemap(python, in) FILE * {
if (!PyFile_Check($input)) {
PyErr_SetString(PyExc_TypeError, "Need a file!");
return NULL;
}
$1 = PyFile_AsFile($input);
}
/* These are for free-ing the return of functions that need to be freed
* before returning control to python. */
%typemap(python, ret) char* WMGetTextFieldText { wfree($1); };
%include exception.i
%exception pyWMScreenMainLoop {
$function
if (PyErr_Occurred())
return NULL;
}
%exception pyWMRunModalLoop {
$function
if (PyErr_Occurred())
return NULL;
}
%{
static int mainLoopDone = 0;
%}
%inline %{
WMScreen *pyWMOpenScreen(const char *display, int simpleapp)
{
Display *dpy = XOpenDisplay(display);
if (!dpy) {
wwarning("WINGs: could not open display %s", XDisplayName(display));
return NULL;
}
if (simpleapp) {
return WMCreateSimpleApplicationScreen(dpy);
} else {
return WMCreateScreen(dpy, DefaultScreen(dpy));
}
}
void pyWMScreenMainLoop(WMScreen *scr)
{
XEvent event;
while (!PyErr_Occurred() && !mainLoopDone) {
WMNextEvent(((W_Screen*)scr)->display, &event);
WMHandleEvent(&event);
}
}
void pyWMBreakScreenMainLoop(WMScreen *scr)
{
mainLoopDone = 1;
}
void pyWMRunModalLoop(WMScreen *scr, WMView *view)
{
int oldModalLoop = scr->modalLoop;
WMView *oldModalView = scr->modalView;
scr->modalView = view;
scr->modalLoop = 1;
while (!PyErr_Occurred() && scr->modalLoop) {
XEvent event;
WMNextEvent(scr->display, &event);
WMHandleEvent(&event);
}
scr->modalView = oldModalView;
scr->modalLoop = oldModalLoop;
}
%}
//%rename WMScreenMainLoop _WMScreenMainLoop;
//%rename(_WMScreenMainLoop) WMScreenMainLoop;
//%rename WMRunModalLoop _WMRunModalLoop;
%{
/* These functions match the prototypes of the normal C callback
* functions. However, we use the clientdata pointer for holding a
* reference to a Python tuple containing (object, funct, clientData).
*/
static void PythonWMActionCallback(WMWidget *widget, void *cdata)
{
PyObject *pyobj, *func, *pydata, *arglist, *tuple, *result;
tuple = (PyObject*) cdata;
pyobj = PyTuple_GetItem(tuple, 0);
func = PyTuple_GetItem(tuple, 1);
if (func && func!=Py_None) {
pydata = PyTuple_GetItem(tuple, 2);
arglist = Py_BuildValue("(OO)", pyobj, pydata);
result = PyEval_CallObject(func, arglist);
Py_DECREF(arglist);
Py_XDECREF(result);
}
}
static void PythonWMCallback(void *data)
{
PyObject *func, *pydata, *arglist, *tuple, *result;
tuple = (PyObject*) data;
func = PyTuple_GetItem(tuple, 0);
if (func && func!=Py_None) {
pydata = PyTuple_GetItem(tuple, 1);
arglist = Py_BuildValue("(O)", pydata);
result = PyEval_CallObject(func, arglist);
Py_DECREF(arglist);
Py_XDECREF(result);
}
}
static void
pyTextFieldDidBeginEditing(WMTextFieldDelegate *self, WMNotification *notif)
{
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
int action;
tuple = (PyObject*) self->data;
pyobj = PyTuple_GetItem(tuple, 0);
delegate = PyTuple_GetItem(tuple, 1);
if (delegate != Py_None) {
// should we call PyObject_HasAttrString()?? rather not and let
// python raise an exception because the object doesn't has the
// attribute
func = PyObject_GetAttrString(delegate, "didBeginEditing");
if (func!=NULL && func!=Py_None) {
pydata = PyObject_GetAttrString(delegate, "data");
if (!pydata) {
Py_INCREF(Py_None);
pydata = Py_None;
}
action = (int)WMGetNotificationClientData(notif);
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
result = PyEval_CallObject(func, arglist);
Py_DECREF(pydata);
Py_DECREF(arglist);
Py_XDECREF(result);
}
Py_XDECREF(func);
}
}
static void
pyTextFieldDidChange(WMTextFieldDelegate *self, WMNotification *notif)
{
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
int action;
tuple = (PyObject*) self->data;
pyobj = PyTuple_GetItem(tuple, 0);
delegate = PyTuple_GetItem(tuple, 1);
if (delegate != Py_None) {
func = PyObject_GetAttrString(delegate, "didChange");
if (func!=NULL && func!=Py_None) {
pydata = PyObject_GetAttrString(delegate, "data");
if (!pydata) {
Py_INCREF(Py_None);
pydata = Py_None;
}
action = (int)WMGetNotificationClientData(notif);
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
result = PyEval_CallObject(func, arglist);
Py_DECREF(pydata);
Py_DECREF(arglist);
Py_XDECREF(result);
}
Py_XDECREF(func);
}
}
static void
pyTextFieldDidEndEditing(WMTextFieldDelegate *self, WMNotification *notif)
{
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
int action;
tuple = (PyObject*) self->data;
pyobj = PyTuple_GetItem(tuple, 0);
delegate = PyTuple_GetItem(tuple, 1);
if (delegate != Py_None) {
func = PyObject_GetAttrString(delegate, "didEndEditing");
if (func!=NULL && func!=Py_None) {
pydata = PyObject_GetAttrString(delegate, "data");
if (!pydata) {
Py_INCREF(Py_None);
pydata = Py_None;
}
action = (int)WMGetNotificationClientData(notif);
arglist = Py_BuildValue("(OOi)", pyobj, pydata, action);
result = PyEval_CallObject(func, arglist);
Py_DECREF(pydata);
Py_DECREF(arglist);
Py_XDECREF(result);
}
Py_XDECREF(func);
}
}
static Bool
pyTextFieldShouldBeginEditing(WMTextFieldDelegate *self, WMTextField *tPtr)
{
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
Bool retval = False;
tuple = (PyObject*) self->data;
pyobj = PyTuple_GetItem(tuple, 0);
delegate = PyTuple_GetItem(tuple, 1);
if (delegate != Py_None) {
func = PyObject_GetAttrString(delegate, "shouldBeginEditing");
if (func!=NULL && func!=Py_None) {
pydata = PyObject_GetAttrString(delegate, "data");
if (!pydata) {
Py_INCREF(Py_None);
pydata = Py_None;
}
arglist = Py_BuildValue("(OO)", pyobj, pydata);
result = PyEval_CallObject(func, arglist);
if (result!=Py_None && PyInt_AsLong(result)!=0) {
retval = True;
}
Py_DECREF(pydata);
Py_DECREF(arglist);
Py_XDECREF(result);
}
Py_XDECREF(func);
}
return retval;
}
static Bool
pyTextFieldShouldEndEditing(WMTextFieldDelegate *self, WMTextField *tPtr)
{
PyObject *pyobj, *delegate, *func, *pydata, *arglist, *tuple, *result;
Bool retval = False;
tuple = (PyObject*) self->data;
pyobj = PyTuple_GetItem(tuple, 0);
delegate = PyTuple_GetItem(tuple, 1);
if (delegate != Py_None) {
func = PyObject_GetAttrString(delegate, "shouldEndEditing");
if (func!=NULL && func!=Py_None) {
pydata = PyObject_GetAttrString(delegate, "data");
if (!pydata) {
Py_INCREF(Py_None);
pydata = Py_None;
}
arglist = Py_BuildValue("(OO)", pyobj, pydata);
result = PyEval_CallObject(func, arglist);
if (result!=Py_None && PyInt_AsLong(result)!=0) {
retval = True;
}
Py_DECREF(pydata);
Py_DECREF(arglist);
Py_XDECREF(result);
}
Py_XDECREF(func);
}
return retval;
}
%}
%inline %{
void pyWMSetWindowCloseAction(WMWindow *win, PyObject *pyacArgs) {
WMSetWindowCloseAction(win, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetButtonAction(WMButton *bPtr, PyObject *pyacArgs) {
WMSetButtonAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetScrollerAction(WMScroller *sPtr, PyObject *pyacArgs) {
WMSetScrollerAction(sPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetListAction(WMList *lPtr, PyObject *pyacArgs) {
WMSetListAction(lPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetListDoubleAction(WMList *lPtr, PyObject *pyacArgs) {
WMSetListDoubleAction(lPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetBrowserAction(WMBrowser *bPtr, PyObject *pyacArgs) {
WMSetBrowserAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetBrowserDoubleAction(WMBrowser *bPtr, PyObject *pyacArgs) {
WMSetBrowserDoubleAction(bPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetMenuItemAction(WMMenuItem *miPtr, PyObject *pyacArgs) {
WMSetMenuItemAction(miPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetPopUpButtonAction(WMPopUpButton *pPtr, PyObject *pyacArgs) {
WMSetPopUpButtonAction(pPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetSliderAction(WMSlider *sPtr, PyObject *pyacArgs) {
WMSetSliderAction(sPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetRulerMoveAction(WMRuler *rPtr, PyObject *pyacArgs) {
WMSetRulerMoveAction(rPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetRulerReleaseAction(WMRuler *rPtr, PyObject *pyacArgs) {
WMSetRulerReleaseAction(rPtr, PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void pyWMSetColorPanelAction(WMColorPanel *panel, PyObject *pyacArgs) {
WMSetColorPanelAction(panel, (WMAction2*)PythonWMActionCallback, (void*)pyacArgs);
Py_INCREF(pyacArgs);
}
void* pyWMAddTimerHandler(int miliseconds, PyObject *pycArgs) {
Py_INCREF(pycArgs);
return (void*)WMAddTimerHandler(miliseconds, PythonWMCallback,
(void*)pycArgs);
}
void* pyWMAddPersistentTimerHandler(int miliseconds, PyObject *pycArgs) {
Py_INCREF(pycArgs);
return (void*)WMAddPersistentTimerHandler(miliseconds, PythonWMCallback,
(void*)pycArgs);
}
/* this doesn't work. we pass (func, data) as cdata at creation time, but
* only data at destruction, so it won't find it unless we change
* WMDeleteTimerWithClientData() to extract data from the tuple, and this
* requires access to the internals of WINGs
void pyWMDeleteTimerWithClientData(PyObject *pycData) {
WMDeleteTimerWithClientData((void*)pycData);
}*/
void pyWMDeleteTimerHandler(void *handlerID) {
WMDeleteTimerHandler((WMHandlerID)handlerID);
}
void* pyWMAddIdleHandler(PyObject *pycArgs) {
Py_INCREF(pycArgs);
return (void*)WMAddIdleHandler(PythonWMCallback, (void*)pycArgs);
}
void pyWMDeleteIdleHandler(void *handlerID) {
WMDeleteIdleHandler((WMHandlerID)handlerID);
}
%}
%exception pyWMSetTextFieldDelegate {
$function
if (PyErr_Occurred()) {
return NULL;
}
}
%inline %{
void pyWMSetTextFieldDelegate(WMTextField *tPtr, PyObject *txtArgs) {
WMTextFieldDelegate *td;
if (!txtArgs || !PyTuple_Check(txtArgs) || PyTuple_Size(txtArgs)!=2) {
PyErr_SetString(PyExc_TypeError, "invalid setting of WMTextField "
"delegate. Should be '(self, delegate)'");
return;
}
// how do I check if txtArgs[1] is an instance of WMTextFieldDelegate?
td = WMGetTextFieldDelegate(tPtr);
if (!td) {
td = (WMTextFieldDelegate*)wmalloc(sizeof(WMTextFieldDelegate));
td->didBeginEditing = pyTextFieldDidBeginEditing;
td->didChange = pyTextFieldDidChange;
td->didEndEditing = pyTextFieldDidEndEditing;
td->shouldBeginEditing = pyTextFieldShouldBeginEditing;
td->shouldEndEditing = pyTextFieldShouldEndEditing;
} else {
Py_XDECREF((PyObject*)td->data);
}
Py_INCREF(txtArgs);
td->data = txtArgs;
WMSetTextFieldDelegate(tPtr, td);
}
%}
%inline %{
PyObject* pyWMGetTextFieldDelegate(WMTextField *tPtr) {
WMTextFieldDelegate *td;
PyObject *result, *tuple;
td = WMGetTextFieldDelegate(tPtr);
if (!td) {
Py_INCREF(Py_None);
return Py_None;
}
tuple = (PyObject*)td->data;
if (!tuple || !PyTuple_Check(tuple) || PyTuple_Size(tuple)!=2) {
PyErr_SetString(PyExc_TypeError, "invalid TextField delegate");
return NULL;
}
result = PyTuple_GetItem(tuple, 1);
if (!result)
result = Py_None;
Py_INCREF(result);
return result;
}
%}
/* ignore structures we will not use */
%ignore ConnectionDelegate;
/* ignore functions we don't need */
// should we ignore vararg functions, or just convert them to functions with
// a fixed number of parameters?
%varargs(char*) wmessage;
//%ignore wmessage;
%ignore wwarning;
%ignore wfatal;
%ignore wsyserror;
%ignore wsyserrorwithcode;
%ignore WMCreatePLArray;
%ignore WMCreatePLDictionary;
%apply int *INPUT { int *argc };
#define Bool int
%include "WINGs/WUtil.h"
/* ignore structures we will not use */
/* ignore functions we don't need */
%include "WINGs/WINGs.h"
%{
void
WHandleEvents()
{
/* Check any expired timers */
W_CheckTimerHandlers();
/* Do idle and timer stuff while there are no input events */
/* Do not wait for input here. just peek to se if input is available */
while (!W_HandleInputEvents(False, -1) && W_CheckIdleHandlers()) {
/* dispatch timer events */
W_CheckTimerHandlers();
}
W_HandleInputEvents(True, -1);
/* Check any expired timers */
W_CheckTimerHandlers();
}
%}
/* rewrite functions originally defined as macros */
%inline %{
#undef WMDuplicateArray
WMArray* WMDuplicateArray(WMArray* array) {
return WMCreateArrayWithArray(array);
}
#undef WMPushInArray
void WMPushInArray(WMArray *array, void *item) {
WMAddToArray(array, item);
}
#undef WMSetInArray
void* WMSetInArray(WMArray *array, int index, void *item) {
return WMReplaceInArray(array, index, item);
}
#undef WMRemoveFromArray
int WMRemoveFromArray(WMArray *array, void *item) {
return WMRemoveFromArrayMatching(array, NULL, item);
}
#undef WMGetFirstInArray
int WMGetFirstInArray(WMArray *array, void *item) {
return WMFindInArray(array, NULL, item);
}
#undef WMCreateBag
WMBag* WMCreateBag(int size) {
return WMCreateTreeBag();
}
#undef WMCreateBagWithDestructor
WMBag* WMCreateBagWithDestructor(int size, WMFreeDataProc *destructor) {
return WMCreateTreeBagWithDestructor(destructor);
}
#undef WMSetInBag
void* WMSetInBag(WMBag *bag, int index, void *item) {
return WMReplaceInBag(bag, index, item);
}
#undef WMAddItemToTree
WMTreeNode* WMAddItemToTree(WMTreeNode *parent, void *item) {
return WMInsertItemInTree(parent, -1, item);
}
#undef WMAddNodeToTree
WMTreeNode* WMAddNodeToTree(WMTreeNode *parent, WMTreeNode *aNode) {
return WMInsertNodeInTree(parent, -1, aNode);
}
#undef WMGetFirstInTree
/* Returns first tree node that has data == cdata */
WMTreeNode* WMGetFirstInTree(WMTreeNode *aTree, void *cdata) {
return WMFindInTree(aTree, NULL, cdata);
}
#undef WMFlushConnection
int WMFlushConnection(WMConnection *cPtr) {
return WMSendConnectionData(cPtr, NULL);
}
#undef WMGetConnectionQueuedData
WMArray* WMGetConnectionQueuedData(WMConnection *cPtr) {
return WMGetConnectionUnsentData(cPtr);
}
#undef WMWidgetClass
W_Class WMWidgetClass(WMWidget *widget) {
return (((W_WidgetType*)(widget))->widgetClass);
}
#undef WMWidgetView
WMView* WMWidgetView(WMWidget *widget) {
return (((W_WidgetType*)(widget))->view);
}
#undef WMCreateCommandButton
WMButton* WMCreateCommandButton(WMWidget *parent) {
return WMCreateCustomButton(parent, WBBSpringLoadedMask|WBBPushInMask
|WBBPushLightMask|WBBPushChangeMask);
}
#undef WMCreateRadioButton
WMButton* WMCreateRadioButton(WMWidget *parent) {
return WMCreateButton(parent, WBTRadio);
}
#undef WMCreateSwitchButton
WMButton* WMCreateSwitchButton(WMWidget *parent) {
return WMCreateButton(parent, WBTSwitch);
}
#undef WMAddListItem
WMListItem* WMAddListItem(WMList *lPtr, char *text)
{
return WMInsertListItem(lPtr, -1, text);
}
#undef WMCreateText
WMText* WMCreateText(WMWidget *parent) {
return WMCreateTextForDocumentType(parent, NULL, NULL);
}
#undef WMRefreshText
void WMRefreshText(WMText *tPtr) {
return WMThawText(tPtr);
}
#undef WMClearText
void WMClearText(WMText *tPtr) {
return WMAppendTextStream(tPtr, NULL);
}
%}
+631
View File
@@ -0,0 +1,631 @@
#!/usr/bin/env python
import sys
import wings
# Some useful constants
False = 0
True = 1
# check about None as action for buttonAction/windowCloseAction ...
################################################################################
# Exceptions
################################################################################
from exceptions import Exception, StandardError
class Error(StandardError):
pass
del Exception, StandardError
class WMTimer:
def __init__(self, milliseconds, callback, cdata=None, persistent=False):
if persistent:
self._o = wings.pyWMAddPersistentTimerHandler(milliseconds, (callback, cdata))
else:
self._o = wings.pyWMAddTimerHandler(milliseconds, (callback, cdata))
def __del__(self):
wings.pyWMDeleteTimerHandler(self._o)
#delete = __del__
class WMPersistentTimer(WMTimer):
def __init__(self, milliseconds, callback, cdata=None):
WMTimer.__init__(self, milliseconds, callback, cdata, persistent=True)
class WMScreen:
__readonly = ('display', 'width', 'height', 'depth')
def __init__(self, appname, display="", simpleapp=False):
wings.WMInitializeApplication(appname, len(sys.argv), sys.argv)
self._o = wings.pyWMOpenScreen(display, simpleapp)
if not self._o:
raise Error, "Cannot open display %s" % display
self.__dict__['display'] = wings.WMScreenDisplay(self._o)
self.__dict__['width'] = wings.WMScreenWidth(self._o)
self.__dict__['height'] = wings.WMScreenHeight(self._o)
self.__dict__['depth'] = wings.WMScreenDepth(self._o)
def __setattr__(self, name ,value):
if name in self.__readonly:
#raise AttributeError, "'%s' is a read-only WMScreen attribute" % name
raise Error, "'%s' is a read-only WMScreen attribute" % name
self.__dict__[name] = value
def mainLoop(self):
wings.pyWMScreenMainLoop(self._o)
def breakMainLoop(self):
wings.pyWMBreakScreenMainLoop(self._o)
def runModalLoop(self, view):
wings.pyWMRunModalLoop(self._o, view)
def breakModalLoop(self):
wings.WMBreakModalLoop(self._o)
def size(self):
return (self.width, self.height)
class WMView:
pass
class WMWidget(WMView):
def __init__(self):
self._o = None
if self.__class__ == WMWidget:
raise Error, "a WMWidget can't be instantiated directly"
def __del__(self):
if (self._o != None):
wings.WMDestroyWidget(self._o)
def resize(self, width, height):
wings.WMResizeWidget(self._o, width, height)
def move(self, x, y):
wings.WMMoveWidget(self._o, x, y)
def realize(self):
wings.WMRealizeWidget(self._o)
def show(self):
wings.WMMapWidget(self._o)
def hide(self):
wings.WMUnmapWidget(self._o)
def redisplay(self):
wings.WMRedisplayWidget(self._o)
def width(self):
return wings.WMWidgetWidth(self._o)
def height(self):
return wings.WMWidgetHeight(self._o)
def screen(self):
return wings.WMWidgetScreen(self._o)
def view(self):
return wings.WMWidgetView(self._o)
def setFocusTo(self, other):
wings.WMSetFocusToWidget(other._o)
class WMWindow(WMWidget):
def __init__(self, screen, name, style=wings.WMTitledWindowMask
|wings.WMClosableWindowMask|wings.WMMiniaturizableWindowMask
|wings.WMResizableWindowMask):
WMWidget.__init__(self)
self._o = wings.WMCreateWindowWithStyle(screen._o, name, style)
def setMinSize(self, minWidth, minHeight):
wings.WMSetWindowMinSize(self._o, minWidth, minHeight)
def setMaxSize(self, maxWidth, maxHeight):
wings.WMSetWindowMaxSize(self._o, maxWidth, maxHeight)
def setInitialPosition(self, x, y):
wings.WMSetWindowInitialPosition(self._o, x, y)
def setTitle(self, title):
wings.WMSetWindowTitle(self._o, title)
def setCloseAction(self, action, data=None):
if action!=None and (not callable(action)):
raise Error, "action needs to be a callable object or None"
wings.pyWMSetWindowCloseAction(self._o, (self, action, data))
class WMPanel(WMWindow):
def __init__(self, owner, name, style=wings.WMTitledWindowMask
|wings.WMClosableWindowMask|wings.WMResizableWindowMask):
WMWidget.__init__(self)
self._o = wings.WMCreatePanelWithStyleForWindow(owner._o, name, style)
class WMFrame(WMWidget):
def __init__(self, parent, title=None):
WMWidget.__init__(self)
self._o = wings.WMCreateFrame(parent._o)
self.setTitle(title)
def setRelief(self, relief):
wings.WMSetFrameRelief(self._o, relief)
def setTitle(self, title=""):
wings.WMSetFrameTitle(self._o, title)
def setTitlePosition(self, position):
wings.WMSetFrameTitlePosition(self._o, position)
class WMLabel(WMWidget):
def __init__(self, parent, text=None):
WMWidget.__init__(self)
self._o = wings.WMCreateLabel(parent._o)
self.setText(text)
def setWraps(self, flag):
# bool(flag) for python2.2
wings.WMSetLabelWraps(self._o, flag)
def setRelief(self, relief):
wings.WMSetLabelRelief(self._o, relief)
def setText(self, text=""):
wings.WMSetLabelText(self._o, text)
def setTextColor(self, color):
wings.WMSetLabelTextColor(self._o, color)
def setFont(self, font):
wings.WMSetLabelFont(self._o, font)
def setTextAlignment(self, alignment):
wings.WMSetLabelTextAlignment(self._o, alignment)
def setImage(self, image):
wings.WMSetLabelImage(self._o, image)
def setImagePosition(self, position):
wings.WMSetLabelImagePosition(self._o, position)
def text(self):
return wings.WMGetLabelText(self._o)
def font(self):
return wings.WMGetLabelFont(self._o)
def image(self):
return wings.WMGetLabelImage(self._o)
class WMBox(WMWidget):
def __init__(self, parent):
WMWidget.__init__(self)
self._o = wings.WMCreateBox(parent._o)
def setHorizontal(self, flag):
# bool(flag) for python2.2
wings.WMSetBoxHorizontal(self._o, flag)
def setBorderWidth(self, width):
wings.WMSetBoxBorderWidth(self._o, width)
def addSubview(self, view, expand, fill, minSize, maxSize, space):
wings.WMAddBoxSubview(self._o, view, expand, fill, minSize, maxSixe, space)
def addSubviewAtEnd(self, view, expand, fill, minSize, maxSize, space):
wings.WMAddBoxSubviewAtEnd(self._o, view, expand, fill, minSize, maxSixe, space)
def removeSubview(self, view):
wings.WMRemoveBoxSubview(self._o, view)
class WMButton(WMWidget): # not for user instantiation
def __init__(self, parent):
WMWidget.__init__(self)
if self.__class__ == WMButton:
raise Error, "a WMButton can't be instantiated directly"
def setText(self, text=""):
wings.WMSetButtonText(self._o, text)
def setAction(self, action, data=None):
if action!=None and (not callable(action)):
raise Error, "action needs to be a callable object or None"
wings.pyWMSetButtonAction(self._o, (self, action, data))
def performClick(self):
wings.WMPerformButtonClick(self._o)
def setEnabled(self, flag):
# bool(flag) for python2.2
wings.WMSetButtonEnabled(self._o, flag)
def isEnabled(self):
return wings.WMGetButtonEnabled(self._o)
def setImageDimsWhenDisabled(self, flag):
# bool(flag)
wings.WMSetButtonImageDimsWhenDisabled(self._o, flag)
def setImage(self, image):
wings.WMSetButtonImage(self_.o, image)
def setAlternateImage(self, image):
wings.WMSetButtonAltImage(self._o, image)
def setImagePosition(self, position):
wings.WMSetButtonImagePosition(self._o, position)
def setImageDefault(self):
wings.WMSetButtonImageDefault(self._o)
class WMCommandButton(WMButton):
def __init__(self, parent):
WMButton.__init__(self, parent)
self._o = wings.WMCreateCommandButton(parent._o)
class WMSwitchButton(WMButton):
def __init__(self, parent):
WMButton.__init__(self, parent)
self._o = wings.WMCreateSwitchButton(parent._o)
class WMRadioButton(WMButton):
def __init__(self, parent, group=None):
WMButton.__init__(self, parent)
self._o = wings.WMCreateRadioButton(parent._o)
if group:
wings.WMGroupButtons(group._o, self._o)
class WMListItem:
pass
class WMList(WMWidget):
def __init__(self, parent):
WMWidget.__init__(self)
self._o = wings.WMCreateList(parent._o)
def allowEmptySelection(self, flag):
# bool(flag)
wings.WMSetListAllowEmptySelection(self._o, flag)
def allowMultipleSelection(self, flag):
# bool(flag)
wings.WMSetListAllowMultipleSelection(self._o, flag)
def addItem(self, item):
wings.WMAddListItem(self._o, item)
def insertItem(self, row, item):
wings.WMInsertListItem(self._o, row, item)
def sortItems(self):
wings.WMSortListItems(self._o)
def rowWithTitle(self, title):
return wings.WMFindRowOfListItemWithTitle(self._o, title)
def selectedItemRow(self):
return wings.WMGetListSelectedItemRow(self._o)
def selectedItem(self):
return wings.WMGetListSelectedItem(self._o)
def removeItem(self, index):
wings.WMRemoveListItem(self._o, index)
def selectItem(self, index):
wings.WMSelectListItem(self._o, index)
def unselectItem(self, index):
wings.WMUnselectListItem(self._o, index)
class WMTextFieldDelegate:
__callbacks = ('didBeginEditing', 'didChange', 'didEndEditing',
'shouldBeginEditing', 'shouldEndEditing')
def __init__(self):
self.__dict__['data'] = None
self.__dict__['didBeginEditing'] = None
self.__dict__['didChange'] = None
self.__dict__['didEndEditing'] = None
self.__dict__['shouldBeginEditing'] = None
self.__dict__['shouldEndEditing'] = None
def __setattr__(self, name ,value):
if name in self.__callbacks and value!=None and (not callable(value)):
#raise AttributeError, "%s.%s needs to be a callable object or None" % (self.__class__.__name__, name)
raise Error, "%s.%s needs to be a callable object or None" % (self.__class__.__name__, name)
else:
self.__dict__[name] = value
class WMTextField(WMWidget):
def __init__(self, parent, text=""):
WMWidget.__init__(self)
self._o = wings.WMCreateTextField(parent._o)
wings.WMSetTextFieldText(self._o, text)
def setDelegate(self, delegate):
if delegate.__class__ != WMTextFieldDelegate:
raise Error, "textfield delegate must be of type 'WMTextFieldDelegate'"
wings.pyWMSetTextFieldDelegate(self._o, (self, delegate))
def delegate(self):
return wings.pyWMGetTextFieldDelegate(self._o)
def text(self):
return wings.WMGetTextFieldText(self._o)
def setEditable(self, flag):
# bool(flag)
wings.WMSetTextFieldEditable(self._o, flag)
def setBordered(self, flag):
# bool(flag)
wings.WMSetTextFieldBordered(self._o, flag)
def setBeveled(self, flag):
# bool(flag)
wings.WMSetTextFieldBeveled(self._o, flag)
def setSecure(self, flag):
# bool(flag)
wings.WMSetTextFieldSecure(self._o, flag)
def setCursorPosition(self, position):
wings.WMSetTextFieldCursorPosition(self._o, position)
def setNextText(self, next):
wings.WMSetTextFieldNextTextField(self._o, next._o)
def setPreviousText(self, previous):
wings.WMSetTextFieldPrevTextField(self._o, previous._o)
def setTextAlignment(self, alignment):
wings.WMSetTextFieldAlignment(self._o, alignment)
def isEditable(self):
return wings.WMGetTextFieldEditable(self._o)
def insertText(self, text, position):
wings.WMInsertTextFieldText(self._o, text, position)
def deleteText(self, start, count):
wings.WMDeleteTextFieldRange(self._o, wings.wmkrange(start, count))
def selectText(self, start, count):
wings.WMSelectTextFieldRange(self._o, wings.wmkrange(start, count))
def setFont(self, font):
wings.WMSetTextFieldFont(self._o, font)
def font(self):
return wings.WMGetTextFieldFont(self._o)
################################################################################
# wrap the WINGs constants so we don't need wings.constant_name
################################################################################
# WMWindow title style
WMTitledWindowMask = wings.WMTitledWindowMask
WMClosableWindowMask = wings.WMClosableWindowMask
WMMiniaturizableWindowMask = wings.WMMiniaturizableWindowMask
WMResizableWindowMask = wings.WMResizableWindowMask
# WMFrame title positions
WTPNoTitle = wings.WTPNoTitle
WTPAboveTop = wings.WTPAboveTop
WTPAtTop = wings.WTPAtTop
WTPBelowTop = wings.WTPBelowTop
WTPAboveBottom = wings.WTPAboveBottom
WTPAtBottom = wings.WTPAtBottom
WTPBelowBottom = wings.WTPBelowBottom
# Alingments
WALeft = wings.WALeft
WACenter = wings.WACenter
WARight = wings.WARight
WAJustified = wings.WAJustified # not valid for textfields
# Image positions
WIPNoImage = wings.WIPNoImage
WIPImageOnly = wings.WIPImageOnly
WIPLeft = wings.WIPLeft
WIPRight = wings.WIPRight
WIPBelow = wings.WIPBelow
WIPAbove = wings.WIPAbove
WIPOverlaps = wings.WIPOverlaps
# Relief types
WRFlat = wings.WRFlat
WRSimple = wings.WRSimple
WRRaised = wings.WRRaised
WRSunken = wings.WRSunken
WRGroove = wings.WRGroove
WRRidge = wings.WRRidge
WRPushed = wings.WRPushed
# TextField events
WMReturnTextMovement = wings.WMReturnTextMovement
WMEscapeTextMovement = wings.WMEscapeTextMovement
WMIllegalTextMovement = wings.WMIllegalTextMovement
WMTabTextMovement = wings.WMTabTextMovement
WMBacktabTextMovement = wings.WMBacktabTextMovement
WMLeftTextMovement = wings.WMLeftTextMovement
WMRightTextMovement = wings.WMRightTextMovement
WMUpTextMovement = wings.WMUpTextMovement
WMDownTextMovement = wings.WMDownTextMovement
if __name__ == "__main__":
def quit(obj, data):
#sys.exit()
scr.breakMainLoop()
def click(btn, list):
print win.width(), win.height()
print list.selectedItemRow()
win2.show()
scr.runModalLoop(win2.view())
print txt2.text()
def sayhi(btn, data):
print "hi"
def breakLoop(btn, data):
#sys.exit()
scr.breakModalLoop()
win2.hide()
def dc(object, data, action):
print "didChange:", object, data, action
def dbe(object, data, action):
print "didBeginEditing:", object, data, action
def dee(object, data, action):
if action == wings.WMReturnTextMovement:
if object == txt:
object.setFocusTo(txt2)
else:
object.setFocusTo(txt)
print "didEndEditing:", object, data, action, object.text()
def tcb(one):
old = list.selectedItemRow()
list.selectItem(list.index)
list.unselectItem(old)
list.index = (list.index+1) % 3
#print one
scr = WMScreen("foobar")
win = WMWindow(scr, "aWindow")
win.setCloseAction(quit)
win.setTitle("test window")
win.resize(400, 180)
win.setInitialPosition((scr.width-win.width())/2, (scr.height-win.height())/2)
btn = WMCommandButton(win)
btn.setText("Click Me")
btn.resize(100, 25)
btn.move(20, 20)
btn.show()
sw = WMSwitchButton(win)
sw.setText("Some option")
sw.resize(100, 25)
sw.move(20, 50)
sw.show()
radios = []
r = None
j = 0
for i in ["One", "Two", "Four"]:
r = WMRadioButton(win, r)
radios.append(r)
r.show()
r.setText(i)
r.move(20, 70+j*25)
r.resize(100, 25)
j=j+1
sw.setAction(sayhi)
list = WMList(win)
list.resize(100,100)
list.move(130, 20)
list.addItem("one")
list.addItem("two")
list.addItem("three")
list.allowMultipleSelection(1)
list.show()
list.index = 0
txtdel = WMTextFieldDelegate()
txtdel.data = 'mydata'
txtdel.didBeginEditing = dbe
txtdel.didEndEditing = dee
txtdel.didChange = dc
txt = WMTextField(win, "abc")
txt.resize(95, 20)
txt.move(295, 20)
txt.setDelegate(txtdel)
txt.show()
txt2 = WMTextField(win, "01234567890")
txt2.resize(95, 20)
txt2.move(295, 45)
txt2.setDelegate(txtdel)
txt2.show()
txt.setNextText(txt2)
txt2.setNextText(txt)
label = WMLabel(win, "Text1:")
label.setTextAlignment(WARight)
label.move(240, 20)
label.resize(55, 20)
label.show()
label2 = WMLabel(win, "mytext2:")
label2.setTextAlignment(WARight)
label2.move(240, 45)
label2.resize(55, 20)
label2.show()
btn.setAction(click, list)
frame = WMFrame(win, "My Frame")
frame.resize(150, 50)
frame.move(240, 70)
#frame.setRelief(WRPushed)
frame.show()
ebtn = WMCommandButton(win)
ebtn.setText("Exit")
ebtn.resize(100, 25)
ebtn.move(290, 147)
ebtn.setAction(quit)
ebtn.show()
win.realize()
win.show()
timer = WMPersistentTimer(1000, tcb, win)
#del(timer)
#timer.delete()
win2 = WMPanel(win, "anotherWindow", WMTitledWindowMask)
win2.setTitle("transient test window")
win2.resize(150, 50)
win2.setInitialPosition((scr.width-win2.width())/2, (scr.height-win2.height())/2)
btn7 = WMCommandButton(win2)
btn7.setText("Dismiss")
btn7.resize(100, 25)
btn7.move(27, 10)
btn7.show()
btn7.setAction(breakLoop)
win2.realize()
scr.mainLoop()
+74
View File
@@ -0,0 +1,74 @@
#!/usr/bin/env python
"""Setup script for the WINGs module distribution."""
import os, sys
from distutils.core import setup
from distutils.extension import Extension
## Get the include dirs
wings = os.popen("get-wings-flags --cflags", "r")
lines = [x.strip() for x in wings.readlines()]
flags = reduce(lambda x,y: x+y, [x.split() for x in lines if x])
include_dirs = [x[2:] for x in flags]
#include_dirs += [".."]
wings.close()
## Get the library dirs
wings = os.popen("get-wings-flags --ldflags", "r")
lines = [x.strip() for x in wings.readlines()]
flags = reduce(lambda x,y: x+y, [x.split() for x in lines if x])
library_dirs = [x[2:] for x in flags]
#library_dirs += [".."]
wings.close()
## Get the libraries
wings = os.popen("get-wings-flags --libs", "r")
lines = [x.strip() for x in wings.readlines()]
flags = reduce(lambda x,y: x+y, [x.split() for x in lines if x])
libraries = [x[2:] for x in flags]
wings.close()
runtime_library_dirs = []
extra_objects = []
extra_compile_args = ['-Wno-strict-prototypes', '-Wno-unused']
long_description = \
"""Python interface to the WINGs library
Python WINGs is an interface to WINGs, a small widget set with the
N*XTSTEP look and feel. It's API is inspired in OpenStep and it's
implementation borrows some ideas from Tk. It has a reasonable set of
widgets, sufficient for building small applications (like a CDPlayer
or hacking something like rxvt). It also has other functions that are
usefull for applications, like a User Defaults alike configuration
manager and a notification system.
"""
setup (# Distribution meta-data
name = "Python-WINGs",
version = "0.81.0",
description = "A python interface to WINGs",
long_description=long_description,
author = "Dan Pascu",
author_email = "dan@windowmaker.org",
license = "GPL",
platforms = "ALL",
url = "http://windowmaker.org/",
# Description of the modules and packages in the distribution
py_modules = ["WINGs"],
ext_modules = [Extension(
name='wings',
sources=['WINGs.c'],
include_dirs=include_dirs,
library_dirs=library_dirs,
runtime_library_dirs=runtime_library_dirs,
libraries=libraries,
extra_objects=extra_objects,
extra_compile_args=extra_compile_args,
)],
)
+159
View File
@@ -0,0 +1,159 @@
#!/usr/bin/env python
import sys
from WINGs import *
if __name__ == "__main__":
def quit(obj, data):
#sys.exit()
scr.breakMainLoop()
def click(btn, list):
print win.width(), win.height()
print list.selectedItemRow()
win2.show()
scr.runModalLoop(win2.view())
print txt2.text()
def sayhi(btn, data):
print "hi"
def breakLoop(btn, data):
#sys.exit()
scr.breakModalLoop()
win2.hide()
def dc(object, data, action):
print "didChange:", object, data, action
def dbe(object, data, action):
print "didBeginEditing:", object, data, action
def dee(object, data, action):
if action == wings.WMReturnTextMovement:
if object == txt:
object.setFocusTo(txt2)
else:
object.setFocusTo(txt)
print "didEndEditing:", object, data, action, object.text()
def tcb(one):
old = list.selectedItemRow()
list.selectItem(list.index)
list.unselectItem(old)
list.index = (list.index+1) % 3
#print one
scr = WMScreen("foobar")
win = WMWindow(scr, "aWindow")
win.setCloseAction(quit)
win.setTitle("test window")
win.resize(400, 180)
win.setInitialPosition((scr.width-win.width())/2, (scr.height-win.height())/2)
btn = WMCommandButton(win)
btn.setText("Click Me")
btn.resize(100, 25)
btn.move(20, 20)
btn.show()
sw = WMSwitchButton(win)
sw.setText("Some option")
sw.resize(100, 25)
sw.move(20, 50)
sw.show()
radios = []
r = None
j = 0
for i in ["One", "Two", "Four"]:
r = WMRadioButton(win, r)
radios.append(r)
r.show()
r.setText(i)
r.move(20, 70+j*25)
r.resize(100, 25)
j=j+1
sw.setAction(sayhi)
list = WMList(win)
list.resize(100,100)
list.move(130, 20)
list.addItem("one")
list.addItem("two")
list.addItem("three")
list.allowMultipleSelection(1)
list.show()
list.index = 0
txtdel = WMTextFieldDelegate()
txtdel.data = 'mydata'
txtdel.didBeginEditing = dbe
txtdel.didEndEditing = dee
txtdel.didChange = dc
txt = WMTextField(win)
txt.resize(95, 20)
txt.move(295, 20)
txt.setDelegate(txtdel)
txt.show()
txt2 = WMTextField(win, "01234567890")
txt2.resize(95, 20)
txt2.move(295, 45)
txt2.setDelegate(txtdel)
txt2.show()
txt.setNextText(txt2)
txt2.setNextText(txt)
label = WMLabel(win, "Text1:")
label.setTextAlignment(WARight)
label.move(240, 20)
label.resize(55, 20)
label.show()
label2 = WMLabel(win, "mytext2:")
label2.setTextAlignment(WARight)
label2.move(240, 45)
label2.resize(55, 20)
label2.show()
btn.setAction(click, list)
frame = WMFrame(win, "My Frame")
frame.resize(150, 50)
frame.move(240, 70)
#frame.setRelief(WRPushed)
frame.show()
ebtn = WMCommandButton(win)
ebtn.setText("Exit")
ebtn.resize(100, 25)
ebtn.move(290, 147)
ebtn.setAction(quit)
ebtn.show()
win.realize()
win.show()
timer = WMPersistentTimer(1000, tcb, win)
#del(timer)
#timer.delete()
win2 = WMPanel(win, "anotherWindow", WMTitledWindowMask)
win2.setTitle("transient test window")
win2.resize(150, 50)
win2.setInitialPosition((scr.width-win2.width())/2, (scr.height-win2.height())/2)
btn7 = WMCommandButton(win2)
btn7.setText("Dismiss")
btn7.resize(100, 25)
btn7.move(27, 10)
btn7.show()
btn7.setAction(breakLoop)
win2.realize()
scr.mainLoop()
+660 -660
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -186,6 +186,21 @@ wstrdup(char *str)
} }
char*
wstrndup(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* char*
wstrconcat(char *str1, char *str2) wstrconcat(char *str1, char *str2)
{ {
+23 -27
View File
@@ -39,6 +39,7 @@ static UserDefaults *sharedUserDefaults = NULL;
char *WMUserDefaultsDidChangeNotification = "WMUserDefaultsDidChangeNotification"; char *WMUserDefaultsDidChangeNotification = "WMUserDefaultsDidChangeNotification";
static void synchronizeUserDefaults(void *foo);
extern char *WMGetApplicationName(); extern char *WMGetApplicationName();
@@ -93,19 +94,14 @@ wdefaultspathfordomain(char *domain)
static void static void
#ifndef HAVE_ATEXIT #ifdef HAVE_ATEXIT
saveDefaultsChanges(int foo, void *bar)
#else
saveDefaultsChanges(void) saveDefaultsChanges(void)
#else
saveDefaultsChanges(int foo, void *bar)
#endif #endif
{ {
/* save the user defaults databases */ /* save the user defaults databases */
UserDefaults *tmp = sharedUserDefaults; synchronizeUserDefaults(NULL);
while (tmp) {
WMSynchronizeUserDefaults(tmp);
tmp = tmp->next;
}
} }
@@ -116,10 +112,10 @@ registerSaveOnExit(void)
static Bool registeredSaveOnExit = False; static Bool registeredSaveOnExit = False;
if (!registeredSaveOnExit) { if (!registeredSaveOnExit) {
#ifndef HAVE_ATEXIT #ifdef HAVE_ATEXIT
on_exit(saveDefaultsChanges, (void*)NULL);
#else
atexit(saveDefaultsChanges); atexit(saveDefaultsChanges);
#else
on_exit(saveDefaultsChanges, (void*)NULL);
#endif #endif
registeredSaveOnExit = True; registeredSaveOnExit = True;
} }
@@ -136,7 +132,6 @@ synchronizeUserDefaults(void *foo)
WMSynchronizeUserDefaults(database); WMSynchronizeUserDefaults(database);
database = database->next; database = database->next;
} }
WMAddTimerHandler(UD_SYNC_INTERVAL, synchronizeUserDefaults, NULL);
} }
@@ -146,7 +141,8 @@ addSynchronizeTimerHandler(void)
static Bool initialized = False; static Bool initialized = False;
if (!initialized) { if (!initialized) {
WMAddTimerHandler(UD_SYNC_INTERVAL, synchronizeUserDefaults, NULL); WMAddPersistentTimerHandler(UD_SYNC_INTERVAL, synchronizeUserDefaults,
NULL);
initialized = True; initialized = True;
} }
} }
@@ -265,7 +261,7 @@ WMGetStandardUserDefaults(void)
if (sharedUserDefaults) { if (sharedUserDefaults) {
defaults = sharedUserDefaults; defaults = sharedUserDefaults;
while (defaults) { while (defaults) {
/* Trick, path == NULL only for StandardUserDefaults db */ /* path == NULL only for StandardUserDefaults db */
if (defaults->path == NULL) if (defaults->path == NULL)
return defaults; return defaults;
defaults = defaults->next; defaults = defaults->next;
@@ -284,19 +280,18 @@ WMGetStandardUserDefaults(void)
key = WMCreatePLString(WMGetApplicationName()); key = WMCreatePLString(WMGetApplicationName());
defaults->searchList[0] = key; defaults->searchList[0] = key;
/* temporary kluge */ /* temporary kluge. wmaker handles synchronization itself */
if (strcmp(WMGetApplicationName(), "WindowMaker")==0) { if (strcmp(WMGetApplicationName(), "WindowMaker")==0) {
domain = NULL; defaults->dontSync = 1;
path = NULL;
} else {
path = wdefaultspathfordomain(WMGetFromPLString(key));
if (stat(path, &stbuf) >= 0)
defaults->timestamp = stbuf.st_mtime;
domain = WMReadPropListFromFile(path);
} }
path = wdefaultspathfordomain(WMGetFromPLString(key));
if (stat(path, &stbuf) >= 0)
defaults->timestamp = stbuf.st_mtime;
domain = WMReadPropListFromFile(path);
if (!domain) if (!domain)
domain = WMCreatePLDictionary(NULL, NULL, NULL); domain = WMCreatePLDictionary(NULL, NULL, NULL);
@@ -332,7 +327,7 @@ WMGetStandardUserDefaults(void)
i = 0; i = 0;
while (defaults->searchList[i]) { while (defaults->searchList[i]) {
WMAddToPLArray(defaults->searchListArray, WMAddToPLArray(defaults->searchListArray,
defaults->searchList[i]); defaults->searchList[i]);
i++; i++;
} }
@@ -409,7 +404,7 @@ WMGetDefaultsFromPath(char *path)
i = 0; i = 0;
while (defaults->searchList[i]) { while (defaults->searchList[i]) {
WMAddToPLArray(defaults->searchListArray, WMAddToPLArray(defaults->searchListArray,
defaults->searchList[i]); defaults->searchList[i]);
i++; i++;
} }
@@ -669,6 +664,7 @@ WMSetUDSearchList(WMUserDefaults *database, WMPropList *list)
for (i=0; i<c; i++) { for (i=0; i<c; i++) {
database->searchList[i] = WMGetFromPLArray(list, i); database->searchList[i] = WMGetFromPLArray(list, i);
} }
database->searchList[c] = NULL;
database->searchListArray = WMDeepCopyPropList(list); database->searchListArray = WMDeepCopyPropList(list);
} }
+1 -1
View File
@@ -35,7 +35,7 @@ WMInitializeApplication(char *applicationName, int *argc, char **argv)
assert(argv!=NULL); assert(argv!=NULL);
assert(applicationName!=NULL); assert(applicationName!=NULL);
/* // TODO: check if to move inside #ifdef I18N */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#ifdef I18N #ifdef I18N
+1 -1
View File
@@ -102,7 +102,7 @@ WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
gray.red = 0xae; gray.red = 0xae;
gray.green = 0xaa; gray.green = 0xaa;
gray.blue = 0xae; gray.blue = 0xae;
gray.alpha = 0; gray.alpha = 0xff;
if (!color) if (!color)
color = &gray; color = &gray;
+83 -31
View File
@@ -275,40 +275,97 @@ W_BalloonHandleEnterView(WMView *view)
static void static void
drawBalloon(Display *dpy, Pixmap pix, GC gc, int x, int y, int w, int h, drawBalloon(WMScreen *scr, Pixmap bitmap, Pixmap pix, int x, int y, int w,
int side) int h, int side)
{ {
Display *dpy = scr->display;
WMColor *white = WMWhiteColor(scr);
WMColor *black = WMBlackColor(scr);
GC bgc = scr->monoGC;
GC gc = WMColorGC(white);
int rad = h*3/10; int rad = h*3/10;
XPoint pt[3]; XPoint pt[3], ipt[3];
int w1;
XFillArc(dpy, pix, gc, x, y, rad, rad, 90*64, 90*64); /* outline */
XFillArc(dpy, pix, gc, x, y+h-1-rad, rad, rad, 180*64, 90*64); XSetForeground(dpy, bgc, 1);
XFillArc(dpy, pix, gc, x+w-1-rad, y, rad, rad, 0*64, 90*64); XFillArc(dpy, bitmap, bgc, x, y, rad, rad, 90*64, 90*64);
XFillArc(dpy, pix, gc, x+w-1-rad, y+h-1-rad, rad, rad, 270*64, 90*64); XFillArc(dpy, bitmap, bgc, x, y+h-1-rad, rad, rad, 180*64, 90*64);
XFillRectangle(dpy, pix, gc, x, y+rad/2, w, h-rad); XFillArc(dpy, bitmap, bgc, x+w-1-rad, y, rad, rad, 0*64, 90*64);
XFillRectangle(dpy, pix, gc, x+rad/2, y, w-rad, h); XFillArc(dpy, bitmap, bgc, x+w-1-rad, y+h-1-rad, rad, rad, 270*64, 90*64);
XFillRectangle(dpy, bitmap, bgc, x, y+rad/2, w, h-rad);
XFillRectangle(dpy, bitmap, bgc, x+rad/2, y, w-rad, h);
/* interior */
XFillArc(dpy, pix, gc, x+1, y+1, rad, rad, 90*64, 90*64);
XFillArc(dpy, pix, gc, x+1, y+h-2-rad, rad, rad, 180*64, 90*64);
XFillArc(dpy, pix, gc, x+w-2-rad, y+1, rad, rad, 0*64, 90*64);
XFillArc(dpy, pix, gc, x+w-2-rad, y+h-2-rad, rad, rad, 270*64, 90*64);
XFillRectangle(dpy, pix, gc, x+1, y+1+rad/2, w-2, h-2-rad);
XFillRectangle(dpy, pix, gc, x+1+rad/2, y+1, w-2-rad, h-2);
if (side & BOTTOM) { if (side & BOTTOM) {
pt[0].y = y+h-1; pt[0].y = y+h-1;
pt[1].y = y+h-1+SPACE; pt[1].y = y+h-1+SPACE;
pt[2].y = y+h-1; pt[2].y = y+h-1;
ipt[0].y = pt[0].y-1;
ipt[1].y = pt[1].y-1;
ipt[2].y = pt[2].y-1;
} else { } else {
pt[0].y = y; pt[0].y = y;
pt[1].y = y-SPACE; pt[1].y = y-SPACE;
pt[2].y = y; pt[2].y = y;
ipt[0].y = pt[0].y+1;
ipt[1].y = pt[1].y+1;
ipt[2].y = pt[2].y+1;
} }
/*w1 = WMAX(h, 24);*/
w1 = WMAX(h, 21);
if (side & RIGHT) { if (side & RIGHT) {
pt[0].x = x+w-h+2*h/16; pt[0].x = x+w-w1+2*w1/16;
pt[1].x = x+w-h+11*h/16; pt[1].x = x+w-w1+11*w1/16;
pt[2].x = x+w-h+7*h/16; pt[2].x = x+w-w1+7*w1/16;
ipt[0].x = x+1+w-w1+2*(w1-1)/16;
ipt[1].x = x+1+w-w1+11*(w1-1)/16;
ipt[2].x = x+1+w-w1+7*(w1-1)/16;
/*ipt[0].x = pt[0].x+1;
ipt[1].x = pt[1].x;
ipt[2].x = pt[2].x;*/
} else { } else {
pt[0].x = x+h-2*h/16; pt[0].x = x+w1-2*w1/16;
pt[1].x = x+h-11*h/16; pt[1].x = x+w1-11*w1/16;
pt[2].x = x+h-7*h/16; pt[2].x = x+w1-7*w1/16;
ipt[0].x = x-1+w1-2*(w1-1)/16;
ipt[1].x = x-1+w1-11*(w1-1)/16;
ipt[2].x = x-1+w1-7*(w1-1)/16;
/*ipt[0].x = pt[0].x-1;
ipt[1].x = pt[1].x;
ipt[2].x = pt[2].x;*/
} }
XFillPolygon(dpy, pix, gc, pt, 3, Convex, CoordModeOrigin);
XFillPolygon(dpy, bitmap, bgc, pt, 3, Convex, CoordModeOrigin);
XFillPolygon(dpy, pix, gc, ipt, 3, Convex, CoordModeOrigin);
/* fix outline */
XDrawLines(dpy, pix, WMColorGC(black), pt, 3, CoordModeOrigin);
if (side & RIGHT) {
pt[0].x++;
pt[2].x--;
} else {
pt[0].x--;
pt[2].x++;
}
XDrawLines(dpy, pix, WMColorGC(black), pt, 3, CoordModeOrigin);
WMReleaseColor(white);
WMReleaseColor(black);
} }
@@ -320,7 +377,6 @@ makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask)
Pixmap pixmap; Pixmap pixmap;
int x, y; int x, y;
WMColor *black = WMBlackColor(scr); WMColor *black = WMBlackColor(scr);
WMColor *white = WMWhiteColor(scr);
bitmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, 1); bitmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, 1);
@@ -328,10 +384,10 @@ makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask)
XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width+SPACE, height+SPACE); XFillRectangle(dpy, bitmap, scr->monoGC, 0, 0, width+SPACE, height+SPACE);
pixmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE, pixmap = XCreatePixmap(dpy, scr->rootWin, width+SPACE, height+SPACE,
scr->depth); scr->depth);
XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0, XFillRectangle(dpy, pixmap, WMColorGC(black), 0, 0, width+SPACE,
width+SPACE, height+SPACE); height+SPACE);
if (side & BOTTOM) { if (side & BOTTOM) {
y = 0; y = 0;
@@ -340,22 +396,18 @@ makePixmap(WMScreen *scr, int width, int height, int side, Pixmap *mask)
} }
x = 0; x = 0;
XSetForeground(dpy, scr->monoGC, 1); drawBalloon(scr, bitmap, pixmap, x, y, width, height, side);
drawBalloon(dpy, bitmap, scr->monoGC, x, y, width, height, side);
drawBalloon(dpy, pixmap, WMColorGC(white), x+1, y+1, width-2, height-2,
side);
*mask = bitmap; *mask = bitmap;
WMReleaseColor(black); WMReleaseColor(black);
WMReleaseColor(white);
return pixmap; return pixmap;
} }
static void static void
showText(Balloon *bPtr, int x, int y, int h, int w, char *text) showText(Balloon *bPtr, int x, int y, int w, int h, char *text)
{ {
WMScreen *scr = bPtr->view->screen; WMScreen *scr = bPtr->view->screen;
Display *dpy = WMScreenDisplay(scr); Display *dpy = WMScreenDisplay(scr);
@@ -424,7 +476,7 @@ showText(Balloon *bPtr, int x, int y, int h, int w, char *text)
W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2, W_PaintText(bPtr->view, pixmap, font, 8, ty + (height - textHeight)/2,
width, bPtr->flags.alignment, width, bPtr->flags.alignment,
WMColorGC(bPtr->textColor ? bPtr->textColor : scr->black), bPtr->textColor ? bPtr->textColor : scr->black,
False, text, strlen(text)); False, text, strlen(text));
XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap); XSetWindowBackgroundPixmap(dpy, bPtr->view->window, pixmap);
+17 -22
View File
@@ -280,13 +280,13 @@ drawTitleOfColumn(WMBrowser *bPtr, int column)
&titleLen, widthC); &titleLen, widthC);
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
bPtr->columnSize.width, WACenter, WMColorGC(scr->white), bPtr->columnSize.width, WACenter, scr->white,
False, titleBuf, titleLen); False, titleBuf, titleLen);
wfree (titleBuf); wfree (titleBuf);
} else { } else {
W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x, W_PaintText(bPtr->view, bPtr->view->window, scr->boldFont, x,
(bPtr->titleHeight-WMFontHeight(scr->boldFont))/2, (bPtr->titleHeight-WMFontHeight(scr->boldFont))/2,
bPtr->columnSize.width, WACenter, WMColorGC(scr->white), bPtr->columnSize.width, WACenter, scr->white,
False, bPtr->titles[column], titleLen); False, bPtr->titles[column], titleLen);
} }
} }
@@ -540,50 +540,45 @@ willResizeBrowser(W_ViewDelegate *self, WMView *view,
static void static void
paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect)
WMRect *rect)
{ {
WMView *view = W_VIEW(lPtr); WMView *view = W_VIEW(lPtr);
W_Screen *scr = view->screen; W_Screen *scr = view->screen;
int width, height, x, y; Display *display = scr->display;
WMFont *font = ((state & WLDSIsBranch) ? scr->boldFont : scr->normalFont);
WMColor *backColor = ((state & WLDSSelected) ? scr->white : view->backColor);
int width, height, x, y, textLen;
width = rect->size.width; width = rect->size.width;
height = rect->size.height; height = rect->size.height;
x = rect->pos.x; x = rect->pos.x;
y = rect->pos.y; y = rect->pos.y;
textLen = strlen(text);
if (state & WLDSSelected) XFillRectangle(display, d, WMColorGC(backColor), x, y, width, height);
XFillRectangle(scr->display, d, WMColorGC(scr->white), x, y,
width, height);
else
XClearArea(scr->display, d, x, y, width, height, False);
if (text) { if (text) {
/* Avoid overlaping... */ /* Avoid overlaping... */
WMFont *font = (state & WLDSIsBranch) ? scr->boldFont : scr->normalFont;
int textLen = strlen(text);
int widthC = (state & WLDSIsBranch) ? width-20 : width-8; int widthC = (state & WLDSIsBranch) ? width-20 : width-8;
if (WMWidthOfString(font, text, textLen) > widthC) { if (WMWidthOfString(font, text, textLen) > widthC) {
char *textBuf = createTruncatedString(font, text, &textLen, widthC); char *textBuf = createTruncatedString(font, text, &textLen, widthC);
W_PaintText(view, d, font, x+4, y, widthC, W_PaintText(view, d, font, x+4, y, widthC,
WALeft, WMColorGC(scr->black), False, textBuf, textLen); WALeft, scr->black, False, textBuf, textLen);
wfree(textBuf); wfree(textBuf);
} else { } else {
W_PaintText(view, d, font, x+4, y, widthC, W_PaintText(view, d, font, x+4, y, widthC,
WALeft, WMColorGC(scr->black), False, text, textLen); WALeft, scr->black, False, text, textLen);
} }
} }
if (state & WLDSIsBranch) { if (state & WLDSIsBranch) {
XDrawLine(scr->display, d, WMColorGC(scr->darkGray), x+width-11, y+3, WMColor *lineColor = ((state & WLDSSelected) ? scr->gray : scr->white);
XDrawLine(display, d, WMColorGC(scr->darkGray), x+width-11, y+3,
x+width-6, y+height/2); x+width-6, y+height/2);
if (state & WLDSSelected) XDrawLine(display, d, WMColorGC(lineColor), x+width-11, y+height-5,
XDrawLine(scr->display, d,WMColorGC(scr->gray), x+width-11, y+height-5, x+width-6, y+height/2);
x+width-6, y+height/2); XDrawLine(display, d, WMColorGC(scr->black), x+width-12, y+3,
else
XDrawLine(scr->display, d,WMColorGC(scr->white), x+width-11, y+height-5,
x+width-6, y+height/2);
XDrawLine(scr->display, d, WMColorGC(scr->black), x+width-12, y+3,
x+width-12, y+height-5); x+width-12, y+height-5);
} }
} }
+6 -6
View File
@@ -612,9 +612,9 @@ paintButton(Button *bPtr)
char *caption; char *caption;
WMPixmap *image; WMPixmap *image;
WMColor *textColor; WMColor *textColor;
GC gc; WMColor *backColor;
gc = NULL; backColor = NULL;
caption = bPtr->caption; caption = bPtr->caption;
if (bPtr->flags.enabled) { if (bPtr->flags.enabled) {
@@ -637,7 +637,7 @@ paintButton(Button *bPtr)
if (bPtr->flags.selected) { if (bPtr->flags.selected) {
if (bPtr->flags.stateLight) { if (bPtr->flags.stateLight) {
gc = WMColorGC(scrPtr->white); backColor = scrPtr->white;
textColor = scrPtr->black; textColor = scrPtr->black;
} }
@@ -662,7 +662,7 @@ paintButton(Button *bPtr)
offset = 1; offset = 1;
} }
if (bPtr->flags.pushLight) { if (bPtr->flags.pushLight) {
gc = WMColorGC(scrPtr->white); backColor = scrPtr->white;
textColor = scrPtr->black; textColor = scrPtr->black;
} }
@@ -676,10 +676,10 @@ paintButton(Button *bPtr)
} }
} }
W_PaintTextAndImage(bPtr->view, True, WMColorGC(textColor), W_PaintTextAndImage(bPtr->view, True, textColor,
(bPtr->font!=NULL ? bPtr->font : scrPtr->normalFont), (bPtr->font!=NULL ? bPtr->font : scrPtr->normalFont),
relief, caption, bPtr->flags.alignment, image, relief, caption, bPtr->flags.alignment, image,
bPtr->flags.imagePosition, gc, offset); bPtr->flags.imagePosition, backColor, offset);
} }
+48 -14
View File
@@ -16,8 +16,9 @@ static unsigned char DARK_STIPPLE_BITS[] = {
0x0a, 0x04, 0x0a, 0x01}; 0x0a, 0x04, 0x0a, 0x01};
static WMColor *createRGBColor(WMScreen *scr, unsigned short red, static WMColor *createRGBAColor(WMScreen *scr, unsigned short red,
unsigned short green, unsigned short blue); unsigned short green, unsigned short blue,
unsigned short alpha);
/* /*
* TODO: make the color creation code return the same WMColor for the * TODO: make the color creation code return the same WMColor for the
@@ -28,7 +29,7 @@ static WMColor *createRGBColor(WMScreen *scr, unsigned short red,
static WMColor* static WMColor*
findCloseColor(WMScreen *scr, unsigned short red, unsigned short green, findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue) unsigned short blue, unsigned short alpha)
{ {
WMColor *color; WMColor *color;
XColor xcolor; XColor xcolor;
@@ -37,6 +38,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
rcolor.red = red>>8; rcolor.red = red>>8;
rcolor.green = green>>8; rcolor.green = green>>8;
rcolor.blue = blue>>8; rcolor.blue = blue>>8;
rcolor.alpha = alpha>>8;
if (!RGetClosestXColor(scr->rcontext, &rcolor, &xcolor)) if (!RGetClosestXColor(scr->rcontext, &rcolor, &xcolor))
return NULL; return NULL;
@@ -49,6 +51,7 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
color->screen = scr; color->screen = scr;
color->refCount = 1; color->refCount = 1;
color->color = xcolor; color->color = xcolor;
color->alpha = alpha;
color->flags.exact = 1; color->flags.exact = 1;
color->gc = NULL; color->gc = NULL;
@@ -58,8 +61,8 @@ findCloseColor(WMScreen *scr, unsigned short red, unsigned short green,
static WMColor* static WMColor*
createRGBColor(WMScreen *scr, unsigned short red, unsigned short green, createRGBAColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue) unsigned short blue, unsigned short alpha)
{ {
WMColor *color; WMColor *color;
XColor xcolor; XColor xcolor;
@@ -76,6 +79,7 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
color->screen = scr; color->screen = scr;
color->refCount = 1; color->refCount = 1;
color->color = xcolor; color->color = xcolor;
color->alpha = alpha;
color->flags.exact = 1; color->flags.exact = 1;
color->gc = NULL; color->gc = NULL;
@@ -83,15 +87,30 @@ createRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
} }
WMColor* WMColor*
WMCreateRGBColor(WMScreen *scr, unsigned short red, unsigned short green, WMCreateRGBColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue, Bool exact) unsigned short blue, Bool exact)
{ {
WMColor *color = NULL; WMColor *color = NULL;
if (!exact || !(color=createRGBColor(scr, red, green, blue))) { if (!exact || !(color=createRGBAColor(scr, red, green, blue, 0xffff))) {
color = findCloseColor(scr, red, green, blue); color = findCloseColor(scr, red, green, blue, 0xffff);
}
if (!color)
color = WMBlackColor(scr);
return color;
}
WMColor*
WMCreateRGBAColor(WMScreen *scr, unsigned short red, unsigned short green,
unsigned short blue, unsigned short alpha, Bool exact)
{
WMColor *color = NULL;
if (!exact || !(color=createRGBAColor(scr, red, green, blue, alpha))) {
color = findCloseColor(scr, red, green, blue, alpha);
} }
if (!color) if (!color)
color = WMBlackColor(scr); color = WMBlackColor(scr);
@@ -112,9 +131,9 @@ WMCreateNamedColor(WMScreen *scr, char *name, Bool exact)
if (scr->visual->class == TrueColor) if (scr->visual->class == TrueColor)
exact = True; exact = True;
if (!exact || !(color=createRGBColor(scr, xcolor.red, xcolor.green, if (!exact || !(color=createRGBAColor(scr, xcolor.red, xcolor.green,
xcolor.blue))) { xcolor.blue, 0xffff))) {
color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue); color = findCloseColor(scr, xcolor.red, xcolor.green, xcolor.blue, 0xffff);
} }
return color; return color;
} }
@@ -147,6 +166,13 @@ WMReleaseColor(WMColor *color)
} }
void
WMSetColorAlpha(WMColor *color, unsigned short alpha)
{
color->alpha = alpha;
}
void void
WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y, WMPaintColorSwatch(WMColor *color, Drawable d, int x, int y,
unsigned int width, unsigned int height) unsigned int width, unsigned int height)
@@ -201,7 +227,6 @@ WMWhiteColor(WMScreen *scr)
} }
WMColor* WMColor*
WMBlackColor(WMScreen *scr) WMBlackColor(WMScreen *scr)
{ {
@@ -231,7 +256,7 @@ WMGrayColor(WMScreen *scr)
LIGHT_STIPPLE_BITS, LIGHT_STIPPLE_WIDTH, LIGHT_STIPPLE_BITS, LIGHT_STIPPLE_WIDTH,
LIGHT_STIPPLE_HEIGHT); LIGHT_STIPPLE_HEIGHT);
color = createRGBColor(scr, 0xffff, 0xffff, 0xffff); color = createRGBAColor(scr, 0xffff, 0xffff, 0xffff, 0xffff);
gcv.foreground = white->color.pixel; gcv.foreground = white->color.pixel;
gcv.background = black->color.pixel; gcv.background = black->color.pixel;
@@ -272,7 +297,7 @@ WMDarkGrayColor(WMScreen *scr)
DARK_STIPPLE_BITS, DARK_STIPPLE_WIDTH, DARK_STIPPLE_BITS, DARK_STIPPLE_WIDTH,
DARK_STIPPLE_HEIGHT); DARK_STIPPLE_HEIGHT);
color = createRGBColor(scr, 0, 0, 0); color = createRGBAColor(scr, 0, 0, 0, 0xffff);
gcv.foreground = white->color.pixel; gcv.foreground = white->color.pixel;
gcv.background = black->color.pixel; gcv.background = black->color.pixel;
@@ -317,6 +342,13 @@ WMBlueComponentOfColor(WMColor *color)
} }
unsigned short
WMGetColorAlpha(WMColor *color)
{
return color->alpha;
}
char* char*
WMGetColorRGBDescription(WMColor *color) WMGetColorRGBDescription(WMColor *color)
{ {
@@ -327,3 +359,5 @@ WMGetColorRGBDescription(WMColor *color)
return str; return str;
} }
+44 -45
View File
@@ -36,7 +36,8 @@
#include <errno.h> #include <errno.h>
/* BUG There's something fishy with shaped windows */ /* BUG There's something fishy with shaped windows */
#if 1 /* Whithout shape extension the magnified image is completely broken -Dan */
#if 0
#ifdef SHAPE #ifdef SHAPE
#define SHAPE_WAS_DEFINED #define SHAPE_WAS_DEFINED
#undef SHAPE #undef SHAPE
@@ -282,6 +283,10 @@ enum {
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
/* Silly hack for Windows systems with cygwin */
#ifndef O_BINARY
# define O_BINARY 0
#endif
static int fetchFile(char* toPath, char *imageSrcFile, static int fetchFile(char* toPath, char *imageSrcFile,
char *imageDestFileName); char *imageDestFileName);
@@ -302,9 +307,9 @@ static WMPoint magnifyInitialize(W_ColorPanel *panel);
static void magnifyPutCursor(WMWidget *w, void *data); static void magnifyPutCursor(WMWidget *w, void *data);
static Pixmap magnifyCreatePixmap(WMColorPanel *panel); static Pixmap magnifyCreatePixmap(WMColorPanel *panel);
static void magnifyGetImageStored(W_ColorPanel *panel, int x1, int y1, static void magnifyGetImageStored(W_ColorPanel *panel, int x1, int y1,
int x2, int y2); int x2, int y2);
static XImage* magnifyGetImage(WMScreen *scr, XImage *image, int x, int y, static XImage* magnifyGetImage(WMScreen *scr, XImage *image, int x, int y,
int w, int h); int w, int h);
static wheelMatrix* wheelCreateMatrix(unsigned int width , unsigned int height); static wheelMatrix* wheelCreateMatrix(unsigned int width , unsigned int height);
static void wheelDestroyMatrix(wheelMatrix *matrix); static void wheelDestroyMatrix(wheelMatrix *matrix);
@@ -601,7 +606,7 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap, W_PaintText(W_VIEW(panel->grayBrightnessS), pixmap->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scrPtr->white), panel->font12, 2, 0, 100, WALeft, scrPtr->white,
False, _("Brightness"), strlen(_("Brightness"))); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -677,8 +682,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbRedS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Red"), 2, 0, 100, WALeft, scrPtr->white, False, _("Red"),
strlen(_("Red"))); strlen(_("Red")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -710,8 +715,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbGreenS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Green"), 2, 0, 100, WALeft, scrPtr->white, False, _("Green"),
strlen(_("Green"))); strlen(_("Green")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -744,8 +749,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->rgbBlueS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->white), False, _("Blue"), 2, 0, 100, WALeft, scrPtr->white, False, _("Blue"),
strlen(_("Blue"))); strlen(_("Blue")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -804,8 +809,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykCyanS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Cyan"), 2, 0, 100, WALeft, scrPtr->black, False, _("Cyan"),
strlen(_("Cyan"))); strlen(_("Cyan")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -838,8 +843,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykMagentaS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Magenta"), 2, 0, 100, WALeft, scrPtr->black, False, _("Magenta"),
strlen(_("Magenta"))); strlen(_("Magenta")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -872,8 +877,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykYellowS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Yellow"), 2, 0, 100, WALeft, scrPtr->black, False, _("Yellow"),
strlen(_("Yellow"))); strlen(_("Yellow")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -907,8 +912,8 @@ makeColorPanel(WMScreen *scrPtr, char *name)
if (pixmap) if (pixmap)
W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12, W_PaintText(W_VIEW(panel->cmykBlackS), pixmap->pixmap, panel->font12,
2, 0, 100, WALeft, WMColorGC(scrPtr->black), False, _("Black"), 2, 0, 100, WALeft, scrPtr->black, False, _("Black"),
strlen(_("Black"))); strlen(_("Black")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -1282,7 +1287,7 @@ readXColors(W_ColorPanel *panel)
return; return;
} }
else { else {
if ((rgbtxt = fopen(RGBTXT, "r"))) { if ((rgbtxt = fopen(RGBTXT, "rb"))) {
while (fgets(line, MAX_LENGTH, rgbtxt)) { while (fgets(line, MAX_LENGTH, rgbtxt)) {
if (sscanf(line, "%d%d%d %[^\n]", &red, &green, &blue, name)) { if (sscanf(line, "%d%d%d %[^\n]", &red, &green, &blue, name)) {
color = wmalloc(sizeof(RColor)); color = wmalloc(sizeof(RColor));
@@ -2820,7 +2825,7 @@ hsbUpdateBrightnessGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbBrightnessS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, WMColorGC(scr->white), panel->font12, 2, 0, 100, WALeft, scr->white,
False, _("Brightness"), strlen(_("Brightness"))); False, _("Brightness"), strlen(_("Brightness")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -2855,8 +2860,8 @@ hsbUpdateSaturationGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbSaturationS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(from.hsv.value < 128 ? scr->white : scr->black), False, from.hsv.value < 128 ? scr->white : scr->black, False,
_("Saturation"), strlen(_("Saturation"))); _("Saturation"), strlen(_("Saturation")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -2891,8 +2896,8 @@ hsbUpdateHueGradient(W_ColorPanel *panel)
if (sliderPxmp) if (sliderPxmp)
W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap,
panel->font12, 2, 0, 100, WALeft, panel->font12, 2, 0, 100, WALeft,
WMColorGC(hsvcolor.value < 128 ? scr->white : scr->black), False, hsvcolor.value < 128 ? scr->white : scr->black, False,
_("Hue"), strlen(_("Hue"))); _("Hue"), strlen(_("Hue")));
else else
wwarning(_("Color Panel: Could not allocate memory")); wwarning(_("Color Panel: Could not allocate memory"));
@@ -3418,14 +3423,13 @@ static void
colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text, colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
int state, WMRect *rect) int state, WMRect *rect)
{ {
int width, height, x, y; WMScreen *scr = WMWidgetScreen(lPtr);
RColor color = *((RColor *)WMGetListItem(lPtr, index)->clientData); Display *dpy = WMScreenDisplay(scr);
WMScreen *scr = WMWidgetScreen(lPtr); WMView *view = W_VIEW(lPtr);
Display *dpy = WMScreenDisplay(scr); RColor color = *((RColor *)WMGetListItem(lPtr, index)->clientData);
W_ColorPanel *panel = WMGetHangedData(lPtr); W_ColorPanel *panel = WMGetHangedData(lPtr);
WMColor *white = WMWhiteColor(scr); int width, height, x, y;
WMColor *black = WMBlackColor(scr); WMColor *fillColor;
WMColor *fillColor;
width = rect->size.width; width = rect->size.width;
height = rect->size.height; height = rect->size.height;
@@ -3433,22 +3437,17 @@ colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text,
y = rect->pos.y; y = rect->pos.y;
if (state & WLDSSelected) if (state & WLDSSelected)
WMPaintColorSwatch(white, d, x +15, y, width -15, height); XFillRectangle(dpy, d, WMColorGC(scr->white), x, y, width, height);
else else
XClearArea(dpy, d, x +15, y, width -15, height, False); XFillRectangle(dpy, d, WMColorGC(view->backColor), x, y, width, height);
fillColor = WMCreateRGBColor(scr, color.red*256, color.green*256, fillColor = WMCreateRGBColor(scr, color.red<<8, color.green<<8,
color.blue*256, False); color.blue<<8, True);
WMSetColorInGC(fillColor, WMColorGC(fillColor)); XFillRectangle(dpy, d, WMColorGC(fillColor), x, y, 15, height);
WMPaintColorSwatch(fillColor, d, x, y, 15, 15);
WMReleaseColor(fillColor); WMReleaseColor(fillColor);
WMDrawString(scr, d, WMColorGC(black), panel->font12, x+18, y, text, WMDrawString(scr, d, scr->black, panel->font12, x+18, y, text, strlen(text));
strlen(text));
WMReleaseColor(white);
WMReleaseColor(black);
} }
@@ -3644,13 +3643,13 @@ fetchFile(char *toPath, char *srcFile, char *destFile)
char *tmp; char *tmp;
char buf[BUFSIZE]; char buf[BUFSIZE];
if ((src = open(srcFile, O_RDONLY)) == 0) { if ((src = open(srcFile, O_RDONLY|O_BINARY)) == 0) {
wsyserror(_("Could not open %s"), srcFile); wsyserror(_("Could not open %s"), srcFile);
return -1; return -1;
} }
tmp = wstrconcat(toPath, destFile); tmp = wstrconcat(toPath, destFile);
if ((dest = open( tmp, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) if ((dest = open( tmp, O_RDWR|O_CREAT|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH))
== 0) { == 0) {
wsyserror(_("Could not create %s"), tmp); wsyserror(_("Could not create %s"), tmp);
wfree(tmp); wfree(tmp);
+4 -5
View File
@@ -193,13 +193,13 @@ WMCreateColorWell(WMWidget *parent)
WMAddNotificationObserver(colorChangedObserver, cPtr, WMAddNotificationObserver(colorChangedObserver, cPtr,
WMColorPanelColorChangedNotification, NULL); WMColorPanelColorChangedNotification, NULL);
WMSetViewDragSourceProcs(cPtr->view, &_DragSourceProcs); WMSetViewDragSourceProcs(cPtr->colorView, &_DragSourceProcs);
WMSetViewDragDestinationProcs(cPtr->view, &_DragDestinationProcs); WMSetViewDragDestinationProcs(cPtr->colorView, &_DragDestinationProcs);
{ {
char *types[2] = {"application/X-color", NULL}; char *types[2] = {"application/X-color", NULL};
WMRegisterViewForDraggedTypes(cPtr->view, types); WMRegisterViewForDraggedTypes(cPtr->colorView, types);
} }
return cPtr; return cPtr;
@@ -370,12 +370,11 @@ handleDragEvents(XEvent *event, void *data)
offs.height = 2; offs.height = 2;
pixmap = makeDragPixmap(cPtr); pixmap = makeDragPixmap(cPtr);
WMDragImageFromView(cPtr->view, pixmap, types, WMDragImageFromView(cPtr->colorView, pixmap, types,
wmkpoint(event->xmotion.x_root, wmkpoint(event->xmotion.x_root,
event->xmotion.y_root), event->xmotion.y_root),
offs, event, True); offs, event, True);
WMReleasePixmap(pixmap); WMReleasePixmap(pixmap);
} }
} }
+13 -18
View File
@@ -62,36 +62,31 @@ static WMEventHook *extraEventHandler=NULL;
* WMCreateEventHandler-- * WMCreateEventHandler--
* Create an event handler and put it in the event handler list for the * Create an event handler and put it in the event handler list for the
* view. If the same callback and clientdata are already used in another * view. If the same callback and clientdata are already used in another
* handler, the masks are swapped. * handler, the masks are OR'ed.
* *
*/ */
void void
WMCreateEventHandler(WMView *view, unsigned long mask, WMEventProc *eventProc, WMCreateEventHandler(WMView *view, unsigned long mask, WMEventProc *eventProc,
void *clientData) void *clientData)
{ {
W_EventHandler *handler, *ptr; W_EventHandler *hPtr;
unsigned long eventMask;
WMArrayIterator iter; WMArrayIterator iter;
WM_ITERATE_ARRAY(view->eventHandlers, hPtr, iter) {
handler = NULL; if (hPtr->clientData==clientData && hPtr->proc==eventProc) {
eventMask = mask; hPtr->eventMask |= mask;
return;
WM_ITERATE_ARRAY(view->eventHandlers, ptr, iter) {
if (ptr->clientData == clientData && ptr->proc == eventProc) {
handler = ptr;
eventMask |= ptr->eventMask;
} }
} }
if (!handler) {
handler = wmalloc(sizeof(W_EventHandler));
WMAddToArray(view->eventHandlers, handler); hPtr = wmalloc(sizeof(W_EventHandler));
}
/* select events for window */ /* select events for window */
handler->eventMask = eventMask; hPtr->eventMask = mask;
handler->proc = eventProc; hPtr->proc = eventProc;
handler->clientData = clientData; hPtr->clientData = clientData;
WMAddToArray(view->eventHandlers, hPtr);
} }
+4 -1
View File
@@ -548,12 +548,15 @@ listDirectoryOnColumn(WMFilePanel *panel, int column, char *path)
DIR *dir; DIR *dir;
struct stat stat_buf; struct stat stat_buf;
char pbuf[PATH_MAX+16]; char pbuf[PATH_MAX+16];
char *name;
assert(column >= 0); assert(column >= 0);
assert(path != NULL); assert(path != NULL);
/* put directory name in the title */ /* put directory name in the title */
WMSetBrowserColumnTitle(bPtr, column, get_name_from_path(path)); name = get_name_from_path(path);
WMSetBrowserColumnTitle(bPtr, column, name);
wfree(name);
dir = opendir(path); dir = opendir(path);
+747 -226
View File
File diff suppressed because it is too large Load Diff
+59 -14
View File
@@ -10,6 +10,13 @@
#include <string.h> #include <string.h>
/* XXX TODO */
char *WMFontPanelFontChangedNotification = "WMFontPanelFontChangedNotification";
typedef struct W_FontPanel { typedef struct W_FontPanel {
WMWindow *win; WMWindow *win;
@@ -27,6 +34,9 @@ typedef struct W_FontPanel {
WMTextField *sizT; WMTextField *sizT;
WMList *sizLs; WMList *sizLs;
WMAction2 *action;
void *data;
WMButton *revertB; WMButton *revertB;
WMButton *setB; WMButton *setB;
@@ -150,6 +160,26 @@ closeWindow(WMWidget *w, void *data)
static void
setClickedAction(WMWidget *w, void *data)
{
FontPanel *panel = (FontPanel*)data;
if (panel->action)
(*panel->action)(panel, panel->data);
}
static void
revertClickedAction(WMWidget *w, void *data)
{
FontPanel *panel = (FontPanel*)data;
/* XXX TODO */
}
WMFontPanel* WMFontPanel*
WMGetFontPanel(WMScreen *scr) WMGetFontPanel(WMScreen *scr)
{ {
@@ -250,11 +280,14 @@ WMGetFontPanel(WMScreen *scr)
WMResizeWidget(panel->setB, 70, 24); WMResizeWidget(panel->setB, 70, 24);
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5)); WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->setB, _("Set")); WMSetButtonText(panel->setB, _("Set"));
WMSetButtonAction(panel->setB, setClickedAction, panel);
panel->revertB = WMCreateCommandButton(panel->win); panel->revertB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->revertB, 70, 24); WMResizeWidget(panel->revertB, 70, 24);
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5)); WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->revertB, _("Revert")); WMSetButtonText(panel->revertB, _("Revert"));
WMSetButtonAction(panel->revertB, revertClickedAction, panel);
WMRealizeWidget(panel->win); WMRealizeWidget(panel->win);
@@ -350,6 +383,17 @@ WMGetFontPanelFontName(WMFontPanel *panel)
void
WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data)
{
panel->action = action;
panel->data = data;
}
static void static void
arrangeLowerFrame(FontPanel *panel) arrangeLowerFrame(FontPanel *panel)
{ {
@@ -573,7 +617,6 @@ addTypefaceToFamily(Family *family, char fontFields[NUM_FIELDS][256])
} }
/* /*
* families (same family name) (Hashtable of family -> array) * families (same family name) (Hashtable of family -> array)
* registries (same family but different registries) * registries (same family but different registries)
@@ -695,12 +738,11 @@ static void
listFamilies(WMScreen *scr, WMFontPanel *panel) listFamilies(WMScreen *scr, WMFontPanel *panel)
{ {
char **fontList; char **fontList;
int count; WMHashTable *families;
int i;
WMHashTable *families = WMCreateHashTable(WMStringPointerHashCallbacks);
char fields[NUM_FIELDS][256]; char fields[NUM_FIELDS][256];
WMHashEnumerator enumer; WMHashEnumerator enumer;
WMArray *array; WMArray *array;
int i, count;
fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE, fontList = XListFonts(scr->display, ALL_FONTS_MASK, MAX_FONTS_TO_RETRIEVE,
&count); &count);
@@ -710,6 +752,8 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
return; return;
} }
families = WMCreateHashTable(WMStringPointerHashCallbacks);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
int fname_len; int fname_len;
@@ -757,7 +801,6 @@ listFamilies(WMScreen *scr, WMFontPanel *panel)
item->clientData = fam; item->clientData = fam;
} }
/* Isn't this going to memleak since items weren't released? --Dan */
WMFreeArray(array); WMFreeArray(array);
} }
WMSortListItems(panel->famLs); WMSortListItems(panel->famLs);
@@ -788,15 +831,17 @@ getSelectedFont(FontPanel *panel, char buffer[], int bufsize)
size = WMGetTextFieldText(panel->sizT); size = WMGetTextFieldText(panel->sizT);
snprintf(buffer, bufsize, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s", snprintf(buffer, bufsize, "-%s-%s-%s-%s-%s-%s-%s-*-*-*-*-*-%s-%s",
family->foundry, family->foundry,
family->name, family->name,
face->weight, face->weight,
face->slant, face->slant,
face->setWidth, face->setWidth,
face->addStyle, face->addStyle,
size, size,
family->registry, family->registry,
family->encoding); family->encoding);
wfree(size);
} }
+40 -25
View File
@@ -8,7 +8,6 @@ typedef struct W_Frame {
char *caption; char *caption;
struct { struct {
WMReliefType relief:4; WMReliefType relief:4;
WMTitlePosition titlePosition:4; WMTitlePosition titlePosition:4;
@@ -44,8 +43,8 @@ WMSetFrameRelief(WMFrame *fPtr, WMReliefType relief)
{ {
fPtr->flags.relief = relief; fPtr->flags.relief = relief;
if (fPtr->view->flags.realized) { if (fPtr->view->flags.realized) {
repaintFrame(fPtr); repaintFrame(fPtr);
} }
} }
@@ -54,14 +53,15 @@ void
WMSetFrameTitle(WMFrame *fPtr, char *title) WMSetFrameTitle(WMFrame *fPtr, char *title)
{ {
if (fPtr->caption) if (fPtr->caption)
wfree(fPtr->caption); wfree(fPtr->caption);
if (title)
fPtr->caption = wstrdup(title);
else
fPtr->caption = NULL;
if (fPtr->view->flags.realized) { if (title)
repaintFrame(fPtr); fPtr->caption = wstrdup(title);
else
fPtr->caption = NULL;
if (fPtr->view->flags.realized) {
repaintFrame(fPtr);
} }
} }
@@ -82,14 +82,18 @@ paintFrame(Frame *fPtr)
{ {
W_View *view = fPtr->view; W_View *view = fPtr->view;
W_Screen *scrPtr = view->screen; W_Screen *scrPtr = view->screen;
int tx, ty, tw, th; WMFont *font = scrPtr->normalFont;
Display *display = scrPtr->display;
int tx, ty, tw, th, tlen;
int fy, fh; int fy, fh;
Bool drawTitle; Bool drawTitle;
if (fPtr->caption!=NULL) if (fPtr->caption!=NULL) {
th = WMFontHeight(scrPtr->normalFont); th = WMFontHeight(font);
else { tlen = strlen(fPtr->caption);
th = 0; } else {
th = 0;
tlen = 0;
} }
fh = view->size.height; fh = view->size.height;
@@ -138,13 +142,12 @@ paintFrame(Frame *fPtr)
fh = view->size.height; fh = view->size.height;
} }
if (fPtr->caption!=NULL && fPtr->flags.titlePosition!=WTPNoTitle) { if (tlen>0 && fPtr->flags.titlePosition!=WTPNoTitle) {
tw = WMWidthOfString(scrPtr->normalFont, fPtr->caption, tw = WMWidthOfString(font, fPtr->caption, tlen);
strlen(fPtr->caption));
tx = (view->size.width - tw) / 2; tx = (view->size.width - tw) / 2;
drawTitle = True; drawTitle = True;
} else { } else {
drawTitle = False; drawTitle = False;
} }
@@ -180,7 +183,7 @@ paintFrame(Frame *fPtr)
gc[3] = WMColorGC(scrPtr->white); gc[3] = WMColorGC(scrPtr->white);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
XSetRegion(scrPtr->display, gc[i], region); XSetRegion(display, gc[i], region);
} }
XDestroyRegion(region); XDestroyRegion(region);
@@ -188,14 +191,26 @@ paintFrame(Frame *fPtr)
fPtr->flags.relief, gc[0], gc[1], gc[2], gc[3]); fPtr->flags.relief, gc[0], gc[1], gc[2], gc[3]);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
XSetClipMask(scrPtr->display, gc[i], None); XSetClipMask(display, gc[i], None);
} }
} }
if (drawTitle) { if (drawTitle) {
WMDrawString(scrPtr, view->window, WMColorGC(scrPtr->black), /* can't draw AA text over and over again because it gets messed */
scrPtr->normalFont, tx, ty, fPtr->caption, /* // TODO create the dbl buffer pixmap when create/set frame title */
strlen(fPtr->caption)); if (font->antialiased) {
Drawable d;
d = XCreatePixmap(display, view->window, tw, th, scrPtr->depth);
XFillRectangle(display, d, WMColorGC(view->backColor), 0, 0, tw, th);
WMDrawString(scrPtr, d, scrPtr->black, font, 0, 0, fPtr->caption, tlen);
XCopyArea(display, d, view->window, scrPtr->copyGC, 0, 0, tw, th, tx, ty);
XFreePixmap(display, d);
} else {
WMDrawString(scrPtr, view->window, scrPtr->black, font, tx, ty,
fPtr->caption, tlen);
}
} }
} }
+42 -6
View File
@@ -3,6 +3,10 @@
#include "WINGsP.h" #include "WINGsP.h"
#include "wconfig.h" #include "wconfig.h"
#ifdef XFT
# include <X11/Xft/Xft.h>
#endif
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/keysym.h> #include <X11/keysym.h>
@@ -618,8 +622,23 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks); scrPtr->fontCache = WMCreateHashTable(WMStringPointerHashCallbacks);
scrPtr->xftFontCache = WMCreateHashTable(WMStringPointerHashCallbacks);
scrPtr->fontSetCache = WMCreateHashTable(WMStringPointerHashCallbacks); scrPtr->fontSetCache = WMCreateHashTable(WMStringPointerHashCallbacks);
scrPtr->xftFontSetCache = WMCreateHashTable(WMStringPointerHashCallbacks);
#ifdef XFT
# ifdef XFT2
scrPtr->hasXftSupport = 1;
# else
scrPtr->hasXftSupport = XftDefaultHasRender(scrPtr->display);
# endif
scrPtr->xftdraw = XftDrawCreate(scrPtr->display, W_DRAWABLE(scrPtr),
scrPtr->visual, scrPtr->colormap);
#endif
/* create input method stuff */ /* create input method stuff */
W_InitIMStuff(scrPtr); W_InitIMStuff(scrPtr);
@@ -672,7 +691,7 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
ShiftMask,LockMask,ControlMask,Mod1Mask, ShiftMask,LockMask,ControlMask,Mod1Mask,
Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask
}; };
unsigned int numLockMask, scrollLockMask; unsigned int numLockMask=0, scrollLockMask=0;
nlock = XKeysymToKeycode(display, XK_Num_Lock); nlock = XKeysymToKeycode(display, XK_Num_Lock);
slock = XKeysymToKeycode(display, XK_Scroll_Lock); slock = XKeysymToKeycode(display, XK_Scroll_Lock);
@@ -727,7 +746,6 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->clipGC = XCreateGC(display, W_DRAWABLE(scrPtr), GCFunction scrPtr->clipGC = XCreateGC(display, W_DRAWABLE(scrPtr), GCFunction
|GCGraphicsExposures, &gcv); |GCGraphicsExposures, &gcv);
stipple = XCreateBitmapFromData(display, W_DRAWABLE(scrPtr), stipple = XCreateBitmapFromData(display, W_DRAWABLE(scrPtr),
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT); STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT);
gcv.foreground = W_PIXEL(scrPtr->darkGray); gcv.foreground = W_PIXEL(scrPtr->darkGray);
@@ -738,10 +756,10 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
GCForeground|GCBackground|GCStipple GCForeground|GCBackground|GCStipple
|GCFillStyle|GCGraphicsExposures, &gcv); |GCFillStyle|GCGraphicsExposures, &gcv);
gcv.foreground = W_PIXEL(scrPtr->black); scrPtr->drawStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
gcv.background = W_PIXEL(scrPtr->white); GCGraphicsExposures, &gcv);
scrPtr->textFieldGC = XCreateGC(display, W_DRAWABLE(scrPtr), scrPtr->drawImStringGC = XCreateGC(display, W_DRAWABLE(scrPtr),
GCForeground|GCBackground, &gcv); GCGraphicsExposures, &gcv);
/* we need a 1bpp drawable for the monoGC, so borrow this one */ /* we need a 1bpp drawable for the monoGC, so borrow this one */
scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL); scrPtr->monoGC = XCreateGC(display, stipple, 0, NULL);
@@ -750,6 +768,17 @@ WMCreateScreenWithRContext(Display *display, int screen, RContext *context)
scrPtr->useMultiByte = WINGsConfiguration.useMultiByte; scrPtr->useMultiByte = WINGsConfiguration.useMultiByte;
if (scrPtr->hasXftSupport) {
scrPtr->antialiasedText = WINGsConfiguration.antialiasedText;
} else {
if (WINGsConfiguration.antialiasedText) {
wwarning(_("Text antialiasing is enabled in the configuration but"
" the X server doesn't have the required capabilities "
"(missing RENDER extension). Disabling text antialiasing."));
}
scrPtr->antialiasedText = False;
}
scrPtr->normalFont = WMSystemFontOfSize(scrPtr, scrPtr->normalFont = WMSystemFontOfSize(scrPtr,
WINGsConfiguration.defaultFontSize); WINGsConfiguration.defaultFontSize);
@@ -1043,6 +1072,13 @@ WMSetWidgetBackgroundColor(WMWidget *w, WMColor *color)
} }
WMColor*
WMGetWidgetBackgroundColor(WMWidget *w)
{
return W_VIEW(w)->backColor;
}
void void
WMRaiseWidget(WMWidget *w) WMRaiseWidget(WMWidget *w)
{ {
+2 -7
View File
@@ -205,14 +205,9 @@ static void
paintLabel(Label *lPtr) paintLabel(Label *lPtr)
{ {
W_Screen *scrPtr = lPtr->view->screen; W_Screen *scrPtr = lPtr->view->screen;
GC gc;
if (lPtr->textColor) W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap,
gc = WMColorGC(lPtr->textColor); lPtr->textColor ? lPtr->textColor : scrPtr->black,
else
gc = WMColorGC(scrPtr->black);
W_PaintTextAndImage(lPtr->view, !lPtr->flags.noWrap, gc,
(lPtr->font!=NULL ? lPtr->font : scrPtr->normalFont), (lPtr->font!=NULL ? lPtr->font : scrPtr->normalFont),
lPtr->flags.relief, lPtr->caption, lPtr->flags.relief, lPtr->caption,
lPtr->flags.alignment, lPtr->image, lPtr->flags.alignment, lPtr->image,
+55 -15
View File
@@ -33,6 +33,8 @@ typedef struct W_List {
WMScroller *vScroller; WMScroller *vScroller;
Pixmap doubleBuffer;
struct { struct {
unsigned int allowMultipleSelection:1; unsigned int allowMultipleSelection:1;
unsigned int allowEmptySelection:1; unsigned int allowEmptySelection:1;
@@ -83,6 +85,30 @@ W_ViewDelegate _ListViewDelegate = {
}; };
static void
updateDoubleBufferPixmap(WMList *lPtr)
{
WMView *view = lPtr->view;
WMScreen *scr = view->screen;
if (!view->flags.realized)
return;
if (lPtr->doubleBuffer)
XFreePixmap(scr->display, lPtr->doubleBuffer);
lPtr->doubleBuffer =
XCreatePixmap(scr->display, view->window, view->size.width,
lPtr->itemHeight, scr->depth);
}
static void
realizeObserver(void *self, WMNotification *not)
{
updateDoubleBufferPixmap(self);
}
static void static void
releaseItem(void *data) releaseItem(void *data)
{ {
@@ -138,6 +164,9 @@ WMCreateList(WMWidget *parent)
W_ResizeView(lPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT); W_ResizeView(lPtr->view, DEFAULT_WIDTH, DEFAULT_HEIGHT);
WMAddNotificationObserver(realizeObserver, lPtr,
WMViewRealizedNotification, lPtr->view);
return lPtr; return lPtr;
} }
@@ -279,6 +308,8 @@ WMSetListUserDrawItemHeight(WMList *lPtr, unsigned short height)
lPtr->flags.userItemHeight = 1; lPtr->flags.userItemHeight = 1;
lPtr->itemHeight = height; lPtr->itemHeight = height;
updateDoubleBufferPixmap(lPtr);
updateGeometry(lPtr); updateGeometry(lPtr);
} }
@@ -491,8 +522,10 @@ paintItem(List *lPtr, int index)
{ {
WMView *view = lPtr->view; WMView *view = lPtr->view;
W_Screen *scr = view->screen; W_Screen *scr = view->screen;
int width, height, x, y; Display *display = scr->display;
int width, height, x, y, tlen;
WMListItem *itemPtr; WMListItem *itemPtr;
Drawable d = lPtr->doubleBuffer;
itemPtr = WMGetFromArray(lPtr->items, index); itemPtr = WMGetFromArray(lPtr->items, index);
@@ -500,15 +533,17 @@ paintItem(List *lPtr, int index)
height = lPtr->itemHeight; height = lPtr->itemHeight;
x = 19; x = 19;
y = 2 + (index-lPtr->topItem) * lPtr->itemHeight + 1; y = 2 + (index-lPtr->topItem) * lPtr->itemHeight + 1;
tlen = strlen(itemPtr->text);
if (lPtr->flags.userDrawn) { if (lPtr->flags.userDrawn) {
WMRect rect; WMRect rect;
int flags; int flags;
rect.size.width = width; rect.size.width = width;
rect.size.height = height; rect.size.height = height;
rect.pos.x = x; rect.pos.x = 0;
rect.pos.y = y; rect.pos.y = 0;
flags = itemPtr->uflags; flags = itemPtr->uflags;
if (itemPtr->disabled) if (itemPtr->disabled)
@@ -519,19 +554,17 @@ paintItem(List *lPtr, int index)
flags |= WLDSIsBranch; flags |= WLDSIsBranch;
if (lPtr->draw) if (lPtr->draw)
(*lPtr->draw)(lPtr, index, view->window, itemPtr->text, flags, (*lPtr->draw)(lPtr, index, d, itemPtr->text, flags, &rect);
&rect);
} else {
if (itemPtr->selected) {
XFillRectangle(scr->display, view->window, WMColorGC(scr->white),
x, y, width, height);
} else {
XClearArea(scr->display, view->window, x, y, width, height, False);
}
W_PaintText(view, view->window, scr->normalFont, x+4, y, width, XCopyArea(display, d, view->window, scr->copyGC, 0, 0, width, height, x, y);
WALeft, WMColorGC(scr->black), False, } else {
itemPtr->text, strlen(itemPtr->text)); WMColor *back = (itemPtr->selected ? scr->white : view->backColor);
XFillRectangle(display, d, WMColorGC(back), 0, 0, width, height);
W_PaintText(view, d, scr->normalFont, 4, 0, width, WALeft, scr->black,
False, itemPtr->text, tlen);
XCopyArea(display, d, view->window, scr->copyGC, 0, 0, width, height, x, y);
} }
if ((index-lPtr->topItem+lPtr->fullFitLines)*lPtr->itemHeight > if ((index-lPtr->topItem+lPtr->fullFitLines)*lPtr->itemHeight >
@@ -1202,6 +1235,8 @@ didResizeList(W_ViewDelegate *self, WMView *view)
WMResizeWidget(lPtr->vScroller, 1, view->size.height-2); WMResizeWidget(lPtr->vScroller, 1, view->size.height-2);
updateDoubleBufferPixmap(lPtr);
updateGeometry(lPtr); updateGeometry(lPtr);
} }
@@ -1223,6 +1258,11 @@ destroyList(List *lPtr)
if (lPtr->items) if (lPtr->items)
WMFreeArray(lPtr->items); WMFreeArray(lPtr->items);
if (lPtr->doubleBuffer)
XFreePixmap(lPtr->view->screen->display, lPtr->doubleBuffer);
WMRemoveNotificationObserver(lPtr);
wfree(lPtr); wfree(lPtr);
} }
+22 -16
View File
@@ -101,7 +101,7 @@ fitText(char *text, WMFont *font, int width, int wrap)
i = 0; i = 0;
if (wrap) { if (wrap) {
if (text[0]=='\n') if (text[0]=='\n')
return 1; return 0;
do { do {
i++; i++;
@@ -154,7 +154,7 @@ W_GetTextHeight(WMFont *font, char *text, int width, int wrap)
void void
W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y, W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
int width, WMAlignment alignment, GC gc, int width, WMAlignment alignment, WMColor *color,
int wrap, char *text, int length) int wrap, char *text, int length)
{ {
char *ptr = text; char *ptr = text;
@@ -174,7 +174,7 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
else else
line_x = x + (width - line_width) / 2; line_x = x + (width - line_width) / 2;
WMDrawString(view->screen, d, gc, font, line_x, y, ptr, count); WMDrawString(view->screen, d, color, font, line_x, y, ptr, count);
if (wrap && ptr[count]!='\n') if (wrap && ptr[count]!='\n')
y += fheight; y += fheight;
@@ -191,10 +191,10 @@ W_PaintText(W_View *view, Drawable d, WMFont *font, int x, int y,
void void
W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font, W_PaintTextAndImage(W_View *view, int wrap, WMColor *textColor, W_Font *font,
WMReliefType relief, char *text, WMReliefType relief, char *text,
WMAlignment alignment, W_Pixmap *image, WMAlignment alignment, W_Pixmap *image,
WMImagePosition position, GC backGC, int ofs) WMImagePosition position, WMColor *backColor, int ofs)
{ {
W_Screen *screen = view->screen; W_Screen *screen = view->screen;
int ix, iy; int ix, iy;
@@ -208,24 +208,19 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
#endif #endif
/* background */ /* background */
#ifndef DOUBLE_BUFFER if (backColor) {
if (backGC) { XFillRectangle(screen->display, d, WMColorGC(backColor),
XFillRectangle(screen->display, d, backGC,
0, 0, view->size.width, view->size.height); 0, 0, view->size.width, view->size.height);
} else { } else {
#ifndef DOUBLE_BUFFER
XClearWindow(screen->display, d); XClearWindow(screen->display, d);
}
#else #else
if (backGC)
XFillRectangle(screen->display, d, backGC, 0, 0,
view->size.width, view->size.height);
else {
XSetForeground(screen->display, screen->copyGC, XSetForeground(screen->display, screen->copyGC,
view->attribs.background_pixel); view->attribs.background_pixel);
XFillRectangle(screen->display, d, screen->copyGC, 0, 0, XFillRectangle(screen->display, d, screen->copyGC, 0, 0,
view->size.width, view->size.height); view->size.width, view->size.height);
}
#endif #endif
}
if (relief == WRFlat) { if (relief == WRFlat) {
@@ -303,7 +298,7 @@ W_PaintTextAndImage(W_View *view, int wrap, GC textGC, W_Font *font,
textHeight = W_GetTextHeight(font, text, w-8, wrap); textHeight = W_GetTextHeight(font, text, w-8, wrap);
W_PaintText(view, d, font, x+ofs+4, y+ofs + (h-textHeight)/2, w-8, W_PaintText(view, d, font, x+ofs+4, y+ofs + (h-textHeight)/2, w-8,
alignment, textGC, wrap, text, strlen(text)); alignment, textColor, wrap, text, strlen(text));
} }
@@ -343,7 +338,18 @@ wmksize(unsigned int width, unsigned int height)
} }
WMRect
wmkrect(int x, int y, unsigned int width, unsigned int height)
{
WMRect rect;
rect.pos.x = x;
rect.pos.y = y;
rect.size.width = width;
rect.size.height = height;
return rect;
}
+6 -6
View File
@@ -333,7 +333,7 @@ paintPopUpButton(PopUpButton *bPtr)
W_PaintText(bPtr->view, pixmap, scr->normalFont, 6, W_PaintText(bPtr->view, pixmap, scr->normalFont, 6,
(bPtr->view->size.height-WMFontHeight(scr->normalFont))/2, (bPtr->view->size.height-WMFontHeight(scr->normalFont))/2,
bPtr->view->size.width, WALeft, bPtr->view->size.width, WALeft,
bPtr->flags.enabled ? WMColorGC(scr->black) : WMColorGC(scr->darkGray), bPtr->flags.enabled ? scr->black : scr->darkGray,
False, caption, strlen(caption)); False, caption, strlen(caption));
} }
@@ -421,7 +421,7 @@ paintMenuEntry(PopUpButton *bPtr, int index, int highlight)
width, itemHeight, WRRaised); width, itemHeight, WRRaised);
W_PaintText(bPtr->menuView, bPtr->menuView->window, scr->normalFont, 6, W_PaintText(bPtr->menuView, bPtr->menuView->window, scr->normalFont, 6,
index*itemHeight + yo, width, WALeft, WMColorGC(scr->black), index*itemHeight + yo, width, WALeft, scr->black,
False, title, strlen(title)); False, title, strlen(title));
if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) { if (!bPtr->flags.pullsDown && index == bPtr->selectedItemIndex) {
@@ -457,7 +457,7 @@ makeMenuPixmap(PopUpButton *bPtr)
i = 0; i = 0;
WM_ITERATE_ARRAY(bPtr->items, item, iter) { WM_ITERATE_ARRAY(bPtr->items, item, iter) {
GC gc; WMColor *color;
char *text; char *text;
text = WMGetMenuItemTitle(item); text = WMGetMenuItemTitle(item);
@@ -466,12 +466,12 @@ makeMenuPixmap(PopUpButton *bPtr)
WRRaised); WRRaised);
if (!WMGetMenuItemEnabled(item)) if (!WMGetMenuItemEnabled(item))
gc = WMColorGC(scr->darkGray); color = scr->darkGray;
else else
gc = WMColorGC(scr->black); color = scr->black;
W_PaintText(bPtr->menuView, pixmap, scr->normalFont, 6, W_PaintText(bPtr->menuView, pixmap, scr->normalFont, 6,
i*itemHeight + yo, width, WALeft, gc, False, i*itemHeight + yo, width, WALeft, color, False,
text, strlen(text)); text, strlen(text));
if (!bPtr->flags.pullsDown && i == bPtr->selectedItemIndex) { if (!bPtr->flags.pullsDown && i == bPtr->selectedItemIndex) {
-18
View File
@@ -40,18 +40,10 @@ W_ViewDelegate _ProgressIndicatorDelegate = {
static void destroyProgressIndicator(ProgressIndicator *pPtr); static void destroyProgressIndicator(ProgressIndicator *pPtr);
static void paintProgressIndicator(ProgressIndicator *pPtr); static void paintProgressIndicator(ProgressIndicator *pPtr);
static void realizeProgressIndicator(ProgressIndicator *pPtr);
static void handleEvents(XEvent *event, void *data); static void handleEvents(XEvent *event, void *data);
static void
realizeObserver(void *self, WMNotification *not)
{
realizeProgressIndicator(self);
}
WMProgressIndicator* WMProgressIndicator*
WMCreateProgressIndicator(WMWidget *parent) WMCreateProgressIndicator(WMWidget *parent)
{ {
@@ -84,9 +76,6 @@ WMCreateProgressIndicator(WMWidget *parent)
pPtr->minValue = 0; pPtr->minValue = 0;
pPtr->maxValue = 100; pPtr->maxValue = 100;
WMAddNotificationObserver(realizeObserver, pPtr,
WMViewRealizedNotification, pPtr->view);
return pPtr; return pPtr;
} }
@@ -169,13 +158,6 @@ WMGetProgressIndicatorValue(WMProgressIndicator *progressindicator)
} }
static void
realizeProgressIndicator(ProgressIndicator *pPtr)
{
W_RealizeView(pPtr->view);
}
static void static void
didResizeProgressIndicator(W_ViewDelegate *self, WMView *view) didResizeProgressIndicator(W_ViewDelegate *self, WMView *view)
{ {
+74 -59
View File
@@ -33,7 +33,8 @@ typedef struct W_Ruler {
WMAction *releaseAction; /* what to do when released */ WMAction *releaseAction; /* what to do when released */
void *clientData; void *clientData;
GC fg, bg; WMColor *fg;
GC fgGC, bgGC;
WMFont *font; WMFont *font;
WMRulerMargins margins; WMRulerMargins margins;
int offset; int offset;
@@ -68,11 +69,10 @@ static void
drawLeftMarker(Ruler * rPtr) drawLeftMarker(Ruler * rPtr)
{ {
XPoint points[4]; XPoint points[4];
int xpos = (rPtr->flags.whichMarker == 1 ? int xpos = (rPtr->flags.whichMarker==1 ? rPtr->motion : rPtr->margins.left);
rPtr->motion : rPtr->margins.left);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 8, xpos, 22); xpos, 8, xpos, 22);
points[0].x = xpos; points[0].x = xpos;
points[0].y = 1; points[0].y = 1;
points[1].x = points[0].x + 6; points[1].x = points[0].x + 6;
@@ -81,8 +81,8 @@ drawLeftMarker(Ruler * rPtr)
points[2].y = 9; points[2].y = 9;
points[3].x = points[0].x; points[3].x = points[0].x;
points[3].y = 9; points[3].y = 9;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 4, Convex, CoordModeOrigin); points, 4, Convex, CoordModeOrigin);
} }
@@ -95,14 +95,14 @@ drawLeftMarker(Ruler * rPtr)
| |
*/ */
static void drawRightMarker(Ruler * rPtr) static void
drawRightMarker(Ruler * rPtr)
{ {
XPoint points[4]; XPoint points[4];
int xpos = (rPtr->flags.whichMarker == 2 ? int xpos = (rPtr->flags.whichMarker==2 ? rPtr->motion : rPtr->margins.right);
rPtr->motion : rPtr->margins.right);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 8, xpos, 22); xpos, 8, xpos, 22);
points[0].x = xpos + 1; points[0].x = xpos + 1;
points[0].y = 0; points[0].y = 0;
points[1].x = points[0].x - 6; points[1].x = points[0].x - 6;
@@ -111,8 +111,8 @@ static void drawRightMarker(Ruler * rPtr)
points[2].y = 9; points[2].y = 9;
points[3].x = points[0].x; points[3].x = points[0].x;
points[3].y = 9; points[3].y = 9;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 4, Convex, CoordModeOrigin); points, 4, Convex, CoordModeOrigin);
} }
@@ -122,15 +122,16 @@ static void drawRightMarker(Ruler * rPtr)
| |
*/ */
static void drawFirstMarker(Ruler * rPtr) static void
drawFirstMarker(Ruler * rPtr)
{ {
int xpos = ((rPtr->flags.whichMarker == 3 || rPtr->flags.whichMarker == 6) ? int xpos = ((rPtr->flags.whichMarker == 3 || rPtr->flags.whichMarker == 6) ?
rPtr->motion : rPtr->margins.first); rPtr->motion : rPtr->margins.first);
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos - 5, 10, 11, 5); xpos - 5, 10, 11, 5);
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, xpos, 12, xpos, 22); xpos, 12, xpos, 22);
} }
/* Marker for rest of body /* Marker for rest of body
@@ -138,7 +139,8 @@ static void drawFirstMarker(Ruler * rPtr)
\ / \ /
\./ \./
*/ */
static void drawBodyMarker(Ruler * rPtr) static void
drawBodyMarker(Ruler * rPtr)
{ {
XPoint points[4]; XPoint points[4];
int xpos = ((rPtr->flags.whichMarker == 4 || rPtr->flags.whichMarker == 6) ? int xpos = ((rPtr->flags.whichMarker == 4 || rPtr->flags.whichMarker == 6) ?
@@ -150,40 +152,41 @@ static void drawBodyMarker(Ruler * rPtr)
points[1].y = 16; points[1].y = 16;
points[2].x = points[0].x + 5; points[2].x = points[0].x + 5;
points[2].y = 22; points[2].y = 22;
XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, XFillPolygon(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->fg, points, 3, Convex, CoordModeOrigin); points, 3, Convex, CoordModeOrigin);
} }
static void createDrawBuffer(Ruler * rPtr) static void
createDrawBuffer(Ruler * rPtr)
{ {
if(!rPtr->view->flags.realized) if(!rPtr->view->flags.realized)
return; return;
if (rPtr->drawBuffer) if (rPtr->drawBuffer)
XFreePixmap(rPtr->view->screen->display, rPtr->drawBuffer); XFreePixmap(rPtr->view->screen->display, rPtr->drawBuffer);
rPtr->drawBuffer = XCreatePixmap(rPtr->view->screen->display, rPtr->drawBuffer = XCreatePixmap(rPtr->view->screen->display,
rPtr->view->window, rPtr->view->size.width, 40, rPtr->view->window, rPtr->view->size.width, 40,
rPtr->view->screen->depth); rPtr->view->screen->depth);
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->bg, 0, 0, rPtr->view->size.width, 40); rPtr->bgGC, 0, 0, rPtr->view->size.width, 40);
} }
static void drawRulerOnPixmap(Ruler * rPtr) static void
drawRulerOnPixmap(Ruler * rPtr)
{ {
int i, j, w, m; int i, j, w, m;
char c[3]; char c[3];
int marks[9] = int marks[9] = {11, 3, 5, 3, 7, 3, 5, 3};
{11, 3, 5, 3, 7, 3, 5, 3};
if (!rPtr->drawBuffer || !rPtr->view->flags.realized) if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
return; return;
XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer, XFillRectangle(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->bg, 0, 0, rPtr->view->size.width, 40); rPtr->bgGC, 0, 0, rPtr->view->size.width, 40);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg, WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10); rPtr->font, rPtr->margins.left + 2, 26, _("0 inches"), 10);
@@ -192,26 +195,26 @@ static void drawRulerOnPixmap(Ruler * rPtr)
i = j = m = 0; i = j = m = 0;
w = rPtr->view->size.width - rPtr->margins.left; w = rPtr->view->size.width - rPtr->margins.left;
while (m < w) { while (m < w) {
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->fg, rPtr->margins.left + m, 23, rPtr->fgGC, rPtr->margins.left + m, 23,
rPtr->margins.left + m, marks[i % 8] + 23); rPtr->margins.left + m, marks[i % 8] + 23);
if (i != 0 && i % 8 == 0) { if (i != 0 && i % 8 == 0) {
if (j < 10) if (j < 10)
snprintf(c, 3, "%d", ++j); snprintf(c, 3, "%d", ++j);
else else
snprintf(c, 3, "%2d", ++j); snprintf(c, 3, "%2d", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg, WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2); rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
} }
m = (++i) * 10; m = (++i) * 10;
} }
rPtr->end = rPtr->margins.left + m - 10; rPtr->end = rPtr->margins.left + m - 10;
if (rPtr->margins.right > rPtr->end) if (rPtr->margins.right > rPtr->end)
rPtr->margins.right = rPtr->end; rPtr->margins.right = rPtr->end;
/* base line */ /* base line */
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fg, XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer, rPtr->fgGC,
rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22); rPtr->margins.left, 22, rPtr->margins.left + m - 10, 22);
drawLeftMarker(rPtr); drawLeftMarker(rPtr);
drawRightMarker(rPtr); drawRightMarker(rPtr);
@@ -222,7 +225,8 @@ static void drawRulerOnPixmap(Ruler * rPtr)
} }
static void paintRuler(Ruler * rPtr) static void
paintRuler(Ruler * rPtr)
{ {
if (!rPtr->drawBuffer || !rPtr->view->flags.realized) if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
return; return;
@@ -230,13 +234,13 @@ static void paintRuler(Ruler * rPtr)
if (rPtr->flags.redraw) if (rPtr->flags.redraw)
drawRulerOnPixmap(rPtr); drawRulerOnPixmap(rPtr);
XCopyArea(rPtr->view->screen->display, rPtr->drawBuffer, XCopyArea(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->view->window, rPtr->bg, 0, 0, rPtr->view->size.width, 40, rPtr->view->window, rPtr->bgGC, 0, 0,
0, 0); rPtr->view->size.width, 40, 0, 0);
} }
static Bool static Bool
verifyMarkerMove(Ruler * rPtr, int x) verifyMarkerMove(Ruler * rPtr, int x)
{ {
if (rPtr->flags.whichMarker < 1 || rPtr->flags.whichMarker > 6) if (rPtr->flags.whichMarker < 1 || rPtr->flags.whichMarker > 6)
return False; return False;
@@ -281,7 +285,8 @@ static Bool
} }
static int whichMarker(Ruler * rPtr, int x, int y) static int
whichMarker(Ruler * rPtr, int x, int y)
{ {
if (x < rPtr->offset || y > 22) if (x < rPtr->offset || y > 22)
return 0; return 0;
@@ -322,7 +327,8 @@ static int whichMarker(Ruler * rPtr, int x, int y)
return 0; return 0;
} }
static void rulerDidResize(W_ViewDelegate * self, WMView * view) static void
rulerDidResize(W_ViewDelegate * self, WMView * view)
{ {
Ruler *rPtr = (Ruler *) view->self; Ruler *rPtr = (Ruler *) view->self;
@@ -333,7 +339,8 @@ static void rulerDidResize(W_ViewDelegate * self, WMView * view)
} }
static void handleEvents(XEvent * event, void *data) static void
handleEvents(XEvent * event, void *data)
{ {
Ruler *rPtr = (Ruler *) data; Ruler *rPtr = (Ruler *) data;
@@ -447,8 +454,9 @@ WMCreateRuler(WMWidget * parent)
rPtr->view->delegate = &_RulerViewDelegate; rPtr->view->delegate = &_RulerViewDelegate;
rPtr->bg = WMColorGC(WMGrayColor(rPtr->view->screen)); rPtr->fg = WMBlackColor(rPtr->view->screen);
rPtr->fg = WMColorGC(WMBlackColor(rPtr->view->screen)); rPtr->fgGC = WMColorGC(rPtr->fg);
rPtr->bgGC = WMColorGC(WMGrayColor(rPtr->view->screen));
rPtr->font = WMSystemFontOfSize(rPtr->view->screen, 8); rPtr->font = WMSystemFontOfSize(rPtr->view->screen, 8);
rPtr->offset = 22; rPtr->offset = 22;
@@ -471,7 +479,8 @@ WMCreateRuler(WMWidget * parent)
} }
void WMSetRulerMargins(WMRuler * rPtr, WMRulerMargins margins) void
WMSetRulerMargins(WMRuler * rPtr, WMRulerMargins margins)
{ {
if (!rPtr) if (!rPtr)
return; return;
@@ -530,7 +539,8 @@ WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin)
void WMSetRulerOffset(WMRuler * rPtr, int pixels) void
WMSetRulerOffset(WMRuler * rPtr, int pixels)
{ {
if (!rPtr || pixels < 0 || pixels + MIN_DOC_WIDTH >= rPtr->view->size.width) if (!rPtr || pixels < 0 || pixels + MIN_DOC_WIDTH >= rPtr->view->size.width)
return; return;
@@ -539,7 +549,8 @@ void WMSetRulerOffset(WMRuler * rPtr, int pixels)
} }
int WMGetRulerOffset(WMRuler * rPtr) int
WMGetRulerOffset(WMRuler * rPtr)
{ {
if (!rPtr) if (!rPtr)
return 0; /* what value should return if no ruler? -1 or 0? */ return 0; /* what value should return if no ruler? -1 or 0? */
@@ -547,7 +558,8 @@ int WMGetRulerOffset(WMRuler * rPtr)
} }
void WMSetRulerReleaseAction(WMRuler * rPtr, WMAction * action, void *clientData) void
WMSetRulerReleaseAction(WMRuler * rPtr, WMAction * action, void *clientData)
{ {
if (!rPtr) if (!rPtr)
return; return;
@@ -557,7 +569,8 @@ void WMSetRulerReleaseAction(WMRuler * rPtr, WMAction * action, void *clientData
} }
void WMSetRulerMoveAction(WMRuler * rPtr, WMAction * action, void *clientData) void
WMSetRulerMoveAction(WMRuler * rPtr, WMAction * action, void *clientData)
{ {
if (!rPtr) if (!rPtr)
return; return;
@@ -568,7 +581,8 @@ void WMSetRulerMoveAction(WMRuler * rPtr, WMAction * action, void *clientData)
/* _which_ one was released */ /* _which_ one was released */
int WMGetReleasedRulerMargin(WMRuler * rPtr) int
WMGetReleasedRulerMargin(WMRuler * rPtr)
{ {
if (!rPtr) if (!rPtr)
return 0; return 0;
@@ -577,7 +591,8 @@ int WMGetReleasedRulerMargin(WMRuler * rPtr)
/* _which_ one is being grabbed */ /* _which_ one is being grabbed */
int WMGetGrabbedRulerMargin(WMRuler * rPtr) int
WMGetGrabbedRulerMargin(WMRuler * rPtr)
{ {
if (!rPtr) if (!rPtr)
return 0; return 0;
+3 -2
View File
@@ -248,13 +248,14 @@ WMResizeScrollViewContent(WMScrollView *sPtr, unsigned int width,
} }
if (sPtr->flags.hasVScroller) { if (sPtr->flags.hasVScroller) {
width -= W_VIEW(sPtr->hScroller)->size.width;
WMResizeWidget(sPtr->vScroller, 20, h); WMResizeWidget(sPtr->vScroller, 20, h);
width -= W_VIEW(sPtr->vScroller)->size.width;
} }
if (sPtr->flags.hasHScroller) { if (sPtr->flags.hasHScroller) {
height -= W_VIEW(sPtr->hScroller)->size.height;
WMResizeWidget(sPtr->hScroller, w, 20); WMResizeWidget(sPtr->hScroller, w, 20);
WMMoveWidget(sPtr->hScroller, x, h); WMMoveWidget(sPtr->hScroller, x, h);
height -= W_VIEW(sPtr->hScroller)->size.height;
} }
W_ResizeView(sPtr->view, w, h); W_ResizeView(sPtr->view, w, h);
+1 -11
View File
@@ -52,7 +52,6 @@ W_ViewDelegate _SliderViewDelegate = {
static void destroySlider(Slider *sPtr); static void destroySlider(Slider *sPtr);
static void paintSlider(Slider *sPtr); static void paintSlider(Slider *sPtr);
static void realizeSlider(Slider *sPtr);
static void handleEvents(XEvent *event, void *data); static void handleEvents(XEvent *event, void *data);
static void handleActionEvents(XEvent *event, void *data); static void handleActionEvents(XEvent *event, void *data);
@@ -62,7 +61,7 @@ static void makeKnobPixmap(Slider *sPtr);
static void static void
realizeObserver(void *self, WMNotification *not) realizeObserver(void *self, WMNotification *not)
{ {
realizeSlider(self); makeKnobPixmap(self);
} }
@@ -294,15 +293,6 @@ makeKnobPixmap(Slider *sPtr)
} }
static void
realizeSlider(Slider *sPtr)
{
W_RealizeView(sPtr->view);
makeKnobPixmap(sPtr);
}
static void static void
didResizeSlider(W_ViewDelegate *self, WMView *view) didResizeSlider(W_ViewDelegate *self, WMView *view)
{ {
+2 -2
View File
@@ -660,7 +660,7 @@ drawTab(TabView *tPtr, Drawable d, int x, int y,
XDrawLine(dpy, d, white, trap[1].x, trap[1].y, trap[2].x, trap[2].y); XDrawLine(dpy, d, white, trap[1].x, trap[1].y, trap[2].x, trap[2].y);
XDrawLine(dpy, d, white, trap[2].x, trap[2].y, trap[3].x, trap[3].y); XDrawLine(dpy, d, white, trap[2].x, trap[2].y, trap[3].x, trap[3].y);
XDrawLine(dpy, d, white, trap[3].x, trap[3].y, trap[4].x, trap[4].y); XDrawLine(dpy, d, white, trap[3].x, trap[3].y, trap[4].x, trap[4].y);
XDrawLine(dpy, d, dark, trap[4].x, trap[4].y, trap[5].x, trap[5].y); XDrawLine(dpy, d, dark, trap[4].x, trap[4].y, trap[5].x, trap[5].y);
XDrawLine(dpy, d, black, trap[5].x, trap[5].y, trap[6].x, trap[6].y); XDrawLine(dpy, d, black, trap[5].x, trap[5].y, trap[6].x, trap[6].y);
XDrawLine(dpy, d, black, trap[6].x, trap[6].y, trap[7].x, trap[7].y); XDrawLine(dpy, d, black, trap[6].x, trap[6].y, trap[7].x, trap[7].y);
@@ -882,7 +882,7 @@ W_DrawLabel(WMTabViewItem *item, Drawable d, WMRect rect, Bool enabled)
if (!item->label) if (!item->label)
return; return;
WMDrawString(scr, d, WMColorGC(enabled ? scr->black : scr->darkGray), WMDrawString(scr, d, enabled ? scr->black : scr->darkGray,
item->tabView->font, rect.pos.x, rect.pos.y, item->tabView->font, rect.pos.x, rect.pos.y,
item->label, strlen(item->label)); item->label, strlen(item->label));
} }
+116 -191
View File
@@ -106,8 +106,9 @@ typedef struct W_Text {
WMColor *dColor; /* the default color */ WMColor *dColor; /* the default color */
WMPixmap *dBulletPix; /* the default pixmap for bullets */ WMPixmap *dBulletPix; /* the default pixmap for bullets */
GC bgGC; /* the background GC to draw with */ WMColor *fgColor; /* The current foreground color */
GC fgGC; /* the foreground GC to draw with */ WMColor *bgColor; /* The background color */
GC stippledGC; /* the GC to overlay selected graphics with */ GC stippledGC; /* the GC to overlay selected graphics with */
Pixmap db; /* the buffer on which to draw */ Pixmap db; /* the buffer on which to draw */
WMPixmap *bgPixmap; /* the background pixmap */ WMPixmap *bgPixmap; /* the background pixmap */
@@ -421,7 +422,7 @@ setSelectionProperty(WMText *tPtr, WMFont *font, WMColor *color, int underlined)
if (!tb || !tPtr->flags.ownsSelection) if (!tb || !tPtr->flags.ownsSelection)
return; return;
if(font && (!color || underlined==-1)) if (font && (!color || underlined==-1))
isFont = True; isFont = True;
while (tb) { while (tb) {
@@ -568,7 +569,8 @@ removeSelection(Text *tPtr)
return True; return True;
} }
static TextBlock *
static TextBlock*
getFirstNonGraphicBlockFor(TextBlock *tb, short dir) getFirstNonGraphicBlockFor(TextBlock *tb, short dir)
{ {
TextBlock *hold = tb; TextBlock *hold = tb;
@@ -648,7 +650,6 @@ paintText(Text *tPtr)
{ {
TextBlock *tb; TextBlock *tb;
WMFont *font; WMFont *font;
GC gc, greyGC;
char *text; char *text;
int len, y, c, s, done=False, prev_y=-23, dir /* 1 = down */; int len, y, c, s, done=False, prev_y=-23, dir /* 1 = down */;
WMScreen *scr = tPtr->view->screen; WMScreen *scr = tPtr->view->screen;
@@ -660,8 +661,8 @@ paintText(Text *tPtr)
return; return;
XFillRectangle(dpy, tPtr->db, tPtr->bgGC, XFillRectangle(dpy, tPtr->db, WMColorGC(tPtr->bgColor), 0, 0,
0, 0, tPtr->visible.w, tPtr->visible.h); tPtr->visible.w, tPtr->visible.h);
if (tPtr->bgPixmap) { if (tPtr->bgPixmap) {
WMDrawPixmap(tPtr->bgPixmap, tPtr->db, WMDrawPixmap(tPtr->bgPixmap, tPtr->db,
@@ -675,12 +676,6 @@ paintText(Text *tPtr)
} }
} }
if (tPtr->flags.ownsSelection) {
color = WMGrayColor(scr);
greyGC = WMColorGC(color);
WMReleaseColor(color);
}
done = False; done = False;
@@ -721,8 +716,6 @@ _getSibling:
/* first, place all text that can be viewed */ /* first, place all text that can be viewed */
while (!done && tb) { while (!done && tb) {
if (tb->graphic) { if (tb->graphic) {
tb = tb->next; tb = tb->next;
continue; continue;
@@ -742,18 +735,18 @@ _getSibling:
if (tPtr->flags.monoFont) { if (tPtr->flags.monoFont) {
font = tPtr->dFont; font = tPtr->dFont;
gc = tPtr->fgGC; color = tPtr->fgColor;
} else { } else {
font = tb->d.font; font = tb->d.font;
gc = WMColorGC(tb->color); color = tb->color;
} }
if (tPtr->flags.ownsSelection) { if (tPtr->flags.ownsSelection) {
XRectangle rect; XRectangle rect;
if ( sectionWasSelected(tPtr, tb, &rect, s)) { if (sectionWasSelected(tPtr, tb, &rect, s)) {
tb->selected = True; tb->selected = True;
XFillRectangle(dpy, tPtr->db, greyGC, XFillRectangle(dpy, tPtr->db, WMColorGC(scr->gray),
rect.x, rect.y, rect.width, rect.height); rect.x, rect.y, rect.width, rect.height);
} }
} }
@@ -763,21 +756,18 @@ _getSibling:
len = tb->sections[s].end - tb->sections[s].begin; len = tb->sections[s].end - tb->sections[s].begin;
text = &(tb->text[tb->sections[s].begin]); text = &(tb->text[tb->sections[s].begin]);
y = tb->sections[s].y - tPtr->vpos; y = tb->sections[s].y - tPtr->vpos;
WMDrawString(scr, tPtr->db, gc, font, WMDrawString(scr, tPtr->db, color, font,
tb->sections[s].x - tPtr->hpos, y, text, len); tb->sections[s].x - tPtr->hpos, y, text, len);
if (!tPtr->flags.monoFont && tb->underlined) { if (!tPtr->flags.monoFont && tb->underlined) {
XDrawLine(dpy, tPtr->db, gc, XDrawLine(dpy, tPtr->db, WMColorGC(color),
tb->sections[s].x - tPtr->hpos, tb->sections[s].x - tPtr->hpos,
y + font->y + 1, y + font->y + 1,
tb->sections[s].x + tb->sections[s].w - tPtr->hpos, tb->sections[s].x + tb->sections[s].w - tPtr->hpos,
y + font->y + 1); y + font->y + 1);
} }
} }
tb = (!done? tb->next : NULL); tb = (!done? tb->next : NULL);
} }
/* now , show all graphic items that can be viewed */ /* now , show all graphic items that can be viewed */
@@ -855,22 +845,22 @@ _copy_area:
if (tPtr->flags.editable && tPtr->flags.cursorShown if (tPtr->flags.editable && tPtr->flags.cursorShown
&& tPtr->cursor.x != -23 && tPtr->flags.focused) { && tPtr->cursor.x != -23 && tPtr->flags.focused) {
int y = tPtr->cursor.y - tPtr->vpos; int y = tPtr->cursor.y - tPtr->vpos;
XDrawLine(dpy, tPtr->db, tPtr->fgGC, XDrawLine(dpy, tPtr->db, WMColorGC(tPtr->fgColor),
tPtr->cursor.x, y, tPtr->cursor.x, y,
tPtr->cursor.x, y + tPtr->cursor.h); tPtr->cursor.x, y + tPtr->cursor.h);
} }
XCopyArea(dpy, tPtr->db, win, tPtr->bgGC, 0, 0, XCopyArea(dpy, tPtr->db, win, WMColorGC(tPtr->bgColor), 0, 0,
tPtr->visible.w, tPtr->visible.h, tPtr->visible.w, tPtr->visible.h,
tPtr->visible.x, tPtr->visible.y); tPtr->visible.x, tPtr->visible.y);
W_DrawRelief(scr, win, 0, 0, W_DrawRelief(scr, win, 0, 0,
tPtr->view->size.width, tPtr->view->size.height, tPtr->view->size.width, tPtr->view->size.height,
tPtr->flags.relief); tPtr->flags.relief);
if (tPtr->ruler && tPtr->flags.rulerShown) if (tPtr->ruler && tPtr->flags.rulerShown)
XDrawLine(dpy, win, tPtr->fgGC, XDrawLine(dpy, win, WMColorGC(tPtr->fgColor),
2, 42, tPtr->view->size.width-4, 42); 2, 42, tPtr->view->size.width-4, 42);
} }
@@ -1483,7 +1473,8 @@ layOutLine(Text *tPtr, myLineItems *items, int nitems, int x, int y)
} else { } else {
font = (tPtr->flags.monoFont)?tPtr->dFont : tb->d.font; font = (tPtr->flags.monoFont)?tPtr->dFont : tb->d.font;
max_d = WMAX(max_d, abs(font->height-font->y)); /*max_d = WMAX(max_d, abs(font->height-font->y));*/
max_d = 2;
line_height = WMAX(line_height, font->height + max_d); line_height = WMAX(line_height, font->height + max_d);
text = &(tb->text[items[i].begin]); text = &(tb->text[items[i].begin]);
len = items[i].end - items[i].begin; len = items[i].end - items[i].begin;
@@ -2357,7 +2348,8 @@ handleTextKeyPress(Text *tPtr, XEvent *event)
goto L_imaGFX; goto L_imaGFX;
if(tPtr->tpos==0) { if(tPtr->tpos==0) {
L_imaGFX: if(tb->prior) { L_imaGFX:
if(tb->prior) {
tPtr->currentTextBlock = tb->prior; tPtr->currentTextBlock = tb->prior;
if(tPtr->currentTextBlock->graphic) if(tPtr->currentTextBlock->graphic)
tPtr->tpos = 1; tPtr->tpos = 1;
@@ -2378,7 +2370,8 @@ L_imaGFX: if(tb->prior) {
if(tb->graphic) if(tb->graphic)
goto R_imaGFX; goto R_imaGFX;
if(tPtr->tpos == tb->used) { if(tPtr->tpos == tb->used) {
R_imaGFX: if(tb->next) { R_imaGFX:
if(tb->next) {
tPtr->currentTextBlock = tb->next; tPtr->currentTextBlock = tb->next;
tPtr->tpos = 0; tPtr->tpos = 0;
if(!tb->next->first && tb->next->used>0) if(!tb->next->first && tb->next->used>0)
@@ -2439,15 +2432,16 @@ R_imaGFX: if(tb->next) {
Bool i = !tPtr->flags.rulerShown; Bool i = !tPtr->flags.rulerShown;
WMShowTextRuler(tPtr, i); WMShowTextRuler(tPtr, i);
tPtr->flags.rulerShown = i; tPtr->flags.rulerShown = i;
} } else if (control_pressed && *buffer == '\a') {
else if (control_pressed && *buffer == '')
XBell(tPtr->view->screen->display, 0); XBell(tPtr->view->screen->display, 0);
else } else {
WMRelayToNextResponder(tPtr->view, event); WMRelayToNextResponder(tPtr->view, event);
}
} }
if (!control_pressed && tPtr->flags.ownsSelection) if (!control_pressed && tPtr->flags.ownsSelection) {
releaseSelection(tPtr); releaseSelection(tPtr);
}
} }
@@ -3138,30 +3132,27 @@ WMCreateTextForDocumentType(WMWidget *parent, WMAction *parser, WMAction *writer
tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor; tPtr->view->attribFlags |= CWOverrideRedirect | CWCursor;
W_ResizeView(tPtr->view, 250, 200); W_ResizeView(tPtr->view, 250, 200);
tPtr->dColor = WMWhiteColor(scr);
tPtr->bgGC = WMColorGC(tPtr->dColor);
W_SetViewBackgroundColor(tPtr->view, tPtr->dColor);
WMReleaseColor(tPtr->dColor);
tPtr->dColor = WMBlackColor(scr); tPtr->dColor = WMBlackColor(scr);
tPtr->fgGC = WMColorGC(tPtr->dColor); tPtr->fgColor = WMBlackColor(scr);
tPtr->bgColor = WMWhiteColor(scr);
W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
gcv.graphics_exposures = False; gcv.graphics_exposures = False;
gcv.foreground = W_PIXEL(scr->gray); gcv.foreground = W_PIXEL(scr->gray);
gcv.background = W_PIXEL(scr->darkGray); gcv.background = W_PIXEL(scr->darkGray);
gcv.fill_style = FillStippled; gcv.fill_style = FillStippled;
/* why not use scr->stipple here? */ /* why not use scr->stipple here? */
gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr), gcv.stipple = XCreateBitmapFromData(dpy, W_DRAWABLE(scr), STIPPLE_BITS,
STIPPLE_BITS, STIPPLE_WIDTH, STIPPLE_HEIGHT); STIPPLE_WIDTH, STIPPLE_HEIGHT);
tPtr->stippledGC = XCreateGC(dpy, W_DRAWABLE(scr), tPtr->stippledGC = XCreateGC(dpy, W_DRAWABLE(scr),
GCForeground|GCBackground|GCStipple GCForeground|GCBackground|GCStipple
|GCFillStyle|GCGraphicsExposures, &gcv); |GCFillStyle|GCGraphicsExposures, &gcv);
tPtr->ruler = NULL; tPtr->ruler = NULL;
tPtr->vS = NULL; tPtr->vS = NULL;
tPtr->hS = NULL; tPtr->hS = NULL;
tPtr->dFont = WMRetainFont(WMSystemFontOfSize(scr, 12)); tPtr->dFont = WMSystemFontOfSize(scr, 12);
tPtr->view->delegate = &_TextViewDelegate; tPtr->view->delegate = &_TextViewDelegate;
@@ -3314,31 +3305,37 @@ WMAppendTextStream(WMText *tPtr, char *text)
} }
char * char*
WMGetTextStream(WMText *tPtr) WMGetTextStream(WMText *tPtr)
{ {
CHECK_CLASS(tPtr, WC_Text); CHECK_CLASS(tPtr, WC_Text);
return getStream(tPtr, 0, 0); return getStream(tPtr, 0, 0);
} }
char *
char*
WMGetTextSelectedStream(WMText *tPtr) WMGetTextSelectedStream(WMText *tPtr)
{ {
CHECK_CLASS(tPtr, WC_Text); CHECK_CLASS(tPtr, WC_Text);
return getStream(tPtr, 1, 0); return getStream(tPtr, 1, 0);
} }
WMArray *
WMArray*
WMGetTextObjects(WMText *tPtr) WMGetTextObjects(WMText *tPtr)
{ {
CHECK_CLASS(tPtr, WC_Text); CHECK_CLASS(tPtr, WC_Text);
return getStreamObjects(tPtr, 0); return getStreamObjects(tPtr, 0);
} }
WMArray * WMArray*
WMGetTextSelectedObjects(WMText *tPtr) WMGetTextSelectedObjects(WMText *tPtr)
{ {
CHECK_CLASS(tPtr, WC_Text); CHECK_CLASS(tPtr, WC_Text);
return getStreamObjects(tPtr, 1); return getStreamObjects(tPtr, 1);
} }
@@ -3352,7 +3349,7 @@ WMSetTextDelegate(WMText *tPtr, WMTextDelegate *delegate)
} }
void * void*
WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w, WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w,
char *description, WMColor *color, char *description, WMColor *color,
unsigned short first, unsigned short extraInfo) unsigned short first, unsigned short extraInfo)
@@ -3363,8 +3360,6 @@ WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w,
return NULL; return NULL;
tb = wmalloc(sizeof(TextBlock)); tb = wmalloc(sizeof(TextBlock));
if (!tb)
return NULL;
tb->text = wstrdup(description); tb->text = wstrdup(description);
tb->used = strlen(description); tb->used = strlen(description);
@@ -3389,7 +3384,7 @@ WMCreateTextBlockWithObject(WMText *tPtr, WMWidget *w,
} }
void * void*
WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p, WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p,
char *description, WMColor *color, char *description, WMColor *color,
unsigned short first, unsigned short extraInfo) unsigned short first, unsigned short extraInfo)
@@ -3400,8 +3395,6 @@ WMCreateTextBlockWithPixmap(WMText *tPtr, WMPixmap *p,
return NULL; return NULL;
tb = wmalloc(sizeof(TextBlock)); tb = wmalloc(sizeof(TextBlock));
if (!tb)
return NULL;
tb->text = wstrdup(description); tb->text = wstrdup(description);
tb->used = strlen(description); tb->used = strlen(description);
@@ -3436,8 +3429,6 @@ WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font, WMColor *color
return NULL; return NULL;
tb = wmalloc(sizeof(TextBlock)); tb = wmalloc(sizeof(TextBlock));
if (!tb)
return NULL;
tb->allocated = reqBlockSize(len); tb->allocated = reqBlockSize(len);
tb->text = (char *)wmalloc(tb->allocated); tb->text = (char *)wmalloc(tb->allocated);
@@ -3470,6 +3461,7 @@ WMCreateTextBlockWithText(WMText *tPtr, char *text, WMFont *font, WMColor *color
return tb; return tb;
} }
void void
WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first, WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
unsigned int kanji, unsigned int underlined, int script, unsigned int kanji, unsigned int underlined, int script,
@@ -3486,6 +3478,7 @@ WMSetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int first,
tb->marginN = newMargin(tPtr, margins); tb->marginN = newMargin(tPtr, margins);
} }
void void
WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first, WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
unsigned int *kanji, unsigned int *underlined, int *script, unsigned int *kanji, unsigned int *underlined, int *script,
@@ -3503,13 +3496,12 @@ WMGetTextBlockProperties(WMText *tPtr, void *vtb, unsigned int *first,
} }
void void
WMPrependTextBlock(WMText *tPtr, void *vtb) WMPrependTextBlock(WMText *tPtr, void *vtb)
{ {
TextBlock *tb = (TextBlock *)vtb; TextBlock *tb = (TextBlock *)vtb;
if (!tPtr || !tb) if (!tb)
return; return;
if (tb->graphic) { if (tb->graphic) {
@@ -3557,7 +3549,7 @@ WMAppendTextBlock(WMText *tPtr, void *vtb)
{ {
TextBlock *tb = (TextBlock *)vtb; TextBlock *tb = (TextBlock *)vtb;
if (!tPtr || !tb) if (!tb)
return; return;
if (tb->graphic) { if (tb->graphic) {
@@ -3608,8 +3600,8 @@ WMRemoveTextBlock(WMText *tPtr)
{ {
TextBlock *tb = NULL; TextBlock *tb = NULL;
if (!tPtr || !tPtr->firstTextBlock || !tPtr->lastTextBlock if (!tPtr->firstTextBlock || !tPtr->lastTextBlock ||
|| !tPtr->currentTextBlock) { !tPtr->currentTextBlock) {
return NULL; return NULL;
} }
@@ -3657,7 +3649,7 @@ void
WMDestroyTextBlock(WMText *tPtr, void *vtb) WMDestroyTextBlock(WMText *tPtr, void *vtb)
{ {
TextBlock *tb = (TextBlock *)vtb; TextBlock *tb = (TextBlock *)vtb;
if (!tPtr || !tb) if (!tb)
return; return;
if (tb->graphic) { if (tb->graphic) {
@@ -3668,8 +3660,8 @@ WMDestroyTextBlock(WMText *tPtr, void *vtb)
/* 5 months later... destroy it 10 seconds after now which should /* 5 months later... destroy it 10 seconds after now which should
* be enough time for the widget's action to be completed... :-) */ * be enough time for the widget's action to be completed... :-) */
/* This is a bad assumption. Just destroy the widget here. /* This is a bad assumption. Just destroy the widget here.
// if the caller needs it, it can protect it with W_RetainView() * if the caller needs it, it can protect it with W_RetainView()
//WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/ * WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);*/
WMDestroyWidget(tb->d.widget); WMDestroyWidget(tb->d.widget);
} else { } else {
WMReleasePixmap(tb->d.pixmap); WMReleasePixmap(tb->d.pixmap);
@@ -3690,43 +3682,31 @@ WMDestroyTextBlock(WMText *tPtr, void *vtb)
void void
WMSetTextForegroundColor(WMText *tPtr, WMColor *color) WMSetTextForegroundColor(WMText *tPtr, WMColor *color)
{ {
if (!tPtr) if (tPtr->fgColor)
return; WMReleaseColor(tPtr->fgColor);
if (color) tPtr->fgColor = WMRetainColor(color ? color : tPtr->view->screen->black);
tPtr->fgGC = WMColorGC(color);
else {
WMColor *color = WMBlackColor(tPtr->view->screen);
tPtr->fgGC = WMColorGC(color);
WMReleaseColor(color);
}
paintText(tPtr); paintText(tPtr);
} }
void void
WMSetTextBackgroundColor(WMText *tPtr, WMColor *color) WMSetTextBackgroundColor(WMText *tPtr, WMColor *color)
{ {
if (!tPtr) if (tPtr->bgColor)
return; WMReleaseColor(tPtr->bgColor);
if (color) { tPtr->bgColor = WMRetainColor(color ? color : tPtr->view->screen->white);
tPtr->bgGC = WMColorGC(color); W_SetViewBackgroundColor(tPtr->view, tPtr->bgColor);
W_SetViewBackgroundColor(tPtr->view, color);
} else {
tPtr->bgGC = WMColorGC(WMWhiteColor(tPtr->view->screen));
W_SetViewBackgroundColor(tPtr->view,
WMWhiteColor(tPtr->view->screen));
}
paintText(tPtr); paintText(tPtr);
} }
void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap)
{
if (!tPtr)
return;
void
WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap)
{
if (tPtr->bgPixmap) if (tPtr->bgPixmap)
WMReleasePixmap(tPtr->bgPixmap); WMReleasePixmap(tPtr->bgPixmap);
@@ -3736,21 +3716,18 @@ void WMSetTextBackgroundPixmap(WMText *tPtr, WMPixmap *pixmap)
tPtr->bgPixmap = NULL; tPtr->bgPixmap = NULL;
} }
void void
WMSetTextRelief(WMText *tPtr, WMReliefType relief) WMSetTextRelief(WMText *tPtr, WMReliefType relief)
{ {
if (!tPtr)
return;
tPtr->flags.relief = relief; tPtr->flags.relief = relief;
textDidResize(tPtr->view->delegate, tPtr->view); textDidResize(tPtr->view->delegate, tPtr->view);
} }
void void
WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave) WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave)
{ {
if (!tPtr)
return;
if (shouldhave && !tPtr->hS) { if (shouldhave && !tPtr->hS) {
tPtr->hS = WMCreateScroller(tPtr); tPtr->hS = WMCreateScroller(tPtr);
(W_VIEW(tPtr->hS))->attribs.cursor = tPtr->view->screen->defaultCursor; (W_VIEW(tPtr->hS))->attribs.cursor = tPtr->view->screen->defaultCursor;
@@ -3773,9 +3750,6 @@ WMSetTextHasHorizontalScroller(WMText *tPtr, Bool shouldhave)
void void
WMSetTextHasRuler(WMText *tPtr, Bool shouldhave) WMSetTextHasRuler(WMText *tPtr, Bool shouldhave)
{ {
if (!tPtr)
return;
if(shouldhave && !tPtr->ruler) { if(shouldhave && !tPtr->ruler) {
tPtr->ruler = WMCreateRuler(tPtr); tPtr->ruler = WMCreateRuler(tPtr);
(W_VIEW(tPtr->ruler))->attribs.cursor = (W_VIEW(tPtr->ruler))->attribs.cursor =
@@ -3794,8 +3768,6 @@ WMSetTextHasRuler(WMText *tPtr, Bool shouldhave)
void void
WMShowTextRuler(WMText *tPtr, Bool show) WMShowTextRuler(WMText *tPtr, Bool show)
{ {
if(!tPtr)
return;
if(!tPtr->ruler) if(!tPtr->ruler)
return; return;
@@ -3812,14 +3784,12 @@ WMShowTextRuler(WMText *tPtr, Bool show)
textDidResize(tPtr->view->delegate, tPtr->view); textDidResize(tPtr->view->delegate, tPtr->view);
} }
Bool Bool
WMGetTextRulerShown(WMText *tPtr) WMGetTextRulerShown(WMText *tPtr)
{ {
if(!tPtr)
return 0;
if(!tPtr->ruler) if(!tPtr->ruler)
return 0; return False;
return tPtr->flags.rulerShown; return tPtr->flags.rulerShown;
} }
@@ -3828,9 +3798,6 @@ WMGetTextRulerShown(WMText *tPtr)
void void
WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave) WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave)
{ {
if (!tPtr)
return;
if (shouldhave && !tPtr->vS) { if (shouldhave && !tPtr->vS) {
tPtr->vS = WMCreateScroller(tPtr); tPtr->vS = WMCreateScroller(tPtr);
(W_VIEW(tPtr->vS))->attribs.cursor = tPtr->view->screen->defaultCursor; (W_VIEW(tPtr->vS))->attribs.cursor = tPtr->view->screen->defaultCursor;
@@ -3850,13 +3817,11 @@ WMSetTextHasVerticalScroller(WMText *tPtr, Bool shouldhave)
} }
Bool Bool
WMScrollText(WMText *tPtr, int amount) WMScrollText(WMText *tPtr, int amount)
{ {
Bool scroll=False; Bool scroll=False;
if (!tPtr)
return False;
if (amount == 0 || !tPtr->view->flags.realized) if (amount == 0 || !tPtr->view->flags.realized)
return False; return False;
@@ -3883,61 +3848,51 @@ WMScrollText(WMText *tPtr, int amount)
return scroll; return scroll;
} }
Bool Bool
WMPageText(WMText *tPtr, Bool direction) WMPageText(WMText *tPtr, Bool direction)
{ {
if (!tPtr) return False; if (!tPtr->view->flags.realized)
if (!tPtr->view->flags.realized) return False; return False;
return WMScrollText(tPtr, direction?tPtr->visible.h:-tPtr->visible.h); return WMScrollText(tPtr, direction?tPtr->visible.h:-tPtr->visible.h);
} }
void void
WMSetTextEditable(WMText *tPtr, Bool editable) WMSetTextEditable(WMText *tPtr, Bool editable)
{ {
if (!tPtr)
return;
tPtr->flags.editable = editable; tPtr->flags.editable = editable;
} }
int int
WMGetTextEditable(WMText *tPtr) WMGetTextEditable(WMText *tPtr)
{ {
if (!tPtr)
return 0;
return tPtr->flags.editable; return tPtr->flags.editable;
} }
void void
WMSetTextIndentNewLines(WMText *tPtr, Bool indent) WMSetTextIndentNewLines(WMText *tPtr, Bool indent)
{ {
if (!tPtr)
return;
tPtr->flags.indentNewLine = indent; tPtr->flags.indentNewLine = indent;
} }
void void
WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore) WMSetTextIgnoresNewline(WMText *tPtr, Bool ignore)
{ {
if (!tPtr)
return;
tPtr->flags.ignoreNewLine = ignore; tPtr->flags.ignoreNewLine = ignore;
} }
Bool Bool
WMGetTextIgnoresNewline(WMText *tPtr) WMGetTextIgnoresNewline(WMText *tPtr)
{ {
if (!tPtr)
return True;
return tPtr->flags.ignoreNewLine; return tPtr->flags.ignoreNewLine;
} }
void void
WMSetTextUsesMonoFont(WMText *tPtr, Bool mono) WMSetTextUsesMonoFont(WMText *tPtr, Bool mono)
{ {
if (!tPtr)
return;
if (mono) { if (mono) {
if(tPtr->flags.rulerShown) if(tPtr->flags.rulerShown)
WMShowTextRuler(tPtr, False); WMShowTextRuler(tPtr, False);
@@ -3952,8 +3907,6 @@ WMSetTextUsesMonoFont(WMText *tPtr, Bool mono)
Bool Bool
WMGetTextUsesMonoFont(WMText *tPtr) WMGetTextUsesMonoFont(WMText *tPtr)
{ {
if (!tPtr)
return True;
return tPtr->flags.monoFont; return tPtr->flags.monoFont;
} }
@@ -3961,52 +3914,48 @@ WMGetTextUsesMonoFont(WMText *tPtr)
void void
WMSetTextDefaultFont(WMText *tPtr, WMFont *font) WMSetTextDefaultFont(WMText *tPtr, WMFont *font)
{ {
if (!tPtr) if (tPtr->dFont)
return; WMReleaseFont(tPtr->dFont);
WMReleaseFont(tPtr->dFont); if (font) {
if (font)
tPtr->dFont = WMRetainFont(font); tPtr->dFont = WMRetainFont(font);
else } else {
tPtr->dFont = WMRetainFont(WMSystemFontOfSize(tPtr->view->screen, 12)); tPtr->dFont = WMSystemFontOfSize(tPtr->view->screen, 12);
}
} }
WMFont *
WMFont*
WMGetTextDefaultFont(WMText *tPtr) WMGetTextDefaultFont(WMText *tPtr)
{ {
if (!tPtr) return WMRetainFont(tPtr->dFont);
return NULL;
else
return WMRetainFont(tPtr->dFont);
} }
void void
WMSetTextDefaultColor(WMText *tPtr, WMColor *color) WMSetTextDefaultColor(WMText *tPtr, WMColor *color)
{ {
if (!tPtr) if (tPtr->dColor)
return; WMReleaseColor(tPtr->dColor);
WMReleaseColor(tPtr->dColor); if (color) {
if (color)
tPtr->dColor = WMRetainColor(color); tPtr->dColor = WMRetainColor(color);
else } else {
tPtr->dColor = WMBlackColor(tPtr->view->screen); tPtr->dColor = WMBlackColor(tPtr->view->screen);
}
} }
WMColor *
WMColor*
WMGetTextDefaultColor(WMText *tPtr) WMGetTextDefaultColor(WMText *tPtr)
{ {
if (!tPtr) return tPtr->dColor;
return NULL;
else
return WMRetainColor(tPtr->dColor);
} }
void void
WMSetTextAlignment(WMText *tPtr, WMAlignment alignment) WMSetTextAlignment(WMText *tPtr, WMAlignment alignment)
{ {
if (!tPtr)
return;
if(tPtr->flags.monoFont) if(tPtr->flags.monoFont)
tPtr->flags.alignment = WALeft; tPtr->flags.alignment = WALeft;
else else
@@ -4014,11 +3963,10 @@ WMSetTextAlignment(WMText *tPtr, WMAlignment alignment)
WMThawText(tPtr); WMThawText(tPtr);
} }
int int
WMGetTextInsertType(WMText *tPtr) WMGetTextInsertType(WMText *tPtr)
{ {
if (!tPtr)
return 0;
return tPtr->flags.prepend; return tPtr->flags.prepend;
} }
@@ -4026,20 +3974,15 @@ WMGetTextInsertType(WMText *tPtr)
void void
WMSetTextSelectionColor(WMText *tPtr, WMColor *color) WMSetTextSelectionColor(WMText *tPtr, WMColor *color)
{ {
if (!tPtr || !color)
return;
setSelectionProperty(tPtr, NULL, color, -1); setSelectionProperty(tPtr, NULL, color, -1);
} }
WMColor *
WMColor*
WMGetTextSelectionColor(WMText *tPtr) WMGetTextSelectionColor(WMText *tPtr)
{ {
TextBlock *tb; TextBlock *tb;
if (!tPtr)
return NULL;
tb = tPtr->currentTextBlock; tb = tPtr->currentTextBlock;
if (!tb || !tPtr->flags.ownsSelection) if (!tb || !tPtr->flags.ownsSelection)
@@ -4055,20 +3998,15 @@ WMGetTextSelectionColor(WMText *tPtr)
void void
WMSetTextSelectionFont(WMText *tPtr, WMFont *font) WMSetTextSelectionFont(WMText *tPtr, WMFont *font)
{ {
if (!tPtr || !font)
return;
setSelectionProperty(tPtr, font, NULL, -1) ; setSelectionProperty(tPtr, font, NULL, -1) ;
} }
WMFont *
WMFont*
WMGetTextSelectionFont(WMText *tPtr) WMGetTextSelectionFont(WMText *tPtr)
{ {
TextBlock *tb; TextBlock *tb;
if (!tPtr)
return NULL;
tb = tPtr->currentTextBlock; tb = tPtr->currentTextBlock;
if (!tb || !tPtr->flags.ownsSelection) if (!tb || !tPtr->flags.ownsSelection)
@@ -4089,7 +4027,8 @@ WMGetTextSelectionFont(WMText *tPtr)
void void
WMSetTextSelectionUnderlined(WMText *tPtr, int underlined) WMSetTextSelectionUnderlined(WMText *tPtr, int underlined)
{ {
if (!tPtr || (underlined!=0 && underlined !=1)) // check this
if (underlined!=0 && underlined!=1)
return; return;
setSelectionProperty(tPtr, NULL, NULL, underlined); setSelectionProperty(tPtr, NULL, NULL, underlined);
@@ -4101,9 +4040,6 @@ WMGetTextSelectionUnderlined(WMText *tPtr)
{ {
TextBlock *tb; TextBlock *tb;
if (!tPtr)
return 0;
tb = tPtr->currentTextBlock; tb = tPtr->currentTextBlock;
if (!tb || !tPtr->flags.ownsSelection) if (!tb || !tPtr->flags.ownsSelection)
@@ -4119,9 +4055,6 @@ WMGetTextSelectionUnderlined(WMText *tPtr)
void void
WMFreezeText(WMText *tPtr) WMFreezeText(WMText *tPtr)
{ {
if (!tPtr)
return;
tPtr->flags.frozen = True; tPtr->flags.frozen = True;
} }
@@ -4129,9 +4062,6 @@ WMFreezeText(WMText *tPtr)
void void
WMThawText(WMText *tPtr) WMThawText(WMText *tPtr)
{ {
if (!tPtr)
return;
tPtr->flags.frozen = False; tPtr->flags.frozen = False;
if(tPtr->flags.monoFont) { if(tPtr->flags.monoFont) {
@@ -4209,14 +4139,12 @@ mystrrstr(char *haystack, char *needle, unsigned short len, char *end,
Bool Bool
WMFindInTextStream(WMText *tPtr, char *needle, Bool direction, WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
Bool caseSensitive) Bool caseSensitive)
{ {
TextBlock *tb; TextBlock *tb;
char *mark=NULL; char *mark=NULL;
unsigned short pos; unsigned short pos;
if (!tPtr || !needle)
return False;
#if 0 #if 0
if (! (tb = tPtr->currentTextBlock)) { if (! (tb = tPtr->currentTextBlock)) {
@@ -4301,9 +4229,6 @@ WMFindInTextStream(WMText *tPtr, char *needle, Bool direction,
Bool Bool
WMReplaceTextSelection(WMText *tPtr, char *replacement) WMReplaceTextSelection(WMText *tPtr, char *replacement)
{ {
if (!tPtr)
return False;
if (!tPtr->flags.ownsSelection) if (!tPtr->flags.ownsSelection)
return False; return False;
+40 -26
View File
@@ -757,6 +757,7 @@ paintCursor(TextField *tPtr)
tPtr->view->size.height - 2*tPtr->offsetWidth - 1); tPtr->view->size.height - 2*tPtr->offsetWidth - 1);
printf("%d %d\n",cx,tPtr->cursorPosition); printf("%d %d\n",cx,tPtr->cursorPosition);
*/ */
XDrawLine(screen->display, tPtr->view->window, screen->xorGC, XDrawLine(screen->display, tPtr->view->window, screen->xorGC,
cx, tPtr->offsetWidth, cx, cx, tPtr->offsetWidth, cx,
tPtr->view->size.height - tPtr->offsetWidth - 1); tPtr->view->size.height - tPtr->offsetWidth - 1);
@@ -816,6 +817,7 @@ paintTextField(TextField *tPtr)
int totalWidth; int totalWidth;
char *text; char *text;
Pixmap drawbuffer; Pixmap drawbuffer;
WMColor *color;
if (!view->flags.realized || !view->flags.mapped) if (!view->flags.realized || !view->flags.mapped)
@@ -877,12 +879,10 @@ paintTextField(TextField *tPtr)
break; break;
} }
if (!tPtr->flags.enabled) color = tPtr->flags.enabled ? screen->black : screen->darkGray;
WMSetColorInGC(screen->darkGray, screen->textFieldGC);
WMDrawImageString(screen, drawbuffer, screen->textFieldGC, WMDrawImageString(screen, drawbuffer, color, screen->white,
tPtr->font, tx, ty, tPtr->font, tx, ty, &(text[tPtr->viewPosition]),
&(text[tPtr->viewPosition]),
tPtr->textLen - tPtr->viewPosition); tPtr->textLen - tPtr->viewPosition);
if (tPtr->selection.count) { if (tPtr->selection.count) {
@@ -897,27 +897,15 @@ paintTextField(TextField *tPtr)
count = tPtr->viewPosition; count = tPtr->viewPosition;
} }
rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count) rx = tPtr->offsetWidth + 1 + WMWidthOfString(tPtr->font,text,count)
- WMWidthOfString(tPtr->font,text,tPtr->viewPosition); - WMWidthOfString(tPtr->font,text,tPtr->viewPosition);
XSetBackground(screen->display, screen->textFieldGC, WMDrawImageString(screen, drawbuffer, color, screen->gray,
screen->gray->color.pixel); tPtr->font, rx, ty, &(text[count]), count2);
WMDrawImageString(screen, drawbuffer, screen->textFieldGC,
tPtr->font, rx, ty, &(text[count]),
count2);
XSetBackground(screen->display, screen->textFieldGC,
screen->white->color.pixel);
} }
if (!tPtr->flags.enabled)
WMSetColorInGC(screen->black, screen->textFieldGC);
} else { } else {
XFillRectangle(screen->display, drawbuffer, XFillRectangle(screen->display, drawbuffer, WMColorGC(screen->white),
WMColorGC(screen->white), bd, bd, totalWidth,view->size.height-2*bd);
bd,bd, totalWidth,view->size.height-2*bd);
} }
/* draw relief */ /* draw relief */
@@ -1347,12 +1335,13 @@ pointToCursorPosition(TextField *tPtr, int x)
if (tPtr->flags.bordered) if (tPtr->flags.bordered)
x -= 2; x -= 2;
a = tPtr->viewPosition;
b = tPtr->viewPosition + tPtr->textLen;
if (WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]), if (WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]),
tPtr->textLen - tPtr->viewPosition) < x) tPtr->textLen - tPtr->viewPosition) < x)
return tPtr->textLen; return tPtr->textLen;
a = tPtr->viewPosition;
b = tPtr->textLen;
while (a < b && b-a>1) { while (a < b && b-a>1) {
mid = (a+b)/2; mid = (a+b)/2;
tw = WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]), tw = WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]),
@@ -1364,6 +1353,7 @@ pointToCursorPosition(TextField *tPtr, int x)
else else
return mid; return mid;
} }
return (a+b)/2; return (a+b)/2;
} }
@@ -1406,6 +1396,7 @@ handleTextFieldActionEvents(XEvent *event, void *data)
TextField *tPtr = (TextField*)data; TextField *tPtr = (TextField*)data;
static int move = 0; static int move = 0;
static Time lastButtonReleasedEvent = 0; static Time lastButtonReleasedEvent = 0;
static Time lastButtonReleasedEvent2 = 0;
Display *dpy = event->xany.display; Display *dpy = event->xany.display;
CHECK_CLASS(data, WC_TextField); CHECK_CLASS(data, WC_TextField);
@@ -1564,9 +1555,31 @@ handleTextFieldActionEvents(XEvent *event, void *data)
if (!tPtr->flags.secure && if (!tPtr->flags.secure &&
event->xbutton.time - lastButtonReleasedEvent event->xbutton.time - lastButtonReleasedEvent
<= WINGsConfiguration.doubleClickDelay) { <= WINGsConfiguration.doubleClickDelay) {
tPtr->selection.position = 0;
tPtr->selection.count = tPtr->textLen; if (event->xbutton.time - lastButtonReleasedEvent2 <= 2*WINGsConfiguration.doubleClickDelay) {
paintTextField(tPtr); tPtr->selection.position = 0;
tPtr->selection.count = tPtr->textLen;
} else {
int pos, cnt;
char *txt;
pos = tPtr->selection.position;
cnt = tPtr->selection.count;
txt = tPtr->text;
while(pos >= 0) {
if (txt[pos] == ' ' || txt[pos] == '\t') break;
pos--;
}
pos++;
while(pos + cnt < tPtr->textLen) {
if (txt[pos + cnt] == ' ' || txt[pos + cnt] == '\t')
break;
cnt++;
}
tPtr->selection.position = pos;
tPtr->selection.count = cnt;
}
paintTextField(tPtr);
if (!tPtr->flags.ownsSelection) { if (!tPtr->flags.ownsSelection) {
tPtr->flags.ownsSelection = tPtr->flags.ownsSelection =
@@ -1584,6 +1597,7 @@ handleTextFieldActionEvents(XEvent *event, void *data)
&selectionHandler, NULL); &selectionHandler, NULL);
} }
lastButtonReleasedEvent2 = lastButtonReleasedEvent;
lastButtonReleasedEvent = event->xbutton.time; lastButtonReleasedEvent = event->xbutton.time;
break; break;
+1 -1
View File
@@ -14,7 +14,7 @@ WHandleEvents()
W_CheckTimerHandlers(); W_CheckTimerHandlers();
/* Do idle and timer stuff while there are no input events */ /* Do idle and timer stuff while there are no input events */
/* Do not wait for input here. just peek to se if input is available */ /* Do not wait for input here. just peek to see if input is available */
while (!W_HandleInputEvents(False, -1) && W_CheckIdleHandlers()) { while (!W_HandleInputEvents(False, -1) && W_CheckIdleHandlers()) {
/* dispatch timer events */ /* dispatch timer events */
W_CheckTimerHandlers(); W_CheckTimerHandlers();
+5 -4
View File
@@ -504,7 +504,7 @@ W_MoveView(W_View *view, int x, int y)
void void
W_ResizeView(W_View *view, unsigned int width, unsigned int height) W_ResizeView(W_View *view, unsigned int width, unsigned int height)
{ {
int shrinked; /*int shrinked;*/
if (view->delegate && view->delegate->willResize) { if (view->delegate && view->delegate->willResize) {
(*view->delegate->willResize)(view->delegate, view, &width, &height); (*view->delegate->willResize)(view->delegate, view, &width, &height);
@@ -516,7 +516,7 @@ W_ResizeView(W_View *view, unsigned int width, unsigned int height)
if (view->size.width == width && view->size.height == height) if (view->size.width == width && view->size.height == height)
return; return;
shrinked = width < view->size.width || height < view->size.height; /*shrinked = width < view->size.width || height < view->size.height;*/
if (view->flags.realized) { if (view->flags.realized) {
XResizeWindow(view->screen->display, view->window, width, height); XResizeWindow(view->screen->display, view->window, width, height);
@@ -528,6 +528,7 @@ W_ResizeView(W_View *view, unsigned int width, unsigned int height)
(*view->delegate->didResize)(view->delegate, view); (*view->delegate->didResize)(view->delegate, view);
} }
/* // TODO. replace in WINGs code, with the didResize delegate */
if (view->flags.notifySizeChanged) if (view->flags.notifySizeChanged)
WMPostNotificationName(WMViewSizeDidChangeNotification, view, NULL); WMPostNotificationName(WMViewSizeDidChangeNotification, view, NULL);
} }
@@ -560,10 +561,10 @@ W_SetViewBackgroundColor(W_View *view, WMColor *color)
view->backColor = WMRetainColor(color); view->backColor = WMRetainColor(color);
view->attribFlags |= CWBackPixel; view->attribFlags |= CWBackPixel;
view->attribs.background_pixel = color->color.pixel; view->attribs.background_pixel = W_PIXEL(color);
if (view->flags.realized) { if (view->flags.realized) {
XSetWindowBackground(view->screen->display, view->window, XSetWindowBackground(view->screen->display, view->window,
color->color.pixel); W_PIXEL(color));
XClearWindow(view->screen->display, view->window); XClearWindow(view->screen->display, view->window);
} }
} }
+4 -4
View File
@@ -667,10 +667,10 @@ handleEvents(XEvent *event, void *clientData)
} }
break; break;
/* /*
// was causing windows to ignore commands like closeWindow * was causing windows to ignore commands like closeWindow
* // after the windows is iconized/restored or a workspace change * after the windows is iconized/restored or a workspace change
* // if this is really needed, put the MapNotify portion too and * if this is really needed, put the MapNotify portion too and
* // fix the restack bug in wmaker * fix the restack bug in wmaker
case UnmapNotify: case UnmapNotify:
WMUnmapWidget(win); WMUnmapWidget(win);
break; break;

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