diff -Nru jwm-2.1.0+svn579/ChangeLog jwm-2.3.1+0~16~ubuntu14.10.1/ChangeLog --- jwm-2.1.0+svn579/ChangeLog 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,2998 +0,0 @@ -2012-01-27 00:54 joewing - - * [r579] /config.h.in, /configure.in, /src/event.c, /src/help.c, - /src/jwm.h, /src/jxlib.h, /src/main.c, /src/main.h: Use - ConfigureNotify instead of RandR for detecting changes in - resolution (jdoe0154). - -2012-01-22 23:19 joewing - - * [r578] /src/event.c, /src/main.c: Another attempt to fix xrandr - support. - -2012-01-22 16:04 joewing - - * [r577] /src/main.c: Attempt to fix a bug with randr support - (3476900). - -2012-01-15 23:57 joewing - - * [r576] /src/help.c, /src/render.c: Report xrandr with -version. - -2012-01-15 23:50 joewing - - * [r575] /config.h.in, /configure.in, /src/event.c, /src/jwm.h, - /src/jxlib.h, /src/main.c, /src/main.h: Restart when the screen - changes resolution or rotates. - -2012-01-14 16:18 joewing - - * [r574] /src/icon.h, /src/render.c: Change the way alpha - transparency is handled. - -2012-01-14 01:14 joewing - - * [r573] /src/event.c: Attempt to address an issue with keyboard - focus when windows are unmapped. - -2012-01-11 00:25 joewing - - * [r572] /src/Makefile.in: USE DESTDIR with BINDIR. - -2012-01-10 23:51 joewing - - * [r571] /src/clientlist.c, /src/hint.c, /src/taskbar.c: Attempt to - fix the hidden window bug. - -2012-01-05 17:44 joewing - - * [r570] /src/clientlist.c: Attempt to fix an issue with walking - the window stack. - -2012-01-03 17:30 joewing - - * [r569] /src/clock.c, /src/pager.c, /src/taskbar.c, - /src/traybutton.c: Fix spurious popups. - -2012-01-03 03:39 joewing - - * [r568] /src/client.c: Fix for loss of keybindings (bug 3468278). - -2012-01-02 21:59 joewing - - * [r567] /src/client.c, /src/event.c: Use eventTime rather than - CurrentTime in SetInputFocus. - -2012-01-02 21:56 joewing - - * [r566] /src/client.c, /src/event.c: Fix a focus problem with - Flash app settings (bug 3466795). - -2012-01-01 21:00 joewing - - * [r565] /src/menu.c, /src/root.c: Fix segfault with -reload (bug - 3468016). - -2011-12-31 15:42 joewing - - * [r564] /src/jwm.h, /src/status.c: Don't draw a rounded border on - popups if --disable-shape. - -2011-12-31 15:32 joewing - - * [r563] /src/jwm.h: Fix build with --disable-shape. - -2011-12-23 22:41 joewing - - * [r562] /src/icon.c: Fix build with --disable-icons. - -2011-12-23 22:21 joewing - - * [r561] /src/hint.c, /src/jwm.h, /src/resize.c: Allow resizing a - window larger than the root screen. - -2011-12-23 00:25 joewing - - * [r560] /jwm.1.in, /po/POTFILES.in, /po/jwm.pot, /src/Makefile.in, - /src/lex.c, /src/lex.h, /src/move.c, /src/outline.c, - /src/parse.c, /src/spacer.c, /src/spacer.h, /src/traybutton.c, - /src/winmenu.c: Add a spacer tray component. - -2011-12-23 00:11 joewing - - * [r559] /src/icon.c: Use fixed point for icon scaling. - -2011-12-22 23:34 joewing - - * [r558] /src/button.c, /src/icon.c, /src/icon.h, /src/menu.c: - Align text in menus even if only some items have icons. - -2011-12-22 23:23 joewing - - * [r557] /src/tray.c: Make trays work better with multiple - monitors. - -2011-12-19 16:20 joewing - - * [r556] /src/hint.c: Fix an issue with EWMH and layers. - -2011-12-19 15:11 joewing - - * [r555] /src/dock.c: Fix scaling of dock icons. - -2011-12-19 00:47 joewing - - * [r554] /src/button.c, /src/client.c, /src/client.h, /src/color.c, - /src/dock.c, /src/event.c, /src/group.c, /src/outline.c, - /src/pager.c, /src/place.c, /src/render.c, /src/resize.c, - /src/root.c, /src/root.h, /src/traybutton.c: Fun with fixed - point. - -2011-12-17 20:49 joewing - - * [r553] /src/root.c: Fix another warning. - -2011-12-17 20:47 joewing - - * [r552] /src/button.c, /src/clock.c, /src/dock.c: Fix some - compiler warnings. - -2011-12-17 20:33 joewing - - * [r551] /src/dock.c: Fix a double free. - -2011-12-17 20:10 joewing - - * [r550] /jwm.1.in, /src/dock.c, /src/dock.h, /src/parse.c: Fix - Docks on restart and add a width attribute. - -2011-12-16 15:26 joewing - - * [r549] /src/client.c: Fix some focus problems. - -2011-12-16 00:34 joewing - - * [r548] /src/client.c, /src/event.c, /src/event.h, /src/move.c, - /src/resize.c: Fix a race condition with WM_TAKE_FOCUS. - -2011-12-13 01:26 joewing - - * [r547] /src/event.c, /src/help.c, /src/hint.c, /src/hint.h, - /src/main.c, /src/main.h, /src/parse.c, /src/root.c, /src/root.h: - Add jwm -reload for reloading the root menu. - -2011-12-03 03:48 joewing - - * [r546] /src/client.c, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c: Full screen key binding (Rodionov Andrey). - -2011-11-23 01:41 joewing - - * [r545] /src/match.c: Fix a memory leak. - -2011-11-23 01:30 joewing - - * [r544] /src/match.c: Add support for regular expressions when - matching (Rodionov Andrey). - -2011-10-22 03:55 joewing - - * [r543] /configure.in: Disable Xmu on IRIX64 in addition to IRIX - by default. - -2011-10-16 18:25 joewing - - * [r542] /src/color.c, /src/main.c: Don't create zombies. - -2011-10-16 06:01 joewing - - * [r541] /jwm.1.in, /src/group.c, /src/popup.c: Change the behavior - of Group settings to require a name and class match if both are - specified. - -2011-10-16 05:28 joewing - - * [r540] /src/client.c, /src/command.c: Only fork once when - starting programs. - -2011-10-15 22:43 joewing - - * [r539] /doc-header.shtml: Attempt to fix doxygen HTML. - -2011-10-15 22:18 joewing - - * [r538] /configure.in: Add check for unsetenv. - -2011-10-15 22:14 joewing - - * [r537] /src/clock.c, /src/taskbar.c, /src/timing.c, /src/tray.c: - More clock fixes. - -2011-10-15 21:52 joewing - - * [r536] /configure.in, /src/clock.c, /src/timing.c: Fix some - timezone issues. - -2011-10-15 19:23 joewing - - * [r535] /src/event.c, /src/move.c, /src/move.h: Disable edge - resistance when holding mod1. - -2011-10-15 19:04 joewing - - * [r534] /src/status.c: Fix rounded corners on status windows when - Xmu is disabled. - -2011-10-15 18:40 joewing - - * [r533] /configure.in: Update the configure script to disable Xmu - by default on IRIX. - -2011-10-15 18:26 joewing - - * [r532] /src/border.c, /src/border.h, /src/button.c, /src/jxlib.h, - /src/popup.c: Add support for rounded windows without Xmu - support. - -2011-10-14 23:46 joewing - - * [r531] /src/button.c, /src/font.c, /src/menu.c: Fix computation - of text width. - -2011-10-13 02:59 joewing - - * [r530] /, /ABOUT-NLS, /Makefile.in, /aclocal.m4, /config.guess, - /config.h.in, /config.sub, /configure.in, /install-sh, /po, - /po/LINGUAS, /po/Makefile.in.in, /po/Makevars, /po/POTFILES.in, - /po/Rules-quot, /po/boldquot.sed, /po/en@boldquot.header, - /po/en@quot.header, /po/insert-header.sin, /po/jwm.pot, - /po/quot.sed, /po/remove-potcdate.sin, /src, /src/background.c, - /src/border.c, /src/client.c, /src/command.c, /src/cursor.c, - /src/desktop.c, /src/dock.c, /src/event.c, /src/font.c, - /src/group.c, /src/image.c, /src/jwm.h, /src/key.c, /src/lex.c, - /src/main.c, /src/menu.c, /src/move.c, /src/parse.c, - /src/popup.c, /src/root.c, /src/status.c, /src/swallow.c, - /src/taskbar.c, /src/tray.c, /src/traybutton.c, /src/winmenu.c: - Add native language support. - -2011-10-12 01:30 joewing - - * [r529] /jwm.1.in: Fix WindowStyle documentation. - -2011-10-09 18:52 joewing - - * [r528] /src/hint.c: Fix an issue with some windows not mapping. - -2011-10-09 05:57 joewing - - * [r527] /src/desktop.c: Fix desktop wrapping. - -2011-10-09 02:13 joewing - - * [r526] /src/border.c: Fix pixmap allocation for rounded borders. - -2011-10-08 22:41 joewing - - * [r525] /src/client.c: Attempt to fix another issue with input - focus. - -2011-10-08 21:43 joewing - - * [r524] /config.h.in, /configure.in, /src/hint.c, /src/timing.c: - Changes to fix the IRIX build. - -2011-10-08 18:55 joewing - - * [r523] /src/debug.h: Fix debug build. - -2011-10-08 18:54 joewing - - * [r522] /src/background.c, /src/border.c, /src/button.c, - /src/client.c, /src/clock.c, /src/color.c, /src/confirm.c, - /src/cursor.c, /src/debug.h, /src/desktop.c, /src/dock.c, - /src/event.c, /src/font.c, /src/group.c, /src/icon.c, - /src/image.c, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/lex.c, - /src/main.c, /src/menu.c, /src/move.c, /src/pager.c, - /src/parse.c, /src/popup.c, /src/resize.c, /src/root.c, - /src/status.c, /src/swallow.c, /src/taskbar.c, /src/tray.c, - /src/traybutton.c, /src/winmenu.c: Some performance improvements. - -2011-10-08 17:35 joewing - - * [r521] /src/gradient.c: Don't use floating point for gradients. - -2011-10-08 15:14 joewing - - * [r520] /src/icon.c, /src/icon.h, /src/render.c: Release the alpha - picture earlier. - -2011-10-08 15:14 joewing - - * [r519] /src/button.c: Better icon centering. - -2011-10-08 05:10 joewing - - * [r518] /src/client.c, /src/hint.c: Fix an input focus problem - with some applications. - -2011-10-07 14:56 joewing - - * [r517] /src/render.c: Fix render scale factors. - -2011-10-07 14:10 joewing - - * [r516] /src/icon.c, /src/render.c: Better xrender scaling. - -2011-10-07 02:23 joewing - - * [r515] /src/render.c: Fix xrender scaling. - -2011-10-07 02:15 joewing - - * [r514] /src/render.c: Use xrender for scaling if available. - -2011-10-07 02:15 joewing - - * [r513] /src/event.c: Fix a compiler warning. - -2011-10-06 00:25 joewing - - * [r512] /src/event.c, /src/hint.c, /src/hint.h: Add support for - _NET_WM_ACTION_ABOVE/BELOW. - -2011-10-04 03:52 joewing - - * [r511] /src/client.c, /src/desktop.c, /src/event.c, /src/hint.c, - /src/hint.h: Remove old GNOME hint support. - -2011-10-03 23:38 joewing - - * [r510] /src/Makefile.in: Strip the binary after copying it when - installing. - -2011-10-01 20:05 joewing - - * [r509] /src/desktop.c, /src/desktop.h, /src/event.c, /src/hint.c, - /src/hint.h: Add support for _NET_SHOWING_DESKTOP. - -2011-10-01 03:54 joewing - - * [r508] /todo.txt: Remove outdated todo.txt. - -2011-10-01 03:04 joewing - - * [r507] /src/event.c: Fix a bug with opening tabs in maximized - windows for some applications. - -2011-09-30 02:33 joewing - - * [r506] /src/border.c, /src/button.c, /src/client.c, /src/clock.c, - /src/event.c, /src/image.c, /src/place.c, /src/taskbar.c: Fixes - suggested by clang (patches from Lauri Kasanen). - -2011-09-26 18:52 joewing - - * [r505] /Makefile.in: Add DESTDIR to the Makefile. - -2011-09-26 02:23 joewing - - * [r504] /LICENSE: Updated license. - -2011-09-25 22:31 joewing - - * [r503] /configure.in: Update version. - -2011-09-25 19:12 joewing - - * [r502] /src/hint.c, /src/move.c: Fix issues with dragging windows - to new desktops and fix a fullscreen problem. - -2011-05-26 12:20 joewing - - * [r501] /src/desktop.c, /src/desktop.h, /src/move.c: Attempt to - fix a bug where desktops can disappear. - -2010-12-26 06:09 joewing - - * [r500] /src/jwm.h: Attempted build fix for newer versions of - fribidi. - -2010-12-26 06:03 joewing - - * [r499] /src/client.c: Fix a fullscreen problem with some programs - (patch from Patriot). - -2010-12-17 01:18 joewing - - * [r498] /src/event.c, /src/pager.c, /src/pager.h, /src/popup.c, - /src/popup.h: Show popups on the pager with desktop names (patch - from Steve Neumann). - -2010-12-14 22:04 joewing - - * [r497] /jwm.1.in, /src/clientlist.c, /src/clientlist.h, - /src/desktop.c, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c: Add 'prev' and 'prevstacked' key bindings and fix - the 'desktop' keybinding (patch from Steve Neumann). - -2010-12-13 04:07 joewing - - * [r496] /example.jwmrc, /jwm.1.in, /src/client.c, /src/desktop.c, - /src/desktop.h, /src/event.c, /src/hint.c, /src/jwm.h, - /src/key.c, /src/key.h, /src/main.c, /src/main.h, /src/move.c, - /src/pager.c, /src/parse.c: Add support for virtual desktops in - 2-dimensions. - -2010-12-12 21:16 joewing - - * [r495] /jwm.1.in, /src/taskbar.c: Fix a crash when updating - _NET_CLIENT_LIST_STACKING and update documentation. - -2010-12-12 20:48 joewing - - * [r494] /jwm.1.in, /src/clock.c, /src/clock.h, /src/parse.c, - /src/timing.c, /src/timing.h: Add time zone support (patch from - Steve Neumann). - -2010-09-11 03:34 joewing - - * [r493] /jwm.1.in, /src/client.h, /src/event.c, /src/group.c, - /src/group.h, /src/parse.c: Add a 'nofocus' group option to - prevent windows from stealing the focus when mapped. - -2010-05-04 04:25 joewing - - * [r492] /src/hint.c: Don't make windows forever invisible if they - are mapped in the Withdrawn state. - -2010-05-02 17:16 joewing - - * [r491] /src/client.c, /src/client.h: Go back to always grabbing - the mouse on windows. - -2010-04-16 23:03 joewing - - * [r490] /src/client.c: Fix a bug with windows losing focus. - -2010-04-13 03:27 joewing - - * [r489] /config.h.in, /configure.in, /src/clock.c, /src/jwm.h, - /src/main.c: Add locale support for the clock popup. - -2010-04-10 22:01 joewing - - * [r488] /src/client.c, /src/client.h: Speed up the last fix - -2010-04-10 21:49 joewing - - * [r487] /src/client.c, /src/hint.c: Ungrab the mouse for the top - window to work around a bug in flash. - -2010-04-10 20:45 joewing - - * [r486] /src/place.c: Fix handling of _NET_WM_STRUT_PARTIAL - -2010-04-10 20:30 joewing - - * [r485] /src/place.c: Fix a crash when a client strut is removed. - -2010-04-10 20:11 joewing - - * [r484] /src/hint.c: Better handling for - _NET_WM_WINDOW_TYPE_DESKTOP. - -2010-04-10 19:50 joewing - - * [r483] /src/hint.c: Fix an issue with window state handling. - -2010-04-10 19:25 joewing - - * [r482] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h: - Improve EWMH support - -2010-04-10 19:24 joewing - - * [r481] /src/place.c: Fix a bug with maximization - -2010-04-09 04:33 joewing - - * [r480] /src/event.c, /src/hint.c, /src/hint.h: Add support for - _NET_WM_STATE_SKIP_TASKBAR. - -2010-04-09 04:00 joewing - - * [r479] /example.jwmrc, /src/tray.h: Updated example configuration - -2010-04-06 05:59 joewing - - * [r478] /src/render.c: Fix an issue with JWM and render - -2010-04-06 05:54 joewing - - * [r477] /src/event.c: Fix maximization problem with some GNOME - programs. - -2010-04-06 00:23 joewing - - * [r476] /src/hint.c, /src/render.c, /src/taskbar.c: Fix a bug with - withdrawn windows - -2010-04-02 03:42 joewing - - * [r475] /src/background.c, /src/icon.c, /src/jxlib.h, /src/main.c, - /src/render.c: Yet another attempt to fix an issue with icons - displaying incorrectly on some systems. - -2010-03-24 23:46 joewing - - * [r474] /src/render.c: Attempt to fix an issue with - semi-transparent icons with some setups. - -2010-03-23 03:29 joewing - - * [r473] /src/background.c: Fix a bug with per-desktop backgrounds. - -2010-03-23 03:07 joewing - - * [r472] /src/move.c: Make dragging a window to the edge of the - screen switch desktops. - -2010-03-23 02:36 joewing - - * [r471] /config.h.in, /jwm.1.in, /src/clientlist.c, /src/key.c, - /src/key.h, /src/parse.c: Clean up nextstacked key binding. - -2010-03-10 04:29 joewing - - * [r470] /src/jwm.h: Fix a fribidi compilation issue - -2010-02-21 02:12 joewing - - * [r469] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c, /src/tray.c, /src/tray.h: Add a 'show tray' key - binding (patch from Omair Eshkenazi) - -2010-01-30 00:17 joewing - - * [r468] /jwm.1.in: Update the man page on the opacity group option - -2010-01-30 00:07 joewing - - * [r467] /jwm.1.in: Sync man.1.in with the copy on SF - -2010-01-30 00:05 joewing - - * [r466] /jwm.1.in: Remove the opaque key binding from the man page - -2010-01-30 00:04 joewing - - * [r465] /src/client.h, /src/parse.c: Fix the opacity group setting - -2010-01-18 05:30 joewing - - * [r464] /src/place.c: Fix a bug with window placement - -2010-01-18 04:42 joewing - - * [r463] /src/jwm.h: Fix a compile error if libjpeg is enabled and - libpng is disabled - -2010-01-18 04:38 joewing - - * [r462] /src/taskbar.c: Fix a bug with minimizing clients that are - slow to map - -2010-01-18 03:49 joewing - - * [r461] /src/client.c, /src/clientlist.c, /src/event.c, - /src/key.c, /src/key.h: Fix nextstacked key binding - -2010-01-02 00:39 joewing - - * [r460] /src/clock.c: Fix a build issue with some versions of gcc - -2009-12-07 03:37 joewing - - * [r459] /jwm.1.in: Fix syntax errors in the jwm man page - -2009-12-07 00:28 joewing - - * [r458] /src/hint.c: Multibyte fix for title bars from Hiroyuki - Yamamori - -2009-09-28 01:23 joewing - - * [r457] /src/taskbar.c: Fix a crash with popups if a window has no - title - -2009-03-26 03:10 joewing - - * [r456] /src/move.c: Only restore the maximized status of a client - when moving if it was only - maximized in one direction. - -2009-03-25 03:53 joewing - - * [r455] /src/background.c, /src/client.c, /src/client.h, - /src/error.c, /src/event.c, /src/group.c, /src/group.h, - /src/hint.c, /src/hint.h, /src/icon.c, /src/jwm.h, /src/key.c, - /src/key.h, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, - /src/parse.c, /src/render.c, /src/render.h, /src/root.c, - /src/tray.c, /src/winmenu.c: Do transparency based on the - stacking order. - The key binding and window menu for transparency have been - removed for now. - -2009-03-24 01:50 joewing - - * [r454] /src/button.c, /src/button.h: Tweak button label sizes and - remove ALIGN_RIGHT, which wasn't used and - probably wrong. - -2009-03-22 22:05 joewing - - * [r453] /jwm.1.in: Update the man page with info about "Opacity". - -2009-03-22 21:55 joewing - - * [r452] /src/desktop.c: Fix for windows loosing focus when - switching desktops. - -2009-03-22 21:40 joewing - - * [r451] /src/client.c, /src/clientlist.c: Make "next" and - "nextstacked" restore minimized clients if needed. - -2009-03-22 19:35 joewing - - * [r450] /src/main.c, /src/main.h, /src/root.c, /src/root.h, - /src/winmenu.c: Fix a crash with jwm -p. - -2009-03-22 19:30 joewing - - * [r449] /src/pager.c: Don't allow the pager labels to run outside - of the desktop. - -2009-03-22 19:27 joewing - - * [r448] /jwm.1.in, /src/color.c, /src/color.h, /src/desktop.c, - /src/desktop.h, /src/font.c, /src/font.h, /src/pager.c, - /src/pager.h, /src/parse.c: Allow pager labels. - -2009-03-22 18:53 joewing - - * [r447] /src/menu.c: Fix text width on menu items. - -2009-03-22 18:45 joewing - - * [r446] /src/hint.c: Put fullscreen clients on the top layer. - -2009-03-22 05:17 joewing - - * [r445] /jwm.1.in: Update the man page. - -2009-03-22 04:50 joewing - - * [r444] /src/border.c: Add the ability to resize from the top of - the window. - -2009-03-22 04:32 joewing - - * [r443] /src/border.c: Fix a memory leak. - -2009-03-22 04:29 joewing - - * [r442] /src/border.c, /src/border.h, /src/color.c, /src/lex.c, - /src/lex.h, /src/parse.c: Add the ability to set the window - buttons via the configuration file. - -2009-03-22 03:48 joewing - - * [r441] /example.jwmrc: Updated example configuration. - -2009-03-22 03:47 joewing - - * [r440] /jwm.1.in, /src/color.h, /src/lex.c, /src/lex.h, - /src/parse.c: Remove the "Corner" configuration option since it - no longer does anything. - -2009-03-22 03:23 joewing - - * [r439] /Makefile.in: Allow setting the version used for creating - tarballs. - -2009-03-22 03:02 joewing - - * [r438] /configure.in: Fix some configure problems. - -2009-03-22 02:54 joewing - - * [r437] /src/border.c, /src/jwm.h: Fix some build problems. - -2009-03-22 02:50 joewing - - * [r436] /src/jwm.h: Fix the inclusion of Xmu.h - -2009-03-22 02:47 joewing - - * [r435] /src/traybutton.c: Fix the use of an uninitialized value. - -2009-03-22 02:42 joewing - - * [r434] /README, /config.h.in, /configure.in, /src/border.c, - /src/border.h, /src/button.c, /src/client.c, /src/event.c, - /src/popup.c, /src/resize.c, /src/status.c: Clean up the use of - libXmu. - -2009-03-22 02:23 joewing - - * [r433] /src/button.c: No more 3D buttons. - -2009-03-22 02:23 joewing - - * [r432] /src/confirm.c: Fix the size of buttons on the confirm - dialog. - -2009-03-22 01:55 joewing - - * [r431] /src/border.c: Clean up some border stuff. - -2009-03-22 01:52 joewing - - * [r430] /src/status.c: Make status windows rounded. - -2009-03-21 00:17 joewing - - * [r429] /src/jxlib.h, /src/main.c, /src/root.c: Log a debug - message about the composite extension. - -2009-03-21 00:08 joewing - - * [r428] /src/border.c, /src/jxlib.h: Fix shaded rounded windows. - -2009-03-20 23:53 joewing - - * [r427] /src/client.c, /src/event.c, /src/menu.c: Fix some - warnings. - -2009-03-20 04:49 joewing - - * [r426] /configure.in: Fix a link error with Xmu functions. - -2009-03-20 04:35 joewing - - * [r425] /configure.in, /jwm.1.in, /src/border.c, /src/border.h, - /src/button.c, /src/client.c, /src/client.h, /src/color.c, - /src/color.h, /src/event.c, /src/group.c, /src/group.h, - /src/hint.c, /src/hint.h, /src/icon.c, /src/jwm.h, /src/jxlib.h, - /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/menu.c, - /src/menu.h, /src/parse.c, /src/popup.c, /src/resize.c, - /src/root.c, /src/root.h, /src/tray.c, /src/tray.h, - /src/winmenu.c: User-contributed JWM-enhancements: - Patriot: - - Rounded window corners - - Transparent menus, trays, and window support. - - Borderless taskbutton tweak. - - Flat menu button option. - - New tray/tasklist border. - - xcompmgr bug workaround. - - User replaceable window button mask. - - gxine fullscreen fix. - Dougal: - - Show-desktop keybinding. - - Opacity keybinding. - - Transparent group. - -2007-11-02 02:50 joewing - - * [r424] /src/client.c, /src/lex.c, /src/parse.c, /src/tray.c, - /src/tray.h: Some speedups. - -2007-11-02 02:30 joewing - - * [r423] /src/icon.c: Better icon hashing. - -2007-11-02 02:13 joewing - - * [r422] /configure.in: Bump version number. - -2007-11-02 02:12 joewing - - * [r421] /src/clientlist.c: With "nextstacked", don't raise until - the modifier key is released. - -2007-08-01 01:37 joewing - - * [r420] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c: Add the ability to stick/unstick windows with a key - binding. - -2007-08-01 01:33 joewing - - * [r419] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c: Add the ability to switch to the previous desktop - via a key binding. - -2007-08-01 01:27 joewing - - * [r418] /src/key.c: Fix a key binding issue with lock modifiers. - -2007-07-05 23:58 joewing - - * [r417] /src/client.c: Fix maximization on restart. - -2007-07-04 00:26 joewing - - * [r416] /src/jwm.h, /src/main.c, /src/swallow.c: Delay a bit - before restarting to give swallow windows a chance to map. - -2007-07-03 23:55 joewing - - * [r415] /configure.in, /src/icon.c, /src/x.xpm: Better icon hash - and updated version number. - -2007-07-03 05:13 joewing - - * [r414] /src/image.c: Fix file handle leak. - -2007-06-25 00:55 joewing - - * [r413] /configure.in: A hack to make MANDIR behave - -2007-06-25 00:50 joewing - - * [r412] /configure.in: Fix man page installation directory - (hopefully). - -2007-06-25 00:45 joewing - - * [r411] /src/key.c: Don't attempt to grab keys for which we can't - get the key code. - -2007-06-25 00:03 joewing - - * [r410] /src/parse.c: Fix a menu include bug. - -2007-06-24 23:44 joewing - - * [r409] /configure.in: Update version. - -2007-06-24 22:27 joewing - - * [r408] /src/background.c: Only include misc.h once. - -2007-06-24 22:25 joewing - - * [r407] /src/event.c, /src/resize.c: Make alt+right click resize - windows. - -2007-06-24 21:33 joewing - - * [r406] /example.jwmrc: Update config again... - -2007-06-24 21:30 joewing - - * [r405] /example.jwmrc: Update the default config. - -2007-06-24 21:30 joewing - - * [r404] /src/background.c: Expand environment variables in - background image paths. - -2007-06-24 21:05 joewing - - * [r403] /src/main.c: Fix a bug with backgrounds. - -2007-06-23 20:12 joewing - - * [r402] /jwm.1.in, /src/icon.c: Support JPEG icons. - -2007-06-22 02:29 joewing - - * [r401] /example.jwmrc, /src/parse.c: Update default config and - fix Desktops tag parsing. - -2007-06-22 01:45 joewing - - * [r400] /src/client.c, /src/client.h, /src/event.c: Make - maximization from double clicking the title use client settings. - -2007-06-21 04:30 joewing - - * [r399] /src/confirm.c, /src/parse.c: Clean up some parsing stuff - and make confirm buttons wider. - -2007-06-21 02:18 joewing - - * [r398] /jwm.1.in, /src/client.h, /src/event.c, /src/group.c, - /src/group.h, /src/parse.c: Add hmax and vmax group options. - -2007-06-21 02:02 joewing - - * [r397] /src/group.c: Fix a bug with matching against window - instance names. - -2007-06-21 01:49 joewing - - * [r396] /src/key.c: Fix nextstacked key binding. - -2007-06-19 02:23 joewing - - * [r395] /README, /src/image.c, /src/jwm.h: Stop png.h's - complaining. - -2007-06-19 01:56 joewing - - * [r394] /config.h.in, /configure.in, /src/border.c, /src/client.c, - /src/client.h, /src/desktop.c, /src/event.c, /src/group.c, - /src/hint.c, /src/image.c, /src/image.h, /src/jwm.h, /src/menu.h, - /src/move.c, /src/pager.c, /src/place.c, /src/place.h, - /src/resize.c, /src/winmenu.c: Horizontal/vertical maximization - Optional JPEG support. - -2007-06-17 04:26 joewing - - * [r393] /src/background.c, /src/main.c: Don't make huge pixmaps - for tiled backgrounds. - -2007-06-17 02:45 joewing - - * [r392] /src/desktop.c: Don't minimize "nolist" items on - showdesktop. - -2007-06-15 04:09 joewing - - * [r391] /jwm.1.in: Update the documentation for menu includes. - -2007-06-15 04:08 joewing - - * [r390] /src/menu.c: Fix a bug where labels were cut off - sometimes. - -2007-06-15 04:05 joewing - - * [r389] /src/parse.c: Make menu includes work better (now they - must be surrounded by a tag). - -2007-06-15 03:45 joewing - - * [r388] /src/image.c: Remove debug stuff. - -2007-06-15 03:44 joewing - - * [r387] /jwm.1.in, /src/background.c, /src/icon.c, /src/image.c, - /src/lex.c: Support for tiled background images. - -2007-06-01 04:05 joewing - - * [r386] /src/main.c: Fix "non-portable" whitespace. - -2007-06-01 04:02 joewing - - * [r385] /src/confirm.c, /src/menu.c, /src/tray.c: Remove tabs - -2007-06-01 03:59 joewing - - * [r384] /src/clock.c, /src/cursor.c, /src/cursor.h, /src/menu.c, - /src/pager.c, /src/taskbar.c, /src/tray.c, /src/tray.h, - /src/traybutton.c: Make all tray buttons appear to be pressed - when pressed. - -2007-06-01 03:08 joewing - - * [r383] /src/button.h, /src/confirm.c, /src/confirm.h: Make dialog - buttons appear to be pressed when pressed. - -2007-05-17 01:33 joewing - - * [r382] /Doxyfile, /doc-footer.shtml, /doc-header.shtml: Doxygen - updates - -2007-05-16 03:39 joewing - - * [r381] /src/client.c, /src/color.c: Fix a seg fault. - -2007-05-04 03:00 joewing - - * [r380] /src/color.c, /src/color.h, /src/gradient.c: Fix gradients - on pseudo x servers - -2007-04-04 02:50 joewing - - * [r379] /jwm.1.in, /src/event.c: Changes from jeremy-c-reed - Fix typos in debugging output. - Fix an issue with some versions of man. - -2007-03-19 03:17 joewing - - * [r378] /jwm.1.in: Document scroll wheel mouse bindings for the - task list. - -2007-03-19 03:11 joewing - - * [r377] /src/traybutton.c: Make the tray button appear pressed - when showing a root menu. - -2007-03-19 02:57 joewing - - * [r376] /src/clientlist.c, /src/clientlist.h: Remove some dead - code. - -2007-03-19 02:52 joewing - - * [r375] /src/Makefile.in, /src/border.c, /src/client.c, - /src/client.h, /src/clientlist.c, /src/clientlist.h, - /src/desktop.c, /src/event.c, /src/key.c, /src/key.h, - /src/move.c, /src/pager.c, /src/parse.c, /src/taskbar.c, - /src/taskbar.h, /src/tray.c: Make "nextstacked" work. - -2007-03-17 00:01 joewing - - * [r374] /src/taskbar.c: Make FocusNextStackedCircular raise as - well as focus. - -2007-03-04 05:17 joewing - - * [r373] /src/dock.c: Fix a seg fault when a program attempts to - dock a window with no dock running. - -2007-02-24 20:48 joewing - - * [r372] /src/background.c: Use a pixmap rather than setting the - background pixel for solid backgrounds. - -2007-01-13 05:02 joewing - - * [r371] /src/background.c: Fix a background problem. - -2007-01-13 05:00 joewing - - * [r370] /src/menu.c, /todo.txt: Fix handling of empty menu items. - -2007-01-13 04:52 joewing - - * [r369] /src/menu.c, /todo.txt: Don't show empty menus. - -2007-01-09 03:31 joewing - - * [r368] /src/event.c: Fix window mapping. - -2007-01-07 05:24 joewing - - * [r367] /src/event.c: Don't hide either. - -2007-01-07 05:22 joewing - - * [r366] /src/event.c: Set the desktop for windows that map - themselves. - -2007-01-07 05:14 joewing - - * [r365] /src/icon.c: Center icons. - -2007-01-07 05:04 joewing - - * [r364] /src/icon.c, /src/render.c: Speed up image loading. - -2007-01-07 04:38 joewing - - * [r363] /src/move.c: Fix mouse position when moving maximized - windows. - -2007-01-07 04:03 joewing - - * [r362] /src/background.c, /src/hint.c, /src/hint.h: Set the - _XSETROOT_ID property on the root window. - -2007-01-06 03:17 joewing - - * [r361] /src/icon.c: Fix endian bug with icons. - -2007-01-05 06:18 joewing - - * [r360] /src/icon.c: Fix warning - -2007-01-05 06:17 joewing - - * [r359] /src/background.c, /src/icon.c, /src/icon.h, /src/image.c, - /src/render.c: Fixes for render - -2007-01-05 06:15 joewing - - * [r358] /src/icon.c, /src/image.c, /src/image.h, /src/render.c: - More speedups - -2007-01-05 05:32 joewing - - * [r357] /src/icon.c: More speedup, hopefully. - -2007-01-05 05:11 joewing - - * [r356] /src/image.c: Attempt to speed things up. - -2007-01-05 04:22 joewing - - * [r355] /src/move.c, /src/pager.c, /todo.txt: Retain maximized - status when moving windows. - -2007-01-04 04:38 joewing - - * [r354] /src/background.c: Fix some warnings - -2007-01-04 04:37 joewing - - * [r353] /jwm.1.in, /src/Makefile.in, /src/background.c, - /src/background.h, /src/color.c, /src/color.h, /src/desktop.c, - /src/lex.c, /src/lex.h, /src/main.c, /src/parse.c, /todo.txt: - Added the ability to set the background and to change it based on - desktop. - -2006-12-30 23:05 joewing - - * [r352] /src/main.c, /src/place.c, /src/place.h, /todo.txt: Fix a - bug drawing trays. - -2006-12-28 04:09 joewing - - * [r351] /src/pager.c: Unmaximize maximized windows when moving - using the pager. - -2006-12-28 04:05 joewing - - * [r350] /example.jwmrc: Updated example configuration. - -2006-12-28 04:03 joewing - - * [r349] /Makefile.in, /configure.in, /package: Remove package - stuff - -2006-12-27 01:13 joewing - - * [r348] /src/pager.c: Fix warnings. - -2006-12-27 01:12 joewing - - * [r347] /src/pager.c, /src/traybutton.c, /todo.txt: Add the - ability to move windows with the pager. - -2006-12-24 19:49 joewing - - * [r346] /src/root.c, /src/taskbar.c: Fix a seg fault when - minimized windows have no name. - -2006-12-24 07:03 joewing - - * [r345] /src/hint.h: More doxygen. - -2006-12-24 06:59 joewing - - * [r344] /src/client.h, /src/winmenu.h: Fix some doxygen comments. - -2006-12-24 06:57 joewing - - * [r343] /src/command.c: Fix a compiler warning. - -2006-12-24 06:55 joewing - - * [r342] /src/client.h, /src/clock.c, /src/clock.h, /src/color.h, - /src/command.c, /src/command.h, /src/cursor.h, /src/dock.c, - /src/dock.h, /src/font.h, /src/help.h, /src/hint.h, /src/image.h, - /src/key.c, /src/key.h, /src/lex.h, /src/main.h, /src/match.h, - /src/menu.h, /src/misc.h, /src/move.h, /src/outline.h, - /src/pager.h, /src/parse.h, /src/place.h, /src/popup.h, - /src/render.h, /src/resize.h, /src/root.c, /src/root.h, - /src/screen.h, /src/status.h, /src/swallow.c, /src/swallow.h, - /src/taskbar.h, /src/timing.h, /src/tray.h, /src/traybutton.c, - /src/traybutton.h, /src/winmenu.h: More doxygen comments. - -2006-12-24 05:02 joewing - - * [r341] /configure.in: Bump version to 1.9 - -2006-12-24 04:53 joewing - - * [r340] /src/border.c, /src/border.h, /src/button.c, - /src/button.h, /src/client.c, /src/client.h, /src/clock.c, - /src/clock.h, /src/color.c, /src/color.h, /src/command.c, - /src/confirm.c, /src/confirm.h, /src/cursor.c, /src/debug.c, - /src/debug.h, /src/desktop.c, /src/dock.c, /src/error.c, - /src/event.c, /src/font.c, /src/font.h, /src/gradient.c, - /src/gradient.h, /src/group.c, /src/group.h, /src/help.c, - /src/hint.c, /src/hint.h, /src/icon.c, /src/icon.h, /src/image.c, - /src/image.h, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/key.h, - /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/match.c, - /src/menu.c, /src/menu.h, /src/misc.c, /src/move.c, /src/move.h, - /src/outline.c, /src/pager.c, /src/parse.c, /src/place.c, - /src/popup.c, /src/render.c, /src/render.h, /src/resize.c, - /src/resize.h, /src/root.c, /src/screen.c, /src/screen.h, - /src/status.c, /src/swallow.c, /src/swallow.h, /src/taskbar.c, - /src/timing.c, /src/timing.h, /src/tray.c, /src/tray.h, - /src/traybutton.c, /src/traybutton.h, /src/winmenu.c: Use spaces - instead of tabs. - -2006-12-24 04:18 joewing - - * [r339] /src/swallow.c: Fix a memory leak. - -2006-12-24 04:13 joewing - - * [r338] /src/misc.c: Fix a bug. - -2006-12-24 04:07 joewing - - * [r337] /src/border.c, /src/color.c, /src/hint.c, /src/hint.h, - /src/jxlib.h, /src/lex.c, /src/lex.h, /src/main.c, /src/match.c, - /src/menu.c, /src/move.c, /src/outline.c, /src/pager.c, - /src/parse.c, /src/place.c, /src/popup.c, /src/popup.h, - /src/render.c, /src/root.c, /src/screen.c, /src/status.c, - /src/taskbar.c, /src/timing.c, /src/tray.c, /src/traybutton.c, - /src/traybutton.h, /src/winmenu.c, /src/winmenu.h: Code cleanups. - -2006-12-24 02:20 joewing - - * [r336] /example.jwmrc, /jwm.1.in, /src/Makefile.in, - /src/border.c, /src/border.h, /src/button.c, /src/client.c, - /src/color.c, /src/color.h, /src/cursor.c, /src/cursor.h, - /src/debug.c, /src/debug.h, /src/desktop.c, /src/event.c, - /src/event.h, /src/font.c, /src/font.h, /src/gradient.c, - /src/gradient.h, /src/group.c, /src/group.h, /src/hint.h, - /src/icon.c, /src/image.c, /src/jwm.h, /src/key.c, /src/lex.c, - /src/lex.h, /src/main.c, /src/menu.c, /src/move.c, /src/parse.c, - /src/taskbar.c, /src/theme.c, /src/theme.h, /todo.txt: New look. - -2006-12-23 07:54 joewing - - * [r335] /todo.txt: Update version in todo - -2006-12-23 06:41 joewing - - * [r334] /src/menu.c, /src/menu.h, /todo.txt: Make submenus appear - on the left if there isn't enough room on the - right (mdsama). - -2006-12-23 06:35 joewing - - * [r333] /src/client.c, /todo.txt: Focus transients of active - windows when they appear. - -2006-12-23 06:25 joewing - - * [r332] /src/event.c, /src/main.c, /src/swallow.c, /src/tray.c, - /todo.txt: Fix swallow on startup. - -2006-12-23 05:22 joewing - - * [r331] /src/dock.c, /src/dock.h, /src/event.c, /todo.txt: Fix - dock when restarting. - -2006-12-23 02:38 joewing - - * [r330] /configure.in, /src/client.c, /src/clock.c, - /src/command.c, /src/confirm.c, /src/confirm.h, /src/dock.c, - /src/error.c, /src/help.c, /src/image.h, /src/lex.h, /src/misc.c, - /src/misc.h, /src/move.c, /src/resize.c, /todo.txt: Fix a bug - with moving windows that could cause windows to jump to the - upper left corner of the screen. - Add some more doxygen comments. - -2006-11-04 21:07 joewing - - * [r329] /configure.in, /todo.txt: version 1.8rc4 - -2006-11-04 20:54 joewing - - * [r328] /src/main.c, /todo.txt: Fix StartupCommands and Swallow - items. - -2006-11-04 20:45 joewing - - * [r327] /src/client.c, /todo.txt: Improve _NET_WM_STATE_FULLSCREEN - support. - -2006-10-28 04:00 joewing - - * [r326] /src/lex.c, /todo.txt: Trim leading and trailing space - from configuration options. - -2006-10-28 02:17 joewing - - * [r325] /example.jwmrc: Fix root menu keybinding in the default - config. - -2006-10-24 01:10 joewing - - * [r324] /configure.in, /src/border.c, /src/cursor.c, /src/parse.c, - /todo.txt: Fix some seg faults with invalid configuration files. - -2006-10-23 02:03 joewing - - * [r323] /src/tray.c, /todo.txt: Fix an issue with auto-hide trays - hidding when they shouldn't. - -2006-10-20 04:16 joewing - - * [r322] /src/client.c, /src/main.c, /todo.txt: Fix a bug that - caused windows to be mapped incorrectly when started at the - same time as JWM. - -2006-10-19 01:32 joewing - - * [r321] /src/client.c, /todo.txt: Fix a bug that caused a seg - fault after a client was killed. - -2006-10-15 04:55 joewing - - * [r320] /src/Makefile.in: Remove "GNU-ism" in makefile. - -2006-10-01 20:15 joewing - - * [r319] /src/client.c, /src/hint.c: Keep transients above owners. - -2006-10-01 20:04 joewing - - * [r318] /src/client.c, /src/key.c, /src/traybutton.c: bah - -2006-10-01 20:01 joewing - - * [r317] /src/key.c, /src/key.h, /src/parse.c, /src/root.h, - /src/traybutton.c, /src/traybutton.h, /todo.txt: More warning - messages about tray buttons/key bindings that specify root menus. - -2006-08-26 22:19 joewing - - * [r316] /src/border.c, /src/client.c, /src/client.h, /src/event.c, - /src/hint.c, /src/hint.h, /src/place.c, /src/traybutton.c, - /todo.txt: Add support for _NET_WM_STATE_FULLSCREEN. - -2006-08-20 01:22 joewing - - * [r315] /src/event.c, /todo.txt: Unmaximize maximized windows that - resize themselves. - -2006-08-18 00:46 joewing - - * [r314] /src/place.c, /todo.txt: When maximizing, place the window - on the screen of its center point. - -2006-08-18 03:06 joewing - - * [r313] /src/theme.c: Fix a compiler warning. - -2006-08-18 00:39 joewing - - * [r312] /src/screen.h, /src/status.h, /src/swallow.h, - /src/taskbar.h, /src/theme.c, /src/theme.h, /src/timing.h, - /src/traybutton.h, /src/winmenu.h: Add some comments. - -2006-08-18 01:50 joewing - - * [r311] /src/client.c, /todo.txt: Fix a compiler warning. - -2006-08-17 23:23 joewing - - * [r310] /src/client.c, /src/client.h, /src/event.c: Allow clients - to be lowered with alt+right click. - -2006-08-17 23:00 joewing - - * [r309] /src/event.c, /todo.txt: Fix alt+left click window moving - so windows don't jump. - -2006-08-17 22:53 joewing - - * [r308] /src/popup.c, /todo.txt: Hide popups if the mouse moves - over them. - -2006-08-14 04:01 joewing - - * [r307] /src/traybutton.c: Fix a compiler warning. - -2006-08-14 01:49 joewing - - * [r306] /configure.in, /src/root.c, /src/root.h, - /src/traybutton.c, /todo.txt: Bump version, fix seg fault when - TrayButtons point to invalid root menus. - -2006-08-13 20:26 joewing - - * [r305] /configure.in, /src/client.c: Fix --disable-shape - -2006-08-13 20:21 joewing - - * [r304] /jwm.1.in: Update documentation. - -2006-08-13 19:55 joewing - - * [r303] /Doxyfile, /Makefile.in, /src/border.h, /src/button.h, - /src/client.h, /src/clock.h, /src/color.h, /src/command.h, - /src/confirm.h, /src/cursor.h, /src/debug.h, /src/desktop.h, - /src/dock.h, /src/error.h, /src/event.h, /src/font.h, - /src/group.h, /src/help.c, /src/help.h, /src/hint.h, /src/icon.h, - /src/image.h, /src/jwm.h, /src/jxlib.h, /src/key.h, /src/lex.h, - /src/main.h, /src/match.h, /src/menu.h, /src/misc.h, /src/move.h, - /src/outline.h, /src/pager.h, /src/parse.h, /src/place.h, - /src/popup.h, /src/render.h, /src/resize.h, /src/root.h, - /src/screen.h, /src/status.h, /src/swallow.h, /src/taskbar.h, - /src/theme.h, /src/timing.h, /src/tray.h, /src/traybutton.h, - /src/winmenu.h: Add some doxygen comments. - -2006-08-13 16:18 joewing - - * [r302] /src/border.h, /src/button.h, /src/client.h, /src/icon.h: - Comments. - -2006-08-13 05:43 joewing - - * [r301] /src/image.h, /src/move.h, /src/outline.h, /src/resize.h, - /src/tray.h: Add some comments. - -2006-08-13 05:21 joewing - - * [r300] /src/border.c, /src/button.c, /src/client.c, /src/clock.c, - /src/color.c, /src/command.c, /src/confirm.c, /src/cursor.c, - /src/debug.c, /src/dock.c, /src/error.c, /src/font.c, - /src/group.c, /src/hint.c, /src/key.c, /src/parse.c, /todo.txt: - Fix some stuff. - -2006-08-12 23:06 joewing - - * [r299] /src/border.c, /src/button.c, /src/font.c, /src/icon.c, - /src/icon.h, /src/traybutton.c: Attempt to fix icon drawing - issue. - -2006-08-11 23:56 joewing - - * [r298] /src/clock.h, /src/command.h, /src/desktop.h, /src/dock.h, - /src/event.c: Don't stop move/resize for superfluous configure - requests. - -2006-08-11 04:35 joewing - - * [r297] /todo.txt: Update todo. - -2006-08-11 02:36 joewing - - * [r296] /src/client.h, /src/command.c, /src/command.h, - /src/font.c, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, - /src/parse.c: Fix font overflow and add RestartCommand. - -2006-08-10 02:46 joewing - - * [r295] /jwm.1.in, /src/cursor.c, /src/cursor.h, /src/desktop.c, - /src/desktop.h, /src/event.c, /src/key.c, /src/key.h, /src/lex.c, - /src/lex.h, /src/menu.c, /src/menu.h, /src/move.c, /src/parse.c, - /src/root.c, /src/root.h, /src/traybutton.c, /src/winmenu.c, - /src/winmenu.h, /todo.txt: Support window controls in root menus. - -2006-08-09 00:39 joewing - - * [r294] /src/button.c: Fix button drawing. - -2006-08-09 01:55 joewing - - * [r293] /src/font.c: Fix a xft problem. - -2006-08-08 23:57 joewing - - * [r292] /jwm.1.in, /src/border.c, /src/button.c, /src/client.c, - /src/client.h, /src/clock.c, /src/confirm.c, /src/font.c, - /src/font.h, /src/icon.c, /src/main.c, /src/main.h, /src/menu.c, - /src/menu.h, /src/pager.c, /src/popup.c, /src/render.c, - /src/status.c, /src/taskbar.c, /src/tray.c, /src/tray.h, - /src/traybutton.c, /todo.txt: Reduce X resource usage. - -2006-08-08 00:49 joewing - - * [r291] /src/event.c, /src/event.h: Remove some dead code. - -2006-08-08 00:47 joewing - - * [r290] /src/event.c, /src/menu.c, /src/parse.c, /src/root.c, - /src/root.h, /src/traybutton.c: Support multiple root menus. - -2006-08-07 23:17 joewing - - * [r289] /src/border.c, /src/border.h, /src/button.c, - /src/client.c, /src/clock.c, /src/confirm.c, /src/event.c, - /src/font.c, /src/font.h, /src/icon.c, /src/icon.h, /src/popup.c, - /src/status.c, /src/theme.c, /src/theme.h, /src/traybutton.c: - Only redraw newly exposed regions of the border. - -2006-08-06 03:49 joewing - - * [r288] /src/popup.c, /todo.txt: Fix click propagation through - popups. - -2006-08-06 03:45 joewing - - * [r287] /configure.in: Change version - -2006-08-06 01:59 joewing - - * [r286] /src/cursor.c, /src/cursor.h, /src/move.c: Fix move - cursor. - -2006-08-06 01:48 joewing - - * [r285] /src/client.c: Fix keyboard input. - -2006-08-06 01:41 joewing - - * [r284] /src/event.c: Remove debug output. - -2006-08-06 01:40 joewing - - * [r283] /src/client.c, /src/cursor.c, /src/cursor.h, /src/event.c, - /src/key.c, /src/move.c: Fix alt+drag moving. - -2006-08-06 02:35 joewing - - * [r282] /src/client.c, /src/client.h, /src/event.c, /src/hint.c, - /src/hint.h, /src/swallow.c: Kill swallow apps that don't accept - WM_DELETE. - -2006-08-06 02:04 joewing - - * [r281] /src/client.c, /src/menu.c, /src/taskbar.c, /src/tray.c: - Don't get NoExpose/GraphicsExpose events. - -2006-08-05 19:05 joewing - - * [r280] /src/tray.c: Never warp the mouse when a tray is shown. - -2006-08-05 16:11 joewing - - * [r279] /src/client.c: Don't propagate uneeded events. - -2006-08-05 07:39 joewing - - * [r278] /src/client.c, /src/cursor.c, /src/cursor.h, /src/dock.c, - /src/event.c, /src/main.c, /src/menu.c, /src/move.c, - /src/popup.c, /src/tray.c: Fix some mouse event handling. - -2006-08-01 00:39 joewing - - * [r277] /src/event.c, /src/place.c, /src/place.h, /src/resize.c: - Placement and resize fixes. - -2006-08-01 00:04 joewing - - * [r276] /src/place.c, /todo.txt: Improve aspect ratio resizing. - -2006-07-30 04:27 joewing - - * [r275] /src/menu.c: Fix menu issue. - -2006-07-30 04:14 joewing - - * [r274] /src/dock.c, /src/error.c, /src/event.c, /src/hint.c, - /src/lex.c, /src/lex.h, /src/misc.c, /src/parse.c: cleanups - -2006-07-29 03:47 joewing - - * [r273] /src/clock.c, /src/color.c, /src/command.c, - /src/confirm.c, /src/desktop.c, /src/font.c, /src/group.c, - /src/icon.c, /src/image.c, /src/key.c, /src/lex.c, /src/main.c, - /src/parse.c, /src/popup.c, /src/root.c, /src/swallow.c: Remove - some redundant code. - -2006-07-29 03:07 joewing - - * [r272] /src/client.c, /src/desktop.c, /todo.txt: Preserve the - shaded status when minimizing. - -2006-07-29 02:56 joewing - - * [r271] /src/client.c, /todo.txt: Fix a bug in raising shaded - windows from a task list. - -2006-07-29 02:39 joewing - - * [r270] /src/event.c, /todo.txt: Add the ability to move a window - with alt+click. - -2006-07-28 05:01 joewing - - * [r269] /src/clock.c, /src/clock.h, /src/main.c, /src/popup.c, - /src/popup.h, /src/taskbar.c, /src/taskbar.h, /src/tray.c, - /src/tray.h, /src/traybutton.c, /src/traybutton.h: Fix some mouse - issues - -2006-07-28 03:54 joewing - - * [r268] /src/event.c: Fix a mouse tracking issue. - -2006-07-23 02:01 joewing - - * [r267] /src/button.c, /src/client.c, /src/event.c, /src/main.c: - Fix some stuff - -2006-07-22 22:36 joewing - - * [r266] /src/client.c, /src/event.c, /src/place.c: Cleanups - -2006-07-22 22:28 joewing - - * [r265] /src/move.c, /src/resize.c: Fix some move stuff. - -2006-07-22 22:02 joewing - - * [r264] /src/button.c, /src/button.h, /src/command.c, /src/main.c, - /src/menu.c: Fix some button/menu stuff. - -2006-07-22 01:10 joewing - - * [r263] /src/cursor.c, /src/cursor.h, /src/event.c, /src/menu.c, - /src/move.c, /src/resize.c, /src/tray.c: Fix some mouse issues. - -2006-07-21 23:53 joewing - - * [r262] /config.h.in, /configure.in, /example.jwmrc, - /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, - /src/button.h, /src/client.c, /src/command.c, /src/command.h, - /src/confirm.c, /src/cursor.c, /src/cursor.h, /src/debug.h, - /src/dock.c, /src/event.c, /src/font.c, /src/hint.c, /src/icon.c, - /src/lex.c, /src/lex.h, /src/main.c, /src/menu.c, /src/parse.c, - /src/place.c, /src/place.h, /src/taskbar.c, /src/theme.c, - /src/theme.h, /src/traybutton.c, /src/winmenu.c, /todo.txt: Some - stuff. - -2006-07-01 22:17 joewing - - * [r261] /config.h.in, /configure.in, /src/Makefile.in, - /src/border.c, /src/border.h, /src/button.c, /src/button.h, - /src/client.c, /src/clock.c, /src/color.c, /src/color.h, - /src/confirm.c, /src/debug.h, /src/dock.c, /src/event.c, - /src/font.c, /src/hint.c, /src/icon.c, /src/image.c, - /src/image.h, /src/jwm.h, /src/jxlib.h, /src/lex.c, /src/lex.h, - /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/misc.c, - /src/misc.h, /src/move.c, /src/parse.c, /src/place.c, - /src/place.h, /src/resize.c, /src/status.c, /src/taskbar.c, - /src/theme.c, /src/theme.h, /src/tray.c, /src/tray.h, - /src/traybutton.c, /todo.txt: Undo theme changes. - -2006-05-11 00:45 joewing - - * [r260] /src/border.c, /src/button.c, /src/icon.c, /src/menu.c, - /src/status.c, /src/theme.c, /src/theme.h, /src/tray.c: More - theme updates. - -2006-05-09 04:55 joewing - - * [r259] /src/border.c: Fix shaped window issues. - -2006-05-09 03:23 joewing - - * [r258] /src/border.c, /src/border.h, /src/clock.c, /src/color.c, - /src/color.h, /src/parse.c, /src/status.c: Some cleanups. - -2006-05-09 02:37 joewing - - * [r257] /src/clock.c, /src/confirm.c, /src/taskbar.c, - /src/theme.c, /src/theme.h, /src/tray.c, /src/tray.h: Pretty some - things up. - -2006-05-09 01:25 joewing - - * [r256] /config.h.in, /configure.in, /src/debug.h, /src/dock.c, - /src/font.c, /src/hint.c, /src/icon.c, /src/jwm.h, /src/lex.c, - /src/taskbar.c, /src/theme.c: Use the stack if possible in some - places. - -2006-05-08 03:17 joewing - - * [r255] /configure.in, /src/Makefile.in, /src/border.c, - /src/border.h, /src/button.c, /src/button.h, /src/client.c, - /src/confirm.c, /src/event.c, /src/hint.c, /src/icon.c, - /src/image.c, /src/image.h, /src/jxlib.h, /src/lex.c, /src/lex.h, - /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/misc.c, - /src/misc.h, /src/move.c, /src/parse.c, /src/place.c, - /src/place.h, /src/resize.c, /src/taskbar.c, /src/theme.c, - /src/theme.h, /src/tray.c, /src/traybutton.c, /todo.txt: Theme - support. - -2006-04-26 02:07 joewing - - * [r254] /configure.in: Change to 1.7. - -2006-04-26 01:57 joewing - - * [r253] /src/clock.c, /src/move.c, /src/tray.c, /src/tray.h, - /todo.txt: Some fixes. - -2006-04-23 04:15 joewing - - * [r252] /src/clock.c, /todo.txt: Don't draw the clock every second - if not needed. - -2006-04-23 04:06 joewing - - * [r251] /src/border.c, /src/border.h, /src/event.c, /todo.txt: - Make left click on window icons show the window menu. - -2006-04-23 03:58 joewing - - * [r250] /src/move.c, /src/resize.c, /todo.txt: Un-maximize windows - on move and resize. - -2006-04-23 03:43 joewing - - * [r249] /src/menu.c, /todo.txt: Support for menus that are too big - for the screen. - -2006-04-19 04:40 joewing - - * [r248] /README: Updated README - -2006-04-19 04:29 joewing - - * [r247] /src/menu.c, /src/taskbar.c, /todo.txt: Minimized item - updates and menu handling work. - -2006-04-19 03:13 joewing - - * [r246] /todo.txt: Updated todo. - -2006-04-19 03:12 joewing - - * [r245] /src/border.c: New window buttons! - -2006-04-19 03:01 joewing - - * [r244] /config.h.in, /configure.in: Some changes to make aCC - work. - -2006-04-19 02:52 joewing - - * [r243] /config.h.in, /configure.in: Yet more configure changes. - -2006-04-19 02:47 joewing - - * [r242] /config.h.in, /configure.in, /src/jwm.h: More configure - updates. - -2006-04-19 02:29 joewing - - * [r241] /configure.in: Updated configure. - -2006-04-15 04:58 joewing - - * [r240] /config.h.in, /configure.in, /src/jwm.h: Fix build on - HP-UX. - -2006-04-09 00:20 joewing - - * [r239] /src/client.c, /src/client.h, /src/desktop.c, - /src/event.c, /src/taskbar.c, /src/winmenu.c: Don't raise clients - when reversing a showdesktop. - -2006-04-09 00:05 joewing - - * [r238] /jwm.1.in, /src/client.c, /src/client.h, /src/desktop.c, - /src/event.c, /todo.txt: Make a second click on a "showdesktop" - button restore minimized windows. - -2006-04-08 02:12 joewing - - * [r237] /src/event.c, /src/key.c, /src/parse.c, /src/taskbar.c, - /src/taskbar.h, /todo.txt: New mouse bindings, fixed key mask - bug. - -2006-04-03 02:25 joewing - - * [r236] /jwm.1.in, /src/popup.c, /todo.txt: Change default delay - to 600 ms, add a 3 px border. - -2006-04-02 21:58 joewing - - * [r235] /src/move.c: Fix a bug with snap-to-screen. - -2006-04-02 21:49 joewing - - * [r234] /src/clock.c, /todo.txt: Fix a bug involving maximized - windows and the clock. - -2006-04-02 19:56 joewing - - * [r233] /src/jxlib.h, /src/key.c, /todo.txt: Fix a key binding - issue with keycode. - -2006-03-28 02:21 joewing - - * [r232] /src/client.c: Fix some issues with shaded windows. - -2006-03-21 04:58 joewing - - * [r231] /src/confirm.c, /src/move.c, /src/place.c, /src/popup.c, - /src/screen.c, /src/screen.h, /src/status.c, /src/taskbar.c, - /src/traybutton.c: Changes to screen handling. - -2006-03-19 03:06 joewing - - * [r230] /configure.in, /src/help.c: Update for 1.6. - -2006-03-19 02:56 joewing - - * [r229] /src/key.c, /todo.txt: Fix keybinding issue on - shutdown/restart. - -2006-03-19 02:46 joewing - - * [r228] /src/menu.c: Fix menu behavior. - -2006-03-19 02:39 joewing - - * [r227] /src/client.c, /src/winmenu.c: Fix confirm dialogs. - -2006-03-19 02:30 joewing - - * [r226] /src/client.c, /src/clock.c, /src/confirm.c, /src/main.c, - /src/timing.c, /src/timing.h: Clean some things. - -2006-03-19 00:35 joewing - - * [r225] /src/client.c: Restack clients after unshade. - -2006-03-18 20:08 joewing - - * [r224] /src/main.c: Fix a bug. - -2006-03-18 07:52 joewing - - * [r223] /src/dock.c, /src/event.c, /src/event.h, /src/main.c, - /src/menu.c, /src/swallow.c: Cleanups. - -2006-03-18 06:57 joewing - - * [r222] /src/main.c, /src/swallow.c: Fix swallow. - -2006-03-18 06:43 joewing - - * [r221] /todo.txt: Update todo too. - -2006-03-18 06:42 joewing - - * [r220] /src/font.c: Fix FriBidi UTF conversion. - -2006-03-18 06:26 joewing - - * [r219] /src/event.c, /src/swallow.c, /src/swallow.h, /todo.txt: - Don't pause waiting for swallow items. - -2006-03-18 04:23 joewing - - * [r218] /src/move.c: Another attempt to fix Xinerama. - -2006-03-18 04:07 joewing - - * [r217] /src/dock.c, /todo.txt: Fix a bug related to removing Dock - and restarting. - -2006-03-16 05:12 joewing - - * [r216] /src/parse.c, /src/tray.c, /src/tray.h: Clean up some - stuff. - -2006-03-16 04:57 joewing - - * [r215] /todo.txt: Updated todo. - -2006-03-16 04:43 joewing - - * [r214] /jwm.1.in, /src/move.c, /src/parse.c, /src/resize.c, - /src/status.c, /src/status.h, /todo.txt: Add coordinates - attribute to MoveMode and ResizeMode. - -2006-03-16 03:07 joewing - - * [r213] /src/clock.c, /todo.txt: Make it possible to fix the width - of the clock. - -2006-03-16 02:28 joewing - - * [r212] /src/move.c, /todo.txt: Fix snap-to-screen with Xinerama. - -2006-03-15 04:28 joewing - - * [r211] /src/client.c, /src/event.c: Fix. - -2006-03-15 03:31 joewing - - * [r210] /src/client.c, /src/client.h, /todo.txt: Fix shading of - shaped windows. - -2006-03-15 03:21 joewing - - * [r209] /src/border.c: Remove unnecessary call. - -2006-03-15 01:44 joewing - - * [r208] /src/place.c, /todo.txt: Fix a xinerama placement issue. - -2006-03-14 03:46 joewing - - * [r207] /src/screen.c, /src/screen.h: Remove some unused stuff. - -2006-03-14 03:41 joewing - - * [r206] /src/border.c, /src/event.c: Attempt to speed up border - drawing. - -2006-03-14 03:20 joewing - - * [r205] /src/debug.c, /src/event.c, /src/event.h, /src/menu.c, - /src/move.c, /src/resize.c: Optimize some stuff. - -2006-03-14 01:50 joewing - - * [r204] /src/client.c, /src/client.h, /src/event.c, /src/jxlib.h, - /src/menu.c, /src/move.c, /src/place.c, /src/resize.c: - MotionNotify handling changes. - -2006-03-14 01:05 joewing - - * [r203] /src/border.c, /src/client.c, /src/client.h, /src/event.c, - /src/hint.c, /src/taskbar.c, /todo.txt: Fix an ugly bug. - -2006-03-13 05:56 joewing - - * [r202] /src/event.c: Remove unneeded shape event stuff. - -2006-03-13 05:47 joewing - - * [r201] /src/event.c, /src/popup.c, /src/popup.h: Better popup - handling. - -2006-03-12 22:52 joewing - - * [r200] /config.h.in, /configure.in, /src/Makefile.in: More - configure.in updates. - -2006-03-12 22:43 joewing - - * [r199] /config.h.in, /configure.in: configure.in updates - -2006-03-12 09:27 joewing - - * [r198] /jwm.1.in: Updated man page. - -2006-03-12 06:13 joewing - - * [r197] /src/key.c, /todo.txt: Ignore caps/num lock. - -2006-03-12 03:46 joewing - - * [r196] /todo.txt: updated todo. - -2006-03-12 03:45 joewing - - * [r195] /src/client.c, /src/event.c: Fix a nasty shape extension - bug. - -2006-03-12 01:25 joewing - - * [r194] /configure.in: Fix XPM configure problem. - -2006-03-12 01:18 joewing - - * [r193] /configure.in: more configure.in changes - -2006-03-12 00:42 joewing - - * [r192] /configure.in, /src/Makefile.in, /src/help.c: Fix - configure. - -2006-03-11 23:12 joewing - - * [r191] /src/clock.c: Faster popup updates for Clock. - -2006-03-11 23:03 joewing - - * [r190] /src/popup.c: Fix popup enabled on restart. - -2006-03-11 23:01 joewing - - * [r189] /jwm.1.in, /src/clock.c, /src/parse.c, /src/popup.c, - /src/popup.h, /src/taskbar.c, /src/traybutton.c, /todo.txt: Add - "enabled" and "delay" PopupStyle attributes. - -2006-03-11 22:28 joewing - - * [r188] /src/event.c, /src/move.c, /src/place.c, /src/tray.c, - /src/tray.h, /todo.txt: Fix autohide issues. - -2006-03-11 21:59 joewing - - * [r187] /src/clock.c, /src/tray.c, /todo.txt: Resize the clock as - needed. - -2006-03-11 21:22 joewing - - * [r186] /src/move.c: Make valgrind stop complaining. - -2006-03-11 20:58 joewing - - * [r185] /src/icon.c, /src/move.c: Fix some stuff. - -2006-03-11 20:39 joewing - - * [r184] /src/clock.c, /src/clock.h, /src/event.c, /src/parse.c, - /src/popup.c, /src/popup.h, /src/taskbar.c, /src/taskbar.h, - /src/timing.h, /src/tray.c, /src/traybutton.c, /src/traybutton.h, - /todo.txt: Popups for TrayButtons. - Resizing clock that doesn't work. - -2006-03-11 08:13 joewing - - * [r183] /src/image.c, /todo.txt: Fix XPM issue. - -2006-03-11 07:56 joewing - - * [r182] /src/color.c, /src/color.h: cleanups. - -2006-03-11 03:45 joewing - - * [r181] /src/font.c: Fix a warning. - -2006-03-11 03:43 joewing - - * [r180] /src/event.c, /src/place.c, /src/place.h, /todo.txt: - Constrain client-requested resizes. - -2006-03-11 03:22 joewing - - * [r179] /src/color.c, /src/color.h, /src/image.c: better colormap - usage with xpms - -2006-03-11 01:43 joewing - - * [r178] /src/color.c: Use the root colormap if necessary - -2006-03-10 05:43 joewing - - * [r177] /src/color.c: Fix memory leak and color cell leak. - -2006-03-10 05:33 joewing - - * [r176] /src/color.c: A try at colormaps. - -2006-03-10 05:07 joewing - - * [r175] /src/color.c: Fix a warning. - -2006-03-10 04:08 joewing - - * [r174] /src/font.c: Fix a warning. - -2006-03-10 03:55 joewing - - * [r173] /src/color.c: Fix for 16 bit. - -2006-03-10 03:42 joewing - - * [r172] /src/color.c, /src/jxlib.h: New color stuff again. - -2006-03-09 05:16 joewing - - * [r171] /src/color.c: Much faster lookups - -2006-03-09 04:44 joewing - - * [r170] /src/color.c: Try this... - -2006-03-09 03:42 joewing - - * [r169] /src/event.c: bah.. - -2006-03-09 01:44 joewing - - * [r168] /src/event.c: Opps, I guess we needed that. - -2006-03-08 05:46 joewing - - * [r167] /src/color.c, /src/color.h, /src/image.c, /src/jxlib.h: - Optimize XPM loading. - -2006-03-08 05:23 joewing - - * [r166] /configure.in, /src/swallow.c: Fix some swallow stuff. - -2006-03-08 05:08 joewing - - * [r165] /src/main.c: Dont' sync. - -2006-03-08 04:59 joewing - - * [r164] /src/client.h, /src/hint.c: Remove unused field. - -2006-03-08 04:58 joewing - - * [r163] /src/client.c, /src/client.h, /src/event.c, /src/hint.c: - Fix X errors from killing clients. - -2006-03-08 04:02 joewing - - * [r162] /src/font.c, /src/main.c, /src/place.c, /src/screen.c, - /src/swallow.c: Fix a bug with fonts and lock the server during - the swallow search. - -2006-03-08 02:25 joewing - - * [r161] /src/place.c, /src/render.c, /src/screen.c: Speed up in - render and some debug code for Xinerama. - -2006-03-07 04:47 joewing - - * [r160] /src/color.c: A hack... but does it work? - -2006-03-07 02:28 joewing - - * [r159] /src/color.c: Try yet again. - -2006-03-07 02:14 joewing - - * [r158] /src/color.c: Try again... - -2006-03-07 02:08 joewing - - * [r157] /src/color.c: Updated color hashing. - -2006-03-06 15:10 joewing - - * [r156] /todo.txt: Updated todo. - -2006-03-06 04:32 joewing - - * [r155] /src/taskbar.c: Fix a UMR. - -2006-03-06 03:53 joewing - - * [r154] /config.h.in, /configure.in, /src/font.c, /src/jwm.h: - First run at supporting right-to-left languages. - -2006-03-05 22:39 joewing - - * [r153] /src/swallow.c, /todo.txt: ResizeRedirect instead of - ConfigureNotify for swallow items. - DestroyNotify -> 1 pixel swallow item. - -2006-03-05 06:54 joewing - - * [r152] /src/key.c, /src/key.h, /src/parse.c, /todo.txt: Allow - "keycode" instead of "key" to be specified for key bindings. - -2006-03-05 06:29 joewing - - * [r151] /src/event.c: Don't complain about unhandled - ConfigureNotify events. - -2006-03-05 06:21 joewing - - * [r150] /src/event.c, /src/swallow.c, /todo.txt: Support for - resizing of swallowed clients (lior2b). - -2006-03-05 05:58 joewing - - * [r149] /src/font.c, /src/jxlib.h, /todo.txt: UTF-8 support. - -2006-03-05 05:44 joewing - - * [r148] /jwm.1.in, /src/traybutton.c: Update man page and add - "root" action to TrayButton to be explicit. - -2006-03-05 05:37 joewing - - * [r147] /configure.in, /src/desktop.c, /src/desktop.h, - /src/traybutton.c, /todo.txt: Added "showdesktop" to TrayButton. - -2006-03-05 05:22 joewing - - * [r146] /configure.in, /src/pager.c, /src/parse.c: Fix an issue - with menu includes. - Slightly faster pager. - -2006-02-09 02:11 joewing - - * [r145] /Makefile.in, /jwm.1.in, /src/parse.c, /src/tray.c, - /src/tray.h, /todo.txt: Add valign and halign Tray attributes. - -2006-02-06 01:33 joewing - - * [r144] /src/error.c, /todo.txt: Don't show X errors in debug - mode. - -2006-02-04 04:55 joewing - - * [r143] /src/jxlib.h, /src/key.c, /todo.txt: Fix a key binding - issue on restart. - -2006-02-04 04:39 joewing - - * [r142] /todo.txt: Update todo. - -2006-02-04 04:39 joewing - - * [r141] /src/border.c, /src/client.c, /src/event.c, /src/main.c, - /src/main.h, /src/move.c, /src/resize.c, /todo.txt: Support - borderless windows with a titlebar. - -2006-02-04 03:45 joewing - - * [r140] /src/swallow.c, /todo.txt: Make Swallow more sane when an - error is encountered. - -2006-02-04 03:38 joewing - - * [r139] /src/swallow.c, /todo.txt: Fixed swallow items getting - more space than requested. - -2006-02-04 03:36 joewing - - * [r138] /src/taskbar.c: Better positioning of task menus for - vertical task bars. - -2006-02-04 03:27 joewing - - * [r137] /src/parse.c, /todo.txt: Automatically detect tray - layouts. - -2006-02-04 03:16 joewing - - * [r136] /src/menu.c, /todo.txt: Make menu sizes specified in terms - of the size of icons. - -2006-02-04 03:05 joewing - - * [r135] /src/root.c, /src/root.h, /src/taskbar.c, - /src/traybutton.c, /src/winmenu.c, /src/winmenu.h, /todo.txt: - Make tray menus popup in more natural locations. - -2006-01-16 03:32 joewing - - * [r134] /configure.in: Version bump to 1.4. - -2006-01-16 03:31 joewing - - * [r133] /todo.txt: Update todo again. - -2006-01-16 03:09 joewing - - * [r132] /todo.txt: Update todo. - -2006-01-15 02:52 joewing - - * [r131] /jwm.1.in, /src/group.c, /src/group.h, /src/parse.c, - /todo.txt: Add the maximized, minimized, and shaded group - options. - -2006-01-14 21:11 joewing - - * [r130] /src/parse.c: Fix pignore. - -2006-01-14 21:05 joewing - - * [r129] /jwm.1.in, /src/client.h, /src/group.c, /src/group.h, - /src/place.c, /todo.txt: Add "pignore" group option. - -2006-01-14 20:43 joewing - - * [r128] /src/event.c, /src/hint.c, /src/hint.h, /todo.txt: More - EWMH support. - -2006-01-14 18:47 joewing - - * [r127] /src/dock.c, /src/main.c: Make dock work after restart. - -2006-01-14 05:42 joewing - - * [r126] /src/confirm.c: Fix it really. - -2006-01-14 05:39 joewing - - * [r125] /src/confirm.c, /src/swallow.c: Fix some resources not - being freed. - -2006-01-14 05:25 joewing - - * [r124] /src/debug.c: Fix a invalid access. - -2006-01-14 02:51 joewing - - * [r123] /jwm.1.in: Update the man page. - -2006-01-14 02:46 joewing - - * [r122] /src/border.c, /src/parse.c: Cut down the size a bit. - -2006-01-13 03:51 joewing - - * [r121] /src/cursor.c, /src/cursor.h, /todo.txt: Remove unused - function. - -2006-01-11 01:44 joewing - - * [r120] /src/dock.c, /src/lex.c, /src/lex.h, /src/parse.c, - /todo.txt: More descriptive configuration parsing error messages. - -2006-01-10 06:05 joewing - - * [r119] /src/traybutton.c, /todo.txt: Center tray button text when - no icon is present. - -2006-01-10 05:58 joewing - - * [r118] /src/clock.c, /src/tray.c, /todo.txt: Fixed size - computation of fixed-size trays. - -2006-01-10 05:33 joewing - - * [r117] /src/taskbar.c, /src/tray.c, /todo.txt: Make vertical - trays size-to-fit. - -2006-01-10 04:56 joewing - - * [r116] /src/border.c: Make borders of small windows look better. - -2006-01-10 04:51 joewing - - * [r115] /src/border.c, /todo.txt: Better handling of really small - windows. - -2006-01-10 04:17 joewing - - * [r114] /todo.txt: Updated todo. - -2006-01-10 04:14 joewing - - * [r113] /configure.in, /todo.txt: Change the version number. - -2006-01-10 04:04 joewing - - * [r112] /src/client.c, /src/main.c, /src/swallow.c: Fix some - stuff. - -2006-01-10 03:56 joewing - - * [r111] /src/dock.c, /src/dock.h, /src/event.c: Center dock items. - -2006-01-10 02:16 joewing - - * [r110] /src/dock.c, /src/dock.h, /src/event.c, /src/taskbar.c, - /todo.txt: Use TaskListStyle instead of TrayButtonStyle for - TaskLists. - also more dock stuff that doesn't work. - -2006-01-10 01:17 joewing - - * [r109] /src/traybutton.c, /todo.txt: Fix centering of tray button - icons. - -2006-01-09 05:35 joewing - - * [r108] /src/tray.c, /src/tray.h: Fixes for variable-sized trays. - -2006-01-09 05:17 joewing - - * [r107] /src/client.c, /src/clock.c, /src/dock.c, /src/dock.h, - /src/event.c, /src/parse.c, /src/swallow.c, /src/taskbar.c, - /src/tray.c, /src/tray.h, /src/traybutton.c: Updates to docking - support. - -2006-01-08 10:06 joewing - - * [r106] /src/Makefile.in, /src/dock.c, /src/dock.h, /src/event.c, - /src/hint.c, /src/hint.h, /src/jxlib.h, /src/lex.c, /src/lex.h, - /src/main.c, /src/parse.c, /src/popup.c, /src/swallow.c, - /todo.txt: Add docking support. - -2006-01-08 06:22 joewing - - * [r105] /src/event.c: Add a function for _NET_WM_STATE - -2006-01-08 06:00 joewing - - * [r104] /src/event.c, /src/hint.c, /src/hint.h, /src/place.c, - /src/place.h, /todo.txt: Add support for _NET_MOVERESIZE_WINDOW - -2006-01-08 01:42 joewing - - * [r103] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h, - /src/place.c, /src/place.h, /src/taskbar.c, /src/taskbar.h, - /todo.txt: Add support for _NET_WM_STRUT_PARTIAL, _NET_WM_STRUT, - _NET_CLIENT_LIST, and _NET_CLIENT_LIST_STACKING - -2006-01-02 03:05 joewing - - * [r102] /src/event.c, /src/event.h, /src/swallow.c, /todo.txt: Fix - a problem with swallowing some programs. - -2006-01-02 02:01 joewing - - * [r101] /src/client.c, /src/client.h, /src/swallow.c, /todo.txt: - Send WM_DELETE_WINDOW to swallowed clients before exiting. - -2006-01-02 00:50 joewing - - * [r100] /src/resize.c, /todo.txt: Fix resize when resizing a - window that specifies and aspect ratio. - -2006-01-01 21:36 joewing - - * [r99] /config.h.in, /configure.in, /src/border.c, /src/client.c, - /src/client.h, /src/clock.c, /src/color.c, /src/confirm.c, - /src/confirm.h, /src/debug.c, /src/debug.h, /src/desktop.c, - /src/desktop.h, /src/error.c, /src/event.c, /src/group.c, - /src/hint.c, /src/icon.c, /src/image.c, /src/key.c, /src/lex.c, - /src/main.c, /src/main.h, /src/match.c, /src/menu.c, /src/menu.h, - /src/misc.c, /src/pager.c, /src/parse.c, /src/place.c, - /src/popup.c, /src/render.c, /src/swallow.c, /src/winmenu.c, - /todo.txt: Updates to configure.in to check if _XOPEN_SOURCE can - safely be used. - Fix some compiler warnings. - Grab keys for trays. - Fix a potential issue with bad PNG icons. - Improved loading of swallowed clients. - Don't use alpha blending for icons on color depths less than 24 - bits. - -2005-11-21 03:56 joewing - - * [r98] /example.jwmrc: Updated example configuration. - -2005-11-21 03:54 joewing - - * [r97] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, - /src/parse.c, /src/taskbar.c, /src/taskbar.h, /todo.txt: Add - "nextstacked" key binding. - -2005-11-21 03:02 joewing - - * [r96] /jwm.1.in, /src/clock.c, /src/clock.h, /src/main.c, - /src/parse.c, /src/traybutton.c, /src/traybutton.h: Updated man - page. - Better TrayButton sizing. - -2005-11-20 02:36 joewing - - * [r95] /src/clock.c, /src/font.c: Fix font inheritance for tray - items and clock font/color. - -2005-11-20 02:29 joewing - - * [r94] /src/icon.c: Sanity check for icon resizing. - -2005-11-20 02:18 joewing - - * [r93] /src/icon.c, /todo.txt: Preserve icon aspect ratios. - -2005-11-20 01:59 joewing - - * [r92] /src/clock.c, /src/main.c, /src/pager.c, /src/swallow.c, - /src/taskbar.c, /src/tray.c, /src/traybutton.c: Fix memory leaks - on jwm -p - -2005-11-20 00:08 joewing - - * [r91] /src/clock.c, /src/color.c, /src/color.h, /src/cursor.h, - /src/font.h, /src/lex.c, /src/lex.h, /src/misc.c, /src/misc.h, - /src/parse.c, /src/taskbar.c, /src/traybutton.c, /todo.txt: More - style stuff. - -2005-11-18 03:22 joewing - - * [r90] /src/clock.c, /src/misc.c, /src/misc.h: Trim the time popup - string. - -2005-11-18 02:40 joewing - - * [r89] /src/jwm.h: add sys/select.h include. - -2005-11-17 02:50 joewing - - * [r88] /src/Makefile.in, /src/clock.c, /src/clock.h, /src/event.c, - /src/lex.c, /src/lex.h, /src/main.c, /src/parse.c, /src/timing.c, - /src/timing.h, /src/tray.c, /todo.txt: Added Clock. - -2005-11-17 01:33 joewing - - * [r87] /src/traybutton.c, /todo.txt: Add button border to - TrayButtons. - -2005-11-16 04:35 joewing - - * [r86] /src/cursor.h, /src/lex.c, /src/lex.h, /src/parse.c: - Preparations for mouse bindings. - -2005-11-15 04:12 joewing - - * [r85] /Makefile.in, /configure.in, /src/Makefile.in: Update - version number. - Fix make install. - -2005-11-15 03:49 joewing - - * [r84] /src/client.c, /todo.txt: Fixed minimization on restart. - -2005-11-15 03:19 joewing - - * [r83] /src/taskbar.c, /todo.txt: Fix task list overflow. - -2005-11-13 20:22 joewing - - * [r82] /example.jwmrc: Updated example configuration. - -2005-11-13 20:20 joewing - - * [r81] /jwm.1.in, /src/event.c, /src/event.h, /src/parse.c: Chnage - RootMenu onroot behaviour. - Update man page. - -2005-11-13 18:41 joewing - - * [r80] /jwm.1.in: man page updates. - -2005-11-13 18:27 joewing - - * [r79] /src/color.c, /src/desktop.c, /src/font.c, /src/parse.c, - /src/taskbar.c, /src/taskbar.h: Fix some configuration stuff. - -2005-11-13 02:43 joewing - - * [r78] /jwm.1.in: Update man page. - -2005-11-13 02:17 joewing - - * [r77] /example.jwmrc: Updated example configuration. - -2005-11-13 02:01 joewing - - * [r76] /configure.in, /jwm.1.in, /src/hint.h, /src/tray.c: Change - to v1.0, update man page. - Fix style issues. - -2005-11-12 20:20 joewing - - * [r75] /src/hint.c: Fix frame extents hint. - -2005-11-12 19:26 joewing - - * [r74] /src/icon.h: Fix problem with no icons. - -2005-11-12 19:14 joewing - - * [r73] /src/client.c: bah - -2005-11-12 19:13 joewing - - * [r72] /src/client.c, /src/confirm.c: Fix confirm stuff. - -2005-11-12 19:01 joewing - - * [r71] /src/parse.c, /src/traybutton.c, /src/traybutton.h: Add - label attribute to TrayButton. - -2005-11-12 18:02 joewing - - * [r70] /example.jwmrc, /src/client.c, /src/place.c, /src/place.h, - /todo.txt: Fix maximization. - -2005-11-12 07:51 joewing - - * [r69] /src/main.c: Startup desktops before hints. - -2005-11-12 06:54 joewing - - * [r68] /src/Makefile.in, /src/client.c, /src/main.c, /src/place.c, - /src/place.h, /src/screen.c, /src/screen.h, /todo.txt: Improved - window placement. - -2005-11-12 05:10 joewing - - * [r67] /src/event.c, /src/parse.c, /todo.txt: Fix key actions with - click-to-focus. - Add desktops menu item icon attribute. - -2005-11-12 04:53 joewing - - * [r66] /src/desktop.c, /src/desktop.h, /src/menu.c, /src/parse.c, - /src/root.c, /src/winmenu.c, /todo.txt: Added "Desktops" root - menu item. - -2005-11-12 03:47 joewing - - * [r65] /src/client.c, /src/desktop.c, /src/desktop.h, /src/hint.c, - /src/hint.h, /src/lex.c, /src/lex.h, /src/main.c, /src/menu.c, - /src/menu.h, /src/parse.c, /src/root.c, /src/winmenu.c: Desktop - names. - Active next when when the active window closes. - -2005-11-10 04:56 joewing - - * [r64] /todo.txt: ... and the todo - -2005-11-10 04:55 joewing - - * [r63] /src/menu.c: Fix menu issue. - -2005-11-10 03:39 joewing - - * [r62] /src/parse.c: Make menu includes actually work. - -2005-11-10 03:25 joewing - - * [r61] /src/parse.c, /todo.txt: Menu includes. - -2005-11-10 01:58 joewing - - * [r60] /todo.txt: todo too. - -2005-11-10 01:58 joewing - - * [r59] /src/hint.c, /src/hint.h: More EWMH stuff. - -2005-11-10 01:18 joewing - - * [r58] /src/client.c, /src/event.c, /src/main.c, /todo.txt: Send - ClientMessage instead of PropertyNotify for _JWM_EXIT and - _JWM_RESTART - -2005-11-07 06:05 joewing - - * [r57] /src/client.c, /src/hint.c: Write _NET_WM_STATE to - _NET_WM_STATE instead of WM_STATE! - -2005-11-07 06:00 joewing - - * [r56] /src/client.c, /src/client.h, /src/event.c, /src/hint.c, - /src/hint.h, /todo.txt: More fixes. - -2005-11-06 16:08 joewing - - * [r55] /src/border.c, /src/client.c, /src/client.h, - /src/desktop.c, /src/event.c, /src/group.c, /src/hint.c, - /src/hint.h, /src/move.c, /src/pager.c, /src/resize.c, - /src/taskbar.c, /src/winmenu.c: Hint updates. - -2005-10-30 18:00 joewing - - * [r54] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h, - /src/icon.c, /src/image.c, /src/render.c: Fix _NET_WM_DESKTOP for - 64-bits. - -2005-10-30 17:19 joewing - - * [r53] /Makefile.in, /src/Makefile.in, /src/font.c: Add "make - depend" - -2005-10-30 17:01 joewing - - * [r52] /src/Makefile.in, /src/border.c, /src/border.h, - /src/button.c, /src/button.h, /src/client.c, /src/client.h, - /src/color.c, /src/color.h, /src/command.c, /src/confirm.c, - /src/const.h, /src/cursor.c, /src/cursor.h, /src/desktop.c, - /src/enum.h, /src/error.c, /src/event.c, /src/font.c, - /src/font.h, /src/global.c, /src/global.h, /src/group.c, - /src/group.h, /src/help.c, /src/hint.c, /src/hint.h, /src/icon.c, - /src/icon.h, /src/image.c, /src/image.h, /src/jwm.h, /src/key.c, - /src/key.h, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, - /src/menu.c, /src/menu.h, /src/move.c, /src/move.h, - /src/outline.c, /src/pager.c, /src/pager.h, /src/parse.c, - /src/popup.c, /src/render.c, /src/render.h, /src/resize.c, - /src/resize.h, /src/root.c, /src/root.h, /src/screen.c, - /src/status.c, /src/struct.h, /src/swallow.c, /src/swallow.h, - /src/taskbar.c, /src/taskbar.h, /src/timing.c, /src/timing.h, - /src/tray.c, /src/tray.h, /src/traybutton.c, /src/traybutton.h, - /src/winmenu.c, /src/winmenu.h: Clean up the build. - -2005-10-30 15:04 joewing - - * [r51] /src/client.c, /src/confirm.c, /src/icon.c, /src/image.c, - /src/render.c, /todo.txt: Update todo. - Cast image stuff correctly. - Make confirm dialogs use menu colors and font. - -2005-10-28 02:26 joewing - - * [r50] /src/icon.c: Don't add unnamed icons to the icon hash. - -2005-10-28 02:07 joewing - - * [r49] /src/client.c, /src/color.c, /src/color.h, /src/hint.c, - /src/icon.c, /src/image.c, /src/render.c, /src/struct.h, - /src/swallow.c, /todo.txt: Fix PNG byte order issues. - -2005-10-27 03:08 joewing - - * [r48] /src/winmenu.c, /todo.txt: Added window menu separator. - -2005-10-27 01:18 joewing - - * [r47] /src/hint.c: Fix type-size issues. - -2005-10-27 00:55 joewing - - * [r46] /example.jwmrc, /src/client.c, /todo.txt: Fix lockups when - restoring transients. - -2005-10-25 03:11 joewing - - * [r45] /src/color.c, /src/color.h, /src/hint.c, /src/hint.h, - /src/icon.c, /src/image.c, /src/image.h, /todo.txt: Fix for - 64-bit X-server issues. - -2005-10-24 05:43 joewing - - * [r44] /todo.txt: Update todo. - -2005-10-23 20:35 joewing - - * [r43] /src/cursor.c, /src/cursor.h, /src/jxlib.h, /src/menu.c, - /src/tray.c: Restore tray autohide. - -2005-10-21 03:27 joewing - - * [r42] /README, /config.h.in, /configure.in, /src/Makefile.in, - /src/client.c, /src/event.c, /src/menu.c, /src/popup.c, - /src/struct.h, /src/taskbar.c, /src/taskbar.h, /src/timing.c, - /src/tray.c: Make popups work again. - -2005-10-16 18:06 joewing - - * [r41] /src/client.c, /src/jxlib.h, /src/parse.c, /src/swallow.c, - /src/traybutton.c, /src/traybutton.h: More fixes. - Added "action" option to tray button. - -2005-10-16 15:01 joewing - - * [r40] /src/border.c, /src/icon.c, /src/icon.h, /src/menu.c, - /src/render.c, /src/render.h, /src/struct.h, /src/taskbar.c, - /src/traybutton.c: More appearance fixes. - -2005-10-14 02:40 joewing - - * [r39] /src/enum.h, /src/lex.c, /src/main.c, /src/pager.c, - /src/parse.c, /src/render.c, /src/swallow.c, /src/swallow.h, - /src/tray.c, /src/traybutton.c, /src/traybutton.h: Vertical - pagers and tray buttons. - -2005-10-13 23:54 joewing - - * [r38] /src/client.c, /src/event.c, /src/swallow.c, - /src/swallow.h: Handle destroyed swallow clients. - -2005-10-13 04:54 joewing - - * [r37] /src/icon.c: Fix scaling of non-render icons. - -2005-10-13 04:25 joewing - - * [r36] /src/main.c, /src/taskbar.c, /src/tray.c: Fix some drawing - issues. - -2005-10-13 04:18 joewing - - * [r35] /src/Makefile.in, /src/jwm.h, /src/main.c, /src/pager.c, - /src/struct.h, /src/swallow.c, /src/taskbar.c, /src/tray.c, - /src/tray.h, /src/traybutton.c, /src/traybutton.h: Improve tray - callback stuff. - -2005-10-12 04:41 joewing - - * [r34] /src/client.c, /src/swallow.c, /src/taskbar.c, /src/tray.c: - Pixel fixes. - -2005-10-12 04:24 joewing - - * [r33] /src/client.c, /src/pager.c, /src/swallow.c, /src/tray.c: - Fix placement issues and tray sizing issues. - -2005-10-12 03:43 joewing - - * [r32] /src/tray.c: Make tray location depend on size for negative - location values. - -2005-10-12 03:30 joewing - - * [r31] /src/client.c, /src/const.h, /src/hint.c, /src/jxlib.h, - /src/move.c, /src/pager.c, /src/pager.h, /src/parse.c, - /src/struct.h, /src/swallow.c, /src/taskbar.c, /src/taskbar.h, - /src/tray.c, /src/tray.h: More tray border support, placement - updates... - -2005-10-12 00:19 joewing - - * [r30] /src/client.c, /src/jxlib.h, /src/parse.c, /src/swallow.c, - /src/swallow.h, /src/taskbar.c, /src/tray.c, /src/tray.h: More - tray changes. - -2005-10-11 02:03 joewing - - * [r29] /src/Makefile.in, /src/border.c, /src/button.c, - /src/client.c, /src/color.c, /src/confirm.c, /src/const.h, - /src/debug.c, /src/desktop.c, /src/desktop.h, /src/enum.h, - /src/event.c, /src/global.c, /src/global.h, /src/group.c, - /src/hint.c, /src/icon.c, /src/icon.h, /src/image.c, /src/jwm.h, - /src/jxlib.h, /src/key.c, /src/lex.c, /src/load.c, /src/load.h, - /src/main.c, /src/menu.c, /src/move.c, /src/os, /src/pager.c, - /src/pager.h, /src/parse.c, /src/popup.c, /src/render.c, - /src/render.h, /src/struct.h, /src/swallow.c, /src/swallow.h, - /src/taskbar.c, /src/taskbar.h, /src/timing.c, /src/timing.h, - /src/tray.c, /src/tray.h: Major tray changes. Still much work to - do. - -2005-10-08 00:59 joewing - - * [r28] /todo.txt: Update todo too. - -2005-10-08 00:58 joewing - - * [r27] /src/client.c, /src/resize.c: Made resizing of large - windows a little more sane. - -2005-10-08 00:37 joewing - - * [r26] /src/icon.c, /src/image.c, /src/main.c, /src/render.c: Fix - image loading issues. - -2005-10-04 04:00 joewing - - * [r25] /src/load.c, /todo.txt: Fix off-by-one drawing the load. - -2005-10-04 03:40 joewing - - * [r24] /src/status.c, /todo.txt: Make status windows show on the - screen with the mouse. - -2005-10-04 03:28 joewing - - * [r23] /src/main.c, /todo.txt: Flush X connection before closing - it. - -2005-10-04 03:25 joewing - - * [r22] /configure.in, /example.jwmrc, /src/command.c, - /src/debug.c, /src/font.c, /src/icon.c, /src/icon.h, - /src/image.c, /src/image.h, /src/jxlib.h, /src/main.c, - /src/render.c, /src/render.h, /src/struct.h, /src/tray.c, - /src/winmenu.c: Icon and render fixes. - -2005-10-01 21:49 joewing - - * [r21] /config.h.in, /configure.in, /src/Makefile.in, - /src/border.c, /src/border.h, /src/client.c, /src/debug.c, - /src/group.c, /src/help.c, /src/icon.c, /src/icon.h, - /src/image.c, /src/image.h, /src/jwm.h, /src/jxlib.h, - /src/main.c, /src/menu.c, /src/parse.c, /src/render.c, - /src/render.h, /src/struct.h, /src/tray.c, /src/tray.h, - /todo.txt: Added PNG and XRender support. - -2005-09-27 02:32 joewing - - * [r20] /example.jwmrc, /src/border.c, /src/font.c, /src/jxlib.h: - XFT fixes - -2005-09-25 17:30 joewing - - * [r19] /src/border.c, /src/help.c, /todo.txt: Double buffer - borders. - -2005-09-25 10:05 joewing - - * [r18] /config.h.in, /configure.in, /example.jwmrc, /jwm.1.in, - /src/border.c, /src/button.c, /src/color.c, /src/color.h, - /src/confirm.c, /src/enum.h, /src/font.c, /src/font.h, - /src/jwm.h, /src/jxlib.h, /src/main.c, /src/menu.c, /src/parse.c, - /src/popup.c, /src/status.c, /src/tray.c, /todo.txt: Use Xft for - antialiasing. - -2005-09-25 01:53 joewing - - * [r17] /src/client.c, /src/color.c, /src/color.h, /src/font.c, - /src/icon.c, /src/move.c, /todo.txt: Fix a bug related to loading - icons and fixes for colors on 64-bit X Servers. - -2005-09-25 00:39 joewing - - * [r16] /jwm.1.in, /src/pager.c, /src/pager.h, /src/parse.c, - /todo.txt: Add the option to enable or disable the pager. - -2005-09-23 01:48 joewing - - * [r15] /todo.txt: typo - -2005-09-23 01:30 joewing - - * [r14] /todo.txt: Another todo. - -2005-09-23 01:28 joewing - - * [r13] /example.jwmrc: New example.jwmrc - -2005-09-23 01:15 joewing - - * [r12] /jwm.1.in, /src/client.c, /src/enum.h, /src/main.c, - /src/parse.c, /src/tray.c, /src/tray.h, /todo.txt: Add the - "layer" attribute to Tray and update the man page. - -2005-09-23 00:52 joewing - - * [r11] /todo.txt: Forgot the todo... - -2005-09-23 00:51 joewing - - * [r10] /src/client.c, /src/enum.h, /src/group.c, /src/parse.c: Add - border, noborder, title, and notitle to Group. - -2005-09-23 00:14 joewing - - * [r9] /README: Add Xinerama comment to the README - -2005-09-21 01:41 joewing - - * [r8] /jwm.1.in, /todo.txt: More todos and an update to the man - page. - -2005-09-21 01:32 joewing - - * [r7] /src/load.c, /src/load.h, /src/parse.c, /src/timing.c, - /src/timing.h, /src/tray.c, /todo.txt: Added "enabled" option to - Load and Clock. - -2005-09-21 00:55 joewing - - * [r6] /todo.txt: Add todo's to todo.txt. - -2005-09-16 01:53 joewing - - * [r5] /src/button.c, /src/confirm.c, /todo.txt: Fix color bugs. - -2005-09-14 01:51 joewing - - * [r4] /Makefile.in, /src/client.c, /src/help.c, /src/help.h, - /src/tray.c, /todo.txt: Fixed off-by-one pixel error with tray. - Added "tarball" option to make. - Made help display version information. - Hopefully fixed a bug with mouse clicks propagating where they - shouldn't. - -2005-09-05 19:03 joewing - - * [r3] /package, /package/irix, /package/irix/Makefile.in, - /package/irix/jwm.idb.in, /package/irix/jwm.spec.in, - /package/slackware, /package/slackware/Makefile.in, - /package/slackware/slack-desc.in, - /package/slackware/slackware.jwmrc, /package/solaris, - /package/solaris/Makefile.in, /package/solaris/pkginfo.in, - /package/solaris/prototype.in, /package/solaris/solaris.jwmrc: - Add package - -2005-09-05 19:01 joewing - - * [r2] /LICENSE, /Makefile.in, /README, /config.h.in, - /configure.in, /example.jwmrc, /jwm.1.in, /jwm1.in, /src, - /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, - /src/button.h, /src/client.c, /src/client.h, /src/color.c, - /src/color.h, /src/command.c, /src/command.h, /src/confirm.c, - /src/confirm.h, /src/const.h, /src/cursor.c, /src/cursor.h, - /src/debug.c, /src/debug.h, /src/enum.h, /src/error.c, - /src/error.h, /src/event.c, /src/event.h, /src/font.c, - /src/font.h, /src/global.c, /src/global.h, /src/group.c, - /src/group.h, /src/help.c, /src/help.h, /src/hint.c, /src/hint.h, - /src/icon.c, /src/icon.h, /src/jwm.h, /src/jxlib.h, /src/key.c, - /src/key.h, /src/lex.c, /src/lex.h, /src/load.c, /src/load.h, - /src/main.c, /src/main.h, /src/match.c, /src/match.h, - /src/menu.c, /src/menu.h, /src/misc.c, /src/misc.h, /src/move.c, - /src/move.h, /src/os, /src/os/darwin.c, /src/os/irix.c, - /src/os/irix64.c, /src/os/linux.c, /src/os/os.h, /src/os/sunos.c, - /src/os/unsupported.c, /src/outline.c, /src/outline.h, - /src/pager.c, /src/pager.h, /src/parse.c, /src/parse.h, - /src/popup.c, /src/popup.h, /src/resize.c, /src/resize.h, - /src/root.c, /src/root.h, /src/screen.c, /src/screen.h, - /src/status.c, /src/status.h, /src/struct.h, /src/timing.c, - /src/timing.h, /src/tray.c, /src/tray.h, /src/winmenu.c, - /src/winmenu.h, /src/x.xpm, /todo.txt: Initial check-in - -2005-09-05 18:57 joewing - - * [r1] /jwm1.in: Test import - diff -Nru jwm-2.1.0+svn579/config.h.in jwm-2.3.1+0~16~ubuntu14.10.1/config.h.in --- jwm-2.1.0+svn579/config.h.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,183 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define to debug JWM */ -#undef DEBUG - -/* Define to disable confirm dialogs */ -#undef DISABLE_CONFIRM - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS - -/* Define to 1 if you have the header file. */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define if the GNU dcgettext() function is already present or preinstalled. - */ -#undef HAVE_DCGETTEXT - -/* Define to 1 if you have the header file. */ -#undef HAVE_FT2BUILD_H - -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - -/* Define if you have the iconv() function and it works. */ -#undef HAVE_ICONV - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBINTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `unsetenv' function. */ -#undef HAVE_UNSETENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_CURSORFONT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XRENDER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_KEYSYM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XATOM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XPM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XPROTO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XRESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XUTIL_H - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* default system configuration path */ -#undef SYSTEM_CONFIG - -/* Define to use FriBidi */ -#undef USE_FRIBIDI - -/* Define to enable icon support */ -#undef USE_ICONS - -/* Define to use libjpeg */ -#undef USE_JPEG - -/* Define to use libpng */ -#undef USE_PNG - -/* Define to enable the X shape extension */ -#undef USE_SHAPE - -/* Define to enable Xft */ -#undef USE_XFT - -/* Define to enable Xinerama */ -#undef USE_XINERAMA - -/* Define to use Xmu */ -#undef USE_XMU - -/* Define to enable XPM support */ -#undef USE_XPM - -/* Define to enable the XRender extension */ -#undef USE_XRENDER - -/* Define to use Xutf8TextPropertyToTextList */ -#undef USE_XUTF8 - -/* Define for single UNIX conformance */ -#undef _XOPEN_SOURCE - -/* Define for timeval on IRIX 6.2 */ -#undef _XOPEN_SOURCE_EXTENDED - -/* Define for timeval on Solaris 2.5.1 */ -#undef __EXTENSIONS__ diff -Nru jwm-2.1.0+svn579/configure jwm-2.3.1+0~16~ubuntu14.10.1/configure --- jwm-2.1.0+svn579/configure 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/configure 1970-01-01 00:00:00.000000000 +0000 @@ -1,9621 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for jwm svn-579. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='jwm' -PACKAGE_TARNAME='jwm' -PACKAGE_VERSION='svn-579' -PACKAGE_STRING='jwm svn-579' -PACKAGE_BUGREPORT='joewing@joewing.net' - -ac_unique_file="src" -ac_unique_file="po" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -gt_needs= -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -XMKMF -GREP -EGREP -SET_MAKE -USE_NLS -GETTEXT_MACRO_VERSION -MSGFMT -GMSGFMT -MSGFMT_015 -GMSGFMT_015 -XGETTEXT -XGETTEXT_015 -MSGMERGE -XGETTEXT_EXTRA_OPTIONS -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -LIBICONV -LTLIBICONV -INTLLIBS -LIBINTL -LTLIBINTL -POSUB -VERSION -INSTVERSION -BINDIR -MANDIR -DATE -SYSCONF -PACKAGE -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -XMKMF' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures jwm svn-579 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/jwm] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of jwm svn-579:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-confirm don't enable confirm dialogs - --disable-icons don't enable icon support - --disable-png don't support PNG images - --disable-jpeg don't support JPEG images - --disable-xft don't use Xft - --disable-xrender don't use the XRender extension - --disable-fribidi disable bi-directional unicode support - --disable-xpm don't support XPM images - --disable-shape don't use the X shape extension - --disable-xmu don't use Xmu - --disable-xinerama don't use Xinerama - --disable-nls do not use Native Language Support - --disable-rpath do not hardcode runtime library paths - --enable-debug use this to debug JWM - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-x use the X Window System - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib - --without-libiconv-prefix don't search for libiconv in includedir and libdir - --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib - --without-libintl-prefix don't search for libintl in includedir and libdir - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -jwm configure svn-579 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by jwm $as_me svn-579, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -gt_needs="$gt_needs " -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - -ac_config_headers="$ac_config_headers config.h" - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - -PACKAGE=jwm - -############################################################################ -# Check if we need _XOPEN_SOURCE -############################################################################ -{ echo "$as_me:$LINENO: checking if _XOPEN_SOURCE should be defined" >&5 -echo $ECHO_N "checking if _XOPEN_SOURCE should be defined... $ECHO_C" >&6; } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#define _XOPEN_SOURCE 600L -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - use_xopen_source="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - use_xopen_source="no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $use_xopen_source" >&5 -echo "${ECHO_T}$use_xopen_source" >&6; } - -if test $use_xopen_source = "yes"; then - - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE 600L -_ACEOF - - - # Needed for IRIX 6.2 so that struct timeval is declared. - -cat >>confdefs.h <<\_ACEOF -#define _XOPEN_SOURCE_EXTENDED 1 -_ACEOF - - - # Needed for Solaris 2.5.1 so that struct timeval is declared. - -cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - - -fi - -############################################################################ -# Check for X11 -############################################################################ - -{ echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6; } - - -# Check whether --with-x was given. -if test "${with_x+set}" = set; then - withval=$with_x; -fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - case $x_includes,$x_libraries in #( - *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 -echo "$as_me: error: Cannot use X directory names containing '" >&2;} - { (exit 1); exit 1; }; };; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ac_x_includes= ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -f -r conftest.dir -fi - -# Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. - # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # We can compile using X headers with no special include directory. -ac_x_includes= -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then - ac_x_includes=$ac_dir - break - fi -done -fi - -rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -int -main () -{ -XrmInitialize () - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl; do - if test -r "$ac_dir/libX11.$ac_extension"; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac -fi -;; #( - *) have_x=yes;; - esac - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - { echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6; } - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } -fi - - -if test ! "$no_x" = "yes" ; then - if test ! x"$x_libraries" = x ; then - LDFLAGS="$LDFLAGS -L$x_libraries" - fi - if test ! x"$x_includes" = x ; then - CFLAGS="$CFLAGS -I$x_includes" - fi -else - { { echo "$as_me:$LINENO: error: Could not find X11" >&5 -echo "$as_me: error: Could not find X11" >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 -echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6; } -if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XOpenDisplay (); -int -main () -{ -return XOpenDisplay (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_X11_XOpenDisplay=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_X11_XOpenDisplay=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6; } -if test $ac_cv_lib_X11_XOpenDisplay = yes; then - LDFLAGS="$LDFLAGS -lX11" -else - { { echo "$as_me:$LINENO: error: libX11 not found" >&5 -echo "$as_me: error: libX11 not found" >&2;} - { (exit 1); exit 1; }; } -fi - - -{ echo "$as_me:$LINENO: checking for Xutf8TextPropertyToTextList in -lX11" >&5 -echo $ECHO_N "checking for Xutf8TextPropertyToTextList in -lX11... $ECHO_C" >&6; } -if test "${ac_cv_lib_X11_Xutf8TextPropertyToTextList+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char Xutf8TextPropertyToTextList (); -int -main () -{ -return Xutf8TextPropertyToTextList (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_X11_Xutf8TextPropertyToTextList=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_X11_Xutf8TextPropertyToTextList=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_X11_Xutf8TextPropertyToTextList" >&5 -echo "${ECHO_T}$ac_cv_lib_X11_Xutf8TextPropertyToTextList" >&6; } -if test $ac_cv_lib_X11_Xutf8TextPropertyToTextList = yes; then - -cat >>confdefs.h <<\_ACEOF -#define USE_XUTF8 1 -_ACEOF - -else - { echo "$as_me:$LINENO: WARNING: Xutf8TextPropertyToTextList not found in libX11" >&5 -echo "$as_me: WARNING: Xutf8TextPropertyToTextList not found in libX11" >&2;} -fi - - -############################################################################ -# Check for necessary include files. -############################################################################ -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - - -for ac_header in stdarg.h stdio.h stdlib.h ctype.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to joewing@joewing.net ## -## ---------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: one or more necessary header files not found" >&5 -echo "$as_me: error: one or more necessary header files not found" >&2;} - { (exit 1); exit 1; }; } -fi - -done - - - - - - - - -for ac_header in sys/select.h signal.h unistd.h time.h sys/wait.h sys/time.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to joewing@joewing.net ## -## ---------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -for ac_header in alloca.h locale.h libintl.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to joewing@joewing.net ## -## ---------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - -for ac_header in X11/Xlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to joewing@joewing.net ## -## ---------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: Xlib.h could not be found" >&5 -echo "$as_me: error: Xlib.h could not be found" >&2;} - { (exit 1); exit 1; }; } -fi - -done - - - - - - - - -for ac_header in X11/Xutil.h X11/cursorfont.h X11/Xproto.h \ - X11/Xatom.h X11/keysym.h X11/Xresource.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - -for ac_func in unsetenv putenv setlocale -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -############################################################################ -# Check for pkg-config. -############################################################################ - - - - - - - { echo "$as_me:$LINENO: checking for pkg-config" >&5 -echo $ECHO_N "checking for pkg-config... $ECHO_C" >&6; } - if test -x `which pkg-config` ; then - PKGCONFIG="pkg-config" - fi - { echo "$as_me:$LINENO: result: $PKGCONFIG" >&5 -echo "${ECHO_T}$PKGCONFIG" >&6; } - - - - if test "x$PKGCONFIG" != "x" ; then - { echo "$as_me:$LINENO: checking if pkg-config knows about libpng" >&5 -echo $ECHO_N "checking if pkg-config knows about libpng... $ECHO_C" >&6; } - if test `$PKGCONFIG libpng ; echo $?` -eq 0 ; then - use_pkgconfig_png="yes" - else - use_pkgconfig_png="no" - fi - { echo "$as_me:$LINENO: result: $use_pkgconfig_png" >&5 -echo "${ECHO_T}$use_pkgconfig_png" >&6; } - else - use_pkgconfig_png="no" - fi - - - - if test "x$PKGCONFIG" != "x" ; then - { echo "$as_me:$LINENO: checking if pkg-config knows about libjpeg" >&5 -echo $ECHO_N "checking if pkg-config knows about libjpeg... $ECHO_C" >&6; } - if test `$PKGCONFIG libjpeg ; echo $?` -eq 0 ; then - use_pkgconfig_jpeg="yes" - else - use_pkgconfig_jpeg="no" - fi - { echo "$as_me:$LINENO: result: $use_pkgconfig_jpeg" >&5 -echo "${ECHO_T}$use_pkgconfig_jpeg" >&6; } - else - use_pkgconfig_jpeg="no" - fi - - - - if test "x$PKGCONFIG" != "x" ; then - { echo "$as_me:$LINENO: checking if pkg-config knows about xft" >&5 -echo $ECHO_N "checking if pkg-config knows about xft... $ECHO_C" >&6; } - if test `$PKGCONFIG xft ; echo $?` -eq 0 ; then - use_pkgconfig_xft="yes" - else - use_pkgconfig_xft="no" - fi - { echo "$as_me:$LINENO: result: $use_pkgconfig_xft" >&5 -echo "${ECHO_T}$use_pkgconfig_xft" >&6; } - else - use_pkgconfig_xft="no" - fi - - - - if test "x$PKGCONFIG" != "x" ; then - { echo "$as_me:$LINENO: checking if pkg-config knows about xrender" >&5 -echo $ECHO_N "checking if pkg-config knows about xrender... $ECHO_C" >&6; } - if test `$PKGCONFIG xrender ; echo $?` -eq 0 ; then - use_pkgconfig_xrender="yes" - else - use_pkgconfig_xrender="no" - fi - { echo "$as_me:$LINENO: result: $use_pkgconfig_xrender" >&5 -echo "${ECHO_T}$use_pkgconfig_xrender" >&6; } - else - use_pkgconfig_xrender="no" - fi - - - - if test "x$PKGCONFIG" != "x" ; then - { echo "$as_me:$LINENO: checking if pkg-config knows about fribidi" >&5 -echo $ECHO_N "checking if pkg-config knows about fribidi... $ECHO_C" >&6; } - if test `$PKGCONFIG fribidi ; echo $?` -eq 0 ; then - use_pkgconfig_fribidi="yes" - else - use_pkgconfig_fribidi="no" - fi - { echo "$as_me:$LINENO: result: $use_pkgconfig_fribidi" >&5 -echo "${ECHO_T}$use_pkgconfig_fribidi" >&6; } - else - use_pkgconfig_fribidi="no" - fi - - -############################################################################ -# Check if confirm dialogs should be used. -############################################################################ -# Check whether --enable-confirm was given. -if test "${enable_confirm+set}" = set; then - enableval=$enable_confirm; -fi - -if test "$enable_confirm" = "no" ; then - -cat >>confdefs.h <<\_ACEOF -#define DISABLE_CONFIRM 1 -_ACEOF - -else - enable_confirm="yes" -fi - -############################################################################ -# Check if icon support was requested. -############################################################################ -# Check whether --enable-icons was given. -if test "${enable_icons+set}" = set; then - enableval=$enable_icons; -fi - -if test "$enable_icons" != "no" ; then - enable_icons="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_ICONS 1 -_ACEOF - -fi - -############################################################################ -# Check if PNG support was requested and available. -############################################################################ -# Check whether --enable-png was given. -if test "${enable_png+set}" = set; then - enableval=$enable_png; -fi - -if test "$enable_png" != "no" ; then - - if test "$use_pkgconfig_png" = "yes" ; then - PNG_CFLAGS=`$PKGCONFIG --cflags libpng` - PNG_LDFLAGS=`$PKGCONFIG --libs libpng` - elif test -x `which libpng-config` ; then - PNG_CFLAGS=`libpng-config --cflags` - PNG_LDFLAGS=`libpng-config --libs` - else - PNG_LDFLAGS="-lpng -lz -lm" - fi - -fi -if test "$enable_png" != "no" ; then - { echo "$as_me:$LINENO: checking for png_read_image in -lpng" >&5 -echo $ECHO_N "checking for png_read_image in -lpng... $ECHO_C" >&6; } -if test "${ac_cv_lib_png_png_read_image+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpng $PNG_LDFLAGS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char png_read_image (); -int -main () -{ -return png_read_image (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_png_png_read_image=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_png_png_read_image=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_image" >&5 -echo "${ECHO_T}$ac_cv_lib_png_png_read_image" >&6; } -if test $ac_cv_lib_png_png_read_image = yes; then - LDFLAGS="$LDFLAGS $PNG_LDFLAGS" - CFLAGS="$CFLAGS $PNG_CFLAGS" - enable_png="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_PNG 1 -_ACEOF - -else - enable_png="no" - { echo "$as_me:$LINENO: WARNING: unable to use libpng, PNG support disabled" >&5 -echo "$as_me: WARNING: unable to use libpng, PNG support disabled" >&2;} -fi - -fi - -############################################################################ -# Check if JPEG support was requested and available. -############################################################################ -# Check whether --enable-jpeg was given. -if test "${enable_jpeg+set}" = set; then - enableval=$enable_jpeg; -fi - -if test "$enable_jpeg" != "no" ; then - if test "$use_pkgconfig_jpeg" = "yes" ; then - JPEG_CFLAGS=`$PKGCONFIG --cflags libjpeg` - JPEG_LDFLAGS=`$PKGCONFIG --libs libjpeg` - else - JPEG_LDFLAGS="-ljpeg" - fi -fi -if test "$enable_jpeg" != "no" ; then - { echo "$as_me:$LINENO: checking for jpeg_start_decompress in -ljpeg" >&5 -echo $ECHO_N "checking for jpeg_start_decompress in -ljpeg... $ECHO_C" >&6; } -if test "${ac_cv_lib_jpeg_jpeg_start_decompress+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ljpeg $JPEG_LDFLAGS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char jpeg_start_decompress (); -int -main () -{ -return jpeg_start_decompress (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_jpeg_jpeg_start_decompress=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_jpeg_jpeg_start_decompress=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_start_decompress" >&5 -echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_start_decompress" >&6; } -if test $ac_cv_lib_jpeg_jpeg_start_decompress = yes; then - LDFLAGS="$LDFLAGS $JPEG_LDFLAGS" - CFLAGS="$CFLAGS $JPEG_CFLAGS" - enable_jpeg="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_JPEG 1 -_ACEOF - -else - enable_jpeg="no" - { echo "$as_me:$LINENO: WARNING: unable to use libjpeg, JPEG support disabled" >&5 -echo "$as_me: WARNING: unable to use libjpeg, JPEG support disabled" >&2;} -fi - -fi - -############################################################################ -# Check if XFT support was requested and available. -############################################################################ -# Check whether --enable-xft was given. -if test "${enable_xft+set}" = set; then - enableval=$enable_xft; -fi - -if test "$enable_xft" != "no"; then - - if test "$use_pkgconfig_xft" = "yes" ; then - XFT_CFLAGS=`$PKGCONFIG --cflags xft` - XFT_LDFLAGS=`$PKGCONFIG --libs xft` - elif test -x `which xft-config` ; then - XFT_CFLAGS=`xft-config --cflags` - XFT_LDFLAGS=`xft-config --libs` - else - XFT_LDFLAGS="-lXft" - fi - -fi -if test "$enable_xft" != "no" ; then - { echo "$as_me:$LINENO: checking for XftFontOpenName in -lXft" >&5 -echo $ECHO_N "checking for XftFontOpenName in -lXft... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xft_XftFontOpenName+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXft $XFT_LDFLAGS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XftFontOpenName (); -int -main () -{ -return XftFontOpenName (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xft_XftFontOpenName=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xft_XftFontOpenName=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpenName" >&5 -echo "${ECHO_T}$ac_cv_lib_Xft_XftFontOpenName" >&6; } -if test $ac_cv_lib_Xft_XftFontOpenName = yes; then - LDFLAGS="$LDFLAGS $XFT_LDFLAGS" - CFLAGS="$CFLAGS $XFT_CFLAGS" - enable_xft="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_XFT 1 -_ACEOF - -else - enable_xft="no" - { echo "$as_me:$LINENO: WARNING: unable to use Xft" >&5 -echo "$as_me: WARNING: unable to use Xft" >&2;} -fi - -fi -if test "$enable_xft" != "no" ; then - -for ac_header in ft2build.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -fi - -############################################################################ -# Check if support for the XRENDER extension was requested and available. -############################################################################ -# Check whether --enable-xrender was given. -if test "${enable_xrender+set}" = set; then - enableval=$enable_xrender; -fi - -if test "$enable_xrender" != "no"; then - - if test "$use_pkgconfig_xrender" = "yes" ; then - XRENDER_CFLAGS=`$PKGCONFIG --cflags xrender` - XRENDER_LDFLAGS=`$PKGCONFIG --libs xrender` - else - XRENDER_LDFLAGS="-lXrender" - fi - - -for ac_header in X11/extensions/Xrender.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - - enable_xrender="no"; - { echo "$as_me:$LINENO: WARNING: unable to use X11/extensions/Xrender.h" >&5 -echo "$as_me: WARNING: unable to use X11/extensions/Xrender.h" >&2;} - -fi - -done - - -fi -if test "$enable_xrender" != "no" ; then - { echo "$as_me:$LINENO: checking for XRenderComposite in -lXrender" >&5 -echo $ECHO_N "checking for XRenderComposite in -lXrender... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xrender_XRenderComposite+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrender $XRENDER_LDFLAGS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XRenderComposite (); -int -main () -{ -return XRenderComposite (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xrender_XRenderComposite=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xrender_XRenderComposite=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderComposite" >&5 -echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderComposite" >&6; } -if test $ac_cv_lib_Xrender_XRenderComposite = yes; then - LDFLAGS="$LDFLAGS $XRENDER_LDFLAGS" - CFLAGS="$CFLAGS $XRENDER_CFLAGS" - enable_xrender="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_XRENDER 1 -_ACEOF - -else - enable_xrender="no" - { echo "$as_me:$LINENO: WARNING: unable to use the XRender extension" >&5 -echo "$as_me: WARNING: unable to use the XRender extension" >&2;} -fi - -fi - -############################################################################ -# Check if FriBidi support was requested and available. -############################################################################ -# Check whether --enable-fribidi was given. -if test "${enable_fribidi+set}" = set; then - enableval=$enable_fribidi; -fi - -if test "$enable_fribidi" != "no" ; then - - if test "$use_pkgconfig_fribidi" = "yes" ; then - FRIBIDI_CFLAGS=`$PKGCONFIG --cflags fribidi` - FRIBIDI_LDFLAGS=`$PKGCONFIG --libs fribidi` - elif test -x `which fribidi-config` ; then - FRIBIDI_CFLAGS=`fribidi-config --cflags` - FRIBIDI_LDFLAGS=`fribidi-config --libs` - else - FRIBIDI_LDFLAGS="-lfribidi" - fi - -fi -if test "$enable_fribidi" != "no" ; then - { echo "$as_me:$LINENO: checking for fribidi_log2vis in -lfribidi" >&5 -echo $ECHO_N "checking for fribidi_log2vis in -lfribidi... $ECHO_C" >&6; } -if test "${ac_cv_lib_fribidi_fribidi_log2vis+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfribidi $FRIBIDI_LDFLAGS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fribidi_log2vis (); -int -main () -{ -return fribidi_log2vis (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_fribidi_fribidi_log2vis=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_fribidi_fribidi_log2vis=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_fribidi_fribidi_log2vis" >&5 -echo "${ECHO_T}$ac_cv_lib_fribidi_fribidi_log2vis" >&6; } -if test $ac_cv_lib_fribidi_fribidi_log2vis = yes; then - LDFLAGS="$LDFLAGS $FRIBIDI_LDFLAGS" - CFLAGS="$CFLAGS $FRIBIDI_CFLAGS" - enable_fribidi="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_FRIBIDI 1 -_ACEOF - -else - enable_fribidi="no" - { echo "$as_me:$LINENO: WARNING: unable to use FriBidi" >&5 -echo "$as_me: WARNING: unable to use FriBidi" >&2;} -fi - -fi - -############################################################################ -# Check if XPM support was requested and available. -############################################################################ -# Check whether --enable-xpm was given. -if test "${enable_xpm+set}" = set; then - enableval=$enable_xpm; -fi - -if test "$enable_xpm" != "no"; then - -for ac_header in X11/xpm.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ---------------------------------- ## -## Report this to joewing@joewing.net ## -## ---------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - enable_xpm="no"; - { echo "$as_me:$LINENO: WARNING: unable to use X11/xpm.h" >&5 -echo "$as_me: WARNING: unable to use X11/xpm.h" >&2;} -fi - -done - -fi -if test "$enable_xpm" != "no"; then - { echo "$as_me:$LINENO: checking whether XpmAllocColor is declared" >&5 -echo $ECHO_N "checking whether XpmAllocColor is declared... $ECHO_C" >&6; } -if test "${ac_cv_have_decl_XpmAllocColor+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include - - -int -main () -{ -#ifndef XpmAllocColor - (void) XpmAllocColor; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_have_decl_XpmAllocColor=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_have_decl_XpmAllocColor=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_XpmAllocColor" >&5 -echo "${ECHO_T}$ac_cv_have_decl_XpmAllocColor" >&6; } -if test $ac_cv_have_decl_XpmAllocColor = yes; then - : -else - enable_xpm="no" - { echo "$as_me:$LINENO: WARNING: XPM library too old" >&5 -echo "$as_me: WARNING: XPM library too old" >&2;} -fi - -fi -if test "$enable_xpm" != "no"; then - { echo "$as_me:$LINENO: checking for XpmReadFileToImage in -lXpm" >&5 -echo $ECHO_N "checking for XpmReadFileToImage in -lXpm... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xpm_XpmReadFileToImage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXpm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XpmReadFileToImage (); -int -main () -{ -return XpmReadFileToImage (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xpm_XpmReadFileToImage=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xpm_XpmReadFileToImage=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToImage" >&5 -echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToImage" >&6; } -if test $ac_cv_lib_Xpm_XpmReadFileToImage = yes; then - LDFLAGS="$LDFLAGS -lXpm"; - enable_xpm="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_XPM 1 -_ACEOF - -else - enable_xpm="no" - { echo "$as_me:$LINENO: WARNING: unable to use libXpm" >&5 -echo "$as_me: WARNING: unable to use libXpm" >&2;} -fi - -fi - -############################################################################ -# Check if support for the shape extension was requested and available. -############################################################################ -# Check whether --enable-shape was given. -if test "${enable_shape+set}" = set; then - enableval=$enable_shape; -fi - -if test "$enable_shape" != "no"; then - { echo "$as_me:$LINENO: checking for XShapeCombineRectangles in -lXext" >&5 -echo $ECHO_N "checking for XShapeCombineRectangles in -lXext... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xext_XShapeCombineRectangles+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XShapeCombineRectangles (); -int -main () -{ -return XShapeCombineRectangles (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xext_XShapeCombineRectangles=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xext_XShapeCombineRectangles=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeCombineRectangles" >&5 -echo "${ECHO_T}$ac_cv_lib_Xext_XShapeCombineRectangles" >&6; } -if test $ac_cv_lib_Xext_XShapeCombineRectangles = yes; then - LDFLAGS="$LDFLAGS -lXext" - enable_shape="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_SHAPE 1 -_ACEOF - -else - enable_shape="no" - { echo "$as_me:$LINENO: WARNING: unable to use the X shape extension" >&5 -echo "$as_me: WARNING: unable to use the X shape extension" >&2;} -fi - -fi - -############################################################################ -# Check if support for Xmu was requested and available. -# Note that Xmu appears to be broken on IRIX (drawing rounded rectangles -# larger than 800 pixels in either direction causes problems). -############################################################################ -# Check whether --enable-xmu was given. -if test "${enable_xmu+set}" = set; then - enableval=$enable_xmu; -else - if test `uname` == "IRIX" -o `uname` == "IRIX64" ; then - { echo "$as_me:$LINENO: WARNING: disabling Xmu (it is broken on IRIX)" >&5 -echo "$as_me: WARNING: disabling Xmu (it is broken on IRIX)" >&2;} - enable_xmu="no" - fi - -fi - -if test "$enable_xmu" != "no"; then - { echo "$as_me:$LINENO: checking for XmuDrawRoundedRectangle in -lXmu" >&5 -echo $ECHO_N "checking for XmuDrawRoundedRectangle in -lXmu... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xmu_XmuDrawRoundedRectangle+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXmu $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XmuDrawRoundedRectangle (); -int -main () -{ -return XmuDrawRoundedRectangle (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xmu_XmuDrawRoundedRectangle=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xmu_XmuDrawRoundedRectangle=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuDrawRoundedRectangle" >&5 -echo "${ECHO_T}$ac_cv_lib_Xmu_XmuDrawRoundedRectangle" >&6; } -if test $ac_cv_lib_Xmu_XmuDrawRoundedRectangle = yes; then - LDFLAGS="$LDFLAGS -lXmu" - enable_xmu="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_XMU 1 -_ACEOF - -else - enable_xmu="no" - { echo "$as_me:$LINENO: WARNING: unable to use Xmu" >&5 -echo "$as_me: WARNING: unable to use Xmu" >&2;} -fi - -fi - -############################################################################ -# Check if support for Xinerama was requested and available. -############################################################################ -# Check whether --enable-xinerama was given. -if test "${enable_xinerama+set}" = set; then - enableval=$enable_xinerama; -fi - -if test "$enable_xinerama" != "no"; then - { echo "$as_me:$LINENO: checking for XineramaQueryExtension in -lXinerama" >&5 -echo $ECHO_N "checking for XineramaQueryExtension in -lXinerama... $ECHO_C" >&6; } -if test "${ac_cv_lib_Xinerama_XineramaQueryExtension+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXinerama $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char XineramaQueryExtension (); -int -main () -{ -return XineramaQueryExtension (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xinerama_XineramaQueryExtension=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_Xinerama_XineramaQueryExtension=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5 -echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; } -if test $ac_cv_lib_Xinerama_XineramaQueryExtension = yes; then - LDFLAGS="$LDFLAGS -lXinerama" - enable_xinerama="yes" - -cat >>confdefs.h <<\_ACEOF -#define USE_XINERAMA 1 -_ACEOF - -else - enable_xinerama="no" - { echo "$as_me:$LINENO: WARNING: unable to use Xinerama" >&5 -echo "$as_me: WARNING: unable to use Xinerama" >&2;} -fi - -fi - -############################################################################ -# Check if support for gettext was requested and available. -############################################################################ -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -AM_PROG_MKDIR_P - - { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 -echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } - # Check whether --enable-nls was given. -if test "${enable_nls+set}" = set; then - enableval=$enable_nls; USE_NLS=$enableval -else - USE_NLS=yes -fi - - { echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6; } - - - - - GETTEXT_MACRO_VERSION=0.18 - - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGFMT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test "$MSGFMT" != ":"; then - { echo "$as_me:$LINENO: result: $MSGFMT" >&5 -echo "${ECHO_T}$MSGFMT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_GMSGFMT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $GMSGFMT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT=$ac_cv_path_GMSGFMT -if test -n "$GMSGFMT"; then - { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 -echo "${ECHO_T}$GMSGFMT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac - - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; - *) GMSGFMT_015=$GMSGFMT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_XGETTEXT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$XGETTEXT" in - [\\/]* | ?:[\\/]*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && - (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test "$XGETTEXT" != ":"; then - { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 -echo "${ECHO_T}$XGETTEXT" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - rm -f messages.po - - case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; - *) XGETTEXT_015=$XGETTEXT ;; - esac - - - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Find out how to test for executable files. Don't use a zero-byte file, -# as systems may use methods other than mode bits to determine executability. -cat >conf$$.file <<_ASEOF -#! /bin/sh -exit 0 -_ASEOF -chmod +x conf$$.file -if test -x conf$$.file >/dev/null 2>&1; then - ac_executable_p="test -x" -else - ac_executable_p="test -f" -fi -rm -f conf$$.file - -# Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_MSGMERGE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case "$MSGMERGE" in - [\\/]* | ?:[\\/]*) - ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. - ;; - *) - ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$ac_save_IFS" - test -z "$ac_dir" && ac_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then - echo "$as_me: trying $ac_dir/$ac_word..." >&5 - if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then - ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" - break 2 - fi - fi - done - done - IFS="$ac_save_IFS" - test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" - ;; -esac -fi -MSGMERGE="$ac_cv_path_MSGMERGE" -if test "$MSGMERGE" != ":"; then - { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 -echo "${ECHO_T}$MSGMERGE" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$localedir" || localedir='${datadir}/locale' - - - test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= - - - ac_config_commands="$ac_config_commands po-directories" - - - - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 -echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } -else - { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } -fi -if test "${acl_cv_path_LD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} - { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } -if test "${acl_cv_prog_gnu_ld+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld - - - - - { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 -echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } -if test "${acl_cv_rpath+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -{ echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 -echo "${ECHO_T}$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then - enableval=$enable_rpath; : -else - enable_rpath=yes -fi - - - - - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { echo "$as_me:$LINENO: checking for 64-bit host" >&5 -echo $ECHO_N "checking for 64-bit host... $ECHO_C" >&6; } -if test "${gl_cv_solaris_64bit+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef _LP64 -sixtyfour bits -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then - gl_cv_solaris_64bit=yes -else - gl_cv_solaris_64bit=no -fi -rm -f conftest* - - -fi -{ echo "$as_me:$LINENO: result: $gl_cv_solaris_64bit" >&5 -echo "${ECHO_T}$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" - - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libiconv-prefix was given. -if test "${with_libiconv_prefix+set}" = set; then - withval=$with_libiconv_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBICONV= - LTLIBICONV= - INCICONV= - LIBICONV_PREFIX= - HAVE_LIBICONV= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='iconv ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'iconv'; then - LIBICONV_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBICONV; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" - ;; - esac - done - fi - else - LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" - done - fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - gt_INTL_MACOSX - - - - - LIBINTL= - LTLIBINTL= - POSUB= - - case " $gt_needs " in - *" need-formatstring-macros "*) gt_api_version=3 ;; - *" need-ngettext "*) gt_api_version=2 ;; - *) gt_api_version=1 ;; - esac - gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" - gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" - - if test "$USE_NLS" = "yes"; then - gt_use_preinstalled_gnugettext=no - - - if test $gt_api_version -ge 3; then - gt_revision_test_code=' -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION -#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) -#endif -typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; -' - else - gt_revision_test_code= - fi - if test $gt_api_version -ge 2; then - gt_expression_test_code=' + * ngettext ("", "", 0)' - else - gt_expression_test_code= - fi - - { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 -echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } -if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern int *_nl_domain_bindings; -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$gt_func_gnugettext_libc=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$gt_func_gnugettext_libc=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$gt_func_gnugettext_libc'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then - - - - - - am_save_CPPFLAGS="$CPPFLAGS" - - for element in $INCICONV; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - - { echo "$as_me:$LINENO: checking for iconv" >&5 -echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } -if test "${am_cv_func_iconv+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - am_cv_func_iconv="no, consider installing GNU libiconv" - am_cv_lib_iconv=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - am_cv_func_iconv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - if test "$am_cv_func_iconv" != yes; then - am_save_LIBS="$LIBS" - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -int -main () -{ -iconv_t cd = iconv_open("",""); - iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - am_cv_lib_iconv=yes - am_cv_func_iconv=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$am_save_LIBS" - fi - -fi -{ echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 -echo "${ECHO_T}$am_cv_func_iconv" >&6; } - if test "$am_cv_func_iconv" = yes; then - { echo "$as_me:$LINENO: checking for working iconv" >&5 -echo $ECHO_N "checking for working iconv... $ECHO_C" >&6; } -if test "${am_cv_func_iconv_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - am_save_LIBS="$LIBS" - if test $am_cv_lib_iconv = yes; then - LIBS="$LIBS $LIBICONV" - fi - if test "$cross_compiling" = yes; then - case "$host_os" in - aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; - *) am_cv_func_iconv_works="guessing yes" ;; - esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#include -#include -int main () -{ - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ - { - iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); - if (cd_utf8_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\342\202\254"; /* EURO SIGN */ - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_utf8_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } - /* Test against Solaris 10 bug: Failures are not distinguishable from - successful returns. */ - { - iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); - if (cd_ascii_to_88591 != (iconv_t)(-1)) - { - static const char input[] = "\263"; - char buf[10]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_ascii_to_88591, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if (res == 0) - return 1; - } - } -#if 0 /* This bug could be worked around by the caller. */ - /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ - { - iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); - if (cd_88591_to_utf8 != (iconv_t)(-1)) - { - static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; - char buf[50]; - const char *inptr = input; - size_t inbytesleft = strlen (input); - char *outptr = buf; - size_t outbytesleft = sizeof (buf); - size_t res = iconv (cd_88591_to_utf8, - (char **) &inptr, &inbytesleft, - &outptr, &outbytesleft); - if ((int)res > 0) - return 1; - } - } -#endif - /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is - provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - return 1; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - am_cv_func_iconv_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -am_cv_func_iconv_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - - LIBS="$am_save_LIBS" - -fi -{ echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5 -echo "${ECHO_T}$am_cv_func_iconv_works" >&6; } - case "$am_cv_func_iconv_works" in - *no) am_func_iconv=no am_cv_lib_iconv=no ;; - *) am_func_iconv=yes ;; - esac - else - am_func_iconv=no am_cv_lib_iconv=no - fi - if test "$am_func_iconv" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_ICONV 1 -_ACEOF - - fi - if test "$am_cv_lib_iconv" = yes; then - { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 -echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $LIBICONV" >&5 -echo "${ECHO_T}$LIBICONV" >&6; } - else - CPPFLAGS="$am_save_CPPFLAGS" - LIBICONV= - LTLIBICONV= - fi - - - - - - - - - - - - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - -# Check whether --with-libintl-prefix was given. -if test "${with_libintl_prefix+set}" = set; then - withval=$with_libintl_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi - fi - fi - -fi - - LIBINTL= - LTLIBINTL= - INCINTL= - LIBINTL_PREFIX= - HAVE_LIBINTL= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='intl ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no \ - || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - */$acl_libdirstem2 | */$acl_libdirstem2/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` - if test "$name" = 'intl'; then - LIBINTL_PREFIX="$basedir" - fi - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBINTL; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" - ;; - esac - done - fi - else - LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" - done - fi - - - - - - - { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 -echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } -if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - gt_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $INCINTL" - gt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBINTL" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$gt_func_gnugettext_libintl=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$gt_func_gnugettext_libintl=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then - LIBS="$LIBS $LIBICONV" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$gt_revision_test_code -extern int _nl_msg_cat_cntr; -extern -#ifdef __cplusplus -"C" -#endif -const char *_nl_expand_alias (const char *); -int -main () -{ -bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - LIBINTL="$LIBINTL $LIBICONV" - LTLIBINTL="$LTLIBINTL $LTLIBICONV" - eval "$gt_func_gnugettext_libintl=yes" - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - fi - CPPFLAGS="$gt_save_CPPFLAGS" - LIBS="$gt_save_LIBS" -fi -ac_res=`eval echo '${'$gt_func_gnugettext_libintl'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - fi - - if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ - || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ - && test "$PACKAGE" != gettext-runtime \ - && test "$PACKAGE" != gettext-tools; }; then - gt_use_preinstalled_gnugettext=yes - else - LIBINTL= - LTLIBINTL= - INCINTL= - fi - - - - if test -n "$INTL_MACOSX_LIBS"; then - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" - LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" - fi - fi - - if test "$gt_use_preinstalled_gnugettext" = "yes" \ - || test "$nls_cv_use_gnu_gettext" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_NLS 1 -_ACEOF - - else - USE_NLS=no - fi - fi - - { echo "$as_me:$LINENO: checking whether to use NLS" >&5 -echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $USE_NLS" >&5 -echo "${ECHO_T}$USE_NLS" >&6; } - if test "$USE_NLS" = "yes"; then - { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 -echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - gt_source="external libintl" - else - gt_source="libc" - fi - else - gt_source="included intl directory" - fi - { echo "$as_me:$LINENO: result: $gt_source" >&5 -echo "${ECHO_T}$gt_source" >&6; } - fi - - if test "$USE_NLS" = "yes"; then - - if test "$gt_use_preinstalled_gnugettext" = "yes"; then - if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then - { echo "$as_me:$LINENO: checking how to link with libintl" >&5 -echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } - { echo "$as_me:$LINENO: result: $LIBINTL" >&5 -echo "${ECHO_T}$LIBINTL" >&6; } - - for element in $INCINTL; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done - - fi - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_GETTEXT 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_DCGETTEXT 1 -_ACEOF - - fi - - POSUB=po - fi - - - - INTLLIBS="$LIBINTL" - - - - - - -LDFLAGS="$LDFLAGS $LIBINTL" - -############################################################################ -# Check if debug mode was requested. -############################################################################ -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then - enableval=$enable_debug; -fi - -if test "$enable_debug" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define DEBUG 1 -_ACEOF - - CFLAGS="$CFLAGS -Wall -g -DDEBUG" - LDFLAGS="$LDFLAGS -g" -else - enable_debug="no" -fi - -############################################################################ -# Create the output files. -############################################################################ -if test "$prefix" = "NONE" ; then - PREFIX="$ac_default_prefix" - prefix="$ac_default_prefix" -else - PREFIX="$prefix" -fi - -if test "$exec_prefix" = "NONE" ; then - exec_prefix="$PREFIX" -fi - -if test "$sysconfdir" = "" ; then - sysconfdir="$ac_default_sysconfdir" -fi - -if test "$mandir" = "" ; then - mandir="$ac_default_mandir" -fi - -if test "$LOCALEDIR" = "" ; then - localedir=`eval echo \""$datadir"/locale\"` - localedir=`eval echo \""$localedir"\"` - CFLAGS="$CFLAGS -DLOCALEDIR=\\\"$localedir\\\"" -fi - -BINDIR=`eval echo \""$bindir"\"` -SYSCONF=`eval echo \""$sysconfdir"\"` -MANDIR=`eval echo \""$mandir"\"` -MANDIR=`eval echo \""$MANDIR"\"` - - -cat >>confdefs.h <<_ACEOF -#define SYSTEM_CONFIG "$SYSCONF/system.jwmrc" -_ACEOF - - - - -VERSION="$PACKAGE_VERSION" - -INSTVERSION=`echo $PACKAGE_VERSION | tr -d .` - -BINDIR="$BINDIR" - -MANDIR="$MANDIR" - -DATE=`date "+%Y-%m-%d"` - -SYSCONF="$SYSCONF" - -PACKAGE="$PACKAGE" - - -ac_config_files="$ac_config_files po/Makefile.in Makefile src/Makefile jwm.1" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by jwm $as_me svn-579, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -jwm config.status svn-579 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; - "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "jwm.1") CONFIG_FILES="$CONFIG_FILES jwm.1" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -XMKMF!$XMKMF$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -USE_NLS!$USE_NLS$ac_delim -GETTEXT_MACRO_VERSION!$GETTEXT_MACRO_VERSION$ac_delim -MSGFMT!$MSGFMT$ac_delim -GMSGFMT!$GMSGFMT$ac_delim -MSGFMT_015!$MSGFMT_015$ac_delim -GMSGFMT_015!$GMSGFMT_015$ac_delim -XGETTEXT!$XGETTEXT$ac_delim -XGETTEXT_015!$XGETTEXT_015$ac_delim -MSGMERGE!$MSGMERGE$ac_delim -XGETTEXT_EXTRA_OPTIONS!$XGETTEXT_EXTRA_OPTIONS$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -LIBICONV!$LIBICONV$ac_delim -LTLIBICONV!$LTLIBICONV$ac_delim -INTLLIBS!$INTLLIBS$ac_delim -LIBINTL!$LIBINTL$ac_delim -LTLIBINTL!$LTLIBINTL$ac_delim -POSUB!$POSUB$ac_delim -VERSION!$VERSION$ac_delim -INSTVERSION!$INSTVERSION$ac_delim -BINDIR!$BINDIR$ac_delim -MANDIR!$MANDIR$ac_delim -DATE!$DATE$ac_delim -SYSCONF!$SYSCONF$ac_delim -PACKAGE!$PACKAGE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "po-directories":C) - for ac_file in $CONFIG_FILES; do - # Support "outfile[:infile[:infile...]]" - case "$ac_file" in - *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - esac - # PO directories have a Makefile.in generated from Makefile.in.in. - case "$ac_file" in */Makefile.in) - # Adjust a relative srcdir. - ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - # Treat a directory as a PO directory if and only if it has a - # POTFILES.in file. This allows packages to have multiple PO - # directories under different names or in different locations. - if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then - rm -f "$ac_dir/POTFILES" - test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" - cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" - POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend - # on $ac_dir but don't depend on user-specified configuration - # parameters. - if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then - # The LINGUAS file contains the set of available languages. - if test -n "$OBSOLETE_ALL_LINGUAS"; then - test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" - fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' - POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assigment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - done - # CATALOGS depends on both $ac_dir and the user's LINGUAS - # environment variable. - INST_LINGUAS= - if test -n "$ALL_LINGUAS"; then - for presentlang in $ALL_LINGUAS; do - useit=no - if test "%UNSET%" != "$LINGUAS"; then - desiredlanguages="$LINGUAS" - else - desiredlanguages="$ALL_LINGUAS" - fi - for desiredlang in $desiredlanguages; do - # Use the presentlang catalog if desiredlang is - # a. equal to presentlang, or - # b. a variant of presentlang (because in this case, - # presentlang can be used as a fallback for messages - # which are not translated in the desiredlang catalog). - case "$desiredlang" in - "$presentlang"*) useit=yes;; - esac - done - if test $useit = yes; then - INST_LINGUAS="$INST_LINGUAS $presentlang" - fi - done - fi - CATALOGS= - if test -n "$INST_LINGUAS"; then - for lang in $INST_LINGUAS; do - CATALOGS="$CATALOGS $lang.gmo" - done - fi - test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" - for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do - if test -f "$f"; then - case "$f" in - *.orig | *.bak | *~) ;; - *) cat "$f" >> "$ac_dir/Makefile" ;; - esac - fi - done - fi - ;; - esac - done ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - - -############################################################################ -# Display the status. -############################################################################ - -echo "Compiler: $CC" -echo "Compile flags: $CFLAGS" -echo "Link flags: $LDFLAGS" -echo -echo "Options" -echo -echo " Confirm: $enable_confirm" -echo " Icon: $enable_icons" -echo " PNG: $enable_png" -echo " JPEG: $enable_jpeg" -echo " XPM: $enable_xpm" -echo " XFT: $enable_xft" -echo " XRender: $enable_xrender" -echo " FriBidi: $enable_fribidi" -echo " Shape: $enable_shape" -echo " Xmu: $enable_xmu" -echo " Xinerama: $enable_xinerama" -echo " Debug: $enable_debug" -echo - diff -Nru jwm-2.1.0+svn579/configure.in jwm-2.3.1+0~16~ubuntu14.10.1/configure.in --- jwm-2.1.0+svn579/configure.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/configure.in 2015-07-18 20:02:18.000000000 +0000 @@ -2,7 +2,7 @@ # JWM autoconf. ############################################################################ -AC_INIT(jwm, svn-579, joewing@joewing.net) +AC_INIT(jwm, 2.3.1, joewing@joewing.net) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src]) AC_CONFIG_SRCDIR([po]) @@ -12,6 +12,7 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL +AC_PROG_MKDIR_P PACKAGE=jwm @@ -69,6 +70,8 @@ AC_CHECK_HEADERS([sys/select.h signal.h unistd.h time.h sys/wait.h sys/time.h]) +AC_CHECK_HEADERS([langinfo.h iconv.h]) + AC_CHECK_HEADERS([alloca.h locale.h libintl.h]) AC_CHECK_HEADERS([X11/Xlib.h], [], @@ -89,10 +92,13 @@ AC_DEFUN([JWM_PKGCONFIG_EXISTS], [ AC_MSG_CHECKING([for pkg-config]) - if test -x `which pkg-config` ; then - PKGCONFIG="pkg-config" + if which pkg-config >/dev/null ; then + PKGCONFIG=pkg-config + AC_MSG_RESULT($PKGCONFIG) + else + PKGCONFIG="" + AC_MSG_RESULT([no]) fi - AC_MSG_RESULT($PKGCONFIG) ]) AC_DEFUN([JWM_PKGCONFIG], @@ -100,7 +106,7 @@ AC_REQUIRE([JWM_PKGCONFIG_EXISTS]) if test "x$PKGCONFIG" != "x" ; then AC_MSG_CHECKING([if pkg-config knows about $2]) - if test `$PKGCONFIG $2 ; echo $?` -eq 0 ; then + if `$PKGCONFIG $2` ; then $1="yes" else $1="no" @@ -113,6 +119,9 @@ JWM_PKGCONFIG([use_pkgconfig_png], [libpng]) JWM_PKGCONFIG([use_pkgconfig_jpeg], [libjpeg]) +JWM_PKGCONFIG([use_pkgconfig_cairo], [cairo]) +JWM_PKGCONFIG([use_pkgconfig_rsvg], [librsvg-2.0]) +JWM_PKGCONFIG([use_pkgconfig_freetype2], [freetype2]) JWM_PKGCONFIG([use_pkgconfig_xft], [xft]) JWM_PKGCONFIG([use_pkgconfig_xrender], [xrender]) JWM_PKGCONFIG([use_pkgconfig_fribidi], [fribidi]) @@ -121,7 +130,7 @@ # Check if confirm dialogs should be used. ############################################################################ AC_ARG_ENABLE(confirm, - AC_HELP_STRING([--disable-confirm], [don't enable confirm dialogs]) ) + AC_HELP_STRING([--disable-confirm], [disable confirm dialogs]) ) if test "$enable_confirm" = "no" ; then AC_DEFINE(DISABLE_CONFIRM, 1, [Define to disable confirm dialogs]) else @@ -132,23 +141,30 @@ # Check if icon support was requested. ############################################################################ AC_ARG_ENABLE(icons, - AC_HELP_STRING([--disable-icons], [don't enable icon support]) ) + AC_HELP_STRING([--disable-icons], [disable icon support]) ) if test "$enable_icons" != "no" ; then enable_icons="yes" AC_DEFINE(USE_ICONS, 1, [Define to enable icon support] ) +else + enable_png="no" + enable_xbm="no" + enable_xpm="no" + enable_rsvg="no" + enable_cairo="no" + enable_jpeg="no" fi ############################################################################ # Check if PNG support was requested and available. ############################################################################ AC_ARG_ENABLE(png, - AC_HELP_STRING([--disable-png], [don't support PNG images]) ) + AC_HELP_STRING([--disable-png], [disable PNG images]) ) if test "$enable_png" != "no" ; then if test "$use_pkgconfig_png" = "yes" ; then PNG_CFLAGS=`$PKGCONFIG --cflags libpng` PNG_LDFLAGS=`$PKGCONFIG --libs libpng` - elif test -x `which libpng-config` ; then + elif which libpng-config >/dev/null ; then PNG_CFLAGS=`libpng-config --cflags` PNG_LDFLAGS=`libpng-config --libs` else @@ -168,10 +184,79 @@ fi ############################################################################ +# Check if Cairo support was requested and available. +############################################################################ +AC_ARG_ENABLE(cairo, + AC_HELP_STRING([--disable-cairo], [disable Cairo support]) ) +if test "$enable_cairo" != "no" ; then + + if test "$use_pkgconfig_cairo" = "yes" ; then + CAIRO_CFLAGS=`$PKGCONFIG --cflags cairo` + CAIRO_LDFLAGS=`$PKGCONFIG --libs cairo` + elif which cairo-config >/dev/null ; then + CAIRO_CFLAGS=`cairo-config --cflags` + CAIRO_LDFLAGS=`cairo-config --libs` + else + CAIRO_LDFLAGS="-lcairo" + fi + +fi +if test "$enable_cairo" != "no" ; then + AC_CHECK_LIB(cairo, cairo_create, + [ enable_cairo="yes" ], + [ enable_cairo="no" + AC_MSG_WARN([unable to use Cairo, Cairo support disabled]) ], + [ $CAIRO_LDFLAGS ]) +fi +if test "$enable_cairo" = "no" ; then + if test "$enable_rsvg" != "no" ; then + AC_MSG_WARN([disabling rsvg because Cairo is disabled]) + enable_rsvg="no" + fi +fi + +############################################################################ +# Check if librsvg support was requested and available. +############################################################################ +AC_ARG_ENABLE(rsvg, + AC_HELP_STRING([--disable-rsvg], [disable rsvg support]) ) +if test "$enable_rsvg" != "no" ; then + + if test "$use_pkgconfig_rsvg" = "yes" ; then + RSVG_CFLAGS=`$PKGCONFIG --cflags librsvg-2.0` + RSVG_LDFLAGS=`$PKGCONFIG --libs librsvg-2.0` + else + RSVG_LDFLAGS="-lrsvg-2.0" + fi + +fi +if test "$enable_rsvg" != "no" ; then + AC_CHECK_LIB(rsvg-2, rsvg_handle_render_cairo, + [ LDFLAGS="$LDFLAGS $RSVG_LDFLAGS" + CFLAGS="$CFLAGS $RSVG_CFLAGS" + enable_rsvg="yes" + AC_DEFINE(USE_RSVG, 1, [Define to use rsvg]) ], + [ enable_rsvg="no" + AC_MSG_WARN([unable to use rsvg, rsvg support disabled]) ], + [ $RSVG_LDFLAGS ]) +fi +if test "$enable_rsvg" = "no" ; then + if test "$enable_cairo" != "no" ; then + AC_MSG_WARN([disabling Cairo because rsvg is disabled]) + enable_cairo="no" + fi +fi +if test "$enable_rsvg" = "yes" ; then + LDFLAGS="$LDFLAGS $CAIRO_LDFLAGS" + CFLAGS="$CFLAGS $CAIRO_CFLAGS" + AC_DEFINE(USE_CAIRO, 1, [Define to use Cairo]) +fi + +############################################################################ # Check if JPEG support was requested and available. ############################################################################ AC_ARG_ENABLE(jpeg, - AC_HELP_STRING([--disable-jpeg], [don't support JPEG images]) ) + AC_HELP_STRING([--disable-jpeg], [disable JPEG images]) ) if test "$enable_jpeg" != "no" ; then if test "$use_pkgconfig_jpeg" = "yes" ; then JPEG_CFLAGS=`$PKGCONFIG --cflags libjpeg` @@ -194,14 +279,24 @@ ############################################################################ # Check if XFT support was requested and available. ############################################################################ -AC_ARG_ENABLE(xft, - AC_HELP_STRING([--disable-xft], [don't use Xft]) ) +AC_ARG_ENABLE(xft, AC_HELP_STRING([--disable-xft], [disable Xft]) ) if test "$enable_xft" != "no"; then + if test "$use_pkgconfig_freetype2" = "yes" ; then + FT2_CFLAGS=`$PKGCONFIG --cflags freetype2` + FT2_LDFLAGS=`$PKGCONFIG --libs freetype2` + elif which freetype-config >/dev/null ; then + FT2_CFLAGS=`freetype-config --cflags` + FT2_LDFLAGS=`freetype-config --libs` + else + FT2_CFLAGS="" + FT2_LDFLAGS="" + fi + if test "$use_pkgconfig_xft" = "yes" ; then XFT_CFLAGS=`$PKGCONFIG --cflags xft` XFT_LDFLAGS=`$PKGCONFIG --libs xft` - elif test -x `which xft-config` ; then + elif which xft-config >/dev/null ; then XFT_CFLAGS=`xft-config --cflags` XFT_LDFLAGS=`xft-config --libs` else @@ -211,26 +306,25 @@ fi if test "$enable_xft" != "no" ; then AC_CHECK_LIB(Xft, XftFontOpenName, - [ LDFLAGS="$LDFLAGS $XFT_LDFLAGS" - CFLAGS="$CFLAGS $XFT_CFLAGS" + [ LDFLAGS="$LDFLAGS $XFT_LDFLAGS $FT2_LDFLAGS" + CFLAGS="$CFLAGS $XFT_CFLAGS $FT2_CFLAGS" enable_xft="yes" AC_DEFINE(USE_XFT, 1, [Define to enable Xft]) ], [ enable_xft="no" AC_MSG_WARN([unable to use Xft]) ], - [ $XFT_LDFLAGS ]) + [ $XFT_LDFLAGS $FT2_LDFLAGS ]) fi if test "$enable_xft" != "no" ; then - AC_CHECK_HEADERS([ft2build.h], [], [], -[ + AC_CHECK_HEADER([ft2build.h], [], [], [ #include -]) + ]) fi ############################################################################ # Check if support for the XRENDER extension was requested and available. ############################################################################ AC_ARG_ENABLE(xrender, - AC_HELP_STRING([--disable-xrender], [don't use the XRender extension]) ) + AC_HELP_STRING([--disable-xrender], [disable XRender]) ) if test "$enable_xrender" != "no"; then if test "$use_pkgconfig_xrender" = "yes" ; then @@ -271,7 +365,7 @@ if test "$use_pkgconfig_fribidi" = "yes" ; then FRIBIDI_CFLAGS=`$PKGCONFIG --cflags fribidi` FRIBIDI_LDFLAGS=`$PKGCONFIG --libs fribidi` - elif test -x `which fribidi-config` ; then + elif which fribidi-config >/dev/null ; then FRIBIDI_CFLAGS=`fribidi-config --cflags` FRIBIDI_LDFLAGS=`fribidi-config --libs` else @@ -280,7 +374,7 @@ fi if test "$enable_fribidi" != "no" ; then - AC_CHECK_LIB(fribidi, fribidi_log2vis, + AC_CHECK_LIB(fribidi, fribidi_charset_to_unicode, [ LDFLAGS="$LDFLAGS $FRIBIDI_LDFLAGS" CFLAGS="$CFLAGS $FRIBIDI_CFLAGS" enable_fribidi="yes" @@ -291,14 +385,49 @@ fi ############################################################################ +# Check if iconv support was requested and available. +############################################################################ +AC_ARG_ENABLE(iconv, + AC_HELP_STRING([--disable-iconv], + [disable non-UTF-8 character set support]) ) +if test "$enable_iconv" != "no" ; then + + # Check the C library. + AC_CHECK_FUNC(iconv, + [ AC_DEFINE(USE_ICONV, 1, [Enable iconv support]) + enable_iconv="yes" + found_iconv="yes" ]) + + # Check libiconv. + if test "$found_iconv" != "yes" ; then + AC_CHECK_LIB(iconv, iconv, + [ AC_DEFINE(USE_ICONV, 1, [Enable iconv support]) + LDFLAGS="$LDFLAGS -liconv" + enable_iconv="yes" + found_iconv="yes" ], + [ enable_iconv="no" + AC_MSG_WARN([unable to use iconv]) ]) + fi + +fi + +############################################################################ # Check if XPM support was requested and available. ############################################################################ AC_ARG_ENABLE(xpm, - AC_HELP_STRING([--disable-xpm], [don't support XPM images]) ) + AC_HELP_STRING([--disable-xpm], [disable XPM images]) ) if test "$enable_xpm" != "no"; then + + # We need to use the XPM libraries in Motif-2.1 on IRIX. + if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then + CFLAGS="$CFLAGS -I/usr/Motif-2.1/include" + LDFLAGS="$LDFLAGS -L/usr/Motif-2.1/lib" + fi + AC_CHECK_HEADERS([X11/xpm.h], [], [ enable_xpm="no"; AC_MSG_WARN([unable to use X11/xpm.h]) ]) + fi if test "$enable_xpm" != "no"; then AC_CHECK_DECL(XpmAllocColor, [], @@ -318,10 +447,23 @@ fi ############################################################################ +# Check if XBM support was requested and available. +############################################################################ +AC_ARG_ENABLE(xbm, + AC_HELP_STRING([--disable-xbm], [disable XBM images]) ) +if test "$enable_xbm" != "no"; then + AC_CHECK_LIB(X11, XReadBitmapFileData, + [ enable_xbm="yes" + AC_DEFINE(USE_XBM, 1, [Define to enable XBM images]) ], + [ enable_xbm="no" + AC_MSG_WARN([unable to use XBM images]) ]) +fi + +############################################################################ # Check if support for the shape extension was requested and available. ############################################################################ AC_ARG_ENABLE(shape, - AC_HELP_STRING([--disable-shape], [don't use the X shape extension]) ) + AC_HELP_STRING([--disable-shape], [disable use of the X shape extension]) ) if test "$enable_shape" != "no"; then AC_CHECK_LIB(Xext, XShapeCombineRectangles, [ LDFLAGS="$LDFLAGS -lXext" @@ -337,9 +479,9 @@ # larger than 800 pixels in either direction causes problems). ############################################################################ AC_ARG_ENABLE(xmu, - AC_HELP_STRING([--disable-xmu], [don't use Xmu]), + AC_HELP_STRING([--disable-xmu], [disable Xmu support]), [], - [ if test `uname` == "IRIX" -o `uname` == "IRIX64" ; then + [ if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then AC_MSG_WARN([disabling Xmu (it is broken on IRIX)]) enable_xmu="no" fi @@ -357,7 +499,7 @@ # Check if support for Xinerama was requested and available. ############################################################################ AC_ARG_ENABLE(xinerama, - AC_HELP_STRING([--disable-xinerama], [don't use Xinerama]) ) + AC_HELP_STRING([--disable-xinerama], [disable Xinerama support]) ) if test "$enable_xinerama" != "no"; then AC_CHECK_LIB(Xinerama, XineramaQueryExtension, [ LDFLAGS="$LDFLAGS -lXinerama" @@ -370,6 +512,8 @@ ############################################################################ # Check if support for gettext was requested and available. ############################################################################ +# Use m4_pattern_allow to work around gettext's use of AM_PROG_MKDIR_P. +m4_pattern_allow([AM_PROG_MKDIR_P]) AM_GNU_GETTEXT([external]) LDFLAGS="$LDFLAGS $LIBINTL" @@ -451,8 +595,12 @@ echo echo " Confirm: $enable_confirm" echo " Icon: $enable_icons" +echo " Iconv: $enable_iconv" +echo " Cairo: $enable_cairo" +echo " RSVG: $enable_rsvg" echo " PNG: $enable_png" echo " JPEG: $enable_jpeg" +echo " XBM: $enable_xbm" echo " XPM: $enable_xpm" echo " XFT: $enable_xft" echo " XRender: $enable_xrender" diff -Nru jwm-2.1.0+svn579/debian/bzr-builder.manifest jwm-2.3.1+0~16~ubuntu14.10.1/debian/bzr-builder.manifest --- jwm-2.1.0+svn579/debian/bzr-builder.manifest 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/bzr-builder.manifest 2015-07-18 20:02:19.000000000 +0000 @@ -0,0 +1,2 @@ +# bzr-builder format 0.3 deb-version {debupstream}+0~16 +lp:~torios-dev/+junk/jwm revid:israeldahl@gmail.com-20150702031302-4sqnqvvkosllppng diff -Nru jwm-2.1.0+svn579/debian/changelog jwm-2.3.1+0~16~ubuntu14.10.1/debian/changelog --- jwm-2.1.0+svn579/debian/changelog 2014-02-18 03:28:03.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/changelog 2015-07-18 20:02:19.000000000 +0000 @@ -1,3 +1,72 @@ +jwm (2.3.1+0~16~ubuntu14.10.1) utopic; urgency=low + + * Auto build. + + -- Israel Dahl Sat, 18 Jul 2015 20:02:19 +0000 + +jwm (2.3.1-0ubuntu1) UNRELEASED; urgency=medium + + * debian/control + - added svg, cairo, jpg and dh_autoreconf to Build-Depends + * debian/rules + - tiny rules with autoreconf + * debian/watch + - watch github for latest releases + * New upstream release. + - Added support for client requested XRaiseWindow (issue #117). + - Added native language support for the confirm dialog. + - Added support for _NET_RESTACK_WINDOW (issue #118). + - Added key binding to send the current window to a different desktop (issue #119). + - Support the specification of an alternate configuration file (patch from Brian Bidulock) + - Added Radius option to configure the roundedness of windows. + - Updated the look of borders around menus and trays. + - Add support for _NET_WM_MOVERESIZE (issue #142). + - Add the fullscreen group option (patch from George Shaw). + - Made window style configuration more consistent (may break old configuration files). + - Add scale background type. + - Added group options: nomin, nomax, noclose, nomove, and noresize (issue #152). + - Added the Outline tag to MenuStyle to specify the color of menu outlines (issue #31). + - Added the Outline tag to TrayStyle to specify the color of tray outlines. + - To conform with GNU standards, running "make install" no longer strips the executable. To strip the executable, "make install‑strip" can be used instead. + * Configuration Changes + - The ActiveBackground and ActiveForeground tags have been replaced by Background and Foreground under the Active tag. This applies to TrayStyle, TaskListStyle, TrayButtonStyle, PagerStyle, and MenuStyle. + - The Inactive tag under WindowStyle has been removed. The tags that used to go within this tag now go directly under the WindowStyle tag. + * Bug Fixes + - ICCCM 2.0 WM_S selection compliance (patch from Brian Bidulock). + - Fixed client window position after maximize/restore (issue #115, patch from Biran Bidulock). + - Fixed window mapping bug with show desktop (issue #114). + - Give focus to the top-most window after show desktop (issue #64). + - Fix uninitialized memory when loading images (patch from Brian Bidulock). + - Fix overlapping string issue with FriBidi (patch from Brian Bidulock). + - Fixed non-UTF8 locales (issue #56). + - Fixed transparency issue with some applications (issue #130). + - Fixed focus after key events (patch from Brian Bidulock). + - Fixed loss of focus after restoring windows (issue #131). + - Fix setting of _NET_WM_STATE_HIDDEN when a window is minimized (issue #133, patch from Brian Bidulock). + - Grab input focus at startup if not already set (issue #148). + - Added the ability to swallow the same client into a tray multiple times. + - Added the ability to specify where the tray is hidden when auto-hide is enabled (issue #34). + - Menu Includes are now loaded dynamically when a menu is shown rather than when JWM starts. + - Added the maxh, maxv, maxtop, maxbottom, maxleft and maxright key bindings (issues #120 and #157). + - Added a configuration migration tool. http://joewing.net/projects/jwm/xslt/jwm-2.3.xslt + - Added the ability to have seperate actions per mouse button for tray buttons (issue #171). + - This is accomplished using the Button tag. i.e. + - fixes vertical Tray button issues + - fix SVG icon scaling (#177) + * changed Radius to Corner + - Corner supports integer pixel values. 0 or 1 is square. + * Clock + - now supports the Button tag. + - now supports menus, this breaks compatibilty as exec: is needed now. + * Updated Translations + - Russian (Aleksandr Samusenko) + - French (Pierrick) + - Italian (Flavio aka Man from Mars) + - Spanish (Pablo Lezaeta) + * New upstream release. + + -- Israel Dahl Wed, 01 Jul 2015 22:12:53 -0500 + jwm (2.1.0+svn579-2ubuntu1) trusty; urgency=low * Use autotools-dev for newer arches (closes: #727911). diff -Nru jwm-2.1.0+svn579/debian/control jwm-2.3.1+0~16~ubuntu14.10.1/debian/control --- jwm-2.1.0+svn579/debian/control 2014-02-18 02:52:34.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/control 2015-07-18 20:02:18.000000000 +0000 @@ -3,16 +3,33 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jari Aalto -Build-Depends: debhelper (>= 9), autotools-dev, libxext-dev, libpng-dev, libxpm-dev, libxinerama-dev, libxft-dev, libxrender-dev, libfontconfig1-dev, zlib1g-dev, libx11-6, libfribidi-dev (>= 0.19.2) -Standards-Version: 3.9.4 -Vcs-Browser: http://git.debian.org/?p=collab-maint/jwm.git -Vcs-Git: git://git.debian.org/git/collab-maint/jwm.git +Build-Depends: + autotools-dev, + dh-autoreconf, + debhelper (>= 9), + libfribidi-dev (>= 0.19.2), + libfontconfig1-dev, + libcairo2-dev, + librsvg2-dev, + libjpeg62-dev, + libpng-dev, + libx11-6, + libxext-dev, + libxft-dev, + libxinerama-dev, + libxmu-dev, + libxpm-dev, + libxrender-dev, + zlib1g-dev, +Standards-Version: 3.9.5 +Vcs-Browser: https://github.com/joewing/jwm.git +Vcs-Git: git://github.com/joewing/jwm.git Package: jwm Provides: x-window-manager Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, rxvt-unicode-256color | rxvt-unicode | rxvt-unicode-lite | gnome-terminal | konsole | x-terminal-emulator -Suggests: menu, x11-apps +Depends: ${shlibs:Depends}, ${misc:Depends}, menu, menu-xdg , xterm | sakura | lxterminal | gnome-terminal | konsole | x-terminal-emulator, xsltproc +Suggests: x11-apps Homepage: http://www.joewing.net/programs/jwm Description: very small lightweight pure X11 window manager with tray and menus Low resource Window manager ideal for older PCs. It uses a minimum of external @@ -25,4 +42,4 @@ configuration files are managed in XML format. . Compared to other light WM, like Fvwm95, the Jwm consumes considerably - less memory while providing the same functionality. + less memory while providing the more functionality. diff -Nru jwm-2.1.0+svn579/debian/patches/03-man-jwmrc.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/03-man-jwmrc.patch --- jwm-2.1.0+svn579/debian/patches/03-man-jwmrc.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/03-man-jwmrc.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From a9793c48d453288cd6efe715ece81cba72ead286 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 11:36:03 +0300 -Subject: [PATCH] jwm.1.in: change system resource file name -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - jwm.1.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/jwm.1.in b/jwm.1.in -index c0b9f31..8a73bf8 100644 ---- a/jwm.1.in -+++ b/jwm.1.in -@@ -44,7 +44,7 @@ Display version information and exit. - .RE - - .SH FILES --.IP "@SYSCONF@/system.jwmrc" -+.IP "@SYSCONF@/jwmrc" - The default JWM configuration file. - .IP "~/.jwmrc" - Local configuration file. Copy the default configuration file to this --- -1.7.5.4 - diff -Nru jwm-2.1.0+svn579/debian/patches/10-jwmrc--clock-24h-format.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/10-jwmrc--clock-24h-format.patch --- jwm-2.1.0+svn579/debian/patches/10-jwmrc--clock-24h-format.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/10-jwmrc--clock-24h-format.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -From 0c505ba8e6116738674b1c213b6008a56ec6beb3 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 11:39:35 +0300 -Subject: [PATCH] example.jwmrc: Set clock format 24h -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/example.jwmrc b/example.jwmrc -index e7b15e9..2a7c777 100644 ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -81,7 +81,7 @@ - xload -nolabel -bg black -fg red -hl white - - -- xclock -+ xclock - - - --- -1.7.5.4 - diff -Nru jwm-2.1.0+svn579/debian/patches/30-jwmrc--terminal--browser--menu-heigh.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/30-jwmrc--terminal--browser--menu-heigh.patch --- jwm-2.1.0+svn579/debian/patches/30-jwmrc--terminal--browser--menu-heigh.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/30-jwmrc--terminal--browser--menu-heigh.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From c3b4419e2910b237fbf053bbd7f66e3c5add1d65 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 11:42:31 +0300 -Subject: [PATCH] example.jwmrc: Lower menu height, use x-www-browser, add - gnome-www-browser -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 5 +++-- - 1 files changed, 3 insertions(+), 2 deletions(-) - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -4,8 +4,9 @@ - - - -- -- xterm -+ -+ x-terminal-emulator -+ gnome-www-browser - - - dia diff -Nru jwm-2.1.0+svn579/debian/patches/31-jwmrc--fonts.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/31-jwmrc--fonts.patch --- jwm-2.1.0+svn579/debian/patches/31-jwmrc--fonts.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/31-jwmrc--fonts.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -From bf1ca9fe50f4eff39767f134ee4bd63376518564 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 11:43:43 +0300 -Subject: [PATCH] example.jwmrc: Change fonts (lower) -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -90,7 +90,7 @@ - - - -- FreeSans-9:bold -+ -*-fixed-*-r-*-*-10-*-*-*-*-*-*-* - 4 - 20 - -@@ -111,7 +111,7 @@ - - - -- FreeSans-12:bold -+ -*-fixed-*-r-*-*-10-*-*-*-*-*-*-* - black - gray80:gray90 - black -@@ -120,7 +120,7 @@ - - - -- FreeSans-12:bold -+ -*-fixed-*-r-*-*-10-*-*-*-*-*-*-* - gray90 - black - 0.75 -@@ -135,7 +135,7 @@ - - - -- FreeSans-12:bold -+ -*-fixed-*-r-*-*-10-*-*-*-*-*-*-* - black - gray90 - white -@@ -144,7 +144,7 @@ - - - -- FreeSans-10 -+ -*-fixed-*-r-*-*-10-*-*-*-*-*-*-* - black - black - yellow diff -Nru jwm-2.1.0+svn579/debian/patches/32-jwmrc--colors.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/32-jwmrc--colors.patch --- jwm-2.1.0+svn579/debian/patches/32-jwmrc--colors.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/32-jwmrc--colors.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From ff5cf224850ca1923d1239bdf689afc9f0c3d2c9 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 11:56:15 +0300 -Subject: [PATCH] example.jwmrc: Use clean colors -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -96,7 +96,10 @@ - - - white -+ -+ gray30:gray60 - black - 1.0 - diff -Nru jwm-2.1.0+svn579/debian/patches/50-jwmrc--removed-menus.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/50-jwmrc--removed-menus.patch --- jwm-2.1.0+svn579/debian/patches/50-jwmrc--removed-menus.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/50-jwmrc--removed-menus.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -From a877571416b687906acc0cd1088de1bde088e655 Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Tue, 27 Sep 2011 18:36:28 +0300 -Subject: [PATCH] example.jwmrc: comment out Applications menu (Debian - provides this) -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -6,8 +6,9 @@ - - - x-terminal-emulator -- gnome-www-browser - -+ - - - xscreensaver-command -activate diff -Nru jwm-2.1.0+svn579/debian/patches/55-alt-tab.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/55-alt-tab.patch --- jwm-2.1.0+svn579/debian/patches/55-alt-tab.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/55-alt-tab.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -From bd7c63b2eee5bb89759d4bfd23a688e57f87219b Mon Sep 17 00:00:00 2001 -From: Jari Aalto -Date: Mon, 26 Sep 2011 12:03:18 +0300 -Subject: [PATCH] example.jwmrc: Change A-Tab keycode -Organization: Private -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - - -Signed-off-by: Jari Aalto ---- - example.jwmrc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -201,7 +201,7 @@ - select - escape - -- nextstacked -+ next - close - desktop# - root:1 diff -Nru jwm-2.1.0+svn579/debian/patches/57-jwmrc--debian-include.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/57-jwmrc--debian-include.patch --- jwm-2.1.0+svn579/debian/patches/57-jwmrc--debian-include.patch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/57-jwmrc--debian-include.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -From: Jari Aalto -Subject: Include Debian menu - ---- a/example.jwmrc -+++ b/example.jwmrc -@@ -38,6 +38,9 @@ - - - --> -+ -+ /etc/jwm/debian-menu -+ - - - xscreensaver-command -activate diff -Nru jwm-2.1.0+svn579/debian/patches/60-fribidi.patch jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/60-fribidi.patch --- jwm-2.1.0+svn579/debian/patches/60-fribidi.patch 2014-02-18 03:27:28.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/60-fribidi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Index: jwm-2.1.0+svn579/src/font.c -=================================================================== ---- jwm-2.1.0+svn579.orig/src/font.c 2012-01-26 20:04:17.000000000 -0500 -+++ jwm-2.1.0+svn579/src/font.c 2014-02-17 22:27:26.906074506 -0500 -@@ -248,11 +248,13 @@ - #ifdef USE_FRIBIDI - - temp = AllocateStack((len + 1) * sizeof(FriBidiChar)); -- unicodeLength = fribidi_utf8_to_unicode((char*)str, len, temp); -+ unicodeLength = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, -+ (char*)str, len, temp); - - fribidi_log2vis(temp, unicodeLength, &type, temp, NULL, NULL, NULL); - -- fribidi_unicode_to_utf8(temp, len, (char*)temp); -+ fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, temp, len, -+ (char*)temp); - output = (char*)temp; - - #else diff -Nru jwm-2.1.0+svn579/debian/patches/series jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/series --- jwm-2.1.0+svn579/debian/patches/series 2014-02-18 03:21:12.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -03-man-jwmrc.patch -10-jwmrc--clock-24h-format.patch -30-jwmrc--terminal--browser--menu-heigh.patch -31-jwmrc--fonts.patch -32-jwmrc--colors.patch -50-jwmrc--removed-menus.patch -55-alt-tab.patch -57-jwmrc--debian-include.patch -60-fribidi.patch diff -Nru jwm-2.1.0+svn579/debian/rules jwm-2.3.1+0~16~ubuntu14.10.1/debian/rules --- jwm-2.1.0+svn579/debian/rules 2014-02-18 02:53:01.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/rules 2015-07-18 20:02:18.000000000 +0000 @@ -1,37 +1,5 @@ #!/usr/bin/make -f - -PACKAGE = jwm -CHANGELOG = debian/upstream.changelog -PKGDIR = $(CURDIR)/debian/$(PACKAGE) -ETCDIR = $(PKGDIR)/etc/$(PACKAGE) - -export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -export DEB_LDFaLAGS_MAINT_APPEND = -Wl,--as-needed - - # Upstream does not support CPPFLAGS -export CC := $(CC) $(CPPFLAGS) - -# Run manaually to get updates -get-changelog: - svn log https://jwm.svn.sourceforge.net/svnroot/jwm \ - | sed 's/[[:space:]]*$$//' \ - > $(CHANGELOG) - -override_dh_installchangelogs: - dh_installchangelogs $(CHANGELOG) - -override_dh_install: - dh_install - install -D -m 644 example.jwmrc $(ETCDIR)/system.$(PACKAGE)rc - -override_dh_auto_configure: - dh_auto_configure -- --sysconfdir=/etc/jwm - -override_dh_auto_install: - # Disable. See debian/install instead. - %: - dh $@ --with autotools_dev + dh $@ --with autotools_dev --with autoreconf # End of file diff -Nru jwm-2.1.0+svn579/debian/source/format jwm-2.3.1+0~16~ubuntu14.10.1/debian/source/format --- jwm-2.1.0+svn579/debian/source/format 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/source/format 2015-07-18 20:02:19.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru jwm-2.1.0+svn579/debian/watch jwm-2.3.1+0~16~ubuntu14.10.1/debian/watch --- jwm-2.1.0+svn579/debian/watch 2012-11-18 18:33:23.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/debian/watch 2015-07-18 20:02:18.000000000 +0000 @@ -1,2 +1,3 @@ version=3 -http://www.joewing.net/programs/jwm/index.shtml .*jwm-(\d+\.[\d.]+.*).tar.bz2 +opts="filenamemangle=s/(?:.*)?v?(\d[\d\.]*)\.tar\.gz/jwm-2.3.0-$1.tar.gz/" \ +https://github.com/joewing/jwm/tags (?:.*/)?v?(\d[\d\.]*)\.tar\.gz diff -Nru jwm-2.1.0+svn579/doc-footer.shtml jwm-2.3.1+0~16~ubuntu14.10.1/doc-footer.shtml --- jwm-2.1.0+svn579/doc-footer.shtml 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/doc-footer.shtml 2015-07-18 20:02:18.000000000 +0000 @@ -1,3 +1,3 @@ - + diff -Nru jwm-2.1.0+svn579/doc-header.shtml jwm-2.3.1+0~16~ubuntu14.10.1/doc-header.shtml --- jwm-2.1.0+svn579/doc-header.shtml 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/doc-header.shtml 2015-07-18 20:02:18.000000000 +0000 @@ -1,6 +1,6 @@ - +

diff -Nru jwm-2.1.0+svn579/example.jwmrc jwm-2.3.1+0~16~ubuntu14.10.1/example.jwmrc --- jwm-2.1.0+svn579/example.jwmrc 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/example.jwmrc 2015-07-18 20:02:18.000000000 +0000 @@ -1,210 +1,180 @@ - - - - - xterm - -

- dia - firefox - gimp - - xterm -e mutt - - - ooffice - - pidgin - rhythmbox - - /usr/local/xilinx/bin/ise - - gxine - - - xcalc - xfontsel - xmag - - gksudo synaptic - - - xprop | xmessage -file - - - - - - xscreensaver-command -activate - - - - -
- - - Pidgin - - - - - gkrellm - - - - - - xterm - - - - - - - - - root:1 - - showdesktop - - - - - - - - - - - xload -nolabel -bg black -fg red -hl white - - - xclock - - - - - - - - FreeSans-9:bold - 4 - 20 - - - white - #70849d:#2e3a67 - black - 1.0 - - - - #aaaaaa - #808488:#303438 - black - 0.5:0.9:0.1 - - - - - - FreeSans-12:bold - black - gray80:gray90 - black - gray90:gray80 - - - - - FreeSans-12:bold - gray90 - black - 0.75 - - - - black - gray90 - #808488 - #70849d - #2e3a67 - - - - FreeSans-12:bold - black - gray90 - white - #70849d:#2e3a67 - 0.85 - - - - FreeSans-10 - black - black - yellow - - - - /usr/share/icons/wm-icons/32x32-gant - - - - - - - /export0/images/formulae.jpg - - - - 400 - - - 2 - - - sloppy - - - border - - - opaque - - - opaque - - gkrellm - - - up - down - right - left - left - down - up - right - select - escape - - nextstacked - close - desktop# - root:1 - window - maximize - rdesktop - ldesktop - udesktop - ddesktop + + + xterm + + audacious + xcalc + gimp + iceweasel + xedit + + + xfontsel + + xprop | xmessage -file - + + + + + xscreensaver-command -lock + + + + + + + + + Pidgin + + + + xterm + + + + + xedit + + + + xcalc + + + + + + + root:1 + showdesktop + + + + + + + + + + + + + Sans-9:bold + 4 + 21 + 4 + #FFFFFF + #333333 + #000000 + 0.5:0.9:0.1 + + #FFFFFF + #0077CC + #000000 + 1.0 + + + + Sans-9 + #111111 + #FFFFFF + 0.75 + + + #FFFFFF + #111111 + + #FFFFFF + #333333 + + + + #000000 + #FFFFFF + #444444 + #111111 + + #0077CC + #333333 + + + + Sans-9 + #FFFFFF + #333333 + + #FFFFFF + #0077CC + + 0.85 + + + Sans-9 + #000000 + #000000 + #999999 + + + + + /usr/share/icons/wm-icons/32x32-gant + + + + + + + #222222 + + + + 400 + + + 2 + + + sloppy + + + border + + + opaque + + + opaque + + + up + down + right + left + left + down + up + right + select + escape + + nextstacked + close + desktop# + root:1 + window + maximize + rdesktop + ldesktop + udesktop + ddesktop
- diff -Nru jwm-2.1.0+svn579/jwm.1.in jwm-2.3.1+0~16~ubuntu14.10.1/jwm.1.in --- jwm-2.1.0+svn579/jwm.1.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/jwm.1.in 2015-07-18 20:02:18.000000000 +0000 @@ -21,6 +21,11 @@ Exit JWM by sending _JWM_EXIT to the root window. .RE .P +\fB\-f\fP \fIfile\fP +.RS +Specify an alternate configuration file to use. +.RE +.P .B "-h" .RS Display a help message and exit. @@ -38,6 +43,11 @@ Restart JWM by sending _JWM_RESTART to the root window. .RE .P +.B "-reload" +.RS +Reload menus by sending _JWM_RELOAD to the root window. +.RE +.P .B "-v" .RS Display version information and exit. @@ -47,13 +57,14 @@ .IP "@SYSCONF@/system.jwmrc" The default JWM configuration file. .IP "~/.jwmrc" -Local configuration file. Copy the default configuration file to this -location to make user-specific changes. +Default local configuration file. Copy the default configuration file to this +location to make user-specific changes. See also, option \fB\-f\fP. .SH CONFIGURATION .B OVERVIEW .RS -Configuration of JWM is done by editing ".jwmrc". This file is XML +Configuration of JWM is done by editing ".jwmrc" (or the configuration +file specified with the \fB\-f\fP option). This file is XML making it easy to edit, either by hand or programmatically. The example.jwmrc gives an example configuration file. Before restarting JWM, it is a good idea to run "jwm \-p" to make @@ -73,8 +84,10 @@ Determine which buttons on the root window activate the menu. This is a list of integers specifying buttons. The default is "123". Note that multiple root menus may be specified by using different -buttons for different menus. The range of possible button values is -\fB0\fP to \fB9\fP inclusive. +buttons for different menus. The range of possible values is +\fB0\fP to \fB9\fP inclusive as well as \fBa\fP to \fBz\fP inclusive, +providing for up to 36 menus. Note that only the numeric values +map to mouse buttons. .RE .P \fBheight\fP \fIint\fP @@ -123,6 +136,14 @@ .RE .RE .P +.B Dynamic +.RS +Dynamically include the contents of a file or executable into a submenu. +The file must start with a "JWM" tag. The file is specified by the text +of the tag. If the text starts with "exec:" then the output of a program +is used. This tag supports the same attributes as \fBMenu\fP. +.RE +.P .B Include .RS Include the contents of a file into the menu structure. The file must @@ -370,9 +391,11 @@ One or more trays may be created via the \fBTray\fP tag. This tag supports the following attributes: .P -\fBautohide\fP \fIbool\fP +\fBautohide\fP \fIstring\fP .RS -Allows this tray to hide itself when not activated. Default is false. +Specifies the location to hide the tray when not activated. Default is "off" +to disable hiding. +Possible values are "left", "right", "top", "bottom", and "off". .RE .P \fBx\fP \fIint\fP @@ -401,21 +424,14 @@ default. .RE .P -\fBborder\fP \fIint\fP -.RS -The width of the border. The default is 1. Valid values are between 0 and 32 -inclusive. -.RE -.P -\fBlayer\fP \fIint\fP +\fBlayer\fP { \fBbelow\fP | \fBnormal\fP | \fBabove\fP } .RS -The layer of the tray. The default is 8. Valid values are between 0 and -12 inclusive. +The layer of the tray. The default is \fBabove\fP. .RE .P \fBlayout\fP { \fBvertical\fP | \fBhorizontal\fP } .RS -The layout of the tray. The default is horizontal. +The layout of the tray. The default is \fBhorizontal\fP. .RE .P \fBvalign\fP { \fBfixed\fP | \fBtop\fP | \fBcenter\fP | \fBbottom\fP } @@ -432,8 +448,29 @@ .P .B Clock .RS -Add a clock to the tray. The text of this tag is a command to run -when the clock is clicked. This tag supports the following attributes: +Add a clock to the tray. The text of this tag determines what action to +take when the clock is clicked. Optionally, one or more \fBButton\fP tags +may be specified to bind actions to specific mouse buttons specified via the +\fBmask\fP attribute. By default, the button mask is "123". +The following actions are supported: +.P +\fBroot:\fP\fIn\fP +.RS +Show root menu \fIn\fP. +Note that the default TrayButton action is \fBroot:1\fP. +.RE +.P +\fBexec:\fP \fIstring\fP +.RS +Execute a command. +.RE +.P +\fBshowdesktop\fP +.RS +Minimize all windows on the current desktop. +.RE +.P +This tag supports the following attributes: .P \fBformat\fP \fIstring\fP .RS @@ -537,7 +574,7 @@ .B TaskList .RS Add a task list to the tray. -This tag supports the following attribute: +This tag supports the following attributes: .P \fBmaxwidth\fP \fIint\fP .RS @@ -549,7 +586,10 @@ .B TrayButton .RS Add a button to the tray. The text of this tag determines what action to -take when the button is clicked. The following actions are supported: +take when the button is clicked. Optionally, one or more \fBButton\fP tags +may be specified to bind actions to specific mouse buttons specified via the +\fBmask\fP attribute. By default, the button mask is "123". +The following actions are supported: .P \fBroot:\fP\fIn\fP .RS @@ -592,7 +632,7 @@ .RS Other configuration files may be included under the JWM tag via the \fBInclude\fP tag. The text of this tag specifies the location of an -additional configuration file. The path may be relative to the loacation +additional configuration file. The path may be relative to the location JWM was started, an absolute path, or a path referencing an environment variable (using '$'). The format of the configuration file is the same as the main configuration file. @@ -603,116 +643,232 @@ Program groups allow one to specify options which apply to a group of programs by name and/or class. A program group is created with the \fBGroup\fP tag. As many program groups can be created as desired. -If one or more \fBName\fP tags is specified, a name must be matched. -Likewise, if one or more \fBClass\fP tags is specified, a class must be -matched. Within the \fBGroup\fP tag the following tags are supported: +If one or more \fBName\fP tags is specified, at least one name must +match. Likewise, if one or more \fBClass\fP tags is specified, at least +one class must match. +JWM matches using extended POSIX regular expressions for both \fBName\fP +and \fBClass\fP tags. See \fBregex\fP(7). +Within the \fBGroup\fP tag the following tags are supported: .P .B Name .RS -The title of a program to match to be in this group. This field is case -sensitive. A wild card, \fB*\fP, may be used. +The window name of a program to match to be in this group (the +first string in WM_CLASS). .RE .B Class .RS -The window class for a program to match to be in this group. This field is -case sensitive. A wild card, \fB*\fP, may be used. +The window class for a program to match to be in this group (the +second string in WM_CLASS). .RE .B Option .RS -An option for this group. Possible options are given below: +An option for this group. Possible options are: + .P .B border .RS Causes windows in this group to have a border. .RE + .P -\fBdesktop:\fP\fI#\fP +.B centered .RS -The desktop on which windows in this group will be started. +Center windows in this group upon initial placement instead of using +cascaded placement. .RE + .P -\fBicon:\fP\fIstring\fP +.B constrain .RS -The icon to be used for windows in this group. +Constrain windows in this group to the screen. .RE + .P -.B layer: -.I # +\fBdesktop:\fP\fI#\fP .RS -The layer on which windows in this group will be started. +The desktop on which windows in this group will be started. .RE + .P -.B maximized +.B fullscreen .RS -Make windows in this group initially maximized. +Make windows in this group initially fullscreen. .RE + .P .B hmax .RS Make windows in this group maximize horizontally. .RE + .P -.B vmax +\fBicon:\fP\fIstring\fP .RS -Make windows in this group maximize vertically. +The icon to be used for windows in this group. +.RE + +.P +.B iignore +.RS +Ignore the size increment hint when maximizing windows in this group. +.RE + +.P +\fBlayer:\fP\fIstring\fP +.RS +The layer on which windows in this group will be started. +Valid options are \fBbelow\fP, \fBnormal\fP, and \fBabove\fP +.RE + +.P +.B maximized +.RS +Make windows in this group initially maximized. .RE + .P .B minimized .RS Make windows in this group initially minimized. .RE + .P .B noborder .RS Causes windows in this group to be displayed without a border. .RE + .P .B nofocus .RS Prevents windows in the group from grabbing the focus when mapped. .RE + .P .B nolist .RS Causes the tray to ignore windows in this group. .RE + +.P +.B nopager +.RS +Causes the pager to ignore windows in this group. +.RE + +.P +.B noshade +.RS +Prevent windows in this group from being shaded. +.RE + +.P +.B nomin +.RS +Prevent windows in this group from being minimized. +.RE + +.P +.B nomax +.RS +Prevent windows in this group from being maximized. +.RE + +.P +.B noclose +.RS +Prevent windows in this group from being closed. +.RE + +.P +.B nomove +.RS +Prevent windows in this group from being moved. +.RE + +.P +.B noresize +.RS +Prevent windows in this group from being resized. +.RE + +.P +.B nofullscreen +.RS +Prevent windows in this group from being fullscreen. +.RE + .P .B notitle .RS Causes windows in this group to be displayed without a title bar. .RE + +.P +.B noturgent +.RS +Ignore the urgent hint for windows in this group. +.RE + +.P +\fBopacity:\fP\fI#\fP +.RS +Set the opacity for windows in this group. +The value is a number between 0.0 and 1.0 inclusive. +.RE + .P .B pignore .RS Ignore initial window position requested by program. .RE + .P .B shaded .RS Make windows in this group initially shaded. .RE + .P .B sticky .RS Make windows in this group sticky. .RE + .P -\fBopacity:\fP\fI#\fP +.B tiled .RS -Set the opacity for windows in this group. -The value is a number between 0.0 and 1.0 inclusive. +Attempt to tile windows in this group upon initial placement. +If tiled placement fails, windows will fall back to cascaded placement +(the default) or centered if specified. .RE + .P .B title .RS -Causes windows in this group to have a title bar. +Forces windows in this group to have a title bar. .RE + +.P +.B vmax +.RS +Make windows in this group maximize vertically. +.RE + .RE .RE .B "WINDOW STYLE" .RS The \fBWindowStyle\fP tag controls the look of window borders. +This tag supports the following attribute: +.P +.B decorations +.RS +The window decorations to use. Valid options are \fBflat\fP and +\fBmotif\fP. \fBflat\fP is the default. +.RE +.P Within this tag, the following tags are supported: .P .B Font @@ -723,13 +879,20 @@ .B Width .RS The width of window borders in pixels. The default is 4, the minimum is 1, -and the maximum is 32. +and the maximum is 128. .RE .P .B Height .RS The height of window title bars in pixels. The default is 20, the minimum -is 2, and the maximum is 64. +is 2, and the maximum is 256. +.RE +.P +.B Corner +.RS +The corner width of the window border for rounded window borders. +The default is 4, the minimum is 0 (rectangular), and the +maximum is 5 (most rounded). .RE .P .P @@ -738,21 +901,22 @@ The colors/opacity used for the active window. See the \fBCOLORS\fP section for more information on colors. The following tags are supported: .P -.B Text +.B Foreground .RS -The color of text on the title bar. -The default is black. +The color of the text and buttons in the title bar. +The default is white. .RE .P -.B Title +.B Background .RS The color of the title bar (gradients are supported). -The default is red:red. +The default is #CC7700:#884400. .RE .P .B Opacity .RS The opacity of the window. This is a floating point value between 0.0 and 1.0. +The default is 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .P @@ -763,41 +927,45 @@ .RE .RE .P -.B Inactive -.RS -The colors used for inactive windows. See the \fBCOLORS\fP section for -more information on colors. The following tags are supported: -.P -.B Text +.B Foreground .RS -The color of text on the title bar. -The default is black. +The color of text and buttons in the title bar of inactive windows. +The default is white. .RE .P -.B Title +.B Background .RS -The color of the title bar (gradients are supported). -The default is gray:gray. +The color of the title bar (gradients are supported) of inactive windows. +The default is #333333:#111111. .RE .P .B Opacity .RS -The opacity of the window. This is a floating point value between 0.0 and 1.0. -Note that a composite manager, such as xcompmgr, is required for this. +The opacity of inactive windows. This is a floating point value between +0.0 and 1.0. The default is 0.75. Note that a composite manager, such as +xcompmgr, is required for this. .RE .P .B Outline .RS -The color of the window outline. +The color of the window outline for inactive windows. The default is black. .RE .RE -.RE .B "TRAY STYLE" .RS The \fBTrayStyle\fP tag controls the look of trays. -Within this tag the following tag is supported: +The following attribute is supported: +.P +.B group +.RS +Determines if windows are grouped when shown in task bars. +Possible values are \fBtrue\fP and \fBfalse\fP. The default +is \fBtrue\fP. +.RE +.P +Within this tag the following tags are supported: .P .B Font .RS @@ -817,11 +985,35 @@ more information. .RE .P +.B Outline +.RS +The color of the outline. See the \fBCOLORS\fP section for +more information. +.RE +.P .B Opacity .RS -The opacity of the window. This is a floating point value between 0.0 and 1.0. +The opacity of trays. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE +.P +.P +.B Active +.RS +The default colors for active items on the tray. +See the \fBCOLORS\fP section for more information. +The following tags are supported: +.P +.B Foreground +.RS +The default foreground color for active items. +.RE +.P +.B Background +.RS +The default background color for active items. +.RE +.RE .RE .B "TASK LIST STYLE" @@ -839,32 +1031,87 @@ .P .B Font .RS -The font used for program names. See the \fBFONTS\fP section for more -information. +The font used for program names. +Inherited from \fBTrayStyle\fP by default. +See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS The foreground color of the task list items. +Inherited from \fBTrayStyle\fP by default. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color of the task list items (gradients are supported). +Inherited from \fBTrayStyle\fP by default. See the \fBCOLORS\fP section for more information. .RE .P -.B ActiveForeground +.P +.B Active .RS -The foreground color of an active item on the task list. See the \fBCOLORS\fP -section for more information. +The colors used for active items in the task list. +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. +.P +.B Foreground +.RS +The foreground color of an active item on the task list. .RE .P -.B ActiveBackground +.B Background .RS The background color of an active item on the task list -(gradients are supported). See the \fBCOLORS\fP section for more information. +(gradients are supported). +.RE +.RE +.RE + +.B "TRAY BUTTON STYLE" +.RS +The \fBTrayButtonStyle\fP tag controls the look of tray buttons. +Within this tag, the following tags are supported. +.P +.B Font +.RS +The font used for tray buttons. +Inherited from \fBTrayStyle\fP by default. +See the \fBFONTS\fP section for more information. +.RE +.P +.B Foreground +.RS +The foreground color for tray buttons. +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. +.RE +.P +.B Background +.RS +The background color for tray buttons (gradients are supported). +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. +.RE +.P +.P +.B Active +.RS +The colors used for pressed tray buttons. +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. +The following tags are supported: +.P +.B Foreground +.RS +The foreground color for pressed tray buttons. +.RE +.B Background +.RS +The background color for pressed tray buttons (gradients are supported). +.RE .RE .RE @@ -875,17 +1122,23 @@ .P .B Font .RS -The font used. See the \fBFONTS\fP section for more information. +The font used for clocks. +Inherited from \fBTrayStyle\fP by default. +See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS -The color of the text. See the \fBCOLORS\fP section for more information. +The color of the text. +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS -The background color. See the \fBCOLORS\fP section for more information. +The background color. +Inherited from \fBTrayStyle\fP by default. +See the \fBCOLORS\fP section for more information. .RE .RE @@ -912,16 +1165,22 @@ \fBCOLORS\fP section for more information. .RE .P -.B ActiveForeground +.P +.B Active .RS -The color of active windows shown in the pager. See the \fBCOLORS\fP section -for more information. +The colors used for active items in the pager. +See the \fBCOLORS\fP section for more information. +The following tags are supported: +.P +.B Foreground +.RS +The color of active windows shown in the pager. .RE .P -.B ActiveBackground +.B Background .RS -The background color of active desktops shown in the pager. See the \fBCOLORS\fP -section for more information. +The background color of active desktops shown in the pager. +.RE .RE .P .B Text @@ -960,21 +1219,34 @@ more information. .RE .P -.B ActiveForeground +.B Outline .RS -The text color of active menu items. +The color of the outline. See the \fBCOLORS\fP section for +more information. +.RE +.P +.P +.B Active +.P +.RS +The colors used for active menu items. See the \fBCOLORS\fP section for more information. +The following tags are supported: +.P +.B Foreground +.RS +The text color of active menu items. .RE .P -.B ActiveBackground +.B Background .RS Text background color of active menu items (gradients are supported). -See the \fBCOLORS\fP section for more information. +.RE .RE .P .B Opacity .RS -The opacity of the window. This is a floating point value between 0.0 and 1.0. +The opacity of menus. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .RE @@ -1031,7 +1303,7 @@ .B COLORS .RS Colors for various parts of JWM are specified within specific tags -(discribed above). Colors may either be hex triplets in RGB format +(described above). Colors may either be hex triplets in RGB format (for example, #FF0000 is red) or by a name recognized by the X server. For components that support gradients, two colors may be specified separated by a colon. @@ -1106,9 +1378,11 @@ .IP \fBleft\fP Move left. Not grabbed. .IP \fBescape\fP -Stop a move/resize or exit a menu. Not grabbed. +Stop a move/resize, exit a menu, or cancel an action. Not grabbed. +.IP \fBfullscreen\fP +Toggle between fullscreen and not fullscreen. Grabbed. .IP \fBselect\fP -Make a menu selection. Not grabbed. +Make a menu selection or confirm an action. Not grabbed. .IP \fBnext\fP Move to the next window in the task list. Grabbed. .IP \fBnextstacked\fP @@ -1123,6 +1397,26 @@ Minimize the active window. Grabbed. .IP \fBmaximize\fP Maximize the active window. Grabbed. +.IP \fBmaxv\fP +Maximize the active window vertically. Grabbed. +.IP \fBmaxh\fP +Maximize the active window horizontally. Grabbed. +.IP \fBmaxtop\fP +Maximize the active window to the top of the screen. Grabbed. +.IP \fBmaxbottom\fP +Maximize the active window to the bottom of the screen. Grabbed. +.IP \fBmaxleft\fP +Maximize the active window to the left of the screen. Grabbed. +.IP \fBmaxright\fP +Maximize the active window to the right of the screen. Grabbed. +.IP \fBsendl\fP +Send the active window left. Grabbed. +.IP \fBsendr\fP +Send the active window right. Grabbed. +.IP \fBsendu\fP +Send the active window up. Grabbed. +.IP \fBsendd\fP +Send the active window down. Grabbed. .IP \fBshade\fP Shade the active window. Grabbed. .IP \fBstick\fP @@ -1165,29 +1459,45 @@ .B "MOUSE BINDINGS" .RS -Any button (other than the scroll wheel) on the root window will bring up -the root menu unless otherwise specified via the \fBonroot\fP attribute of -\fBRootMenu\fP. Scrolling up on the root window switches to the previous -desktop and scrolling down switches to the next desktop. -.RE +Any button other than the scroll wheel (buttons 4 and 5) on the root +window will bring up the root menu unless otherwise specified via the +\fBonroot\fP attribute of \fBRootMenu\fP. Scrolling up on the root window +switches to the left desktop and scrolling down switches to the right desktop. .P +Button 1 (typically the left button): .RS -The right button will show the window menu on the frame. +Over the border, dragging resizes the window. +Over the title bar, dragging moves the window and double clicking toggles +the maximized state. +Over the menu button, clicking shows the menu. +Over the minimize button, clicking minimizes the window. +Over the maximize button, clicking toggles between maximized and normal. +Over the close button, clicking closes the window. .RE .P +Button 2 (typically the middle button): .RS -The left button will resize if on the border or move if in the title bar. +Over the maximize button, clicking toggles between vertically maximized +and normal. +Anywhere else on a window frame, dragging while holding button 2 will +move the window. .RE .P +Button 3 (typically the right button): .RS -The middle button will move anywhere on the frame. +Over the frame, clicking shows the window menu. +On the minimize button, clicking toggles between shaded and unshaded. +On the maximize button, clicking toggles between horizontally maximized +and normal. +On the close button, clicking closes the window. +Over the pager, dragging while holding button 3 will move a window. +.RE .RE .P .RS -A double click on the title bar of a window will toggle the maximized state -of the window. Scrolling up over the title bar will shade the window and -scrolling down will unshade the window. -When a menu is open, the scroll wheel will move through menus. +Scrolling up over the title bar will shade the window and scrolling down +will unshade the window. +When a menu is open, the scroll wheel will move through menu items. When over the pager, the scroll wheel will switch desktops. When over a task list, the scroll wheel will switch windows. .RE @@ -1235,6 +1545,11 @@ .RS A tiled image. Like \fIimage\fP, but the image is tiled instead of stretched. .RE +.B scale +.RS +A scaled image. Like \fIimage\fP, but the aspect ratio of the image is +preserved. +.RE .B command .RS A command to run for setting the background. @@ -1255,6 +1570,26 @@ .RS The following tags may also be supplied: .P +.B ButtonClose +.RS +An icon to display for the close button on client windows instead of the +default. +.RE +.B ButtonMax +.RS +An icon to display for the maximize button on client windows instead of the +default. +.RE +.B ButtonMaxActive +.RS +An icon to display for the maximize button on maximized client windows instead +of the default. +.RE +.B ButtonMin +.RS +An icon to display for the minimize button on client windows instead +of the default. +.RE .B DoubleClickDelta .RS The number of pixels the mouse can move during a double click. @@ -1276,29 +1611,19 @@ .B MoveMode .RS The move mode. The default is "opaque". Valid values are -"opaque" and "outline". The optional \fBcoordinates\fP attribute -determines the location of the move status window. Possible values are: -.RS -.P -.B off -.RS -Disable the status window. -.RE -.P -.B corner -.RS -Place the status window in the corner of the screen. -.RE +"opaque" and "outline". +This tag supports the following attributes: .P -.B window +\fBcoordinates\fP { \fBoff\fP | \fBcorner\fP | \fBwindow\fP | \fBscreen\fP } .RS -Center the status window on the window being moved. +The location of the status window. The default is \fBscreen\fP. .RE .P -.B screen +\fBdelay\fP \fIint\fP .RS -Center the status window on the screen. -.RE +The delay in milliseconds before moving a window to a different desktop. +Setting this to 0 disables dragging windows between desktops. +The default is 1000. .RE .RE .P @@ -1307,27 +1632,11 @@ The resize mode. The default is "opaque". Valid values are "opaque" and "outline". The optional \fBcoordinates\fP attribute determines the location of the move status window. Possible values are: -.RS -.P -.B off -.RS -Disable the status window. -.RE -.P -.B corner -.RS -Place the status window in the corner of the screen. -.RE -.P -.B window -.RS -Center the status window on the window being resized. -.RE +This tag supports the following attribute: .P -.B screen +\fBcoordinates\fP { \fBoff\fP | \fBcorner\fP | \fBwindow\fP | \fBscreen\fP } .RS -Center the status window on the screen. -.RE +The location of the status window. The default is \fBscreen\fP. .RE .RE .P @@ -1355,26 +1664,6 @@ .RS A command to run when JWM restarts. .RE -.P -.B ButtonClose -.RS -Path to a bitmask for the close button on windows. -.RE -.P -.B ButtonMax -.RS -Path to a bitmask for the maximize button on inactive windows. -.RE -.P -.B ButtonMaxActive -.RS -Path to a bitmask for the maximize button on active windows. -.RE -.P -.B ButtonMin -.RS -Path to a bitmask for the minimize button on windows. -.RE .RE .P diff -Nru jwm-2.1.0+svn579/Makefile.in jwm-2.3.1+0~16~ubuntu14.10.1/Makefile.in --- jwm-2.1.0+svn579/Makefile.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/Makefile.in 2015-07-18 20:02:18.000000000 +0000 @@ -16,17 +16,28 @@ install -d -m 0755 $(MANDIR)/man1 install -m 644 jwm.1 $(MANDIR)/man1/jwm.1 -depend: - cd src ; $(MAKE) depend +install-strip: all install-conf + cd src ; $(MAKE) install-strip ; cd .. + cd po ; $(MAKE) install-strip ; cd .. + install -d -m 0755 $(SYSCONF) + install -m 644 example.jwmrc $(SYSCONF)/system.jwmrc + install -d -m 0755 $(MANDIR)/man1 + install -m 644 jwm.1 $(MANDIR)/man1/jwm.1 + +uninstall: + cd src ; $(MAKE) uninstall ; cd .. + cd po ; $(MAKE) uninstall ; cd .. + rm -f $(SYSCONF)/system.jwmrc + rm -f $(MANDIR)/man1/jwm.1 tarball: - rm -f ../jwm-$(VERSION).tar.bz2 ; + rm -f ../jwm-$(VERSION).tar.xz ; rm -fr ../jwm-$(VERSION) ; cp -r ../jwm ../jwm-$(VERSION) ; (cd ../jwm-$(VERSION) && $(MAKE) distclean) ; (cd .. && tar -cf jwm-$(VERSION).tar jwm-$(VERSION)); rm -fr ../jwm-$(VERSION) ; - (cd .. && bzip2 jwm-$(VERSION).tar) + (cd .. && xz jwm-$(VERSION).tar) clean: (cd src && $(MAKE) clean) @@ -35,10 +46,10 @@ distclean: clean rm -f *[~#] config.cache config.log config.status config.h - rm -f Makefile src/Makefile jwm.tardist jwm.1 + rm -f Makefile src/Makefile jwm.1 rm -fr autom4te.cache rm -f Makefile.bak src/Makefile.bak - rm -fr `find . \( -name .svn -o -name .gdb_history \) -print` ; + rm -fr .git .gitignore check-gettext: @if test x$(USE_NLS) != "xyes" ; then \ @@ -69,4 +80,3 @@ cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo .PHONY: check-gettext update-po update-gmo force-update-gmo - diff -Nru jwm-2.1.0+svn579/po/de.po jwm-2.3.1+0~16~ubuntu14.10.1/po/de.po --- jwm-2.1.0+svn579/po/de.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/de.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,353 @@ +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.1.1\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2013-03-11 14:25+0100\n" +"Last-Translator: fido \n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "ungültige Einstellung %s" + +#: src/action.c:181 +#, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "kein Wert für Hintergrund spezifiziert" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "ungültiger Typ für Hintergrund: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "Hintergrundbild nicht gefunden: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Dieses Fenster töten?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Das kann Datenverlust verursachen!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "Ausführung fehlgeschlagen: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "konnte Schrift nicht laden: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "konnte Standard-Schrift nicht laden: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "ungültige Gruppenklasse" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "ungültiger Gruppenname" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "ungültiger Gruppen-Desktop: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "ungültiger Modifizierer: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "ungültiges Tastensymbol: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "" + +#: src/key.c:481 +#, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "ungültige Einstellung %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "ungültige Opazität: \"%s\"" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "ungültiger tag in %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "Konfigurationsfehler" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "ungültiges root Menü spezifiziert: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "JWM beenden" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Sicher?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Schließen" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Minimieren" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Wiedereinlesen" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Senden an" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "ungültige Leistenbreite: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "ungültige Leistenhöhe: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "ungültiges Leistenlayout: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "ungültige Horizontalausrichtung für Leiste: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "ungültige Vertikalausrichtung für Leiste: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "konnte Leistensymbol nicht laden: %s" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Töten" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Größe ändern" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Verschieben" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Entschattieren" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Schattieren" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Maximieren-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Maximieren-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Maximieren" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Abkleben" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Ankleben" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Ebene" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Darüber]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Darüber" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normal]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normal" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Darunter]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Darunter" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "ungültiger EInfügungsmodus: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "ungültige Ebene %s" diff -Nru jwm-2.1.0+svn579/po/es.po jwm-2.3.1+0~16~ubuntu14.10.1/po/es.po --- jwm-2.1.0+svn579/po/es.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/es.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,370 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.2.0\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2014-08-13 03:07-0400\n" +"Last-Translator: PAblo Roberto Francisco Lezaeta Reyes \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.5\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "acción no válida para Botón de Bandeja: «%s»" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "botón de bandeja: menú root %d no definido" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "no hay valor especificado para fondo de pantalla" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "tipo de fondo de pantalla no válido: «%s»" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "imagen de fondo de pantalla no encontrada: «%s»" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "¿Finalizar esta ventana?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "¡Esto puede causar pérdida de datos!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "Ha fallado «exec»: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "OK" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "Cancelar" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "Confirmar" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "etiqueta Nombre de Escritorio vacía" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "solo se permite un Dock" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "no se pudo adquirir selección de bandeja de sistema" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "no se pudo cargar el tipo de letra: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "no se pudo cargar el tipo de letra por omición: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "etiqueta de Tipo de letra vacía" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "clase de grupo no válida" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "nombre de grupo no válido" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "escritorio de grupo no válido: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "no se pudo crear estructura de lectura para imagen PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "error leyendo imagen PNG: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "no se pudo crear estruct. de infor. para imagen PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "" +"El símbolo de tecla especificado no está definido para cualquier código de " +"tecla" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "modificador no encontrado para el símbolo de tecla 0x%0x" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "modificador no válido: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "símbolo de tecla no válido: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "ni tecla ni código especificados para Tecla" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "atajo de teclado: menú raíz %d no definido" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "" +"%s[%u]: etiqueta de cierre «%s» no coincide con etiqueta de apertura «%s»" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: etiqueta de cierre inesperada y no válida" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: etiqueta de cierre \"%s\" sin etiqueta de apertura" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: etiqueta de cierre no válida" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: etiqueta de apertura no válida" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: etiqueta no válida" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: texto inesperado: «%s»" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: entidad no válida: «%.8s»" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "Sin memoria" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "ajuste no válido: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "opacidad no válida: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "etiqueta no válida en %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "error de configuración" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "menú root especificado no válido: «%c»" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Salir de JWM" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "¿Está seguro?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "no se puede mostrar un cliente sin nombre" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Cerrar" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Minimizar" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Restaurar" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Enviar A" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "ancho máx. no válido para Lista de Tareas: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "ancho de bandeja no válido: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "alto de bandeja no válido: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "forma no válida para bandeja: «%s»" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "alineación horizontal no válida para bandeja: «%s»" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "alineación vertical no válida para bandeja: «%s»" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "no se pudo cargar el icono de bandeja: «%s»" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "no hay icono o etiqueta para el Botón de Bandeja" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Finalizar" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Redimensionar" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Mover" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Desenrollar" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Enrollar" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Maximizar-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Maximizar-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Maximizar" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Despegar" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Pegar" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Capa" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Arriba]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Arriba" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normal]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normal" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Abajo]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Abajo" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "modo de insertar no válido: «%s»" + +#~ msgid "invalid layer: %s" +#~ msgstr "capa no válida: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "tipo de ventana de estado no válido: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "no se puede mostrar el mismo cliente varias veces" + +#~ msgid "Fullscreen state will be shaped!" +#~ msgstr "¡Se definirá el estado de Pantalla Completa!" diff -Nru jwm-2.1.0+svn579/po/fr.po jwm-2.3.1+0~16~ubuntu14.10.1/po/fr.po --- jwm-2.1.0+svn579/po/fr.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/fr.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,362 @@ +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.1.1\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2014-11-06 10:23+0100\n" +"Last-Translator: FR_PUPPY_LINUX \n" +"Language-Team: FR_PUPPY_LINUX \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-Language: French\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "action de bouton de barre incorrect: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "Bouton de barre: menu racine %d non défini" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "Pas de valeur spécifiée pour l'arrière-plan" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "type d'arrière-plan incorrect: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "Image d'arrière-plan introuvable: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Éliminer la fenêtre?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Cela peut entraîner la perte de données!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "Échec de l'exécution: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "Valider" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "Annuler" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "Confirmer" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "Balise de noms de bureaux vide" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "Un seul Dock autorisé" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "Impossible d'obtenir la sélection de la barre système" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "Impossible de charger la police de caractères: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "Impossible de charger la police de caractères par défaut: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "Balise de police de caractères vide" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "classe de groupe incorrecte" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "nom de groupe incorrect" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "bureau de groupe incorrect: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "Impossible de créer une structure de lecture pour l'image PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "Erreur de lecture de l'image PNG: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "Impossible de créer les informations de structure pour l'image PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "Le symbole de touche spécifié n'est défini pour aucun code de touche" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "modificateur pour le symbole de touche 0x%0x introuvable" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "modificateur incorrect: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "symbole de touche incorrect: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "ni touche ni code de touche spécifié pour la touche" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "Raccourci-clavier: menu racine %d non défini" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "" +"%s[%u]: la balise de fermeture \"%s\" ne coïncide pas avec la balise " +"d'ouverture \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: balise de fermeture inattendue et incorrecte" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: balise de fermeture \"%s\" sans balise d'ouverture" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: balise de fermeture incorrecte" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: balise d'ouverture incorrecte" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: balise incorrecte" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: texte inattendu: \"%s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: entité incorrecte: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "Mémoire insuffisante" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "paramètre incorrect: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "opacité incorrecte: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "Balise incorrecte dans %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "erreur de configuration" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "menu racine spécifié incorrect: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Quitter JWM" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "En êtes-vous certain?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "Impossible d'afficher un client sans nom" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Fermer" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Réduire" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Restaurer" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Envoyer vers" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "largeur maximale de la liste des tâches incorrecte: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "Largeur de barre incorrecte: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "Hauteur de barre incorrecte: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "Disposition de barre incorrecte: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "alignement horizontal de la barre incorrect: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "alignement vertical de la barre incorrect: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "Impossible de charger l'icône de la barre: \"%s\"" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "aucune icône ou étiquette pour le bouton de barre" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Éliminer" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Redimensionner" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Déplacer" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Déplier" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Replier" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Maximiser-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Maximiser-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Maximiser" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Décoller" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Coller" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Plan" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Avant]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Avant" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normal]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normal" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Arrière]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Arrière" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "Mode d'insertion incorrect: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "disposition incorrecte: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "Statut du type de fenêtre incorrect: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "Impossible d'afficher le même client plusieurs fois" diff -Nru jwm-2.1.0+svn579/po/it.po jwm-2.3.1+0~16~ubuntu14.10.1/po/it.po --- jwm-2.1.0+svn579/po/it.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/it.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,365 @@ +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.2.0\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: Tue Jul 08 2014 15:18:16 GMT+0200\n" +"Last-Translator: Man from Mars \n" +"Language-Team: Italiano \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Loco-Source-Locale: it_IT\n" +"X-Generator: Loco - https://localise.biz/\n" +"X-Loco-Parser: loco_parse_po\n" +"X-Loco-Target-Locale: it_IT\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "Azione del TrayButton non valida: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "Tray button: root menu %d non definito" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "Nessun valore specificato per lo sfondo" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "Formato di sfondo non valido: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "Immagine di sfondo non trovata: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Chiudere questa finestra?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Questo può causare una perdita di dati!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "Esecuzione fallita: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "Ok" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "Annulla" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "Conferma" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "Etichetta Nome dei desktop vuoti" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "Permesso un solo Dock" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "Impossibile acquisire la selezione del vassoio di sistema" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "Impossibile caricare font: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "Impossibile caricare il font predefinito: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "Etichetta Font vuota" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "Classe di gruppo non valida" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "Nome di gruppo non valido" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "Desktop del gruppo non valido: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "Impossibile creare struttura di read per immagine PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "Errore durante la lettura dell'immagine PNG: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "Impossibile creare struttura di info per immagine PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "Il KeySym specificato non è definito per alcun KeyCode" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "Modificatore non trovato per il KeySym 0x%0x" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "Modificatore non valido: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "Key symbol non valido: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "Tasto o keycode non specificati per Key" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "Combinazione di tasti: root menu %d non definito" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "" +"%s[%u]: tag di chiusura \"%s\" non corrisponde al tag di apertura \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: tag di chiusura inatteso e non valido" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: tag di chiusura \"%s\" senza tag di apertura" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: tag di chiusura non valido" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: tag di apertura non valido" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: tag non valido" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: testo non atteso: \"%s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: entità non valida: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "Memoria esaurita" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "Impostazione non valida: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "Opacità non valida: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "Tag non valido in %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "Errore di configurazione" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "Root menu specificato non valido: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Termina JWM" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Sei sicuro?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "Impossibile includere un client senza nome" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Chiudi" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Riduci" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Ripristina" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Manda A" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "Larghezza massima per TaskList non valida: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "Larghezza del vassoio non valida: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "Altezza del vassoio non valida: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "Disposizione del vassoio non valida: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "Allineamento orizzontale del vassoio non valido: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "Allineamento verticale del vassoio non valido: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "Impossibile caricare icona del vassoio: \"%s" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "Nessuna icona o etichetta per il TrayButton" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Termina" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Ridimensiona" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Sposta" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Srotola" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Arrotola" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Ingrandisci-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Ingrandisci-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Ingrandisci" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Sgancia" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Aggancia" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Layer" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Sopra]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Sopra" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normale]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normale" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Sotto]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Sotto" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "Modo di inserimento non valido: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "Layer non valido: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "Tipo di status della finestra non valido: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "Impossibile includere più volte lo stesso client" diff -Nru jwm-2.1.0+svn579/po/jwm.pot jwm-2.3.1+0~16~ubuntu14.10.1/po/jwm.pot --- jwm-2.1.0+svn579/po/jwm.pot 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/jwm.pot 2015-07-18 20:02:18.000000000 +0000 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: jwm 2.1.1\n" +"Project-Id-Version: jwm 2.3.1\n" "Report-Msgid-Bugs-To: joewing@joewing.net\n" -"POT-Creation-Date: 2011-12-22 18:24-0600\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,432 +17,336 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/background.c:136 -msgid "no value specified for background" -msgstr "" - -#: src/background.c:152 -#, c-format -msgid "invalid background type: \"%s\"" -msgstr "" - -#: src/background.c:301 +#: src/action.c:43 #, c-format -msgid "background image not found: \"%s\"" +msgid "invalid action: \"%s\"" msgstr "" -#: src/border.c:82 +#: src/action.c:181 #, c-format -msgid "bitmap could not be loaded: %s" +msgid "action: root menu \"%s\" not defined" msgstr "" -#: src/border.c:654 -#, c-format -msgid "invalid border width specified: %d" +#: src/background.c:143 +msgid "no value specified for background" msgstr "" -#: src/border.c:673 +#: src/background.c:155 #, c-format -msgid "invalid title height specified: %d" +msgid "invalid background type: \"%s\"" msgstr "" -#: src/client.c:490 +#: src/background.c:299 #, c-format -msgid "Client %s requested an invalid layer: %d" +msgid "background image not found: \"%s\"" msgstr "" -#: src/client.c:914 +#: src/client.c:893 msgid "Kill this window?" msgstr "" -#: src/client.c:915 +#: src/client.c:894 msgid "This may cause data to be lost!" msgstr "" -#: src/client.c:1487 -#, c-format -msgid "invalid active client opacity: %s" -msgstr "" - -#: src/client.c:1514 src/client.c:1527 -#, c-format -msgid "invalid inactive client opacity: %s" -msgstr "" - -#: src/client.c:1537 -#, c-format -msgid "invalid inactive client opacity delta: %s" -msgstr "" - -#: src/command.c:146 src/main.c:198 +#: src/command.c:137 src/main.c:214 #, c-format msgid "exec failed: (%s) %s" msgstr "" -#: src/cursor.c:271 -#, c-format -msgid "invalid DoubleClickSpeed: %d" +#: src/confirm.c:68 +msgid "OK" msgstr "" -#: src/cursor.c:289 -#, c-format -msgid "invalid DoubleClickDelta: %d" +#: src/confirm.c:73 +msgid "Cancel" msgstr "" -#: src/desktop.c:269 -msgid "invalid desktop count" +#: src/confirm.c:307 +msgid "Confirm" msgstr "" -#: src/desktop.c:283 +#: src/desktop.c:338 msgid "empty Desktops Name tag" msgstr "" -#: src/dock.c:149 +#: src/dock.c:151 msgid "only one Dock allowed" msgstr "" -#: src/dock.c:226 +#: src/dock.c:230 msgid "could not acquire system tray selection" msgstr "" -#: src/event.c:831 -msgid "Fullscreen state will be shaped!" -msgstr "" - -#: src/font.c:72 src/font.c:89 +#: src/font.c:104 src/font.c:121 #, c-format msgid "could not load font: %s" msgstr "" -#: src/font.c:79 src/font.c:96 +#: src/font.c:111 src/font.c:128 #, c-format msgid "could not load the default font: %s" msgstr "" -#: src/font.c:187 +#: src/font.c:310 msgid "empty Font tag" msgstr "" -#: src/group.c:133 +#: src/group.c:112 msgid "invalid group class" msgstr "" -#: src/group.c:146 +#: src/group.c:123 msgid "invalid group name" msgstr "" -#: src/group.c:271 -#, c-format -msgid "invalid group layer: %s" -msgstr "" - -#: src/group.c:279 -#, c-format -msgid "invalid group desktop: %s" -msgstr "" - -#: src/group.c:304 +#: src/group.c:254 #, c-format -msgid "invalid group opacity: %s" +msgid "invalid group desktop: %d" msgstr "" -#: src/image.c:161 +#: src/image.c:222 #, c-format msgid "could not create read struct for PNG image: %s" msgstr "" -#: src/image.c:179 +#: src/image.c:235 #, c-format msgid "error reading PNG image: %s" msgstr "" -#: src/image.c:186 +#: src/image.c:243 #, c-format msgid "could not create info struct for PNG image: %s" msgstr "" -#: src/key.c:322 +#: src/key.c:332 msgid "Specified KeySym is not defined for any KeyCode" msgstr "" -#: src/key.c:330 +#: src/key.c:340 #, c-format msgid "modifier not found for keysym 0x%0x" msgstr "" -#: src/key.c:360 +#: src/key.c:370 #, c-format msgid "invalid modifier: \"%c\"" msgstr "" -#: src/key.c:376 +#: src/key.c:385 #, c-format msgid "invalid key symbol: \"%s\"" msgstr "" -#: src/key.c:457 +#: src/key.c:466 msgid "neither key nor keycode specified for Key" msgstr "" -#: src/key.c:474 +#: src/key.c:481 #, c-format -msgid "key binding: root menu %d not defined" +msgid "key binding: root menu \"%s\" not defined" msgstr "" -#: src/lex.c:183 +#: src/lex.c:199 #, c-format -msgid "%s[%d]: close tag \"%s\" does not match open tag \"%s\"" +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" msgstr "" -#: src/lex.c:190 +#: src/lex.c:205 #, c-format -msgid "%s[%d]: unexpected and invalid close tag" +msgid "%s[%u]: unexpected and invalid close tag" msgstr "" -#: src/lex.c:197 +#: src/lex.c:211 #, c-format -msgid "%s[%d]: close tag \"%s\" without open tag" +msgid "%s[%u]: close tag \"%s\" without open tag" msgstr "" -#: src/lex.c:200 +#: src/lex.c:214 #, c-format -msgid "%s[%d]: invalid close tag" +msgid "%s[%u]: invalid close tag" msgstr "" -#: src/lex.c:219 +#: src/lex.c:232 #, c-format -msgid "%s[%d]: invalid open tag" +msgid "%s[%u]: invalid open tag" msgstr "" -#: src/lex.c:232 +#: src/lex.c:248 #, c-format -msgid "%s[%d]: invalid tag" +msgid "%s[%u]: invalid tag" msgstr "" -#: src/lex.c:279 +#: src/lex.c:303 #, c-format -msgid "%s[%d]: unexpected text: \"%s\"" +msgid "%s[%u]: unexpected text: \"%s\"" msgstr "" -#: src/lex.c:325 +#: src/lex.c:351 #, c-format msgid "%s[%d]: invalid entity: \"%.8s\"" msgstr "" -#: src/menu.c:851 +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "" + +#: src/parse.c:1889 #, c-format -msgid "invalid menu opacity: %s" +msgid "invalid setting: %s" msgstr "" -#: src/move.c:83 +#: src/parse.c:1901 #, c-format -msgid "invalid snap distance specified: %d" +msgid "invalid opacity: %s" msgstr "" -#: src/parse.c:1738 +#: src/parse.c:1943 #, c-format msgid "invalid tag in %s: %s" msgstr "" -#: src/parse.c:1758 +#: src/parse.c:1963 msgid "configuration error" msgstr "" -#: src/popup.c:183 -#, c-format -msgid "invalid popup delay specified: %s" -msgstr "" - -#: src/root.c:104 +#: src/root.c:131 #, c-format msgid "invalid root menu specified: \"%c\"" msgstr "" -#: src/root.c:225 +#: src/root.c:213 msgid "Exit JWM" msgstr "" -#: src/root.c:226 +#: src/root.c:214 msgid "Are you sure?" msgstr "" -#: src/status.c:227 -#, c-format -msgid "invalid MoveMode coordinates: \"%s\"" -msgstr "" - -#: src/status.c:242 -#, c-format -msgid "invalid ResizeMode coordinates: \"%s\"" -msgstr "" - -#: src/swallow.c:93 +#: src/swallow.c:85 msgid "cannot swallow a client with no name" msgstr "" -#: src/swallow.c:100 -msgid "cannot swallow the same client multiple times" -msgstr "" - -#: src/taskbar.c:766 -#, c-format -msgid "invalid maxwidth for TaskList: %s" -msgstr "" - -#: src/taskbar.c:788 -#, c-format -msgid "invalid insert mode: \"%s\"" -msgstr "" - -#: src/traybutton.c:91 -#, c-format -msgid "could not load tray icon: \"%s\"" -msgstr "" - -#: src/traybutton.c:140 -msgid "no icon or label for TrayButton" +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" msgstr "" -#: src/traybutton.c:145 -#, c-format -msgid "invalid TrayButton width: %d" +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" msgstr "" -#: src/traybutton.c:149 -#, c-format -msgid "invalid TrayButton height: %d" +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" msgstr "" -#: src/traybutton.c:254 -#, c-format -msgid "invalid TrayButton action: \"%s\"" +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" msgstr "" -#: src/traybutton.c:465 +#: src/taskbar.c:845 #, c-format -msgid "tray button: root menu %d not defined" +msgid "invalid maxwidth for TaskList: %s" msgstr "" -#: src/tray.c:1036 +#: src/tray.c:1073 #, c-format msgid "invalid tray width: %d" msgstr "" -#: src/tray.c:1054 +#: src/tray.c:1092 #, c-format msgid "invalid tray height: %d" msgstr "" -#: src/tray.c:1082 +#: src/tray.c:1121 #, c-format msgid "invalid tray layout: \"%s\"" msgstr "" -#: src/tray.c:1108 -#, c-format -msgid "invalid tray layer: %d" -msgstr "" - -#: src/tray.c:1126 -#, c-format -msgid "invalid tray border: %d" -msgstr "" - -#: src/tray.c:1148 +#: src/tray.c:1160 #, c-format msgid "invalid tray horizontal alignment: \"%s\"" msgstr "" -#: src/tray.c:1168 +#: src/tray.c:1183 #, c-format msgid "invalid tray vertical alignment: \"%s\"" msgstr "" -#: src/tray.c:1183 +#: src/traybutton.c:89 #, c-format -msgid "invalid tray opacity: %s" +msgid "could not load tray icon: \"%s\"" msgstr "" -#: src/winmenu.c:76 -msgid "Close" +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" msgstr "" -#: src/winmenu.c:77 +#: src/winmenu.c:52 msgid "Kill" msgstr "" -#: src/winmenu.c:83 +#: src/winmenu.c:60 msgid "Resize" msgstr "" -#: src/winmenu.c:86 +#: src/winmenu.c:63 msgid "Move" msgstr "" -#: src/winmenu.c:93 src/winmenu.c:117 -msgid "Restore" -msgstr "" - -#: src/winmenu.c:96 +#: src/winmenu.c:76 msgid "Unshade" msgstr "" -#: src/winmenu.c:98 +#: src/winmenu.c:78 msgid "Shade" msgstr "" -#: src/winmenu.c:100 -msgid "Minimize" -msgstr "" - -#: src/winmenu.c:109 +#: src/winmenu.c:83 msgid "Maximize-y" msgstr "" -#: src/winmenu.c:113 +#: src/winmenu.c:86 msgid "Maximize-x" msgstr "" -#: src/winmenu.c:119 +#: src/winmenu.c:91 msgid "Maximize" msgstr "" -#: src/winmenu.c:127 +#: src/winmenu.c:100 msgid "Unstick" msgstr "" -#: src/winmenu.c:129 +#: src/winmenu.c:102 msgid "Stick" msgstr "" -#: src/winmenu.c:153 +#: src/winmenu.c:127 msgid "Layer" msgstr "" -#: src/winmenu.c:168 -msgid "[Top]" +#: src/winmenu.c:139 +msgid "[Above]" msgstr "" -#: src/winmenu.c:170 -msgid "Top" +#: src/winmenu.c:141 +msgid "Above" msgstr "" -#: src/winmenu.c:177 +#: src/winmenu.c:144 msgid "[Normal]" msgstr "" -#: src/winmenu.c:179 +#: src/winmenu.c:146 msgid "Normal" msgstr "" -#: src/winmenu.c:200 -msgid "[Bottom]" +#: src/winmenu.c:149 +msgid "[Below]" msgstr "" -#: src/winmenu.c:202 -msgid "Bottom" -msgstr "" - -#: src/winmenu.c:221 -msgid "Send To" +#: src/winmenu.c:151 +msgid "Below" msgstr "" diff -Nru jwm-2.1.0+svn579/po/LINGUAS jwm-2.3.1+0~16~ubuntu14.10.1/po/LINGUAS --- jwm-2.1.0+svn579/po/LINGUAS 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/LINGUAS 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,8 @@ +de +es +fr +it +nl +pl +pt-PT +ru diff -Nru jwm-2.1.0+svn579/po/Makefile jwm-2.3.1+0~16~ubuntu14.10.1/po/Makefile --- jwm-2.1.0+svn579/po/Makefile 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,578 +0,0 @@ -# Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper -# -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU General Public -# License but which still want to provide support for the GNU gettext -# functionality. -# Please note that the actual code of GNU gettext is covered by the GNU -# General Public License and is *not* in the public domain. -# -# Origin: gettext-0.18 -GETTEXT_MACRO_VERSION = 0.18 - -PACKAGE = jwm -VERSION = svn-579 -PACKAGE_BUGREPORT = joewing@joewing.net - -SHELL = /bin/sh - - -srcdir = . -top_srcdir = .. - - -prefix = /usr/local -exec_prefix = /usr/local -datarootdir = ${prefix}/share -datadir = ${datarootdir} -localedir = /usr/local/share/locale -gettextsrcdir = $(datadir)/gettext/po - -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 - -# We use $(mkdir_p). -# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as -# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, -# @install_sh@ does not start with $(SHELL), so we add it. -# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined -# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake -# versions, $(mkinstalldirs) and $(install_sh) are unused. -mkinstalldirs = $(SHELL) /usr/bin/install -c -d -install_sh = $(SHELL) /usr/bin/install -c -MKDIR_P = @MKDIR_P@ -mkdir_p = @MKDIR_P@ - -GMSGFMT_ = : -GMSGFMT_no = : -GMSGFMT_yes = : -GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) -MSGFMT_ = : -MSGFMT_no = : -MSGFMT_yes = : -MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) -XGETTEXT_ = : -XGETTEXT_no = : -XGETTEXT_yes = : -XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) -MSGMERGE = msgmerge -MSGMERGE_UPDATE = : --update -MSGINIT = msginit -MSGCONV = msgconv -MSGFILTER = msgfilter - -POFILES = -GMOFILES = -UPDATEPOFILES = -DUMMYPOFILES = -DISTFILES.common = Makefile.in.in remove-potcdate.sin \ -$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ -$(POFILES) $(GMOFILES) \ -$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) - -POTFILES = \ - ../src/background.c \ - ../src/border.c \ - ../src/button.c \ - ../src/client.c \ - ../src/clientlist.c \ - ../src/clock.c \ - ../src/color.c \ - ../src/command.c \ - ../src/confirm.c \ - ../src/cursor.c \ - ../src/debug.c \ - ../src/desktop.c \ - ../src/dock.c \ - ../src/error.c \ - ../src/event.c \ - ../src/font.c \ - ../src/gradient.c \ - ../src/group.c \ - ../src/help.c \ - ../src/hint.c \ - ../src/icon.c \ - ../src/image.c \ - ../src/key.c \ - ../src/lex.c \ - ../src/main.c \ - ../src/match.c \ - ../src/menu.c \ - ../src/misc.c \ - ../src/move.c \ - ../src/outline.c \ - ../src/pager.c \ - ../src/parse.c \ - ../src/place.c \ - ../src/popup.c \ - ../src/render.c \ - ../src/resize.c \ - ../src/root.c \ - ../src/screen.c \ - ../src/spacer.c \ - ../src/status.c \ - ../src/swallow.c \ - ../src/taskbar.c \ - ../src/timing.c \ - ../src/traybutton.c \ - ../src/tray.c \ - ../src/winmenu.c - -CATALOGS = - -# Makevars gets inserted here. (Don't remove this line!) -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = jwm - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = Free Software Foundation, Inc. - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = joewing@joewing.net - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = - -.SUFFIXES: -.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update - -.po.mo: - @echo "$(MSGFMT) -c -o $@ $<"; \ - $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ - -.po.gmo: - @lang=`echo $* | sed -e 's,.*/,,'`; \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ - cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo - -.sin.sed: - sed -e '/^#/d' $< > t-$@ - mv t-$@ $@ - - -all: check-macro-version all-no - -all-yes: stamp-po -all-no: - -# Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "0.18" \ - || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.18" 1>&2; \ - exit 1; \ - } - -# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no -# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because -# we don't want to bother translators with empty POT files). We assume that -# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. -# In this case, stamp-po is a nop (i.e. a phony target). - -# stamp-po is a timestamp denoting the last time at which the CATALOGS have -# been loosely updated. Its purpose is that when a developer or translator -# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, -# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent -# invocations of "make" will do nothing. This timestamp would not be necessary -# if updating the $(CATALOGS) would always touch them; however, the rule for -# $(POFILES) has been designed to not touch files that don't need to be -# changed. -stamp-po: $(srcdir)/$(DOMAIN).pot - test ! -f $(srcdir)/$(DOMAIN).pot || \ - test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) - @test ! -f $(srcdir)/$(DOMAIN).pot || { \ - echo "touch stamp-po" && \ - echo timestamp > stamp-poT && \ - mv stamp-poT stamp-po; \ - } - -# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', -# otherwise packages like GCC can not be built if only parts of the source -# have been downloaded. - -# This target rebuilds $(DOMAIN).pot; it is an expensive operation. -# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. -$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU jwm' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ - package_gnu='GNU '; \ - else \ - package_gnu=''; \ - fi; \ - if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ - msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ - else \ - msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ - fi; \ - case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address="$$msgid_bugs_address" \ - ;; \ - *) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$${package_gnu}jwm" \ - --package-version='svn-579' \ - --msgid-bugs-address="$$msgid_bugs_address" \ - ;; \ - esac - test ! -f $(DOMAIN).po || { \ - if test -f $(srcdir)/$(DOMAIN).pot; then \ - sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ - sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ - if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ - rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ - else \ - rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ - mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ - fi; \ - else \ - mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ - fi; \ - } - -# This rule has no dependencies: we don't need to update $(DOMAIN).pot at -# every "make" invocation, only create it when it is missing. -# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. -$(srcdir)/$(DOMAIN).pot: - $(MAKE) $(DOMAIN).pot-update - -# This target rebuilds a PO file if $(DOMAIN).pot has changed. -# Note that a PO file is not touched if it doesn't need to be changed. -$(POFILES): $(srcdir)/$(DOMAIN).pot - @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ - if test -f "$(srcdir)/$${lang}.po"; then \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ - cd $(srcdir) \ - && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ - *) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ - esac; \ - }; \ - else \ - $(MAKE) $${lang}.po-create; \ - fi - - -install: install-exec install-data -install-exec: -install-data: install-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common) Makevars.template; do \ - $(INSTALL_DATA) $(srcdir)/$$file \ - $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - for file in Makevars; do \ - rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - else \ - : ; \ - fi -install-data-no: all -install-data-yes: all - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $(DESTDIR)$$dir; \ - if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ - $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ - echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ - for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ - if test -n "$$lc"; then \ - if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ - link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ - mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ - for file in *; do \ - if test -f $$file; then \ - ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ - fi; \ - done); \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - else \ - if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ - :; \ - else \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - fi; \ - fi; \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ - ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ - cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ - fi; \ - done; \ - done - -install-strip: install - -installdirs: installdirs-exec installdirs-data -installdirs-exec: -installdirs-data: installdirs-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ - else \ - : ; \ - fi -installdirs-data-no: -installdirs-data-yes: - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $(DESTDIR)$$dir; \ - for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ - if test -n "$$lc"; then \ - if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ - link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ - mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ - for file in *; do \ - if test -f $$file; then \ - ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ - fi; \ - done); \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - else \ - if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ - :; \ - else \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - fi; \ - fi; \ - fi; \ - done; \ - done - -# Define this as empty until I found a useful application. -installcheck: - -uninstall: uninstall-exec uninstall-data -uninstall-exec: -uninstall-data: uninstall-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - for file in $(DISTFILES.common) Makevars.template; do \ - rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - else \ - : ; \ - fi -uninstall-data-no: -uninstall-data-yes: - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - done; \ - done - -check: all - -info dvi ps pdf html tags TAGS ctags CTAGS ID: - -mostlyclean: - rm -f remove-potcdate.sed - rm -f stamp-poT - rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po - rm -fr *.o - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f stamp-po $(GMOFILES) - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: - $(MAKE) update-po - @$(MAKE) dist2 -# This is a separate target because 'update-po' must be executed before. -dist2: stamp-po $(DISTFILES) - dists="$(DISTFILES)"; \ - if test "$(PACKAGE)" = "gettext-tools"; then \ - dists="$$dists Makevars.template"; \ - fi; \ - if test -f $(srcdir)/$(DOMAIN).pot; then \ - dists="$$dists $(DOMAIN).pot stamp-po"; \ - fi; \ - if test -f $(srcdir)/ChangeLog; then \ - dists="$$dists ChangeLog"; \ - fi; \ - for i in 0 1 2 3 4 5 6 7 8 9; do \ - if test -f $(srcdir)/ChangeLog.$$i; then \ - dists="$$dists ChangeLog.$$i"; \ - fi; \ - done; \ - if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ - for file in $$dists; do \ - if test -f $$file; then \ - cp -p $$file $(distdir) || exit 1; \ - else \ - cp -p $(srcdir)/$$file $(distdir) || exit 1; \ - fi; \ - done - -update-po: Makefile - $(MAKE) $(DOMAIN).pot-update - test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) - $(MAKE) update-gmo - -# General rule for creating PO files. - -.nop.po-create: - @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ - echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ - exit 1 - -# General rule for updating PO files. - -.nop.po-update: - @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ - tmpdir=`pwd`; \ - echo "$$lang:"; \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ - cd $(srcdir); \ - if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ - *) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ - esac; \ - }; then \ - if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "msgmerge for $$lang.po failed!" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - fi - -$(DUMMYPOFILES): - -update-gmo: Makefile $(GMOFILES) - @: - -# Recreate Makefile by invoking config.status. Explicitly invoke the shell, -# because execution permission bits may not work on the current file system. -# Use /bin/sh, which is the shell determined by autoconf for the use by its -# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. -Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS - cd $(top_builddir) \ - && /bin/sh ./config.status $(subdir)/$@.in po-directories - -force: - -# Tell versions [3.59,3.63) of GNU make not to export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: -# Special Makefile rules for English message catalogs with quotation marks. - -DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot - -.SUFFIXES: .insert-header .po-update-en - -en@quot.po-create: - $(MAKE) en@quot.po-update -en@boldquot.po-create: - $(MAKE) en@boldquot.po-update - -en@quot.po-update: en@quot.po-update-en -en@boldquot.po-update: en@boldquot.po-update-en - -.insert-header.po-update-en: - @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ - tmpdir=`pwd`; \ - echo "$$lang:"; \ - ll=`echo $$lang | sed -e 's/@.*//'`; \ - LC_ALL=C; export LC_ALL; \ - cd $(srcdir); \ - if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ - if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "creation of $$lang.po failed!" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - fi - -en@quot.insert-header: insert-header.sin - sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header - -en@boldquot.insert-header: insert-header.sin - sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header - -mostlyclean: mostlyclean-quot -mostlyclean-quot: - rm -f *.insert-header diff -Nru jwm-2.1.0+svn579/po/Makefile.in jwm-2.3.1+0~16~ubuntu14.10.1/po/Makefile.in --- jwm-2.1.0+svn579/po/Makefile.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,444 +0,0 @@ -# Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper -# -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU General Public -# License but which still want to provide support for the GNU gettext -# functionality. -# Please note that the actual code of GNU gettext is covered by the GNU -# General Public License and is *not* in the public domain. -# -# Origin: gettext-0.18 -GETTEXT_MACRO_VERSION = 0.18 - -PACKAGE = jwm -VERSION = svn-579 -PACKAGE_BUGREPORT = joewing@joewing.net - -SHELL = /bin/sh - - -srcdir = . -top_srcdir = .. - - -prefix = /usr/local -exec_prefix = /usr/local -datarootdir = ${prefix}/share -datadir = ${datarootdir} -localedir = /usr/local/share/locale -gettextsrcdir = $(datadir)/gettext/po - -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 - -# We use $(mkdir_p). -# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as -# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, -# @install_sh@ does not start with $(SHELL), so we add it. -# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined -# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake -# versions, $(mkinstalldirs) and $(install_sh) are unused. -mkinstalldirs = $(SHELL) /usr/bin/install -c -d -install_sh = $(SHELL) /usr/bin/install -c -MKDIR_P = @MKDIR_P@ -mkdir_p = @MKDIR_P@ - -GMSGFMT_ = : -GMSGFMT_no = : -GMSGFMT_yes = : -GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) -MSGFMT_ = : -MSGFMT_no = : -MSGFMT_yes = : -MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) -XGETTEXT_ = : -XGETTEXT_no = : -XGETTEXT_yes = : -XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) -MSGMERGE = msgmerge -MSGMERGE_UPDATE = : --update -MSGINIT = msginit -MSGCONV = msgconv -MSGFILTER = msgfilter - -POFILES = @POFILES@ -GMOFILES = @GMOFILES@ -UPDATEPOFILES = @UPDATEPOFILES@ -DUMMYPOFILES = @DUMMYPOFILES@ -DISTFILES.common = Makefile.in.in remove-potcdate.sin \ -$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) -DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ -$(POFILES) $(GMOFILES) \ -$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) - -POTFILES = \ - -CATALOGS = @CATALOGS@ - -# Makevars gets inserted here. (Don't remove this line!) - -.SUFFIXES: -.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update - -.po.mo: - @echo "$(MSGFMT) -c -o $@ $<"; \ - $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ - -.po.gmo: - @lang=`echo $* | sed -e 's,.*/,,'`; \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ - cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo - -.sin.sed: - sed -e '/^#/d' $< > t-$@ - mv t-$@ $@ - - -all: check-macro-version all-no - -all-yes: stamp-po -all-no: - -# Ensure that the gettext macros and this Makefile.in.in are in sync. -check-macro-version: - @test "$(GETTEXT_MACRO_VERSION)" = "0.18" \ - || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.18" 1>&2; \ - exit 1; \ - } - -# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no -# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because -# we don't want to bother translators with empty POT files). We assume that -# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. -# In this case, stamp-po is a nop (i.e. a phony target). - -# stamp-po is a timestamp denoting the last time at which the CATALOGS have -# been loosely updated. Its purpose is that when a developer or translator -# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, -# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent -# invocations of "make" will do nothing. This timestamp would not be necessary -# if updating the $(CATALOGS) would always touch them; however, the rule for -# $(POFILES) has been designed to not touch files that don't need to be -# changed. -stamp-po: $(srcdir)/$(DOMAIN).pot - test ! -f $(srcdir)/$(DOMAIN).pot || \ - test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) - @test ! -f $(srcdir)/$(DOMAIN).pot || { \ - echo "touch stamp-po" && \ - echo timestamp > stamp-poT && \ - mv stamp-poT stamp-po; \ - } - -# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', -# otherwise packages like GCC can not be built if only parts of the source -# have been downloaded. - -# This target rebuilds $(DOMAIN).pot; it is an expensive operation. -# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. -$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed - if LC_ALL=C grep 'GNU jwm' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ - package_gnu='GNU '; \ - else \ - package_gnu=''; \ - fi; \ - if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ - msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ - else \ - msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ - fi; \ - case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --msgid-bugs-address="$$msgid_bugs_address" \ - ;; \ - *) \ - $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ - --files-from=$(srcdir)/POTFILES.in \ - --copyright-holder='$(COPYRIGHT_HOLDER)' \ - --package-name="$${package_gnu}jwm" \ - --package-version='svn-579' \ - --msgid-bugs-address="$$msgid_bugs_address" \ - ;; \ - esac - test ! -f $(DOMAIN).po || { \ - if test -f $(srcdir)/$(DOMAIN).pot; then \ - sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ - sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ - if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ - rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ - else \ - rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ - mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ - fi; \ - else \ - mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ - fi; \ - } - -# This rule has no dependencies: we don't need to update $(DOMAIN).pot at -# every "make" invocation, only create it when it is missing. -# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. -$(srcdir)/$(DOMAIN).pot: - $(MAKE) $(DOMAIN).pot-update - -# This target rebuilds a PO file if $(DOMAIN).pot has changed. -# Note that a PO file is not touched if it doesn't need to be changed. -$(POFILES): $(srcdir)/$(DOMAIN).pot - @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ - if test -f "$(srcdir)/$${lang}.po"; then \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ - cd $(srcdir) \ - && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ - *) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ - esac; \ - }; \ - else \ - $(MAKE) $${lang}.po-create; \ - fi - - -install: install-exec install-data -install-exec: -install-data: install-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ - for file in $(DISTFILES.common) Makevars.template; do \ - $(INSTALL_DATA) $(srcdir)/$$file \ - $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - for file in Makevars; do \ - rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - else \ - : ; \ - fi -install-data-no: all -install-data-yes: all - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $(DESTDIR)$$dir; \ - if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ - $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ - echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ - for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ - if test -n "$$lc"; then \ - if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ - link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ - mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ - for file in *; do \ - if test -f $$file; then \ - ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ - fi; \ - done); \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - else \ - if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ - :; \ - else \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - fi; \ - fi; \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ - ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ - cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ - fi; \ - done; \ - done - -install-strip: install - -installdirs: installdirs-exec installdirs-data -installdirs-exec: -installdirs-data: installdirs-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ - else \ - : ; \ - fi -installdirs-data-no: -installdirs-data-yes: - @catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - dir=$(localedir)/$$lang/LC_MESSAGES; \ - $(mkdir_p) $(DESTDIR)$$dir; \ - for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ - if test -n "$$lc"; then \ - if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ - link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ - mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ - for file in *; do \ - if test -f $$file; then \ - ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ - fi; \ - done); \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ - else \ - if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ - :; \ - else \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ - mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ - fi; \ - fi; \ - fi; \ - done; \ - done - -# Define this as empty until I found a useful application. -installcheck: - -uninstall: uninstall-exec uninstall-data -uninstall-exec: -uninstall-data: uninstall-data-no - if test "$(PACKAGE)" = "gettext-tools"; then \ - for file in $(DISTFILES.common) Makevars.template; do \ - rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ - done; \ - else \ - : ; \ - fi -uninstall-data-no: -uninstall-data-yes: - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - cat=`basename $$cat`; \ - lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ - for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ - rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ - done; \ - done - -check: all - -info dvi ps pdf html tags TAGS ctags CTAGS ID: - -mostlyclean: - rm -f remove-potcdate.sed - rm -f stamp-poT - rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po - rm -fr *.o - -clean: mostlyclean - -distclean: clean - rm -f Makefile Makefile.in POTFILES *.mo - -maintainer-clean: distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - rm -f stamp-po $(GMOFILES) - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) -dist distdir: - $(MAKE) update-po - @$(MAKE) dist2 -# This is a separate target because 'update-po' must be executed before. -dist2: stamp-po $(DISTFILES) - dists="$(DISTFILES)"; \ - if test "$(PACKAGE)" = "gettext-tools"; then \ - dists="$$dists Makevars.template"; \ - fi; \ - if test -f $(srcdir)/$(DOMAIN).pot; then \ - dists="$$dists $(DOMAIN).pot stamp-po"; \ - fi; \ - if test -f $(srcdir)/ChangeLog; then \ - dists="$$dists ChangeLog"; \ - fi; \ - for i in 0 1 2 3 4 5 6 7 8 9; do \ - if test -f $(srcdir)/ChangeLog.$$i; then \ - dists="$$dists ChangeLog.$$i"; \ - fi; \ - done; \ - if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ - for file in $$dists; do \ - if test -f $$file; then \ - cp -p $$file $(distdir) || exit 1; \ - else \ - cp -p $(srcdir)/$$file $(distdir) || exit 1; \ - fi; \ - done - -update-po: Makefile - $(MAKE) $(DOMAIN).pot-update - test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) - $(MAKE) update-gmo - -# General rule for creating PO files. - -.nop.po-create: - @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ - echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ - exit 1 - -# General rule for updating PO files. - -.nop.po-update: - @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ - tmpdir=`pwd`; \ - echo "$$lang:"; \ - test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ - cd $(srcdir); \ - if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ - *) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ - esac; \ - }; then \ - if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "msgmerge for $$lang.po failed!" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - fi - -$(DUMMYPOFILES): - -update-gmo: Makefile $(GMOFILES) - @: - -# Recreate Makefile by invoking config.status. Explicitly invoke the shell, -# because execution permission bits may not work on the current file system. -# Use /bin/sh, which is the shell determined by autoconf for the use by its -# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. -Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ - cd $(top_builddir) \ - && /bin/sh ./config.status $(subdir)/$@.in po-directories - -force: - -# Tell versions [3.59,3.63) of GNU make not to export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff -Nru jwm-2.1.0+svn579/po/nl.po jwm-2.3.1+0~16~ubuntu14.10.1/po/nl.po --- jwm-2.1.0+svn579/po/nl.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/nl.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,359 @@ +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.1.1\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2013-06-26 15:38+0200\n" +"Last-Translator: Bert \n" +"Language-Team: Dutch\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "Ongeldige Taakbalk-knop actie: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "taakbalk-knop: root menu %d niet gedefiniëerd" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "Geen warde opgegeven voor achtergrond" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "ongeldig achtergrond-type: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "Achtergrond-afbeelding niet gevonden: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Sluiten van dit venster forceren?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Dit kan verlies van data veroorzaken!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "uitvoeren mislukt: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "leeg Bureaublad-naam label" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "Slechts één Paneel toegelaten" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "kan de systeem taakbalk keuze niet verkrijgen" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "kon dit lettertype niet laden: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "kon standaard lettertype niet laden: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "Leeg lettertype label" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "ongeldige groepsklasse" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "ongeldige groepsnaam" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "ongeldige groep bureaublad: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "kon geen lees-structuur voor PNG afbeelding aanmaken: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "fout bij lezen van PNG afbeelding: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "kon geen info-structuur aanmaken voor PNG afbeelding: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "Opgegeven Toets-Sym is voor geen enkele ToetsCode bepaald" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "Aanpassing voor toets-sym 0x%0x niet gevonden" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "ongeldige aanpassing: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "ongeldig toets-symbool: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "Toets en Toetscode niet opgegeven voor Toets" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "Sneltoets: root menu %d niet gedefiniëerd" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "%s[%u]: sluiten-label \"%s\" komt niet overeen met openen-label \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: onverwacht en ongeldig sluiten-label " + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: sluiten-label \"%s\" zonder openen-label" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: ongeldig sluiten-label" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: ongeldig openen-label" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: ongeldig label" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: ongeldige entiteit: \"%.8s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: ongeldige entiteit: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "ongeldige instelling: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "ongeldige transparantie: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "ongeldig label in %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "configuratie-fout" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "opgegeven root menu ongeldig: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "JWM afsluiten" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Weet je het zeker?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Sluiten" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Minimaliseren" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Herstellen" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Zend naar" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "ongeldige maximum breedte voor Taaklijst: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "ongeldige taakbalk-breedte: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "ongeldige taakbalk-hoogte: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "ongeldige taakbalk lay-out: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "ongeldige horizontale taakbalk uitlijning: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "ongeldige verticale taakbalk uitlijning: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "kon taakbalk-pictogram niet laden: \"%s\"" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "geen pictogram of label voor Taakbalk-knop" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Sluiten forceren" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Grootte wijzigen" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Verplaatsen" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Uitrollen" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Oprollen" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Maximaliseer-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Maximaliseer-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Maximaliseren" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Losmaken" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Vastmaken" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Laag" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Boven]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Boven" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normaal]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normaal" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Onder]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Onder" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "ongeldige invoeg-modus: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "ongeldige laag: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "ongeldig staus-venster type: %s" + +#~ msgid "Fullscreen state will be shaped!" +#~ msgstr "Volledige scherm-status zal gevormd worden!" diff -Nru jwm-2.1.0+svn579/po/pl.po jwm-2.3.1+0~16~ubuntu14.10.1/po/pl.po --- jwm-2.1.0+svn579/po/pl.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/pl.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,368 @@ +# Polish translations for jwm package. +# Copyright (C) 2012 Free Software Foundation, Inc. +# This file is distributed under the same license as the jwm package. +# Miś Uszatek , 2012 +# +msgid "" +msgstr "" +"Project-Id-Version: 2.1.0+svn579-1\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2012-09-14 16:59+0100\n" +"Last-Translator: Miś Uszatek \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "nieprawidłowa akcja TrayButton: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "przycisk zasobnika: menu głównym %d nie zdefiniowano" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "nie określono wartości dla tła" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "nieprawidłowy typ tła: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "nie znaleziono obrazu tła: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Zabić to okno?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Może to spowodować utratę danych!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "exec nie powiodło się: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "pusty znacznik Nazwa Pulpitów" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "tylko jeden dozwolony Dock" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "nie można nabyć wyboru w zasobniku systemowym" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "nie można załadować czcionki: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "nie można załadować domyślnej czcionki: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "pusty znacznik czcionki" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "nieprawidłowa klasa grupy" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "nieprawidłowa nazwa grupy" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "nieprawidłowy pulpitu grupy: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "nie można utworzyć przeczytać struct dla obrazu PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "błąd odczytu obrazu PNG: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "nie można utworzyć struktur informacji dla obrazu PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "Określony KeySym nie jest zdefiniowany dla żadego KeyCode" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "nie znaleziono modyfikatora dla keysym 0x%0x" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "nieprawidłowy modyfikator: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "nieprawidłowy symbol klucza: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "ani klucza ani keycode określony dla Key" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "klucz wiązania: menu główne %d nie zdefiniowano" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "%s[%u]: zamknij znacznik \"%s\" nie pasuje otwarty znacznik \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: nieoczekiwany i nieprawidłowo zamknięty znacznik" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: zamknij znacznik \"%s\" bez otwartego znacznika" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: nieprawidłowo zamknięty znacznik" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: nieprawidłowo otwarty znacznik" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: nieprawidłowy znacznik" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: nieoczekiwany tekst: \"%s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: nieprawidłowa jednostka: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "nieprawidłowy znacznik w: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "nieprawidłowa nieprzezroczystość menu: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "nieprawidłowy znacznik w %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "błąd konfiguracji" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "nieprawidłowo określono menu główne: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Zakończ JWM" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Czy jesteś pewien?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "nie może połknąć klienta bez nazwy" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Zamknij" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Zminimalizuj" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Przywróć" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Wyślij do" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "nieprawidłowa maksymalna szerokość TaskList: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "nieprawidłowa szerokość zasobnika: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "nieprawidłowa wysokość zasobnika: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "nieprawidłowy układ zasobnika: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "nieprawidłowe wypoziomowanie zasobnika: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "nieprawidłowe wypionowanie zasobnika: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "nie można załadować ikon w zasobniku: \"%s\"" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "brak ikony lub etykiety dla TrayButton" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Zabij" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Zmień rozmiar" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Przenieś" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Rozwiń" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Zwiń" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Zmaksymalizuj pio." + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Zmaksymalizuj poz." + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Zmaksymalizuj" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Odepnij" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Przypnij" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Warstwa" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normalny]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normalny" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "nieprawidłowy tryb edycji: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "nieprawidłowa warstwa grupy: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "nieprawidłowy typ tła: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "nie można połknąć tego samego klienta, wiele razy" + +#~ msgid "Fullscreen state will be shaped!" +#~ msgstr "Pełnoekranowy stan będzie kształtowany!" diff -Nru jwm-2.1.0+svn579/po/POTFILES jwm-2.3.1+0~16~ubuntu14.10.1/po/POTFILES --- jwm-2.1.0+svn579/po/POTFILES 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/POTFILES 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ - ../src/background.c \ - ../src/border.c \ - ../src/button.c \ - ../src/client.c \ - ../src/clientlist.c \ - ../src/clock.c \ - ../src/color.c \ - ../src/command.c \ - ../src/confirm.c \ - ../src/cursor.c \ - ../src/debug.c \ - ../src/desktop.c \ - ../src/dock.c \ - ../src/error.c \ - ../src/event.c \ - ../src/font.c \ - ../src/gradient.c \ - ../src/group.c \ - ../src/help.c \ - ../src/hint.c \ - ../src/icon.c \ - ../src/image.c \ - ../src/key.c \ - ../src/lex.c \ - ../src/main.c \ - ../src/match.c \ - ../src/menu.c \ - ../src/misc.c \ - ../src/move.c \ - ../src/outline.c \ - ../src/pager.c \ - ../src/parse.c \ - ../src/place.c \ - ../src/popup.c \ - ../src/render.c \ - ../src/resize.c \ - ../src/root.c \ - ../src/screen.c \ - ../src/spacer.c \ - ../src/status.c \ - ../src/swallow.c \ - ../src/taskbar.c \ - ../src/timing.c \ - ../src/traybutton.c \ - ../src/tray.c \ - ../src/winmenu.c diff -Nru jwm-2.1.0+svn579/po/POTFILES.in jwm-2.3.1+0~16~ubuntu14.10.1/po/POTFILES.in --- jwm-2.1.0+svn579/po/POTFILES.in 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/POTFILES.in 2015-07-18 20:02:18.000000000 +0000 @@ -1,3 +1,4 @@ +src/action.c src/background.c src/border.c src/button.c @@ -14,6 +15,7 @@ src/error.c src/event.c src/font.c +src/grab.c src/gradient.c src/group.c src/help.c @@ -36,11 +38,12 @@ src/resize.c src/root.c src/screen.c +src/settings.c src/spacer.c src/status.c src/swallow.c src/taskbar.c src/timing.c -src/traybutton.c src/tray.c +src/traybutton.c src/winmenu.c diff -Nru jwm-2.1.0+svn579/po/pt-PT.po jwm-2.3.1+0~16~ubuntu14.10.1/po/pt-PT.po --- jwm-2.1.0+svn579/po/pt-PT.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/pt-PT.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,375 @@ +# Copyright (C) YEAR Free Software Foundation, Inc. +# Translation of JWM 2.1.1 in Portuguese (Portugal) +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# Vitor Lopes , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.1.1\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2013-05-02 07:20+0100\n" +"Last-Translator: Vito Lopes \n" +"Language-Team: Portuguese \n" +"Language: pt-PT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Language: Portuguese\n" +"X-Poedit-Country: PORTUGAL\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "ação do Traybutton invalida: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "botão do tabuleiro: menu root %d não esta definida" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "nenhum valor foi especificado para o fundo (background)" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "tipo de fundo invalido: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "imagem de fundo não encontrada: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "eliminar esta janela?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "esta ação pode causar perda de dados!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "comando executável falhou (exec): (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "etiqueta do ambiente de trabalho vazia (tag)" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "só um tabuleiro e permitido" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "não pode adquirir a seleção da bandeja do sistema" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "impossível carregar fonte %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "Não foi possível carregar a fonte padrão %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "etiqueta da fonte vazia (tag)" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "classe do grupo invalida" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "nome do grupo invalido" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "grupo do ambiente de trabalho invalido: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "não foi possível criar e ler a estrutura das imagens PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "erro lendo imagem PNG %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "não foi possível criar estrutura de informação para imagem PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "KeySym especificado não esta defendido por nenhum Keycode" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "modificador não foi encontrado para o Keysym 0x%0x" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "modificador invalido: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "símbolo da tecla invalido: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "tecla e código de tecla não foi especificado para esta tecla" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "" +"teclas de atalho: não foram especificadas para o menu root %d não esta " +"definido" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "" +"%s[%u]: terminação da etiqueta (tag) \"%s\" não corresponde à abertura da " +"etiqueta (tag) \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: terminação da etiqueta (tag) inesperada e invalida" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: terminação da etiqueta (tag) \"%s\" sem etiqueta de abertura" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: terminação de etiqueta (tag) invalida" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: abertura de etiqueta (tag) invalida" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: etiqueta invalida (tag)" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: texto inesperado: \"%s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: entrada invalida: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "Configuração invalida: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "transparência invalida: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "etiqueta invalida dentro %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "erro de configuração" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "menu root especificado invalido: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Sair do JWM?" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Tem a certeza?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "não podes inserir um cliente no swallow sem nome" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Fechar" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Minimizar" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Restaurar" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Enviar Para" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "largura máxima (maxwidth) invalida para o Tasklist: %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "largura do tabuleiro invalida: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "altura do tabuleiro invalida: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "layout do tabuleiro invalido: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "alinhamento do tabuleiro invalido: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "alinhamento vertical do tabuleiro invalido: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "nao foi possível carregar o ícone no tabuleiro: \"%s\"" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "ícone ou nome não esta definido no TrayButton" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Terminar" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Redimensionar" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Mover" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Desligar Sombra" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Ligar Sombra" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Maximizar-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Maximizar-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Maximizar" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Descolar" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Colar" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Camada" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Acima]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Acima" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Normal]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Normal" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Abaixo]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Abaixo" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "modo de inserção invalido: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "camada invalida: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "tipo de fundo invalido: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "não podes inserir um cliente no swallow mais que uma vez" + +#~ msgid "Fullscreen state will be shaped!" +#~ msgstr "Estado do ecrã expandido será moldado!" diff -Nru jwm-2.1.0+svn579/po/ru.po jwm-2.3.1+0~16~ubuntu14.10.1/po/ru.po --- jwm-2.1.0+svn579/po/ru.po 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/po/ru.po 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,368 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the JWM package. +# Aleksandr Samusenko , 2013. +# +msgid "" +msgstr "" +"Project-Id-Version: jwm 2.2.0\n" +"Report-Msgid-Bugs-To: joewing@joewing.net\n" +"POT-Creation-Date: 2015-06-28 07:47-0500\n" +"PO-Revision-Date: 2013-06-18 10:33+0300\n" +"Last-Translator: aleksandr \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/action.c:43 +#, fuzzy, c-format +msgid "invalid action: \"%s\"" +msgstr "недопустимое значение действия кнопки запуска: \"%s\"" + +#: src/action.c:181 +#, fuzzy, c-format +msgid "action: root menu \"%s\" not defined" +msgstr "кнопка запуска: главное меню %d не задано" + +#: src/background.c:143 +msgid "no value specified for background" +msgstr "не задано значение для цвета фона" + +#: src/background.c:155 +#, c-format +msgid "invalid background type: \"%s\"" +msgstr "неизвестный тип фона: \"%s\"" + +#: src/background.c:299 +#, c-format +msgid "background image not found: \"%s\"" +msgstr "фоновое изображение не найдено: \"%s\"" + +#: src/client.c:893 +msgid "Kill this window?" +msgstr "Ликвидировать окно?" + +#: src/client.c:894 +msgid "This may cause data to be lost!" +msgstr "Это может привести к потере данных!" + +#: src/command.c:137 src/main.c:214 +#, c-format +msgid "exec failed: (%s) %s" +msgstr "не удалось выполнить: (%s) %s" + +#: src/confirm.c:68 +msgid "OK" +msgstr "" + +#: src/confirm.c:73 +msgid "Cancel" +msgstr "Отмена" + +#: src/confirm.c:307 +msgid "Confirm" +msgstr "Подтверждение" + +#: src/desktop.c:338 +msgid "empty Desktops Name tag" +msgstr "пустой тэг Desktops Name (название рабочего стола)" + +#: src/dock.c:151 +msgid "only one Dock allowed" +msgstr "можно использовать только один Dock (область уведомлений)" + +#: src/dock.c:230 +msgid "could not acquire system tray selection" +msgstr "не удалось получить активное приложение в панели задач" + +#: src/font.c:104 src/font.c:121 +#, c-format +msgid "could not load font: %s" +msgstr "не удалось загрузить шрифт: %s" + +#: src/font.c:111 src/font.c:128 +#, c-format +msgid "could not load the default font: %s" +msgstr "не удалось загрузить шрифт по-умолчанию: %s" + +#: src/font.c:310 +msgid "empty Font tag" +msgstr "пустой тэг Font" + +#: src/group.c:112 +msgid "invalid group class" +msgstr "недопустимое значение класса группы" + +#: src/group.c:123 +msgid "invalid group name" +msgstr "недопустимое значение названия группы" + +#: src/group.c:254 +#, c-format +msgid "invalid group desktop: %d" +msgstr "недопустимое значение рабочего стола группы: %d" + +#: src/image.c:222 +#, c-format +msgid "could not create read struct for PNG image: %s" +msgstr "не удалось прочитать структуру изображения PNG: %s" + +#: src/image.c:235 +#, c-format +msgid "error reading PNG image: %s" +msgstr "ошибка чтения изображения PNG: %s" + +#: src/image.c:243 +#, c-format +msgid "could not create info struct for PNG image: %s" +msgstr "ошибка создания структуры информации об изображении PNG: %s" + +#: src/key.c:332 +msgid "Specified KeySym is not defined for any KeyCode" +msgstr "Указанный KeySym не определен ни для одного значения KeyCode" + +#: src/key.c:340 +#, c-format +msgid "modifier not found for keysym 0x%0x" +msgstr "модификатор не найден для KeySym 0x%0x" + +#: src/key.c:370 +#, c-format +msgid "invalid modifier: \"%c\"" +msgstr "недопустимое значение для модификатора: \"%c\"" + +#: src/key.c:385 +#, c-format +msgid "invalid key symbol: \"%s\"" +msgstr "недопустимое значение символа клавиши: \"%s\"" + +#: src/key.c:466 +msgid "neither key nor keycode specified for Key" +msgstr "ни символ, ни код клавиши не заданы в тэге Key" + +#: src/key.c:481 +#, fuzzy, c-format +msgid "key binding: root menu \"%s\" not defined" +msgstr "назначение клавиши: главное меню %d не задано" + +#: src/lex.c:199 +#, c-format +msgid "%s[%u]: close tag \"%s\" does not match open tag \"%s\"" +msgstr "%s[%u]: закрывающий тэг \"%s\" не соответствует открывающему \"%s\"" + +#: src/lex.c:205 +#, c-format +msgid "%s[%u]: unexpected and invalid close tag" +msgstr "%s[%u]: непонятный и неправильный закрывающий тэг" + +#: src/lex.c:211 +#, c-format +msgid "%s[%u]: close tag \"%s\" without open tag" +msgstr "%s[%u]: закрывающий тэг \"%s\" без открывающего" + +#: src/lex.c:214 +#, c-format +msgid "%s[%u]: invalid close tag" +msgstr "%s[%u]: неправильный закрывающий тэг" + +#: src/lex.c:232 +#, c-format +msgid "%s[%u]: invalid open tag" +msgstr "%s[%u]: неправильный открывающий тэг" + +#: src/lex.c:248 +#, c-format +msgid "%s[%u]: invalid tag" +msgstr "%s[%u]: неправильный тэг" + +#: src/lex.c:303 +#, c-format +msgid "%s[%u]: unexpected text: \"%s\"" +msgstr "%s[%u]: непонятный текст: \"%s\"" + +#: src/lex.c:351 +#, c-format +msgid "%s[%d]: invalid entity: \"%.8s\"" +msgstr "%s[%d]: ошибочное вхождение: \"%.8s\"" + +#: src/lex.c:456 src/parse.c:1875 +msgid "out of memory" +msgstr "недостаточно памяти" + +#: src/parse.c:1889 +#, c-format +msgid "invalid setting: %s" +msgstr "недопустимое значение положительного числа: %s" + +#: src/parse.c:1901 +#, c-format +msgid "invalid opacity: %s" +msgstr "недопустимое значение прозрачности: %s" + +#: src/parse.c:1943 +#, c-format +msgid "invalid tag in %s: %s" +msgstr "недопустимое значение тэга в %s: %s" + +#: src/parse.c:1963 +msgid "configuration error" +msgstr "ошибка конфигурации" + +#: src/root.c:131 +#, c-format +msgid "invalid root menu specified: \"%c\"" +msgstr "неправильно задано главное меню: \"%c\"" + +#: src/root.c:213 +msgid "Exit JWM" +msgstr "Выход из JWM" + +#: src/root.c:214 +msgid "Are you sure?" +msgstr "Вы уверены?" + +#: src/swallow.c:85 +msgid "cannot swallow a client with no name" +msgstr "нельзя использовать микро-окно панели (swallow) без имени" + +#: src/taskbar.c:352 src/winmenu.c:51 +msgid "Close" +msgstr "Закрыть" + +#: src/taskbar.c:359 src/winmenu.c:71 +msgid "Minimize" +msgstr "Свернуть" + +#: src/taskbar.c:366 src/winmenu.c:69 src/winmenu.c:89 +msgid "Restore" +msgstr "Восстановить" + +#: src/taskbar.c:373 src/winmenu.c:170 +msgid "Send To" +msgstr "Переместить на рабочий стол" + +#: src/taskbar.c:845 +#, c-format +msgid "invalid maxwidth for TaskList: %s" +msgstr "" +"недопустимое значение макс. ширины кнопки в панели задач (TaskList): %s" + +#: src/tray.c:1073 +#, c-format +msgid "invalid tray width: %d" +msgstr "недопустимое значение ширины панели: %d" + +#: src/tray.c:1092 +#, c-format +msgid "invalid tray height: %d" +msgstr "недопустимое значение высоты панели: %d" + +#: src/tray.c:1121 +#, c-format +msgid "invalid tray layout: \"%s\"" +msgstr "недопустимое значение расположения панели: \"%s\"" + +#: src/tray.c:1160 +#, c-format +msgid "invalid tray horizontal alignment: \"%s\"" +msgstr "недопустимое значение горизонтального выравнивания панели: \"%s\"" + +#: src/tray.c:1183 +#, c-format +msgid "invalid tray vertical alignment: \"%s\"" +msgstr "недопустимое значение вертикального выравнивания панели: \"%s\"" + +#: src/traybutton.c:89 +#, c-format +msgid "could not load tray icon: \"%s\"" +msgstr "не удалось загрузить иконку для кнопки запуска: \"%s\"" + +#: src/traybutton.c:130 +msgid "no icon or label for TrayButton" +msgstr "не заданы ни иконка, ни текст кнопки запуска" + +#: src/winmenu.c:52 +msgid "Kill" +msgstr "Ликвидировать" + +#: src/winmenu.c:60 +msgid "Resize" +msgstr "Изменить размер" + +#: src/winmenu.c:63 +msgid "Move" +msgstr "Переместить" + +#: src/winmenu.c:76 +msgid "Unshade" +msgstr "Развернуть из заголовка" + +#: src/winmenu.c:78 +msgid "Shade" +msgstr "Свернуть в заголовок" + +#: src/winmenu.c:83 +msgid "Maximize-y" +msgstr "Развернуть-y" + +#: src/winmenu.c:86 +msgid "Maximize-x" +msgstr "Развернуть-x" + +#: src/winmenu.c:91 +msgid "Maximize" +msgstr "Развернуть" + +#: src/winmenu.c:100 +msgid "Unstick" +msgstr "Только на этом рабочем столе" + +#: src/winmenu.c:102 +msgid "Stick" +msgstr "Всегда на видимом рабочем столе" + +#: src/winmenu.c:127 +msgid "Layer" +msgstr "Расположение окна" + +#: src/winmenu.c:139 +msgid "[Above]" +msgstr "[Всегда наверху]" + +#: src/winmenu.c:141 +msgid "Above" +msgstr "Всегда наверху" + +#: src/winmenu.c:144 +msgid "[Normal]" +msgstr "[Также как другие]" + +#: src/winmenu.c:146 +msgid "Normal" +msgstr "Также как другие" + +#: src/winmenu.c:149 +msgid "[Below]" +msgstr "[Всегда позади]" + +#: src/winmenu.c:151 +msgid "Below" +msgstr "Всегда позади" + +#~ msgid "invalid insert mode: \"%s\"" +#~ msgstr "недопустимое значение режима вставки: \"%s\"" + +#~ msgid "invalid layer: %s" +#~ msgstr "недопустимое значение расположения окна: %s" + +#~ msgid "invalid status window type: %s" +#~ msgstr "недопустимое значение типа статусного окна для перемещения: %s" + +#~ msgid "cannot swallow the same client multiple times" +#~ msgstr "" +#~ "нельзя использовать одно и то же микро-окно панели (swallow) несколько раз" + +#~ msgid "Fullscreen state will be shaped!" +#~ msgstr "Применено оформление в полноэкранном режиме!" diff -Nru jwm-2.1.0+svn579/README jwm-2.3.1+0~16~ubuntu14.10.1/README --- jwm-2.1.0+svn579/README 2012-01-27 01:04:16.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -JWM -See LICENSE for license information. - -> Requirements -To build JWM you will need a C compiler (gcc works), X11, and the -"development headers" for X11 and Xlib. -If available and not disabled at compile time, JWM will also use -the following libraries: - libfribidi for bi-directional text support. - libjpeg for JPEG icons and backgrounds. - libpng for PNG icons and backgrounds. - libXext for the shape extension. - libXext for the render extension. - libXmu for rounded corners. - libxft for antialiased and true type fonts. - libXinerama for multiple head support. - libXpm for XPM icons and backgrounds. - -> Installation -Run "./configure --help" for configuration options. -Run "./configure [options]" -Run "make" to build JWM. -Run "make install" to install JWM. - -For more information see http://joewing.net - diff -Nru jwm-2.1.0+svn579/README.md jwm-2.3.1+0~16~ubuntu14.10.1/README.md --- jwm-2.1.0+svn579/README.md 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/README.md 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,38 @@ +JWM (Joe's Window Manager) +============================================================================== + +JWM is a light-weight window manager for the X11 Window System. + +Requirements +------------------------------------------------------------------------------ +To build JWM you will need a C compiler (gcc works), X11, and the +"development headers" for X11 and Xlib. +If available and not disabled at compile time, JWM will also use +the following libraries: + + - cairo and librsvg2 for SVG icons and backgrounds. + - fribidi for bi-directional text support. + - libjpeg for JPEG icons and backgrounds. + - libpng for PNG icons and backgrounds. + - libXext for the shape extension. + - libXrender for the render extension. + - libXmu for rounded corners. + - libXft for anti-aliased and true type fonts. + - libXinerama for multiple head support. + - libXpm for XPM icons and backgrounds. + +Installation +------------------------------------------------------------------------------ + + 0. For building from the git repository, run autoreconf to generate configure. + 1. Run "./configure --help" for configuration options. + 2. Run "./configure [options]" + 3. Run "make" to build JWM. + 4. Run "make install" to install JWM. Depending on where you are installing + JWM, you may need to perform this step as root ("sudo make install"). + +License +------------------------------------------------------------------------------ +See LICENSE for license information. + +For more information see http://joewing.net/projects/jwm/ diff -Nru jwm-2.1.0+svn579/src/action.c jwm-2.3.1+0~16~ubuntu14.10.1/src/action.c --- jwm-2.1.0+svn579/src/action.c 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/action.c 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,186 @@ +/** + * @file action.c + * @author Joe Wingbermuehle + * + * @brief Tray component actions. + */ + +#include "jwm.h" +#include "action.h" +#include "tray.h" +#include "root.h" +#include "screen.h" +#include "misc.h" +#include "error.h" +#include "cursor.h" +#include "command.h" +#include "desktop.h" + +typedef struct ActionType { + char *action; + struct ActionType *next; + int mask; +} ActionType; + +/** Add an action. */ +void AddAction(ActionType **actions, const char *action, int mask) +{ + ActionType *ap; + + /* Make sure we actually have an action. */ + if(action == NULL || action[0] == 0 || mask == 0) { + /* Valid (root menu 1). */ + } else if(!strncmp(action, "exec:", 5)) { + /* Valid. */ + } else if(!strncmp(action, "root:", 5)) { + /* Valid. However, the specified root menu may not exist. + * This case is handled in ValidateTrayButtons. + */ + } else if(!strcmp(action, "showdesktop")) { + /* Valid. */ + } else { + /* Invalid; don't add the action. */ + Warning(_("invalid action: \"%s\""), action); + return; + } + + ap = (ActionType*)Allocate(sizeof(ActionType)); + ap->action = CopyString(action); + ap->mask = mask; + ap->next = *actions; + *actions = ap; +} + +/** Destroy an action list. */ +void DestroyActions(ActionType *actions) +{ + while(actions) { + ActionType *next = actions->next; + Release(actions->action); + Release(actions); + actions = next; + } +} + +/** Process a button press. */ +void ProcessActionPress(struct ActionType *actions, + struct TrayComponentType *cp, + int x, int y, int button) +{ + const ScreenType *sp; + const ActionType *ap; + const int mask = 1 << button; + int mwidth, mheight; + int menu; + + menu = -1; + for(ap = actions; ap; ap = ap->next) { + if(ap->mask & mask) { + if(ap->action && ap->action[0]) { + + if(strncmp(ap->action, "root:", 5) != 0) { + + /* Show the button being pressed. */ + GrabMouse(cp->tray->window); + cp->grabbed = 1; + if(cp->Redraw) { + (cp->Redraw)(cp); + UpdateSpecificTray(cp->tray, cp); + } + return; + + } else { + menu = GetRootMenuIndexFromString(&ap->action[5]); + } + } else { + menu = 1; + } + break; + } + } + if(menu < 0) { + return; + } + + GetRootMenuSize(menu, &mwidth, &mheight); + sp = GetCurrentScreen(cp->screenx, cp->screeny); + if(cp->tray->layout == LAYOUT_HORIZONTAL) { + x = cp->screenx; + if(cp->screeny + cp->height / 2 < sp->y + sp->height / 2) { + y = cp->screeny + cp->height; + } else { + y = cp->screeny - mheight; + } + } else { + y = cp->screeny; + if(cp->screenx + cp->width / 2 < sp->x + sp->width / 2) { + x = cp->screenx + cp->width; + } else { + x = cp->screenx - mwidth; + } + } + + cp->grabbed = 1; + if(cp->Redraw) { + (cp->Redraw)(cp); + UpdateSpecificTray(cp->tray, cp); + } + ShowRootMenu(menu, x, y); + cp->grabbed = 0; + if(cp->Redraw) { + (cp->Redraw)(cp); + UpdateSpecificTray(cp->tray, cp); + } +} + +/** Process a button release. */ +void ProcessActionRelease(struct ActionType *actions, + struct TrayComponentType *cp, + int x, int y, int button) +{ + const ActionType *ap; + const int mask = 1 << button; + + cp->grabbed = 0; + if(cp->Redraw) { + (cp->Redraw)(cp); + UpdateSpecificTray(cp->tray, cp); + } + + // Since we grab the mouse, make sure the mouse is actually over the button. + if(x < 0 || x >= cp->width) { + return; + } + if(y < 0 || y >= cp->height) { + return; + } + + // Run the action (if any). + for(ap = actions; ap; ap = ap->next) { + if(ap->mask & mask) { + if(ap->action && strlen(ap->action) > 0) { + if(!strncmp(ap->action, "exec:", 5)) { + RunCommand(ap->action + 5); + } else if(!strcmp(ap->action, "showdesktop")) { + ShowDesktop(); + } + } + return; + } + } +} + +/** Validate actions. */ +void ValidateActions(const ActionType *actions) +{ + const ActionType *ap; + for(ap = actions; ap; ap = ap->next) { + if(ap->action && !strncmp(ap->action, "root:", 5)) { + const int bindex = GetRootMenuIndexFromString(&ap->action[5]); + if(JUNLIKELY(!IsRootMenuDefined(bindex))) { + Warning(_("action: root menu \"%s\" not defined"), + &ap->action[5]); + } + } + } +} diff -Nru jwm-2.1.0+svn579/src/action.h jwm-2.3.1+0~16~ubuntu14.10.1/src/action.h --- jwm-2.1.0+svn579/src/action.h 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/action.h 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,52 @@ +/** + * @file action.h + * @author Joe Wingbermuehle + * + * @brief Mouse click action processing for tray buttons and clocks. + * + */ + +#ifndef ACTION_H +#define ACTION_H + +struct ActionType; +struct TrayComponentType; + +/** Add an action to a list of actions. + * @param actions The action list to update. + * @param action The action to add to the list. + * @param mask The mouse button mask. + */ +void AddAction(struct ActionType **actions, const char *action, int mask); + +/** Destroy a list of actions. */ +void DestroyActions(struct ActionType *actions); + +/** Process a button press event. + * @param actions The action list. + * @param cp The tray component. + * @param x The mouse x-coordinate. + * @param y The mouse y-coordinate. + * @param button The mouse button. + */ +void ProcessActionPress(struct ActionType *actions, + struct TrayComponentType *cp, + int x, int y, int button); + +/** Process a button release event. + * @param actions The action list. + * @param cp The tray component. + * @param x The mouse x-coordinate. + * @param y The mouse y-coordinate. + * @param button The mouse button. + */ +void ProcessActionRelease(struct ActionType *actions, + struct TrayComponentType *cp, + int x, int y, int button); + +/** Validate actions. + * @param actions The action list to validate. + */ +void ValidateActions(const struct ActionType *actions); + +#endif /* ACTION_H */ diff -Nru jwm-2.1.0+svn579/src/background.c jwm-2.3.1+0~16~ubuntu14.10.1/src/background.c --- jwm-2.1.0+svn579/src/background.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/background.c 2015-07-18 20:02:18.000000000 +0000 @@ -20,13 +20,13 @@ #include "hint.h" /** Enumeration of background types. */ -typedef enum { - BACKGROUND_SOLID, /**< Solid color background. */ - BACKGROUND_GRADIENT, /**< Gradient background. */ - BACKGROUND_COMMAND, /**< Command to run for setting the background. */ - BACKGROUND_STRETCH, /**< Stretched image. */ - BACKGROUND_TILE /**< Tiled image. */ -} BackgroundType; +typedef unsigned char BackgroundType; +#define BACKGROUND_SOLID 0 /**< Solid color background. */ +#define BACKGROUND_GRADIENT 1 /**< Gradient background. */ +#define BACKGROUND_COMMAND 2 /**< Command to run. */ +#define BACKGROUND_STRETCH 3 /**< Stretched image. */ +#define BACKGROUND_TILE 4 /**< Tiled image. */ +#define BACKGROUND_SCALE 5 /**< Scaled image. */ /** Structure to represent a background for one or more desktops. */ typedef struct BackgroundNode { @@ -34,7 +34,6 @@ BackgroundType type; /**< The type of background. */ char *value; Pixmap pixmap; - Window window; struct BackgroundNode *next; /**< Next background in the list. */ } BackgroundNode; @@ -47,19 +46,20 @@ /** The last background loaded. */ static BackgroundNode *lastBackground; -static void LoadSolidBackground(BackgroundNode *bp); static void LoadGradientBackground(BackgroundNode *bp); static void LoadImageBackground(BackgroundNode *bp); /** Initialize any data needed for background support. */ -void InitializeBackgrounds() { +void InitializeBackgrounds(void) +{ backgrounds = NULL; defaultBackground = NULL; lastBackground = NULL; } /** Startup background support. */ -void StartupBackgrounds() { +void StartupBackgrounds(void) +{ BackgroundNode *bp; @@ -68,8 +68,6 @@ /* Load background data. */ switch(bp->type) { case BACKGROUND_SOLID: - LoadSolidBackground(bp); - break; case BACKGROUND_GRADIENT: LoadGradientBackground(bp); break; @@ -78,6 +76,7 @@ break; case BACKGROUND_STRETCH: case BACKGROUND_TILE: + case BACKGROUND_SCALE: LoadImageBackground(bp); break; default: @@ -94,7 +93,8 @@ } /** Shutdown background support. */ -void ShutdownBackgrounds() { +void ShutdownBackgrounds(void) +{ BackgroundNode *bp; @@ -103,16 +103,13 @@ JXFreePixmap(display, bp->pixmap); bp->pixmap = None; } - if(bp->window != None) { - JXDestroyWindow(display, bp->window); - bp->window = None; - } } } /** Release any data needed for background support. */ -void DestroyBackgrounds() { +void DestroyBackgrounds(void) +{ BackgroundNode *bp; @@ -126,10 +123,20 @@ } /** Set the background to use for the specified desktops. */ -void SetBackground(int desktop, const char *type, const char *value) { +void SetBackground(int desktop, const char *type, const char *value) +{ + static const StringMappingType mapping[] = { + { "command", BACKGROUND_COMMAND }, + { "gradient", BACKGROUND_GRADIENT }, + { "image", BACKGROUND_STRETCH }, + { "scale", BACKGROUND_SCALE }, + { "solid", BACKGROUND_SOLID }, + { "tile", BACKGROUND_TILE } + }; BackgroundType bgType; BackgroundNode *bp; + BackgroundNode **bpp; /* Make sure we have a value. */ if(JUNLIKELY(!value)) { @@ -138,19 +145,32 @@ } /* Parse the background type. */ - if(!type || !strcmp(type, "solid")) { + if(type == NULL) { bgType = BACKGROUND_SOLID; - } else if(!strcmp(type, "gradient")) { - bgType = BACKGROUND_GRADIENT; - } else if(!strcmp(type, "command")) { - bgType = BACKGROUND_COMMAND; - } else if(!strcmp(type, "image")) { - bgType = BACKGROUND_STRETCH; - } else if(!strcmp(type, "tile")) { - bgType = BACKGROUND_TILE; } else { - Warning(_("invalid background type: \"%s\""), type); - return; + const int x = FindValue(mapping, ARRAY_LENGTH(mapping), type); + if(x >= 0) { + bgType = x; + } else { + Warning(_("invalid background type: \"%s\""), type); + return; + } + } + + /* Remove the existing background if this is a duplicate. + * This allows later settings to override older settings. + * Note that there can be at most one duplicate. + */ + bpp = &backgrounds; + while(*bpp) { + bp = *bpp; + if(bp->desktop == desktop) { + *bpp = bp->next; + Release(bp->value); + Release(bp); + break; + } + bpp = &bp->next; } /* Create the background node. */ @@ -166,10 +186,11 @@ } /** Load the background for the specified desktop. */ -void LoadBackground(int desktop) { +void LoadBackground(int desktop) +{ XSetWindowAttributes attr; - long attrValues; + unsigned long attrValues; BackgroundNode *bp; /* Determine the background to load. */ @@ -193,51 +214,25 @@ && !strcmp(bp->value, lastBackground->value)) { return; } - if(lastBackground && lastBackground->window) { - JXUnmapWindow(display, lastBackground->window); - } lastBackground = bp; /* Load the background based on type. */ - switch(bp->type) { - case BACKGROUND_COMMAND: + if(bp->type == BACKGROUND_COMMAND) { RunCommand(bp->value); return; - default: - attrValues = CWBackPixmap; - attr.background_pixmap = bp->pixmap; - break; } - JXChangeWindowAttributes(display, bp->window, attrValues, &attr); - JXClearWindow(display, bp->window); - JXMapWindow(display, bp->window); - - SetPixmapAtom(rootWindow, ATOM_XSETROOT_ID, bp->window); - -} - -/** Load a solid background. */ -void LoadSolidBackground(BackgroundNode *bp) { - - XColor c; - - ParseColor(bp->value, &c); - - /* Create the window. */ - bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, - rootWidth, rootHeight, 0, 0, 0); - - /* Create the pixmap. */ - bp->pixmap = JXCreatePixmap(display, bp->window, 1, 1, rootDepth); - - JXSetForeground(display, rootGC, c.pixel); - JXDrawPoint(display, bp->pixmap, rootGC, 0, 0); + attrValues = CWBackPixmap; + attr.background_pixmap = bp->pixmap; + JXChangeWindowAttributes(display, rootWindow, attrValues, &attr); + SetPixmapAtom(rootWindow, ATOM_XROOTPMAP_ID, bp->pixmap); + JXClearWindow(display, rootWindow); } /** Load a gradient background. */ -void LoadGradientBackground(BackgroundNode *bp) { +void LoadGradientBackground(BackgroundNode *bp) +{ XColor color1; XColor color2; @@ -246,91 +241,86 @@ int len; sep = strchr(bp->value, ':'); - if(!sep) { - bp->pixmap = None; - bp->window = None; - return; - } + if(sep) { - /* Get the first color. */ - len = (int)(sep - bp->value); - temp = AllocateStack(len + 1); - memcpy(temp, bp->value, len); - temp[len] = 0; - ParseColor(temp, &color1); - ReleaseStack(temp); - - /* Get the second color. */ - len = strlen(sep + 1); - temp = AllocateStack(len + 1); - memcpy(temp, sep + 1, len); - temp[len] = 0; - ParseColor(temp, &color2); - ReleaseStack(temp); - - /* Create the window. */ - bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, - rootWidth, rootHeight, 0, 0, 0); + /* Gradient background. */ - bp->pixmap = JXCreatePixmap(display, bp->window, - rootWidth, rootHeight, rootDepth); + /* Get the first color. */ + len = (int)(sep - bp->value); + temp = AllocateStack(len + 1); + memcpy(temp, bp->value, len); + temp[len] = 0; + ParseColor(temp, &color1); + ReleaseStack(temp); + + /* Get the second color. */ + len = strlen(sep + 1); + temp = AllocateStack(len + 1); + memcpy(temp, sep + 1, len); + temp[len] = 0; + ParseColor(temp, &color2); + ReleaseStack(temp); + } else { + + /* Solid background. */ + ParseColor(bp->value, &color1); + color2.pixel = color1.pixel; + + } + + /* Create the background pixmap. */ if(color1.pixel == color2.pixel) { + bp->pixmap = JXCreatePixmap(display, rootWindow, 1, 1, + rootVisual.depth); JXSetForeground(display, rootGC, color1.pixel); - JXFillRectangle(display, bp->pixmap, rootGC, - 0, 0, rootWidth, rootHeight); + JXDrawPoint(display, bp->pixmap, rootGC, 0, 0); } else { - DrawHorizontalGradient(bp->pixmap, rootGC, - color1.pixel, color2.pixel, 0, 0, rootWidth, rootHeight); + bp->pixmap = JXCreatePixmap(display, rootWindow, 1, rootHeight, + rootVisual.depth); + DrawHorizontalGradient(bp->pixmap, rootGC, color1.pixel, + color2.pixel, 0, 0, 1, rootHeight); } } /** Load an image background. */ -void LoadImageBackground(BackgroundNode *bp) { +void LoadImageBackground(BackgroundNode *bp) +{ IconNode *ip; int width, height; /* Load the icon. */ ExpandPath(&bp->value); - ip = LoadNamedIcon(bp->value); + ip = LoadNamedIcon(bp->value, 0, bp->type == BACKGROUND_SCALE); if(JUNLIKELY(!ip)) { bp->pixmap = None; - bp->window = None; Warning(_("background image not found: \"%s\""), bp->value); return; } - /* We can't use render on these. */ - ip->useRender = 0; - /* Determine the size of the background pixmap. */ if(bp->type == BACKGROUND_TILE) { - width = ip->image->width; - height = ip->image->height; + width = ip->images->width; + height = ip->images->height; } else { width = rootWidth; height = rootHeight; } - /* Create the window. */ - bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, - rootWidth, rootHeight, 0, 0, 0); - /* Create the pixmap. */ - bp->pixmap = JXCreatePixmap(display, bp->window, - width, height, rootDepth); + bp->pixmap = JXCreatePixmap(display, rootWindow, + width, height, rootVisual.depth); /* Clear the pixmap in case it is too small. */ JXSetForeground(display, rootGC, 0); JXFillRectangle(display, bp->pixmap, rootGC, 0, 0, width, height); /* Draw the icon on the background pixmap. */ - PutIcon(ip, bp->pixmap, 0, 0, width, height); + PutIcon(&rootVisual, ip, bp->pixmap, 0, 0, 0, width, height); /* We don't need the icon anymore. */ DestroyIcon(ip); } - diff -Nru jwm-2.1.0+svn579/src/background.h jwm-2.3.1+0~16~ubuntu14.10.1/src/background.h --- jwm-2.1.0+svn579/src/background.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/background.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,17 +10,12 @@ #ifndef BACKGROUND_H #define BACKGROUND_H -/** Initialize any data needed for background support. */ -void InitializeBackgrounds(); - -/** Startup background support. */ -void StartupBackgrounds(); - -/** Shutdown background support. */ -void ShutdownBackgrounds(); - -/** Release any data needed for background support. */ -void DestroyBackgrounds(); +/*@{*/ +void InitializeBackgrounds(void); +void StartupBackgrounds(void); +void ShutdownBackgrounds(void); +void DestroyBackgrounds(void); +/*@}*/ /** Set the background to use for the specified desktops. * @param desktop The desktop whose background to set (-1 for the default). diff -Nru jwm-2.1.0+svn579/src/border.c jwm-2.3.1+0~16~ubuntu14.10.1/src/border.c --- jwm-2.1.0+svn579/src/border.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/border.c 2015-07-18 20:02:18.000000000 +0000 @@ -1,6 +1,9 @@ /** - * Functions for dealing with window borders. - * Copyright (C) 2004 Joe Wingbermuehle + * @file border.c + * @author Joe Wingbermuehle + * @date 2004-2015 + * + * @brief Functions for dealing with window borders. * */ @@ -9,183 +12,123 @@ #include "client.h" #include "clientlist.h" #include "color.h" -#include "main.h" #include "icon.h" #include "font.h" -#include "error.h" #include "misc.h" - -typedef unsigned char BorderPixmapDataType[32]; - -static BorderPixmapDataType bitmaps[BP_COUNT] = { - - /* Close */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x06, 0x70, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0xE0, 0x03, 0x70, 0x07, - 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - - /* Minimize */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xF8, 0x07, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00 }, - - /* Maximize */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x1F, - 0xF8, 0x1F, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, - 0xF8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, - - /* Maximize Active */ - { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0F, - 0xC0, 0x0F, 0x00, 0x08, 0xF0, 0x0B, 0xF0, 0x0B, 0x10, 0x0A, 0x10, 0x0A, - 0x10, 0x02, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00 } - -}; - -static Pixmap pixmaps[BP_COUNT]; -static char *bmpFiles[BP_COUNT]; - -static Region borderRegion = NULL; -static GC borderGC; +#include "settings.h" +#include "grab.h" +#include "button.h" + +static char *buttonNames[BI_COUNT]; +static IconNode *buttonIcons[BI_COUNT]; + +static void DrawBorderHelper(const ClientNode *np); +static void DrawBorderHandles(const ClientNode *np, GC gc); +static void DrawBorderButtons(const ClientNode *np, + Pixmap canvas, GC gc); +static char DrawBorderIcon(BorderIconType t, + unsigned xoffset, unsigned yoffset, + const VisualData *visual, Pixmap canvas); +static void DrawCloseButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc); +static void DrawMaxIButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc); +static void DrawMaxAButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc); +static void DrawMinButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc); +static unsigned GetButtonCount(const ClientNode *np); #ifdef USE_SHAPE -static Pixmap shapePixmap; -static int shapePixmapWidth; -static int shapePixmapHeight; -static GC shapeGC; +static void FillRoundedRectangle(Drawable d, GC gc, int x, int y, + int width, int height, int radius); #endif -static void DrawBorderHelper(const ClientNode *np, int drawIcon); -static void DrawBorderButtons(const ClientNode *np, Pixmap canvas, GC gc); -static int GetButtonCount(const ClientNode *np); - -/** Initialize non-server resources. */ -void InitializeBorders() { - memset(bmpFiles, 0, sizeof(bmpFiles)); +/** Initialize structures. */ +void InitializeBorders(void) +{ + memset(buttonNames, 0, sizeof(buttonNames)); } /** Initialize server resources. */ -void StartupBorders() { - - XGCValues gcValues; - unsigned long gcMask; - int x, hotx, hoty; - unsigned int bmpHeight, bmpWidth; - int found; - - for(x = 0; x < BP_COUNT; x++) { - found = bmpFiles[x] ? 1 : 0; - if(found) { - found = XReadBitmapFile(display, rootWindow, bmpFiles[x], &bmpWidth, - &bmpHeight, &pixmaps[x], &hotx, &hoty) - == BitmapSuccess; - if(JUNLIKELY(!found)) { - Warning(_("bitmap could not be loaded: %s"), bmpFiles[x]); - } - } - if(!found) { - pixmaps[x] = JXCreateBitmapFromData(display, rootWindow, - (char*)bitmaps[x], 16, 16); +void StartupBorders(void) +{ + unsigned int i; + + for(i = 0; i < BI_COUNT; i++) { + if(buttonNames[i]) { + buttonIcons[i] = LoadNamedIcon(buttonNames[i], 1, 1); + Release(buttonNames[i]); + } else { + buttonIcons[i] = NULL; } } - gcMask = GCGraphicsExposures; - gcValues.graphics_exposures = False; - borderGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); - -#if defined(USE_SHAPE) && defined(USE_XMU) - shapePixmap = None; - shapeGC = None; - shapePixmapWidth = 0; - shapePixmapHeight = 0; -#endif - } /** Release server resources. */ -void ShutdownBorders() { - - int x; - - JXFreeGC(display, borderGC); - - for(x = 0; x < BP_COUNT; x++) { - JXFreePixmap(display, pixmaps[x]); - } - -#if defined(USE_SHAPE) && defined(USE_XMU) - if(shapePixmap != None) { - JXFreePixmap(display, shapePixmap); - shapePixmap = None; - } - if(shapeGC != None) { - JXFreeGC(display, shapeGC); - shapeGC = None; - } -#endif - -} - -/** Release non-server resources. */ -void DestroyBorders() { - - int x; - - for(x = 0; x < BP_COUNT; x++) { - if(bmpFiles[x]) { - Release(bmpFiles[x]); - bmpFiles[x] = NULL; - } - } +void ShutdownBorders(void) +{ } /** Get the size of the icon to display on a window. */ -int GetBorderIconSize() { - return titleHeight - 6; +int GetBorderIconSize(void) +{ + if(settings.handles) { + return settings.titleHeight - 4; + } else { + return settings.titleHeight - 6; + } } /** Determine the border action to take given coordinates. */ -BorderActionType GetBorderActionType(const ClientNode *np, int x, int y) { +BorderActionType GetBorderActionType(const ClientNode *np, int x, int y) +{ int north, south, east, west; - int offset; - - Assert(np); + unsigned int resizeMask; + const unsigned int titleHeight = settings.titleHeight; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); /* Check title bar actions. */ - if(np->state.border & BORDER_TITLE) { + if((np->state.border & BORDER_TITLE) && + titleHeight > settings.borderWidth) { /* Check buttons on the title bar. */ - if(y >= south && y <= titleHeight) { + int offset = np->width + west; + if(y >= south && y <= titleHeight + south) { /* Menu button. */ - if(np->icon && np->width >= titleHeight) { - if(x > 0 && x <= titleHeight) { + if(np->width >= titleHeight) { + if(x > west && x <= titleHeight + west) { return BA_MENU; } } /* Close button. */ - offset = np->width + west + east - titleHeight; - if((np->state.border & BORDER_CLOSE) && offset > titleHeight) { - if(x > offset && x < offset + titleHeight) { + if((np->state.border & BORDER_CLOSE) && offset > 2 * titleHeight) { + if(x > offset - titleHeight && x < offset) { return BA_CLOSE; } - offset -= titleHeight; + offset -= titleHeight + 1; } /* Maximize button. */ - if((np->state.border & BORDER_MAX) && offset > titleHeight) { - if(x > offset && x < offset + titleHeight) { + if((np->state.border & BORDER_MAX) && offset > 2 * titleHeight) { + if(x > offset - titleHeight && x < offset) { return BA_MAXIMIZE; } - offset -= titleHeight; + offset -= titleHeight + 1; } /* Minimize button. */ - if((np->state.border & BORDER_MIN) && offset > titleHeight) { - if(x > offset && x < offset + titleHeight) { + if((np->state.border & BORDER_MIN) && offset > 2 * titleHeight) { + if(x > offset - titleHeight && x < offset) { return BA_MINIMIZE; } } @@ -193,8 +136,8 @@ } /* Check for move. */ - if(y >= south && y <= titleHeight) { - if(x > 0 && x < np->width + east + west) { + if(y >= south && y <= titleHeight + south) { + if(x > west && x < offset) { if(np->state.border & BORDER_MOVE) { return BA_MOVE; } else { @@ -211,44 +154,150 @@ return BA_NONE; } + /* We don't allow resizing maximized windows. */ + resizeMask = BA_RESIZE_S | BA_RESIZE_N + | BA_RESIZE_E | BA_RESIZE_W + | BA_RESIZE; + if(np->state.maxFlags & MAX_HORIZ) { + resizeMask &= ~(BA_RESIZE_E | BA_RESIZE_W); + } + if(np->state.maxFlags & MAX_VERT) { + resizeMask &= ~(BA_RESIZE_N | BA_RESIZE_S); + } + if(np->state.status & STAT_SHADED) { + resizeMask &= ~(BA_RESIZE_N | BA_RESIZE_S); + } + /* Check south east/west and north east/west resizing. */ - if(np->width >= titleHeight * 2 && np->height >= titleHeight * 2) { - if(y > np->height + north - titleHeight) { - if(x < titleHeight) { - return BA_RESIZE_S | BA_RESIZE_W | BA_RESIZE; - } else if(x > np->width + west - titleHeight) { - return BA_RESIZE_S | BA_RESIZE_E | BA_RESIZE; - } - } else if(y < titleHeight) { - if(x < titleHeight) { - return BA_RESIZE_N | BA_RESIZE_W | BA_RESIZE; - } else if(x > np->width + west - titleHeight) { - return BA_RESIZE_N | BA_RESIZE_E | BA_RESIZE; + if( np->width >= settings.titleHeight * 2 + && np->height >= settings.titleHeight * 2) { + if(y > np->height + north - settings.titleHeight) { + if(x < settings.titleHeight) { + return (BA_RESIZE_S | BA_RESIZE_W | BA_RESIZE) & resizeMask; + } else if(x > np->width + west - settings.titleHeight) { + return (BA_RESIZE_S | BA_RESIZE_E | BA_RESIZE) & resizeMask; + } + } else if(y < settings.titleHeight) { + if(x < settings.titleHeight) { + return (BA_RESIZE_N | BA_RESIZE_W | BA_RESIZE) & resizeMask; + } else if(x > np->width + west - settings.titleHeight) { + return (BA_RESIZE_N | BA_RESIZE_E | BA_RESIZE) & resizeMask; } } } /* Check east, west, north, and south resizing. */ if(x <= west) { - return BA_RESIZE_W | BA_RESIZE; + return (BA_RESIZE_W | BA_RESIZE) & resizeMask; } else if(x >= np->width + west) { - return BA_RESIZE_E | BA_RESIZE; + return (BA_RESIZE_E | BA_RESIZE) & resizeMask; } else if(y >= np->height + north) { - return BA_RESIZE_S | BA_RESIZE; + return (BA_RESIZE_S | BA_RESIZE) & resizeMask; } else if(y <= south) { - return BA_RESIZE_N | BA_RESIZE; + return (BA_RESIZE_N | BA_RESIZE) & resizeMask; } else { return BA_NONE; } } -/** Draw a client border. */ -void DrawBorder(const ClientNode *np, const XExposeEvent *expose) { +/** Reset the shape of a window border. */ +void ResetBorder(const ClientNode *np) +{ +#ifdef USE_SHAPE + Pixmap shapePixmap; + GC shapeGC; +#endif - XRectangle rect; - int drawIcon; - int temp; + int north, south, east, west; + int width, height; + + GrabServer(); + + /* Determine the size of the window. */ + GetBorderSize(&np->state, &north, &south, &east, &west); + width = np->width + east + west; + if(np->state.status & STAT_SHADED) { + height = north + south; + } else { + height = np->height + north + south; + } + + /** Set the window size. */ + if(!(np->state.status & STAT_SHADED)) { + JXMoveResizeWindow(display, np->window, west, north, + np->width, np->height); + } + JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, + width, height); + +#ifdef USE_SHAPE + if(settings.cornerRadius > 0) { + + /* First set the shape to the window border. */ + shapePixmap = JXCreatePixmap(display, np->parent, width, height, 1); + shapeGC = JXCreateGC(display, shapePixmap, 0, NULL); + + /* Make the whole area transparent. */ + JXSetForeground(display, shapeGC, 0); + JXFillRectangle(display, shapePixmap, shapeGC, 0, 0, width, height); + + /* Draw the window area without the corners. */ + /* Corner bound radius -1 to allow slightly better outline drawing */ + JXSetForeground(display, shapeGC, 1); + if(((np->state.status & STAT_FULLSCREEN) || np->state.maxFlags) && + !(np->state.status & (STAT_SHADED))) { + JXFillRectangle(display, shapePixmap, shapeGC, 0, 0, width, height); + } else { + FillRoundedRectangle(shapePixmap, shapeGC, 0, 0, width, height, + settings.cornerRadius - 1); + } + + /* Apply the client window. */ + if(!(np->state.status & STAT_SHADED) && + (np->state.status & STAT_SHAPED)) { + + XRectangle *rects; + int count; + int ordering; + + /* Cut out an area for the client window. */ + JXSetForeground(display, shapeGC, 0); + JXFillRectangle(display, shapePixmap, shapeGC, west, north, + np->width, np->height); + + /* Fill in the visible area. */ + rects = JXShapeGetRectangles(display, np->window, ShapeBounding, + &count, &ordering); + if(JLIKELY(rects)) { + int i; + for(i = 0; i < count; i++) { + rects[i].x += east; + rects[i].y += north; + } + JXSetForeground(display, shapeGC, 1); + JXFillRectangles(display, shapePixmap, shapeGC, rects, count); + JXFree(rects); + } + + } + + /* Set the shape. */ + JXShapeCombineMask(display, np->parent, ShapeBounding, 0, 0, + shapePixmap, ShapeSet); + + JXFreeGC(display, shapeGC); + JXFreePixmap(display, shapePixmap); + } +#endif + + UngrabServer(); + +} + +/** Draw a client border. */ +void DrawBorder(const ClientNode *np) +{ Assert(np); @@ -272,76 +321,14 @@ return; } - if(expose) { - - /* An expose event caused this draw. - * Only draw what needs to be drawn to reduce flicker. - */ - - /* Create the region to use if needed. */ - if(!borderRegion) { - borderRegion = XCreateRegion(); - } - - /* Add the exposed area to the region. */ - rect.x = (short)expose->x; - rect.y = (short)expose->y; - rect.width = (unsigned short)expose->width; - rect.height = (unsigned short)expose->height; - XUnionRectWithRegion(&rect, borderRegion, borderRegion); - - /* We return now if there are more expose events coming. */ - if(expose->count) { - return; - } - - /* Determine if the icon should be redrawn. This is needed - * since icons need a separate GC for applying shape masks. - * Note that if the icon were naively redrawn, icons with - * alpha channels would acquire artifacts since the area under - * them would not be cleared. So if any part of the icon needs - * to be redrawn, we clear the area and redraw the whole icon. - */ - drawIcon = 0; - if(np->icon && (np->state.border & BORDER_TITLE)) { - temp = GetBorderIconSize(); - rect.x = 6; - rect.y = (short)((titleHeight - temp) / 2); - rect.width = (unsigned short)temp; - rect.height = (unsigned short)temp; - if(XRectInRegion(borderRegion, - rect.x, rect.y, rect.width, rect.height) != RectangleOut) { - - drawIcon = 1; - XUnionRectWithRegion(&rect, borderRegion, borderRegion); - - } - } - - /* Time to redraw the border. Set the clip mask. */ - XSetRegion(display, borderGC, borderRegion); - - } else { - - /* An expose event did not occur. Redraw everything. */ - drawIcon = 1; - XSetClipMask(display, borderGC, None); - - } - /* Do the actual drawing. */ - DrawBorderHelper(np, drawIcon); - - /* We no longer need the region, release it. */ - if(expose) { - XDestroyRegion(borderRegion); - borderRegion = NULL; - } + DrawBorderHelper(np); } /** Helper method for drawing borders. */ -void DrawBorderHelper(const ClientNode *np, int drawIcon) { +void DrawBorderHelper(const ClientNode *np) +{ ColorType borderTextColor; @@ -352,19 +339,20 @@ unsigned int width, height; int iconSize; - int buttonCount, titleWidth; + unsigned int buttonCount; + int titleWidth; Pixmap canvas; GC gc; Assert(np); iconSize = GetBorderIconSize(); - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); width = np->width + east + west; height = np->height + north + south; /* Determine the colors and gradients to use. */ - if(np->state.status & STAT_ACTIVE) { + if(np->state.status & (STAT_ACTIVE | STAT_FLASH)) { borderTextColor = COLOR_TITLE_ACTIVE_FG; titleColor1 = colors[COLOR_TITLE_ACTIVE_BG1]; @@ -380,200 +368,741 @@ } - canvas = np->parent; - gc = borderGC; - - /* Shape window corners */ - if(np->state.status & STAT_SHADED) { - ShapeRoundedRectWindow(np->parent, width, north); - } else { - ShapeRoundedRectWindow(np->parent, width, height); - } + /* Set parent background to reduce flicker. */ + JXSetWindowBackground(display, np->parent, titleColor2); - /* Set the window background color (to reduce flickering). */ - JXSetWindowBackground(display, canvas, titleColor2); + canvas = JXCreatePixmap(display, np->parent, width, north, + np->visual.depth); + gc = JXCreateGC(display, canvas, 0, NULL); - /* Draw the outside border (clear the window with the right color). */ + /* Clear the window with the right color. */ JXSetForeground(display, gc, titleColor2); - JXFillRectangle(display, canvas, gc, 0, 0, width, height); + JXFillRectangle(display, canvas, gc, 0, 0, width, north); /* Determine how many pixels may be used for the title. */ buttonCount = GetButtonCount(np); - titleWidth = width; - titleWidth -= titleHeight * buttonCount; - titleWidth -= iconSize + 7 + 6; + titleWidth = width - east - west - 5; + titleWidth -= settings.titleHeight * (buttonCount + 1); + titleWidth -= settings.handles ? (buttonCount + 1) : 0; + + /* Draw the top part (either a title or north border). */ + if((np->state.border & BORDER_TITLE) && + settings.titleHeight > settings.borderWidth) { - /* Draw the top part (either a title or north border. */ - if(np->state.border & BORDER_TITLE) { + const unsigned startx = west + 1; + const unsigned starty = settings.handles ? (south - 1) : 0; /* Draw a title bar. */ DrawHorizontalGradient(canvas, gc, titleColor1, titleColor2, - 1, 1, width - 2, titleHeight - 2); + 0, 1, width, settings.titleHeight - 2); /* Draw the icon. */ - if(np->icon && np->width >= titleHeight && drawIcon) { - PutIcon(np->icon, canvas, 6, (titleHeight - iconSize) / 2, + if(np->icon && np->width >= settings.titleHeight) { + PutIcon(&np->visual, np->icon, canvas, colors[borderTextColor], + startx, starty + (settings.titleHeight - iconSize) / 2, iconSize, iconSize); } if(np->name && np->name[0] && titleWidth > 0) { - RenderString(canvas, FONT_BORDER, borderTextColor, - iconSize + 6 + 4, - (titleHeight - GetStringHeight(FONT_BORDER)) / 2, - titleWidth, borderRegion, np->name); + const int sheight = GetStringHeight(FONT_BORDER); + const unsigned titlex = startx + settings.titleHeight + + (settings.handles ? 4 : 0); + const unsigned titley = starty + (settings.titleHeight - sheight) / 2; + RenderString(&np->visual, canvas, FONT_BORDER, borderTextColor, + titlex, titley, titleWidth, np->name); } + DrawBorderButtons(np, canvas, gc); + } - /* Window outline. */ - JXSetForeground(display, gc, outlineColor); -#ifdef USE_SHAPE - if(np->state.status & STAT_SHADED) { - DrawRoundedRectangle(canvas, gc, 0, 0, width - 1, north - 1, - CORNER_RADIUS); + /* Copy the title bar to the window. */ + JXCopyArea(display, canvas, np->parent, gc, 0, 1, + width, north - 1, 0, 1); + + /* Window outline. + * These are drawn directly to the window. + */ + JXClearArea(display, np->parent, 0, north, + width, height - north, False); + if(settings.handles) { + DrawBorderHandles(np, gc); } else { - DrawRoundedRectangle(canvas, gc, 0, 0, width - 1, height - 1, - CORNER_RADIUS); + JXSetForeground(display, gc, outlineColor); + if(np->state.status & STAT_SHADED) { + DrawRoundedRectangle(np->parent, gc, 0, 0, width - 1, north - 1, + settings.cornerRadius); + } else if(np->state.maxFlags & MAX_HORIZ) { + if(!(np->state.maxFlags & (MAX_TOP | MAX_VERT))) { + /* Top */ + JXDrawLine(display, np->parent, gc, 0, 0, width, 0); + } + if(!(np->state.maxFlags & (MAX_BOTTOM | MAX_VERT))) { + /* Bottom */ + JXDrawLine(display, np->parent, gc, + 0, height - 1, width, height - 1); + } + } else if(np->state.maxFlags & MAX_VERT) { + if(!(np->state.maxFlags & (MAX_LEFT | MAX_HORIZ))) { + /* Left */ + JXDrawLine(display, np->parent, gc, 0, 0, 0, height); + } + if(!(np->state.maxFlags & (MAX_RIGHT | MAX_HORIZ))) { + /* Right */ + JXDrawLine(display, np->parent, gc, + width - 1, 0, width - 1, height); + } + } else { + DrawRoundedRectangle(np->parent, gc, 0, 0, width - 1, height - 1, + settings.cornerRadius); + } } -#else + + JXFreePixmap(display, canvas); + JXFreeGC(display, gc); + +} + +/** Draw window handles. */ +void DrawBorderHandles(const ClientNode *np, GC gc) +{ + XSegment segments[8]; + long pixelUp, pixelDown; + int width, height; + int north, south, east, west; + unsigned offset = 0; + + /* Determine the window size. */ + GetBorderSize(&np->state, &north, &south, &east, &west); + width = np->width + east + west; if(np->state.status & STAT_SHADED) { - JXDrawRectangle(display, canvas, gc, 0, 0, width - 1, north - 1); + height = north + south; } else { - JXDrawRectangle(display, canvas, gc, 0, 0, width - 1, height - 1); + height = np->height + north + south; + } + + /* Determine the colors to use. */ + if(np->state.status & (STAT_ACTIVE | STAT_FLASH)) { + pixelUp = colors[COLOR_TITLE_ACTIVE_UP]; + pixelDown = colors[COLOR_TITLE_ACTIVE_DOWN]; + } else { + pixelUp = colors[COLOR_TITLE_UP]; + pixelDown = colors[COLOR_TITLE_DOWN]; } -#endif - DrawBorderButtons(np, canvas, gc); + if(!(np->state.maxFlags & MAX_VERT)) { + /* Top title border. */ + segments[offset].x1 = west; + segments[offset].y1 = settings.borderWidth; + segments[offset].x2 = width - east - 1; + segments[offset].y2 = settings.borderWidth; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_HORIZ)) { + /* Right title border. */ + segments[offset].x1 = west; + segments[offset].y1 = south + 1; + segments[offset].x2 = east; + segments[offset].y2 = settings.titleHeight + south - 1; + offset += 1; + + /* Inside right border. */ + segments[offset].x1 = width - east; + segments[offset].y1 = south; + segments[offset].x2 = width - east; + segments[offset].y2 = height - south; + offset += 1; + } + + /* Inside bottom border. */ + segments[offset].x1 = west; + segments[offset].y1 = height - south; + segments[offset].x2 = width - east; + segments[offset].y2 = height - south; + offset += 1; + + if(!(np->state.maxFlags & MAX_HORIZ)) { + /* Left border. */ + segments[offset].x1 = 0; + segments[offset].y1 = 0; + segments[offset].x2 = 0; + segments[offset].y2 = height - 1; + offset += 1; + segments[offset].x1 = 1; + segments[offset].y1 = 1; + segments[offset].x2 = 1; + segments[offset].y2 = height - 2; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_VERT)) { + /* Top border. */ + segments[offset].x1 = 1; + segments[offset].y1 = 0; + segments[offset].x2 = width - 1; + segments[offset].y2 = 0; + offset += 1; + segments[offset].x1 = 1; + segments[offset].y1 = 1; + segments[offset].x2 = width - 2; + segments[offset].y2 = 1; + offset += 1; + } + + /* Draw pixel-up segments. */ + JXSetForeground(display, gc, pixelUp); + JXDrawSegments(display, np->parent, gc, segments, offset); + offset = 0; + + /* Bottom title border. */ + segments[offset].x1 = west + 1; + segments[offset].y1 = north - 1; + segments[offset].x2 = width - east - 1; + segments[offset].y2 = north - 1; + offset += 1; + + if(!(np->state.maxFlags & MAX_HORIZ)) { + /* Right title border. */ + segments[offset].x1 = width - east - 1; + segments[offset].y1 = south + 1; + segments[offset].x2 = width - east - 1; + segments[offset].y2 = north - 1; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_VERT)) { + /* Inside top border. */ + segments[offset].x1 = west - 1; + segments[offset].y1 = settings.borderWidth - 1; + segments[offset].x2 = width - east; + segments[offset].y2 = settings.borderWidth - 1; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_HORIZ)) { + /* Inside left border. */ + segments[offset].x1 = west - 1; + segments[offset].y1 = south; + segments[offset].x2 = west - 1; + segments[offset].y2 = height - south; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_HORIZ)) { + /* Right border. */ + segments[offset].x1 = width - 1; + segments[offset].y1 = 0; + segments[offset].x2 = width - 1; + segments[offset].y2 = height - 1; + offset += 1; + segments[offset].x1 = width - 2; + segments[offset].y1 = 1; + segments[offset].x2 = width - 2; + segments[offset].y2 = height - 2; + offset += 1; + } + + if(!(np->state.maxFlags & MAX_VERT)) { + /* Bottom border. */ + segments[offset].x1 = 0; + segments[offset].y1 = height - 1; + segments[offset].x2 = width; + segments[offset].y2 = height - 1; + offset += 1; + segments[offset].x1 = 1; + segments[offset].y1 = height - 2; + segments[offset].x2 = width - 1; + segments[offset].y2 = height - 2; + offset += 1; + } + + /* Draw pixel-down segments. */ + JXSetForeground(display, gc, pixelDown); + JXDrawSegments(display, np->parent, gc, segments, offset); + offset = 0; + + /* Draw marks */ + if((np->state.border & BORDER_RESIZE) + && !(np->state.status & STAT_SHADED) + && !(np->state.maxFlags)) { + + /* Upper left */ + segments[0].x1 = settings.titleHeight + settings.borderWidth - 1; + segments[0].y1 = 0; + segments[0].x2 = settings.titleHeight + settings.borderWidth - 1; + segments[0].y2 = settings.borderWidth; + segments[1].x1 = 0; + segments[1].y1 = settings.titleHeight + settings.borderWidth - 1; + segments[1].x2 = settings.borderWidth; + segments[1].y2 = settings.titleHeight + settings.borderWidth - 1; + + /* Upper right. */ + segments[2].x1 = width - settings.borderWidth; + segments[2].y1 = settings.titleHeight + settings.borderWidth - 1; + segments[2].x2 = width; + segments[2].y2 = settings.titleHeight + settings.borderWidth - 1; + segments[3].x1 = width - settings.titleHeight - settings.borderWidth - 1; + segments[3].y1 = 0; + segments[3].x2 = width - settings.titleHeight - settings.borderWidth - 1; + segments[3].y2 = settings.borderWidth; + + /* Lower left */ + segments[4].x1 = 0; + segments[4].y1 = height - settings.titleHeight - settings.borderWidth - 1; + segments[4].x2 = settings.borderWidth; + segments[4].y2 = height - settings.titleHeight - settings.borderWidth - 1; + segments[5].x1 = settings.titleHeight + settings.borderWidth - 1; + segments[5].y1 = height - settings.borderWidth; + segments[5].x2 = settings.titleHeight + settings.borderWidth - 1; + segments[5].y2 = height; + + /* Lower right */ + segments[6].x1 = width - settings.borderWidth; + segments[6].y1 = height - settings.titleHeight - settings.borderWidth - 1; + segments[6].x2 = width; + segments[6].y2 = height - settings.titleHeight - settings.borderWidth - 1; + segments[7].x1 = width - settings.titleHeight - settings.borderWidth - 1; + segments[7].y1 = height - settings.borderWidth; + segments[7].x2 = width - settings.titleHeight - settings.borderWidth - 1; + segments[7].y2 = height; + + /* Draw pixel-down segments. */ + JXSetForeground(display, gc, pixelDown); + JXDrawSegments(display, np->parent, gc, segments, 8); + + /* Upper left */ + segments[0].x1 = settings.titleHeight + settings.borderWidth; + segments[0].y1 = 0; + segments[0].x2 = settings.titleHeight + settings.borderWidth; + segments[0].y2 = settings.borderWidth; + segments[1].x1 = 0; + segments[1].y1 = settings.titleHeight + settings.borderWidth; + segments[1].x2 = settings.borderWidth; + segments[1].y2 = settings.titleHeight + settings.borderWidth; + + /* Upper right */ + segments[2].x1 = width - settings.titleHeight - settings.borderWidth; + segments[2].y1 = 0; + segments[2].x2 = width - settings.titleHeight - settings.borderWidth; + segments[2].y2 = settings.borderWidth; + segments[3].x1 = width - settings.borderWidth; + segments[3].y1 = settings.titleHeight + settings.borderWidth; + segments[3].x2 = width; + segments[3].y2 = settings.titleHeight + settings.borderWidth; + + /* Lower left */ + segments[4].x1 = 0; + segments[4].y1 = height - settings.titleHeight - settings.borderWidth; + segments[4].x2 = settings.borderWidth; + segments[4].y2 = height - settings.titleHeight - settings.borderWidth; + segments[5].x1 = settings.titleHeight + settings.borderWidth; + segments[5].y1 = height - settings.borderWidth; + segments[5].x2 = settings.titleHeight + settings.borderWidth; + segments[5].y2 = height; + + /* Lower right */ + segments[6].x1 = width - settings.borderWidth; + segments[6].y1 = height - settings.titleHeight - settings.borderWidth; + segments[6].x2 = width; + segments[6].y2 = height - settings.titleHeight - settings.borderWidth; + segments[7].x1 = width - settings.titleHeight - settings.borderWidth; + segments[7].y1 = height - settings.borderWidth; + segments[7].x2 = width - settings.titleHeight - settings.borderWidth; + segments[7].y2 = height; + + /* Draw pixel-up segments. */ + JXSetForeground(display, gc, pixelUp); + JXDrawSegments(display, np->parent, gc, segments, 8); + } } /** Determine the number of buttons to be displayed for a client. */ -int GetButtonCount(const ClientNode *np) { +unsigned GetButtonCount(const ClientNode *np) +{ int north, south, east, west; - int count; - int offset; + unsigned count; + unsigned buttonWidth; + int available; if(!(np->state.border & BORDER_TITLE)) { return 0; } - - GetBorderSize(np, &north, &south, &east, &west); - - offset = np->width + east + west - titleHeight; - if(offset <= titleHeight) { + if(settings.titleHeight <= settings.borderWidth) { return 0; } + buttonWidth = settings.titleHeight; + buttonWidth += settings.handles ? 1 : 0; + + GetBorderSize(&np->state, &north, &south, &east, &west); + count = 0; + available = np->width - buttonWidth; + if(available < buttonWidth) { + return count; + } + if(np->state.border & BORDER_CLOSE) { - offset -= titleHeight; - ++count; - if(offset <= titleHeight) { + count += 1; + available -= buttonWidth; + if(available < buttonWidth) { return count; } } if(np->state.border & BORDER_MAX) { - offset -= titleHeight; - ++count; - if(offset <= titleHeight) { + count += 1; + available -= buttonWidth; + if(available < buttonWidth) { return count; } } if(np->state.border & BORDER_MIN) { - ++count; + count += 1; } return count; - } /** Draw the buttons on a client frame. */ -void DrawBorderButtons(const ClientNode *np, Pixmap canvas, GC gc) { - - Pixmap pixmap; +void DrawBorderButtons(const ClientNode *np, Pixmap canvas, GC gc) +{ long color; - int offset; - int yoffset; + long pixelUp, pixelDown; + int xoffset, yoffset; int north, south, east, west; + int minx; - Assert(np); - - if(!(np->state.border & BORDER_TITLE)) { - return; - } - - GetBorderSize(np, &north, &south, &east, &west); - offset = np->width + east + west - titleHeight; - if(offset <= titleHeight) { + GetBorderSize(&np->state, &north, &south, &east, &west); + xoffset = np->width + west - settings.titleHeight; + minx = settings.titleHeight + east; + if(xoffset <= minx) { return; } - yoffset = titleHeight / 2 - 16 / 2; - /* Determine the colors to use. */ - if(np->state.status & STAT_ACTIVE) { + if(np->state.status & (STAT_ACTIVE | STAT_FLASH)) { color = colors[COLOR_TITLE_ACTIVE_FG]; + pixelUp = colors[COLOR_TITLE_ACTIVE_UP]; + pixelDown = colors[COLOR_TITLE_ACTIVE_DOWN]; } else { color = colors[COLOR_TITLE_FG]; + pixelUp = colors[COLOR_TITLE_UP]; + pixelDown = colors[COLOR_TITLE_DOWN]; } /* Close button. */ + yoffset = settings.handles ? (south - 1) : 0; if(np->state.border & BORDER_CLOSE) { - pixmap = pixmaps[BP_CLOSE]; - JXSetForeground(display, gc, color); - JXSetClipMask(display, gc, pixmap); - JXSetClipOrigin(display, gc, offset + yoffset, yoffset); - JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); - JXSetClipMask(display, gc, None); + DrawCloseButton(xoffset, yoffset, &np->visual, canvas, gc); - offset -= titleHeight; - if(offset <= titleHeight) { - return; + if(settings.handles) { + JXSetForeground(display, gc, pixelDown); + JXDrawLine(display, canvas, gc, + west + settings.titleHeight - 1, + south, + west + settings.titleHeight - 1, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset - 1, + south, xoffset - 1, + south + settings.titleHeight); + JXSetForeground(display, gc, pixelUp); + JXDrawLine(display, canvas, gc, + east + settings.titleHeight, + south, + east + settings.titleHeight, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset, + south, xoffset, south + settings.titleHeight); + xoffset -= 1; } + xoffset -= settings.titleHeight; + if(xoffset <= minx) { + return; + } } /* Maximize button. */ if(np->state.border & BORDER_MAX) { - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - pixmap = pixmaps[BP_MAXIMIZE_ACTIVE]; + JXSetForeground(display, gc, color); + if(np->state.maxFlags) { + DrawMaxAButton(xoffset, yoffset, &np->visual, canvas, gc); } else { - pixmap = pixmaps[BP_MAXIMIZE]; + DrawMaxIButton(xoffset, yoffset, &np->visual, canvas, gc); } - JXSetForeground(display, gc, color); - JXSetClipMask(display, gc, pixmap); - JXSetClipOrigin(display, gc, offset + yoffset, yoffset); - JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); - JXSetClipMask(display, gc, None); + if(settings.handles) { + JXSetForeground(display, gc, pixelDown); + JXDrawLine(display, canvas, gc, + west + settings.titleHeight - 1, + south, + west + settings.titleHeight - 1, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset - 1, + south, xoffset - 1, + south + settings.titleHeight); + JXSetForeground(display, gc, pixelUp); + JXDrawLine(display, canvas, gc, + east + settings.titleHeight, + south, + east + settings.titleHeight, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset, + south, xoffset, south + settings.titleHeight); + xoffset -= 1; + } - offset -= titleHeight; - if(offset <= titleHeight) { + xoffset -= settings.titleHeight; + if(xoffset <= minx) { return; } - } /* Minimize button. */ if(np->state.border & BORDER_MIN) { - pixmap = pixmaps[BP_MINIMIZE]; - JXSetForeground(display, gc, color); - JXSetClipMask(display, gc, pixmap); - JXSetClipOrigin(display, gc, offset + yoffset, yoffset); - JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); - JXSetClipMask(display, gc, None); + DrawMinButton(xoffset, yoffset, &np->visual, canvas, gc); + + if(settings.handles) { + JXSetForeground(display, gc, pixelDown); + JXDrawLine(display, canvas, gc, + west + settings.titleHeight - 1, + south, + west + settings.titleHeight - 1, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset - 1, + south, xoffset - 1, + south + settings.titleHeight); + JXSetForeground(display, gc, pixelUp); + JXDrawLine(display, canvas, gc, + east + settings.titleHeight, + south, + east + settings.titleHeight, + south + settings.titleHeight); + JXDrawLine(display, canvas, gc, xoffset, + south, xoffset, south + settings.titleHeight); + xoffset -= 1; + } + } +} + +/** Attempt to draw a border icon. */ +char DrawBorderIcon(BorderIconType t, + unsigned xoffset, unsigned yoffset, + const VisualData *visual, Pixmap canvas) +{ + if(buttonIcons[t]) { + ButtonNode button; + ResetButton(&button, canvas, visual); + button.x = xoffset; + button.y = yoffset; + button.width = settings.titleHeight; + button.height = settings.titleHeight; + button.icon = buttonIcons[t]; + button.fill = 0; + DrawButton(&button); + return 1; + } else { + return 0; + } +} + +/** Draw a close button. */ +void DrawCloseButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc) +{ + XSegment segments[2]; + unsigned size; + unsigned x1, y1; + unsigned x2, y2; + + if(DrawBorderIcon(BI_CLOSE, xoffset, yoffset, visual, canvas)) { + return; + } + + size = (settings.titleHeight + 2) / 3; + x1 = xoffset + settings.titleHeight / 2 - size / 2; + y1 = yoffset + settings.titleHeight / 2 - size / 2; + x2 = x1 + size; + y2 = y1 + size; + + segments[0].x1 = x1; + segments[0].y1 = y1; + segments[0].x2 = x2; + segments[0].y2 = y2; + + segments[1].x1 = x2; + segments[1].y1 = y1; + segments[1].x2 = x1; + segments[1].y2 = y2; + + JXSetLineAttributes(display, gc, 2, LineSolid, + CapProjecting, JoinBevel); + JXDrawSegments(display, canvas, gc, segments, 2); + JXSetLineAttributes(display, gc, 1, LineSolid, + CapNotLast, JoinMiter); + +} + +/** Draw an inactive maximize button. */ +void DrawMaxIButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc) +{ + + XSegment segments[5]; + unsigned int size; + unsigned int x1, y1; + unsigned int x2, y2; + + if(DrawBorderIcon(BI_MAX, xoffset, yoffset, visual, canvas)) { + return; + } + + size = 2 + (settings.titleHeight + 2) / 3; + x1 = xoffset + settings.titleHeight / 2 - size / 2; + y1 = yoffset + settings.titleHeight / 2 - size / 2; + x2 = x1 + size; + y2 = y1 + size; + + segments[0].x1 = x1; + segments[0].y1 = y1; + segments[0].x2 = x1 + size; + segments[0].y2 = y1; + + segments[1].x1 = x1; + segments[1].y1 = y1 + 1; + segments[1].x2 = x1 + size; + segments[1].y2 = y1 + 1; + + segments[2].x1 = x1; + segments[2].y1 = y1; + segments[2].x2 = x1; + segments[2].y2 = y2; + + segments[3].x1 = x2; + segments[3].y1 = y1; + segments[3].x2 = x2; + segments[3].y2 = y2; + + segments[4].x1 = x1; + segments[4].y1 = y2; + segments[4].x2 = x2; + segments[4].y2 = y2; + + JXSetLineAttributes(display, gc, 1, LineSolid, + CapProjecting, JoinMiter); + JXDrawSegments(display, canvas, gc, segments, 5); + JXSetLineAttributes(display, gc, 1, LineSolid, + CapButt, JoinMiter); + +} +/** Draw an active maximize button. */ +void DrawMaxAButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc) +{ + XSegment segments[8]; + unsigned size; + unsigned x1, y1; + unsigned x2, y2; + unsigned x3, y3; + + if(DrawBorderIcon(BI_MAX_ACTIVE, xoffset, yoffset, visual, canvas)) { + return; } + size = 2 + (settings.titleHeight + 2) / 3; + x1 = xoffset + settings.titleHeight / 2 - size / 2; + y1 = yoffset + settings.titleHeight / 2 - size / 2; + x2 = x1 + size; + y2 = y1 + size; + x3 = x1 + size / 2; + y3 = y1 + size / 2; + + segments[0].x1 = x1; + segments[0].y1 = y1; + segments[0].x2 = x2; + segments[0].y2 = y1; + + segments[1].x1 = x1; + segments[1].y1 = y1 + 1; + segments[1].x2 = x2; + segments[1].y2 = y1 + 1; + + segments[2].x1 = x1; + segments[2].y1 = y1; + segments[2].x2 = x1; + segments[2].y2 = y2; + + segments[3].x1 = x2; + segments[3].y1 = y1; + segments[3].x2 = x2; + segments[3].y2 = y2; + + segments[4].x1 = x1; + segments[4].y1 = y2; + segments[4].x2 = x2; + segments[4].y2 = y2; + + segments[5].x1 = x1; + segments[5].y1 = y3; + segments[5].x2 = x3; + segments[5].y2 = y3; + + segments[6].x1 = x1; + segments[6].y1 = y3 + 1; + segments[6].x2 = x3; + segments[6].y2 = y3 + 1; + + segments[7].x1 = x3; + segments[7].y1 = y3; + segments[7].x2 = x3; + segments[7].y2 = y2; + + JXSetLineAttributes(display, gc, 1, LineSolid, + CapProjecting, JoinMiter); + JXDrawSegments(display, canvas, gc, segments, 8); + JXSetLineAttributes(display, gc, 1, LineSolid, + CapButt, JoinMiter); +} + +/** Draw a minimize button. */ +void DrawMinButton(unsigned xoffset, unsigned yoffset, + const VisualData *visual, + Pixmap canvas, GC gc) +{ + + unsigned int size; + unsigned int x1, y1; + unsigned int x2, y2; + + if(DrawBorderIcon(BI_MIN, xoffset, yoffset, visual, canvas)) { + return; + } + + size = (settings.titleHeight + 2) / 3; + x1 = xoffset + settings.titleHeight / 2 - size / 2; + y1 = yoffset + settings.titleHeight / 2 - size / 2; + x2 = x1 + size; + y2 = y1 + size; + JXSetLineAttributes(display, gc, 2, LineSolid, + CapProjecting, JoinMiter); + JXDrawLine(display, canvas, gc, x1, y2, x2, y2); + JXSetLineAttributes(display, gc, 1, LineSolid, CapButt, JoinMiter); + } /** Redraw the borders on the current desktop. @@ -581,7 +1110,8 @@ * may cause borders on the current desktop to become visible after moving * clients to their assigned desktops. */ -void ExposeCurrentDesktop() { +void ExposeCurrentDesktop(void) +{ ClientNode *np; int layer; @@ -589,7 +1119,7 @@ for(layer = 0; layer < LAYER_COUNT; layer++) { for(np = nodes[layer]; np; np = np->next) { if(!(np->state.status & (STAT_HIDDEN | STAT_MINIMIZED))) { - DrawBorder(np, NULL); + DrawBorder(np); } } } @@ -597,17 +1127,18 @@ } /** Get the size of the borders for a client. */ -void GetBorderSize(const ClientNode *np, - int *north, int *south, int *east, int *west) { +void GetBorderSize(const ClientState *state, + int *north, int *south, int *east, int *west) +{ - Assert(np); + Assert(state); Assert(north); Assert(south); Assert(east); Assert(west); /* Full screen is a special case. */ - if(np->state.status & STAT_FULLSCREEN) { + if(state->status & STAT_FULLSCREEN) { *north = 0; *south = 0; *east = 0; @@ -615,142 +1146,118 @@ return; } - if(np->state.border & BORDER_OUTLINE) { - - *north = borderWidth; - *south = borderWidth; - *east = borderWidth; - *west = borderWidth; - - } else { + if(state->border & BORDER_OUTLINE) { - *north = 0; - *south = 0; - *east = 0; - *west = 0; - - } - - if(np->state.border & BORDER_TITLE) { - *north = titleHeight; - } - - if(np->state.status & STAT_SHADED) { - *south = 0; - } - -} - -/** Set the size of window borders. */ -void SetBorderWidth(const char *str) { - - int width; - - if(JLIKELY(str)) { - - width = atoi(str); - if(JUNLIKELY(width < MIN_BORDER_WIDTH || width > MAX_BORDER_WIDTH)) { - borderWidth = DEFAULT_BORDER_WIDTH; - Warning(_("invalid border width specified: %d"), width); + if(state->border & BORDER_TITLE) { + *north = settings.titleHeight; } else { - borderWidth = width; + *north = 0; } - - } - -} - -/** Set the height of the title bar. */ -void SetTitleHeight(const char *str) { - - int height; - - if(JLIKELY(str)) { - - height = atoi(str); - if(JUNLIKELY(height < MIN_TITLE_HEIGHT || height > MAX_TITLE_HEIGHT)) { - titleHeight = DEFAULT_TITLE_HEIGHT; - Warning(_("invalid title height specified: %d"), height); + if(state->maxFlags & MAX_VERT) { + *south = 0; } else { - titleHeight = height; + if(settings.handles) { + *north += settings.borderWidth; + *south = settings.borderWidth; + } else { + if(state->status & STAT_SHADED) { + *south = 0; + } else { + *south = settings.borderWidth; + } + } } - } - -} + if(state->maxFlags & MAX_HORIZ) { + *east = 0; + *west = 0; + } else { + *east = settings.borderWidth; + *west = settings.borderWidth; + } -/** Set the bitmask to use for a button. */ -void SetButtonMask(BorderPixmapType pt, const char *filename) { + } else { - if(bmpFiles[pt]) { - Release(bmpFiles[pt]); - bmpFiles[pt] = NULL; - } + *north = 0; + *south = 0; + *east = 0; + *west = 0; - if(JLIKELY(filename)) { - bmpFiles[pt] = CopyString(filename); - ExpandPath(&bmpFiles[pt]); } - } /** Draw a rounded rectangle. */ void DrawRoundedRectangle(Drawable d, GC gc, int x, int y, - int width, int height, int radius) { - + int width, int height, int radius) +{ +#ifdef USE_SHAPE #ifdef USE_XMU - XmuDrawRoundedRectangle(display, d, gc, x, y, width, height, - radius, radius); + if(radius > 0) { + XmuDrawRoundedRectangle(display, d, gc, x, y, width, height, + radius, radius); + } else { + JXDrawRectangle(display, d, gc, x, y, width, height); + } #else - XSegment segments[4]; - XArc arcs[4]; - - segments[0].x1 = x + radius; segments[0].y1 = y; - segments[0].x2 = x + width - radius; segments[0].y2 = y; - segments[1].x1 = x + radius; segments[1].y1 = y + height; - segments[1].x2 = x + width - radius; segments[1].y2 = y + height; - segments[2].x1 = x; segments[2].y1 = y + radius; - segments[2].x2 = x; segments[2].y2 = y + height - radius; - segments[3].x1 = x + width; segments[3].y1 = y + radius; - segments[3].x2 = x + width; segments[3].y2 = y + height - radius; - JXDrawSegments(display, d, gc, segments, 4); - - arcs[0].x = x; - arcs[0].y = y; - arcs[0].width = radius * 2; - arcs[0].height = radius * 2; - arcs[0].angle1 = 90 * 64; - arcs[0].angle2 = 90 * 64; - arcs[1].x = x + width - radius * 2; - arcs[1].y = y; - arcs[1].width = radius * 2; - arcs[1].height = radius * 2; - arcs[1].angle1 = 0 * 64; - arcs[1].angle2 = 90 * 64; - arcs[2].x = x; - arcs[2].y = y + height - radius * 2; - arcs[2].width = radius * 2; - arcs[2].height = radius * 2; - arcs[2].angle1 = 180 * 64; - arcs[2].angle2 = 90 * 64; - arcs[3].x = x + width - radius * 2; - arcs[3].y = y + height - radius * 2; - arcs[3].width = radius * 2; - arcs[3].height = radius * 2; - arcs[3].angle1 = 270 * 64; - arcs[3].angle2 = 90 * 64; - JXDrawArcs(display, d, gc, arcs, 4); + if(radius > 0) { + XSegment segments[4]; + XArc arcs[4]; + + segments[0].x1 = x + radius; segments[0].y1 = y; + segments[0].x2 = x + width - radius; segments[0].y2 = y; + segments[1].x1 = x + radius; segments[1].y1 = y + height; + segments[1].x2 = x + width - radius; segments[1].y2 = y + height; + segments[2].x1 = x; segments[2].y1 = y + radius; + segments[2].x2 = x; segments[2].y2 = y + height - radius; + segments[3].x1 = x + width; segments[3].y1 = y + radius; + segments[3].x2 = x + width; segments[3].y2 = y + height - radius; + JXDrawSegments(display, d, gc, segments, 4); + + arcs[0].x = x; + arcs[0].y = y; + arcs[0].width = radius * 2; + arcs[0].height = radius * 2; + arcs[0].angle1 = 90 * 64; + arcs[0].angle2 = 90 * 64; + arcs[1].x = x + width - radius * 2; + arcs[1].y = y; + arcs[1].width = radius * 2; + arcs[1].height = radius * 2; + arcs[1].angle1 = 0 * 64; + arcs[1].angle2 = 90 * 64; + arcs[2].x = x; + arcs[2].y = y + height - radius * 2; + arcs[2].width = radius * 2; + arcs[2].height = radius * 2; + arcs[2].angle1 = 180 * 64; + arcs[2].angle2 = 90 * 64; + arcs[3].x = x + width - radius * 2; + arcs[3].y = y + height - radius * 2; + arcs[3].width = radius * 2; + arcs[3].height = radius * 2; + arcs[3].angle1 = 270 * 64; + arcs[3].angle2 = 90 * 64; + JXDrawArcs(display, d, gc, arcs, 4); + } else { + JXDrawRectangle(display, d, gc, x, y, width, height); + } #endif +#else + JXDrawRectangle(display, d, gc, x, y, width, height); + +#endif } /** Fill a rounded rectangle. */ +#ifdef USE_SHAPE void FillRoundedRectangle(Drawable d, GC gc, int x, int y, - int width, int height, int radius) { + int width, int height, int radius) +{ #ifdef USE_XMU @@ -805,42 +1312,11 @@ #endif } - - -/** Clear the shape mask of a window. */ -void ResetRoundedRectWindow(Window w) { -#ifdef USE_SHAPE - JXShapeCombineMask(display, w, ShapeBounding, 0, 0, None, ShapeSet); #endif -} - -/** Set the shape mask on a window to give a rounded boarder. */ -void ShapeRoundedRectWindow(Window w, int width, int height) { -#ifdef USE_SHAPE - - if(width > shapePixmapWidth || height > shapePixmapHeight) { - if(shapePixmap != None) { - JXFreePixmap(display, shapePixmap); - } - shapePixmap = JXCreatePixmap(display, w, width, height, 1); - if(shapeGC == None) { - shapeGC = JXCreateGC(display, shapePixmap, 0, NULL); - } - shapePixmapWidth = width; - shapePixmapHeight = height; - } - - JXSetForeground(display, shapeGC, 0); - JXFillRectangle(display, shapePixmap, shapeGC, 0, 0, - width + 1, height + 1); - - /* Corner bound radius -1 to allow slightly better outline drawing */ - JXSetForeground(display, shapeGC, 1); - FillRoundedRectangle(shapePixmap, shapeGC, 0, 0, width, height, - CORNER_RADIUS - 1); - - JXShapeCombineMask(display, w, ShapeBounding, 0, 0, shapePixmap, ShapeSet); -#endif +/** Set the icon to use for a button. */ +void SetBorderIcon(BorderIconType t, const char *name) +{ + buttonNames[t] = CopyString(name); } - + diff -Nru jwm-2.1.0+svn579/src/border.h jwm-2.3.1+0~16~ubuntu14.10.1/src/border.h --- jwm-2.1.0+svn579/src/border.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/border.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,36 +13,35 @@ #include "gradient.h" struct ClientNode; +struct ClientState; -/** Border button image masks. */ -typedef enum { - BP_CLOSE, - BP_MINIMIZE, - BP_MAXIMIZE, - BP_MAXIMIZE_ACTIVE, - BP_COUNT -} BorderPixmapType; +/** Border icon types. */ +typedef unsigned char BorderIconType; +#define BI_CLOSE 0 +#define BI_MAX 1 +#define BI_MAX_ACTIVE 2 +#define BI_MIN 3 +#define BI_COUNT 4 /** Flags to determine what action to take on the border. */ -typedef enum { - BA_NONE = 0, /**< Do nothing. */ - BA_RESIZE = 1, /**< Resize the window. */ - BA_MOVE = 2, /**< Move the window. */ - BA_CLOSE = 3, /**< Close the window. */ - BA_MAXIMIZE = 4, /**< Maximize the window. */ - BA_MINIMIZE = 5, /**< Minimize the window. */ - BA_MENU = 6, /**< Show the window menu. */ - BA_RESIZE_N = 0x10, /**< Resize north. */ - BA_RESIZE_S = 0x20, /**< Resize south. */ - BA_RESIZE_E = 0x40, /**< Resize east. */ - BA_RESIZE_W = 0x80 /**< Resize west. */ -} BorderActionType; +typedef unsigned char BorderActionType; +#define BA_NONE 0 /**< Do nothing. */ +#define BA_RESIZE 1 /**< Resize the window. */ +#define BA_MOVE 2 /**< Move the window. */ +#define BA_CLOSE 3 /**< Close the window. */ +#define BA_MAXIMIZE 4 /**< Maximize the window. */ +#define BA_MINIMIZE 5 /**< Minimize the window. */ +#define BA_MENU 6 /**< Show the window menu. */ +#define BA_RESIZE_N 0x10 /**< Resize north. */ +#define BA_RESIZE_S 0x20 /**< Resize south. */ +#define BA_RESIZE_E 0x40 /**< Resize east. */ +#define BA_RESIZE_W 0x80 /**< Resize west. */ /*@{*/ -void InitializeBorders(); -void StartupBorders(); -void ShutdownBorders(); -void DestroyBorders(); +void InitializeBorders(void); +void StartupBorders(void); +void ShutdownBorders(void); +#define DestroyBorders() (void)(0) /*@}*/ /** Determine the action to take for a client. @@ -53,65 +52,48 @@ */ BorderActionType GetBorderActionType(const struct ClientNode *np, int x, int y); +/** Reset the shape of a window border. + * @param np The client. + */ +void ResetBorder(const struct ClientNode *np); + /** Draw a window border. * @param np The client whose frame to draw. - * @param expose The expose event causing the redraw (or NULL). */ -void DrawBorder(const struct ClientNode *np, const XExposeEvent *expose); +void DrawBorder(const struct ClientNode *np); /** Get the size of a border icon. * @return The size in pixels (note that icons are square). */ -int GetBorderIconSize(); +int GetBorderIconSize(void); /** Get the size of a window border. - * @param np The client. + * @param state The client state. * @param north Pointer to the value to contain the north border size. * @param south Pointer to the value to contain the south border size. * @param east Pointer to the value to contain the east border size. * @param west Pointer to the value to contain the west border size. */ -void GetBorderSize(const struct ClientNode *np, - int *north, int *south, int *east, int *west); - -/** Set the size of window borders. - * @param str The size to use in string form. - */ -void SetBorderWidth(const char *str); - -/** Set the size of window title bars. - * @param str The size to use in string form. - */ -void SetTitleHeight(const char *str); +void GetBorderSize(const struct ClientState *state, + int *north, int *south, int *east, int *west); /** Redraw all borders on the current desktop. */ -void ExposeCurrentDesktop(); - -/** Reset a rounded rectangle window. - * @param w The window. - */ -void ResetRoundedRectWindow(Window w); +void ExposeCurrentDesktop(void); -/** Shape a rounded rectangle window. - * @param w The window to shape. - * @param width The width of the window. - * @param height The height of the window. +/** Draw a rounded rectangle. + * @param d The drawable on which to render. + * @param gc The graphics context. + * @param x The x-coodinate. + * @param y The y-coordinate. + * @param width The width. + * @param height The height. + * @param radius The corner radius. */ -void ShapeRoundedRectWindow(Window w, int width, int height); - -/** Set the bitmask to use for a button. - * @param pt The button bitmask to set. - * @param filename The name of the file containing the bitmask. - */ -void SetButtonMask(BorderPixmapType pt, const char *filename); - -/** Draw a rounded rectangle. */ void DrawRoundedRectangle(Drawable d, GC gc, int x, int y, int width, int height, int radius); -/** Fill a rounded rectangle. */ -void FillRoundedRectangle(Drawable d, GC gc, int x, int y, - int width, int height, int radius); +/** Set the icon to use for a border button. */ +void SetBorderIcon(BorderIconType t, const char *name); #endif /* BORDER_H */ diff -Nru jwm-2.1.0+svn579/src/button.c jwm-2.3.1+0~16~ubuntu14.10.1/src/button.c --- jwm-2.1.0+svn579/src/button.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/button.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,20 +10,15 @@ #include "jwm.h" #include "button.h" #include "border.h" -#include "font.h" -#include "color.h" #include "main.h" #include "icon.h" #include "image.h" -#include "gradient.h" - -static void GetScaledIconSize(IconNode *ip, int maxsize, - int *width, int *height); +#include "misc.h" /** Draw a button. */ -void DrawButton(ButtonNode *bp) { +void DrawButton(ButtonNode *bp) +{ - long outlinePixel; ColorType fg; long bg1, bg2; @@ -39,11 +34,11 @@ Assert(bp); drawable = bp->drawable; - gc = bp->gc; x = bp->x; y = bp->y; width = bp->width; height = bp->height; + gc = JXCreateGC(display, drawable, 0, NULL); /* Determine the colors to use. */ switch(bp->type) { @@ -51,69 +46,78 @@ fg = COLOR_MENU_FG; bg1 = colors[COLOR_MENU_BG]; bg2 = colors[COLOR_MENU_BG]; - outlinePixel = colors[COLOR_MENU_BG]; break; case BUTTON_MENU_ACTIVE: fg = COLOR_MENU_ACTIVE_FG; bg1 = colors[COLOR_MENU_ACTIVE_BG1]; bg2 = colors[COLOR_MENU_ACTIVE_BG2]; - if(bg1 == bg2) { - outlinePixel = colors[COLOR_MENU_ACTIVE_OL]; - } else { - outlinePixel = colors[COLOR_MENU_ACTIVE_DOWN]; - } + break; + case BUTTON_TRAY: + fg = COLOR_TRAYBUTTON_FG; + bg1 = colors[COLOR_TRAYBUTTON_BG1]; + bg2 = colors[COLOR_TRAYBUTTON_BG2]; + break; + case BUTTON_TRAY_ACTIVE: + fg = COLOR_TRAYBUTTON_ACTIVE_FG; + bg1 = colors[COLOR_TRAYBUTTON_ACTIVE_BG1]; + bg2 = colors[COLOR_TRAYBUTTON_ACTIVE_BG2]; break; case BUTTON_TASK: fg = COLOR_TASK_FG; bg1 = colors[COLOR_TASK_BG1]; bg2 = colors[COLOR_TASK_BG2]; - outlinePixel = colors[COLOR_TASK_DOWN]; break; case BUTTON_TASK_ACTIVE: fg = COLOR_TASK_ACTIVE_FG; bg1 = colors[COLOR_TASK_ACTIVE_BG1]; bg2 = colors[COLOR_TASK_ACTIVE_BG2]; - outlinePixel = colors[COLOR_TASK_ACTIVE_UP]; break; case BUTTON_MENU: default: fg = COLOR_MENU_FG; bg1 = colors[COLOR_MENU_BG]; bg2 = colors[COLOR_MENU_BG]; - outlinePixel = colors[COLOR_MENU_DOWN]; break; } /* Draw the background. */ - /* Flat taskbuttons for widths < 48 */ - if(bp->type != BUTTON_TASK || width >= 48) { + if(bp->fill) { /* Draw the button background. */ JXSetForeground(display, gc, bg1); if(bg1 == bg2) { /* single color */ - JXFillRectangle(display, drawable, gc, - x + 1, y + 1, width - 1, height - 1); + JXFillRectangle(display, drawable, gc, x, y, width, height); } else { /* gradient */ DrawHorizontalGradient(drawable, gc, bg1, bg2, - x + 1, y + 1, width - 2, height - 1); + x, y, width, height); } - /* Draw the outline. */ - JXSetForeground(display, gc, outlinePixel); - DrawRoundedRectangle(drawable, gc, x, y, width, height, 3); + } + /* Draw the border. */ + if(bp->border) { + JXSetForeground(display, gc, colors[fg]); + JXDrawRectangle(display, drawable, gc, x, y, width, height); } /* Determine the size of the icon (if any) to display. */ iconWidth = 0; iconHeight = 0; if(bp->icon) { - if(width < height) { - GetScaledIconSize(bp->icon, width - 5, &iconWidth, &iconHeight); + if(bp->icon == &emptyIcon) { + iconWidth = Min(width - 4, height - 4); + iconHeight = iconWidth; } else { - GetScaledIconSize(bp->icon, height - 5, &iconWidth, &iconHeight); + const int ratio = (bp->icon->images->width << 16) + / bp->icon->images->height; + iconHeight = height - 4; + iconWidth = (iconHeight * ratio) >> 16; + if(iconWidth > width - 4) { + iconWidth = width - 4; + iconHeight = (iconWidth << 16) / ratio; + } } } @@ -123,12 +127,12 @@ if(bp->text) { textWidth = GetStringWidth(bp->font, bp->text); textHeight = GetStringHeight(bp->font); - if(textWidth + iconWidth + 8 > width) { - textWidth = width - iconWidth - 8; - if(textWidth < 0) { - textWidth = 0; - } + if(iconWidth > 0 && textWidth + iconWidth + 6 > width) { + textWidth = width - iconWidth - 6; + } else if(iconWidth == 0 && textWidth + 4 > width) { + textWidth = width - 4; } + textWidth = textWidth < 0 ? 0 : textWidth; } /* Determine the offset of the text in the button. */ @@ -138,34 +142,39 @@ xoffset = 0; } } else { - xoffset = 3; + xoffset = 2; } /* Display the icon. */ if(bp->icon) { yoffset = (height - iconHeight + 1) / 2; - PutIcon(bp->icon, drawable, x + xoffset, y + yoffset, + PutIcon(bp->visual, bp->icon, drawable, colors[fg], + x + xoffset, y + yoffset, iconWidth, iconHeight); xoffset += iconWidth + 2; } /* Display the label. */ - if(bp->text && textWidth) { + if(textWidth > 0) { yoffset = (height - textHeight + 1) / 2; - RenderString(drawable, bp->font, fg, x + xoffset, y + yoffset, - textWidth, NULL, bp->text); + RenderString(bp->visual, drawable, bp->font, fg, + x + xoffset, y + yoffset, + textWidth, bp->text); } + JXFreeGC(display, gc); + } /** Reset a button node with default values. */ -void ResetButton(ButtonNode *bp, Drawable d, GC g) { +void ResetButton(ButtonNode *bp, Drawable d, const VisualData *visual) +{ Assert(bp); bp->type = BUTTON_MENU; + bp->visual = visual; bp->drawable = d; - bp->gc = g; bp->font = FONT_TRAY; bp->alignment = ALIGN_LEFT; bp->x = 0; @@ -174,43 +183,7 @@ bp->height = 1; bp->icon = NULL; bp->text = NULL; + bp->fill = 1; + bp->border = 0; } - -/** Get the scaled size of an icon for a button. */ -void GetScaledIconSize(IconNode *ip, int maxsize, - int *width, int *height) { - - int ratio; - - Assert(ip); - Assert(width); - Assert(height); - - if(ip == &emptyIcon) { - *width = maxsize; - *height = maxsize; - return; - } - - Assert(ip->image->height > 0); - - /* Fixed point with 16-bit fraction. */ - ratio = (ip->image->width << 16) / ip->image->height; - - if(ip->image->width > ip->image->height) { - - /* Compute size wrt width */ - *width = (maxsize * ratio) >> 16; - *height = (*width << 16) / ratio; - - } else { - - /* Compute size wrt height */ - *height = (maxsize << 16) / ratio; - *width = (*height * ratio) >> 16; - - } - -} - diff -Nru jwm-2.1.0+svn579/src/button.h jwm-2.3.1+0~16~ubuntu14.10.1/src/button.h --- jwm-2.1.0+svn579/src/button.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/button.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,36 +13,40 @@ #include "font.h" struct IconNode; +struct VisualData; /** Button types. */ -typedef enum { - BUTTON_LABEL, /**< Label. */ - BUTTON_MENU, /**< Menu item. */ - BUTTON_MENU_ACTIVE, /**< Active menu item. */ - BUTTON_TASK, /**< Item in the task list. */ - BUTTON_TASK_ACTIVE /**< Active item in the task list. */ -} ButtonType; +typedef unsigned char ButtonType; +#define BUTTON_LABEL 0 /**< Label. */ +#define BUTTON_MENU 1 /**< Menu item. */ +#define BUTTON_MENU_ACTIVE 2 /**< Active menu item. */ +#define BUTTON_TRAY 3 /**< Inactive tray button. */ +#define BUTTON_TRAY_ACTIVE 4 /**< Active tray button. */ +#define BUTTON_TASK 5 /**< Item in the task list. */ +#define BUTTON_TASK_ACTIVE 6 /**< Active item in the task list. */ /** Alignment of content in a button. */ -typedef enum { - ALIGN_LEFT, /**< Left align. */ - ALIGN_CENTER /**< Center align. */ -} AlignmentType; +typedef unsigned char AlignmentType; +#define ALIGN_LEFT 0 /**< Left align. */ +#define ALIGN_CENTER 1 /**< Center align. */ /** Data used for drawing a button. */ typedef struct { - ButtonType type; /**< The type of button to draw. */ - Drawable drawable; /**< The place to put the button. */ - GC gc; /**< Graphics context used for drawing. */ - FontType font; /**< The font for button text. */ - AlignmentType alignment; /**< Alignment of the button content. */ + ButtonType type; /**< The type of button to draw. */ + AlignmentType alignment; /**< Alignment of the button content. */ + FontType font; /**< The font for button text. */ + char fill; /**< Determine if we should fill. */ + char border; /**< Determine if we should draw a border. */ - int x, y; /**< The coordinates to render the button. */ - int width, height; /**< The size of the button. */ + const struct VisualData *visual; /**< Visual and depth to use. */ + Drawable drawable; /**< The place to put the button. */ - struct IconNode *icon; /**< Icon used in the button. */ - const char *text; /**< Text used in the button. */ + int x, y; /**< The coordinates to render the button. */ + int width, height; /**< The size of the button. */ + + struct IconNode *icon; /**< Icon used in the button. */ + const char *text; /**< Text used in the button. */ } ButtonNode; @@ -56,7 +60,8 @@ * @param d The drawable to use. * @param g The graphics context to use. */ -void ResetButton(ButtonNode *bp, Drawable d, GC g); +void ResetButton(ButtonNode *bp, Drawable d, + const struct VisualData *visual); #endif /* BUTTON_H */ diff -Nru jwm-2.1.0+svn579/src/client.c jwm-2.3.1+0~16~ubuntu14.10.1/src/client.c --- jwm-2.1.0+svn579/src/client.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/client.c 2015-07-18 20:02:18.000000000 +0000 @@ -1,5 +1,5 @@ /** - * @file client.h + * @file client.c * @author Joe Wingbermuehle * @date 2004-2006 * @@ -10,9 +10,7 @@ #include "jwm.h" #include "client.h" #include "clientlist.h" -#include "main.h" #include "icon.h" -#include "hint.h" #include "group.h" #include "tray.h" #include "confirm.h" @@ -22,39 +20,27 @@ #include "screen.h" #include "pager.h" #include "color.h" -#include "error.h" #include "place.h" #include "event.h" +#include "settings.h" +#include "timing.h" +#include "grab.h" static ClientNode *activeClient; -static int clientCount; +unsigned int clientCount; -static void LoadFocus(); +static void LoadFocus(void); static void ReparentClient(ClientNode *np, char notOwner); - -static void MinimizeTransients(ClientNode *np); -static void CheckShape(ClientNode *np); - +static void RestackTransients(const ClientNode *np); +static void MinimizeTransients(ClientNode *np, char lower); static void RestoreTransients(ClientNode *np, char raise); - static void KillClientHandler(ClientNode *np); - -static unsigned int activeOpacity; -static unsigned int maxInactiveOpacity; -static unsigned int minInactiveOpacity; -static unsigned int deltaInactiveOpacity; - -/** Initialize client data. */ -void InitializeClients() { - activeOpacity = (unsigned int)(1.0 * UINT_MAX); - maxInactiveOpacity = (unsigned int)(0.9 * UINT_MAX); - minInactiveOpacity = (unsigned int)(0.5 * UINT_MAX); - deltaInactiveOpacity = (unsigned int)(0.1 * UINT_MAX); -} +static void UnmapClient(ClientNode *np); /** Load windows that are already mapped. */ -void StartupClients() { +void StartupClients(void) +{ XWindowAttributes attr; Window rootReturn, parentReturn, *childrenReturn; @@ -78,8 +64,7 @@ /* Add each client. */ for(x = 0; x < childrenCount; x++) { if(JXGetWindowAttributes(display, childrenReturn[x], &attr)) { - if(attr.override_redirect == False - && attr.map_state == IsViewable) { + if(attr.override_redirect == False && attr.map_state == IsViewable) { AddClientWindow(childrenReturn[x], 1, 1); } } @@ -89,13 +74,14 @@ LoadFocus(); - UpdateTaskBar(); - UpdatePager(); + RequireTaskUpdate(); + RequirePagerUpdate(); } /** Release client windows. */ -void ShutdownClients() { +void ShutdownClients(void) +{ int x; @@ -107,12 +93,9 @@ } -/** Destroy client data. */ -void DestroyClients() { -} - /** Set the focus to the window currently under the mouse pointer. */ -void LoadFocus() { +void LoadFocus(void) +{ ClientNode *np; Window rootReturn, childReturn; @@ -123,7 +106,7 @@ JXQueryPointer(display, rootWindow, &rootReturn, &childReturn, &rootx, &rooty, &winx, &winy, &mask); - np = FindClientByWindow(childReturn); + np = FindClient(childReturn); if(np) { FocusClient(np); } @@ -131,7 +114,8 @@ } /** Add a window to management. */ -ClientNode *AddClientWindow(Window w, char alreadyMapped, char notOwner) { +ClientNode *AddClientWindow(Window w, char alreadyMapped, char notOwner) +{ XWindowAttributes attr; ClientNode *np; @@ -158,27 +142,34 @@ np->window = w; np->owner = None; np->state.desktop = currentDesktop; - np->controller = NULL; - np->name = NULL; - np->colormaps = NULL; np->x = attr.x; np->y = attr.y; np->width = attr.width; np->height = attr.height; + np->visual.depth = attr.depth; + np->visual.visual = attr.visual; np->cmap = attr.colormap; - np->colormaps = NULL; np->state.status = STAT_NONE; + np->state.maxFlags = MAX_NONE; np->state.layer = LAYER_NORMAL; + np->state.defaultLayer = LAYER_NORMAL; np->state.border = BORDER_DEFAULT; np->borderAction = BA_NONE; - ReadClientProtocols(np); + ReadClientInfo(np, alreadyMapped); if(!notOwner) { np->state.border = BORDER_OUTLINE | BORDER_TITLE | BORDER_MOVE; np->state.status |= STAT_WMDIALOG | STAT_STICKY; + np->state.layer = LAYER_ABOVE; + np->state.defaultLayer = LAYER_ABOVE; + } + + ApplyGroups(np); + if(np->icon == NULL) { + LoadIcon(np); } /* We now know the layer, so insert */ @@ -191,14 +182,19 @@ } nodes[np->state.layer] = np; - LoadIcon(np); - - ApplyGroups(np); - SetDefaultCursor(np->window); ReparentClient(np, notOwner); PlaceClient(np, alreadyMapped); + if(!((np->state.status & STAT_FULLSCREEN) || np->state.maxFlags)) { + int north, south, east, west; + GetBorderSize(&np->state, &north, &south, &east, &west); + JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, + np->width + east + west, np->height + north + south); + JXMoveResizeWindow(display, np->window, west, north, + np->width, np->height); + } + /* If one of these fails we are SOL, so who cares. */ XSaveContext(display, np->window, clientContext, (void*)np); XSaveContext(display, np->parent, frameContext, (void*)np); @@ -208,16 +204,15 @@ JXMapWindow(display, np->parent); } - DrawBorder(np, NULL); - - AddClientToTaskBar(np); + clientCount += 1; if(!alreadyMapped) { RaiseClient(np); } - ++clientCount; - + if(np->state.status & STAT_OPACITY) { + SetOpacity(np, np->state.opacity, 1); + } if(np->state.status & STAT_STICKY) { SetCardinalAtom(np->window, ATOM_NET_WM_DESKTOP, ~0UL); } else { @@ -226,21 +221,30 @@ /* Shade the client if requested. */ if(np->state.status & STAT_SHADED) { + np->state.status &= ~STAT_SHADED; ShadeClient(np); } /* Minimize the client if requested. */ if(np->state.status & STAT_MINIMIZED) { np->state.status &= ~STAT_MINIMIZED; - MinimizeClient(np); + MinimizeClient(np, 0); } /* Maximize the client if requested. */ - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - np->state.status &= ~(STAT_HMAX | STAT_VMAX); - MaximizeClientDefault(np); + if(np->state.maxFlags) { + const MaxFlags flags = np->state.maxFlags; + np->state.maxFlags = MAX_NONE; + MaximizeClient(np, flags); + } + + if(np->state.status & STAT_URGENT) { + RegisterCallback(URGENCY_DELAY, SignalUrgent, np); } + /* Update task bars. */ + AddClientToTaskBar(np); + /* Make sure we're still in sync */ WriteState(np); SendConfigureEvent(np); @@ -265,139 +269,123 @@ np->state.status &= ~STAT_FULLSCREEN; SetClientFullScreen(np, 1); } + ResetBorder(np); return np; } /** Minimize a client window and all of its transients. */ -void MinimizeClient(ClientNode *np) { - +void MinimizeClient(ClientNode *np, char lower) +{ Assert(np); - - if(focusModel == FOCUS_CLICK && np == activeClient) { - FocusNextStacked(np); - } - - MinimizeTransients(np); - - UpdateTaskBar(); - UpdatePager(); - + MinimizeTransients(np, lower); + RequireRestack(); + RequireTaskUpdate(); } /** Minimize all transients as well as the specified client. */ -void MinimizeTransients(ClientNode *np) { +void MinimizeTransients(ClientNode *np, char lower) +{ ClientNode *tp; int x; Assert(np); - /* A minimized client can't be active. */ - if(activeClient == np) { - activeClient = NULL; - np->state.status &= ~STAT_ACTIVE; - } - /* Unmap the window and update its state. */ if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { - JXUnmapWindow(display, np->window); + UnmapClient(np); JXUnmapWindow(display, np->parent); } np->state.status |= STAT_MINIMIZED; - np->state.status &= ~STAT_MAPPED; - WriteState(np); /* Minimize transient windows. */ for(x = 0; x < LAYER_COUNT; x++) { - for(tp = nodes[x]; tp; tp = tp->next) { + tp = nodes[x]; + while(tp) { + ClientNode *next = tp->next; if(tp->owner == np->window && (tp->state.status & (STAT_MAPPED | STAT_SHADED)) && !(tp->state.status & STAT_MINIMIZED)) { - MinimizeTransients(tp); + MinimizeTransients(tp, lower); } + tp = next; } } + /* Focus the next window. */ + if(np->state.status & STAT_ACTIVE) { + FocusNextStacked(np); + } + + if(lower) { + /* Move this client to the end of the layer list. */ + if(nodeTail[np->state.layer] != np) { + if(np->prev) { + np->prev->next = np->next; + } else { + nodes[np->state.layer] = np->next; + } + np->next->prev = np->prev; + tp = nodeTail[np->state.layer]; + nodeTail[np->state.layer] = np; + tp->next = np; + np->prev = tp; + np->next = NULL; + } + } + + WriteState(np); + } /** Shade a client. */ -void ShadeClient(ClientNode *np) { - - int north, south, east, west; +void ShadeClient(ClientNode *np) +{ Assert(np); - if(!(np->state.border & BORDER_TITLE)) { + if((np->state.status & (STAT_SHADED | STAT_FULLSCREEN)) || + !(np->state.border & BORDER_SHADE)) { return; } - GetBorderSize(np, &north, &south, &east, &west); - - ResetRoundedRectWindow(np->parent); - if(np->state.status & STAT_MAPPED) { - JXUnmapWindow(display, np->window); - } + UnmapClient(np); np->state.status |= STAT_SHADED; - np->state.status &= ~STAT_MINIMIZED; - np->state.status &= ~STAT_SDESKTOP; - np->state.status &= ~STAT_MAPPED; - - ShapeRoundedRectWindow(np->parent, np->width + west + east, north); - JXResizeWindow(display, np->parent, np->width + east + west, north); WriteState(np); - -#ifdef USE_SHAPE - if(np->state.status & STAT_SHAPE) { - SetShape(np); - } -#endif + ResetBorder(np); + RequirePagerUpdate(); } /** Unshade a client. */ -void UnshadeClient(ClientNode *np) { - - int north, south, east, west; +void UnshadeClient(ClientNode *np) +{ Assert(np); - if(!(np->state.border & BORDER_TITLE)) { + if(!(np->state.status & STAT_SHADED)) { return; } - if(np->state.status & STAT_SHADED) { + if(!(np->state.status & (STAT_MINIMIZED | STAT_SDESKTOP))) { JXMapWindow(display, np->window); np->state.status |= STAT_MAPPED; - np->state.status &= ~STAT_SHADED; } - - GetBorderSize(np, &north, &south, &east, &west); - - ResetRoundedRectWindow(np->parent); - ShapeRoundedRectWindow(np->parent, - np->width + west + east, np->height + north + south); - - JXResizeWindow(display, np->parent, - np->width + west + east, np->height + north + south); + np->state.status &= ~STAT_SHADED; WriteState(np); - -#ifdef USE_SHAPE - if(np->state.status & STAT_SHAPE) { - SetShape(np); - } -#endif - + ResetBorder(np); RefocusClient(); - RestackClients(); + RequirePagerUpdate(); } /** Set a client's state to withdrawn. */ -void SetClientWithdrawn(ClientNode *np) { +void SetClientWithdrawn(ClientNode *np) +{ Assert(np); @@ -408,31 +396,36 @@ } if(np->state.status & STAT_MAPPED) { - JXUnmapWindow(display, np->window); + UnmapClient(np); JXUnmapWindow(display, np->parent); } else if(np->state.status & STAT_SHADED) { - JXUnmapWindow(display, np->parent); + if(!(np->state.status & STAT_MINIMIZED)) { + JXUnmapWindow(display, np->parent); + } } np->state.status &= ~STAT_SHADED; - np->state.status &= ~STAT_MAPPED; np->state.status &= ~STAT_MINIMIZED; np->state.status &= ~STAT_SDESKTOP; WriteState(np); - UpdateTaskBar(); - UpdatePager(); + RequireTaskUpdate(); + RequirePagerUpdate(); } /** Restore a window with its transients (helper method). */ -void RestoreTransients(ClientNode *np, char raise) { +void RestoreTransients(ClientNode *np, char raise) +{ ClientNode *tp; int x; Assert(np); + /* Make sure this window is on the current desktop. */ + SetClientDesktop(np, currentDesktop); + /* Restore this window. */ if(!(np->state.status & STAT_MAPPED)) { if(np->state.status & STAT_SHADED) { @@ -446,61 +439,50 @@ np->state.status &= ~STAT_MINIMIZED; np->state.status &= ~STAT_SDESKTOP; - WriteState(np); - /* Restore transient windows. */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { - if(tp->owner == np->window - && !(tp->state.status & (STAT_MAPPED | STAT_SHADED)) - && (tp->state.status & STAT_MINIMIZED)) { + if(tp->owner == np->window && (tp->state.status & STAT_MINIMIZED)) { RestoreTransients(tp, raise); } } } if(raise) { + FocusClient(np); RaiseClient(np); } + WriteState(np); } /** Restore a client window and its transients. */ -void RestoreClient(ClientNode *np, char raise) { - - Assert(np); - +void RestoreClient(ClientNode *np, char raise) +{ RestoreTransients(np, raise); - - RestackClients(); - UpdateTaskBar(); - UpdatePager(); - + RequireRestack(); + RequireTaskUpdate(); } /** Set the client layer. This will affect transients. */ -void SetClientLayer(ClientNode *np, unsigned int layer) { +void SetClientLayer(ClientNode *np, unsigned int layer) +{ ClientNode *tp, *next; - int x; Assert(np); - - if(JUNLIKELY(layer > LAYER_TOP)) { - Warning(_("Client %s requested an invalid layer: %d"), np->name, layer); - return; - } + Assert(layer <= LAST_LAYER); if(np->state.layer != layer) { + int x; /* Loop through all clients so we get transients. */ - for(x = 0; x < LAYER_COUNT; x++) { + for(x = FIRST_LAYER; x <= LAST_LAYER; x++) { tp = nodes[x]; while(tp) { + next = tp->next; if(tp == np || tp->owner == np->window) { - next = tp->next; - /* Remove from the old node list */ if(next) { next->prev = tp->prev; @@ -525,24 +507,22 @@ /* Set the new layer */ tp->state.layer = layer; + WriteState(tp); - /* Make sure we continue on the correct layer list. */ - tp = next; - - } else { - tp = tp->next; } + tp = next; } } - RestackClients(); + RequireRestack(); } } /** Set a client's sticky status. This will update transients. */ -void SetClientSticky(ClientNode *np, char isSticky) { +void SetClientSticky(ClientNode *np, char isSticky) +{ ClientNode *tp; int x; @@ -595,18 +575,19 @@ } /** Set a client's desktop. This will update transients. */ -void SetClientDesktop(ClientNode *np, unsigned int desktop) { +void SetClientDesktop(ClientNode *np, unsigned int desktop) +{ ClientNode *tp; - int x; Assert(np); - if(JUNLIKELY(desktop >= desktopWidth * desktopHeight)) { + if(JUNLIKELY(desktop >= settings.desktopCount)) { return; } if(!(np->state.status & STAT_STICKY)) { + int x; for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp == np || tp->owner == np->window) { @@ -620,18 +601,19 @@ } SetCardinalAtom(tp->window, ATOM_NET_WM_DESKTOP, - tp->state.desktop); + tp->state.desktop); } } } - UpdatePager(); - UpdateTaskBar(); + RequirePagerUpdate(); + RequireTaskUpdate(); } } /** Hide a client without unmapping. This will not update transients. */ -void HideClient(ClientNode *np) { +void HideClient(ClientNode *np) +{ Assert(np); @@ -646,16 +628,19 @@ } /** Show a hidden client. This will not update transients. */ -void ShowClient(ClientNode *np) { +void ShowClient(ClientNode *np) +{ Assert(np); if(np->state.status & STAT_HIDDEN) { np->state.status &= ~STAT_HIDDEN; if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { - JXMapWindow(display, np->parent); - if(np->state.status & STAT_ACTIVE) { - FocusClient(np); + if(!(np->state.status & STAT_MINIMIZED)) { + JXMapWindow(display, np->parent); + if(np->state.status & STAT_ACTIVE) { + FocusClient(np); + } } } } @@ -663,67 +648,73 @@ } /** Maximize a client window. */ -void MaximizeClient(ClientNode *np, char horiz, char vert) { - - int north, south, east, west; +void MaximizeClient(ClientNode *np, MaxFlags flags) +{ - Assert(np); + /* Return if we don't have a client. */ + if(np == NULL) { + return; + } - /* We don't want to mess with full screen clients. */ + /* Don't allow maximization of full-screen clients. */ if(np->state.status & STAT_FULLSCREEN) { - return; + return; + } + if(!(np->state.border & BORDER_MAX)) { + return; } if(np->state.status & STAT_SHADED) { UnshadeClient(np); } - ResetRoundedRectWindow(np->parent); - - GetBorderSize(np, &north, &south, &east, &west); - - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { + RaiseClient(np); + FocusClient(np); + if(np->state.maxFlags) { + /* Undo existing maximization. */ np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; - np->state.status &= ~(STAT_HMAX | STAT_VMAX); - } else { - PlaceMaximizedClient(np, horiz, vert); + np->state.maxFlags = MAX_NONE; + } + if(flags != MAX_NONE) { + /* Maximize if requested. */ + PlaceMaximizedClient(np, flags); } - - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->window, west, - north, np->width, np->height); WriteState(np); + ResetBorder(np); + DrawBorder(np); SendConfigureEvent(np); + RequirePagerUpdate(); } /** Maximize a client using its default maximize settings. */ -void MaximizeClientDefault(ClientNode *np) { +void MaximizeClientDefault(ClientNode *np) +{ - int hmax, vmax; + MaxFlags flags = MAX_NONE; Assert(np); - hmax = (np->state.border & BORDER_MAX_H) ? 1 : 0; - vmax = (np->state.border & BORDER_MAX_V) ? 1 : 0; + if(np->state.maxFlags == MAX_NONE) { + if(np->state.border & BORDER_MAX_H) { + flags |= MAX_HORIZ; + } + if(np->state.border & BORDER_MAX_V) { + flags |= MAX_VERT; + } + } - MaximizeClient(np, hmax, vmax); + MaximizeClient(np, flags); } /** Set a client's full screen state. */ -void SetClientFullScreen(ClientNode *np, char fullScreen) { +void SetClientFullScreen(ClientNode *np, char fullScreen) +{ XEvent event; int north, south, east, west; @@ -736,28 +727,29 @@ if(!fullScreen == !(np->state.status & STAT_FULLSCREEN)) { return; } + if(!(np->state.border & BORDER_FULLSCREEN)) { + return; + } if(np->state.status & STAT_SHADED) { UnshadeClient(np); } - ResetRoundedRectWindow(np->parent); - if(fullScreen) { np->state.status |= STAT_FULLSCREEN; - np->state.border &= ~BORDER_MOVE; - SetClientLayer(np, LAYER_TOP); - np->oldx = np->x; - np->oldy = np->y; - np->oldWidth = np->width; - np->oldHeight = np->height; + if(!(np->state.maxFlags)) { + np->oldx = np->x; + np->oldy = np->y; + np->oldWidth = np->width; + np->oldHeight = np->height; + } sp = GetCurrentScreen(np->x, np->y); GetScreenBounds(sp, &box); - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); box.x += west; box.y += north; box.width -= east + west; @@ -767,38 +759,24 @@ np->y = box.y; np->width = box.width; np->height = box.height; - - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->window, west, north, - np->width, np->height); + ResetBorder(np); } else { np->state.status &= ~STAT_FULLSCREEN; - np->state.border |= BORDER_MOVE; + np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; + ConstrainSize(np); + ConstrainPosition(np); - GetBorderSize(np, &north, &south, &east, &west); - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - - JXMoveResizeWindow(display, np->parent, - np->x - west, - np->y - north, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->window, - west, north, np->width, np->height); + if(np->state.maxFlags != MAX_NONE) { + PlaceMaximizedClient(np, np->state.maxFlags); + } + + ResetBorder(np); event.type = MapRequest; event.xmaprequest.send_event = True; @@ -806,86 +784,91 @@ event.xmaprequest.parent = np->parent; event.xmaprequest.window = np->window; JXSendEvent(display, rootWindow, False, - SubstructureRedirectMask, &event); - - SetClientLayer(np, LAYER_NORMAL); + SubstructureRedirectMask, &event); } WriteState(np); SendConfigureEvent(np); + RequireRestack(); } /** Set the active client. */ -void FocusClient(ClientNode *np) { - - ClientProtocolType protocols; +void FocusClient(ClientNode *np) +{ Assert(np); if(np->state.status & STAT_HIDDEN) { return; } + if(!(np->state.status & STAT_CANFOCUS)) { + return; + } if(activeClient != np || !(np->state.status & STAT_ACTIVE)) { if(activeClient) { activeClient->state.status &= ~STAT_ACTIVE; - DrawBorder(activeClient, NULL); + if(!(activeClient->state.status & STAT_OPACITY)) { + SetOpacity(activeClient, settings.inactiveClientOpacity, 0); + } + DrawBorder(activeClient); } np->state.status |= STAT_ACTIVE; activeClient = np; + if(!(np->state.status & STAT_OPACITY)) { + SetOpacity(np, settings.activeClientOpacity, 0); + } - DrawBorder(np, NULL); - UpdatePager(); - UpdateTaskBar(); + DrawBorder(np); + RequirePagerUpdate(); + RequireTaskUpdate(); } if(np->state.status & STAT_MAPPED) { UpdateClientColormap(np); SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, np->window); - protocols = ReadWMProtocols(np->window); - JXSetInputFocus(display, np->window, RevertToPointerRoot, eventTime); - if(protocols & PROT_TAKE_FOCUS) { + if(np->state.status & STAT_CANFOCUS) { + JXSetInputFocus(display, np->window, RevertToParent, eventTime); + } else { + JXSetInputFocus(display, np->parent, RevertToParent, eventTime); + } + if(np->state.status & STAT_TAKEFOCUS) { SendClientMessage(np->window, ATOM_WM_PROTOCOLS, ATOM_WM_TAKE_FOCUS); } } else { - JXSetInputFocus(display, rootWindow, RevertToPointerRoot, eventTime); + JXSetInputFocus(display, rootWindow, RevertToParent, eventTime); } } /** Refocus the active client (if there is one). */ -void RefocusClient() { - +void RefocusClient(void) +{ if(activeClient) { FocusClient(activeClient); } - } /** Send a delete message to a client. */ -void DeleteClient(ClientNode *np) { - - ClientProtocolType protocols; - +void DeleteClient(ClientNode *np) +{ Assert(np); - - protocols = ReadWMProtocols(np->window); - if(protocols & PROT_DELETE) { - SendClientMessage(np->window, ATOM_WM_PROTOCOLS, - ATOM_WM_DELETE_WINDOW); + ReadWMProtocols(np->window, &np->state); + if(np->state.status & STAT_DELETE) { + SendClientMessage(np->window, ATOM_WM_PROTOCOLS, ATOM_WM_DELETE_WINDOW); } else { KillClient(np); } - } /** Callback to kill a client after a confirm dialog. */ -void KillClientHandler(ClientNode *np) { +void KillClientHandler(ClientNode *np) +{ Assert(np); @@ -893,34 +876,65 @@ FocusNextStacked(np); } - JXGrabServer(display); - JXSync(display, False); - + GrabServer(); JXKillClient(display, np->window); - JXSync(display, True); - JXUngrabServer(display); + UngrabServer(); RemoveClient(np); } /** Kill a client window. */ -void KillClient(ClientNode *np) { - +void KillClient(ClientNode *np) +{ Assert(np); - ShowConfirmDialog(np, KillClientHandler, _("Kill this window?"), _("This may cause data to be lost!"), NULL); } -/** Raise the client. This will affect transients. */ -void RaiseClient(ClientNode *np) { +/** Place transients on top of the owner. */ +void RestackTransients(const ClientNode *np) +{ + ClientNode *tp; + unsigned int layer; - ClientNode *tp, *next; - int x; + /* Place any transient windows on top of the owner */ + for(layer = 0; layer < LAYER_COUNT; layer++) { + for(tp = nodes[layer]; tp; tp = tp->next) { + if(tp->owner == np->window && tp->prev) { + + ClientNode *next = tp->next; + + tp->prev->next = tp->next; + if(tp->next) { + tp->next->prev = tp->prev; + } else { + nodeTail[tp->state.layer] = tp->prev; + } + tp->next = nodes[tp->state.layer]; + nodes[tp->state.layer]->prev = tp; + tp->prev = NULL; + nodes[tp->state.layer] = tp; + + tp = next; + + } + + /* tp will be tp->next if the above code is executed. */ + /* Thus, if it is NULL, we are done with this layer. */ + if(!tp) { + break; + } + } + } +} + +/** Raise the client. This will affect transients. */ +void RaiseClient(ClientNode *np) +{ Assert(np); @@ -939,146 +953,192 @@ np->prev = NULL; nodes[np->state.layer] = np; - /* Place any transient windows on top of the owner */ - for(x = 0; x < LAYER_COUNT; x++) { - for(tp = nodes[x]; tp; tp = tp->next) { - if(tp->owner == np->window && tp->prev) { + } - next = tp->next; + RestackTransients(np); + RequireRestack(); - tp->prev->next = tp->next; - if(tp->next) { - tp->next->prev = tp->prev; - } else { - nodeTail[tp->state.layer] = tp->prev; - } - tp->next = nodes[tp->state.layer]; - nodes[tp->state.layer]->prev = tp; - tp->prev = NULL; - nodes[tp->state.layer] = tp; +} - tp = next; +/** Restack a client window. This will not affect transients. */ +void RestackClient(ClientNode *np, Window above, int detail) +{ - } + ClientNode *tp; + char inserted = 0; - /* tp will be tp->next if the above code is executed. */ - /* Thus, if it is NULL, we are done with this layer. */ - if(!tp) { - break; - } - } - } + /* Remove from the window list. */ + if(np->prev) { + np->prev->next = np->next; + } else { + nodes[np->state.layer] = np->next; + } + if(np->next) { + np->next->prev = np->prev; + } else { + nodeTail[np->state.layer] = np->prev; + } - RestackClients(); + /* Insert back into the window list. */ + if(above != None && above != np->window) { - } + /* Insert relative to some other window. */ + char found = 0; + for(tp = nodes[np->state.layer]; tp; tp = tp->next) { + if(tp == np) { + found = 1; + } else if(tp->window == above) { + char insert_before = 0; + inserted = 1; + switch(detail) { + case Above: + case TopIf: + insert_before = 1; + break; + case Below: + case BottomIf: + insert_before = 0; + break; + case Opposite: + insert_before = !found; + break; + } + if(insert_before) { -} + /* Insert before this window. */ + np->prev = tp->prev; + np->next = tp; + if(tp->prev) { + tp->prev->next = np; + } else { + nodes[np->state.layer] = np; + } + tp->prev = np; -/** Lower the client. This will not affect transients. */ -void LowerClient(ClientNode *np) { + } else { - ClientNode *tp; + /* Insert after this window. */ + np->prev = tp; + np->next = tp->next; + if(tp->next) { + tp->next->prev = np; + } else { + nodeTail[np->state.layer] = np; + } + tp->next = np; - Assert(np); + } + break; + } + } + } + if(!inserted) { - if(nodeTail[np->state.layer] != np) { + /* Insert absolute for the layer. */ + if(detail == Below || detail == BottomIf) { - Assert(np->next); + /* Insert to the bottom of the stack. */ + np->next = NULL; + np->prev = nodeTail[np->state.layer]; + if(nodeTail[np->state.layer]) { + nodeTail[np->state.layer]->next = np; + } else { + nodes[np->state.layer] = np; + } + nodeTail[np->state.layer] = np; - /* Take the client out of the list. */ - if(np->prev) { - np->prev->next = np->next; } else { - nodes[np->state.layer] = np->next; - } - np->next->prev = np->prev; - /* Place the client at the end of the list. */ - tp = nodeTail[np->state.layer]; - nodeTail[np->state.layer] = np; - tp->next = np; - np->prev = tp; - np->next = NULL; - - RestackClients(); + /* Insert at the top of the stack. */ + np->next = nodes[np->state.layer]; + np->prev = NULL; + if(nodes[np->state.layer]) { + nodes[np->state.layer]->prev = np; + } else { + nodeTail[np->state.layer] = np; + } + nodes[np->state.layer] = np; + } } + RestackTransients(np); + RequireRestack(); + } /** Restack the clients according the way we want them. */ -void RestackClients() { +void RestackClients(void) +{ TrayType *tp; ClientNode *np; unsigned int layer, index; int trayCount; Window *stack; - unsigned int opacity; - unsigned int temp; - int isFirst; + Window fw; + + if(JUNLIKELY(shouldExit)) { + return; + } /* Allocate memory for restacking. */ trayCount = GetTrayCount(); stack = AllocateStack((clientCount + trayCount) * sizeof(Window)); /* Prepare the stacking array. */ + fw = None; index = 0; - layer = LAYER_TOP; - isFirst = 1; - opacity = maxInactiveOpacity; + if(activeClient && (activeClient->state.status & STAT_FULLSCREEN)) { + fw = activeClient->window; + for(np = nodes[activeClient->state.layer]; np; np = np->next) { + if(np->owner == fw) { + stack[index] = np->parent; + index += 1; + } + } + stack[index] = activeClient->parent; + index += 1; + } + layer = LAST_LAYER; for(;;) { for(np = nodes[layer]; np; np = np->next) { - if((np->state.status & (STAT_MAPPED | STAT_SHADED)) + if( (np->state.status & (STAT_MAPPED | STAT_SHADED)) && !(np->state.status & STAT_HIDDEN)) { - stack[index++] = np->parent; - if(isFirst) { - if( !(np->state.status & STAT_OPACITY) - && np->state.opacity != activeOpacity) { - np->state.opacity = activeOpacity; - WriteState(np); - } - isFirst = 0; - } else if(!(np->state.status & STAT_OPACITY)) { - if(np->state.opacity != opacity) { - np->state.opacity = opacity; - WriteState(np); - } - temp = opacity - deltaInactiveOpacity; - if(temp < minInactiveOpacity || temp > opacity) { - opacity = minInactiveOpacity; - } else { - opacity = temp; - } + if(fw != None && (np->window == fw || np->owner == fw)) { + continue; } + stack[index] = np->parent; + index += 1; } } for(tp = GetTrays(); tp; tp = tp->next) { if(layer == tp->layer) { - stack[index++] = tp->window; + stack[index] = tp->window; + index += 1; } } - if(layer == 0) { + if(layer == FIRST_LAYER) { break; } - --layer; + layer -= 1; } JXRestackWindows(display, stack, index); ReleaseStack(stack); - UpdateNetClientList(); + RequirePagerUpdate(); } /** Send a client message to a window. */ -void SendClientMessage(Window w, AtomType type, AtomType message) { +void SendClientMessage(Window w, AtomType type, AtomType message) +{ XEvent event; int status; @@ -1098,74 +1158,9 @@ } -/** Set the border shape for windows using the shape extension. */ -#ifdef USE_SHAPE -void SetShape(ClientNode *np) { - - XRectangle rect[4]; - int north, south, east, west; - - Assert(np); - - np->state.status |= STAT_SHAPE; - - GetBorderSize(np, &north, &south, &east, &west); - - /* Shaded windows are a special case. */ - if(np->state.status & STAT_SHADED) { - - rect[0].x = 0; - rect[0].y = 0; - rect[0].width = np->width + east + west; - rect[0].height = north + south; - - JXShapeCombineRectangles(display, np->parent, ShapeBounding, - 0, 0, rect, 1, ShapeSet, Unsorted); - - return; - } - - /* Add the shape of window. */ - JXShapeCombineShape(display, np->parent, ShapeBounding, west, north, - np->window, ShapeBounding, ShapeSet); - - /* Add the shape of the border. */ - if(north > 0) { - - /* Top */ - rect[0].x = 0; - rect[0].y = 0; - rect[0].width = np->width + east + west; - rect[0].height = north; - - /* Left */ - rect[1].x = 0; - rect[1].y = 0; - rect[1].width = west; - rect[1].height = np->height + north + south; - - /* Right */ - rect[2].x = np->width + east; - rect[2].y = 0; - rect[2].width = west; - rect[2].height = np->height + north + south; - - /* Bottom */ - rect[3].x = 0; - rect[3].y = np->height + north; - rect[3].width = np->width + east + west; - rect[3].height = south; - - JXShapeCombineRectangles(display, np->parent, ShapeBounding, - 0, 0, rect, 4, ShapeUnion, Unsorted); - - } - -} -#endif /* USE_SHAPE */ - /** Remove a client window from management. */ -void RemoveClient(ClientNode *np) { +void RemoveClient(ClientNode *np) +{ ColormapNode *cp; @@ -1173,8 +1168,6 @@ Assert(np->window != None); Assert(np->parent != None); - JXGrabServer(display); - /* Remove this client from the client list */ if(np->next) { np->next->prev = np->prev; @@ -1186,10 +1179,14 @@ } else { nodes[np->state.layer] = np->next; } - --clientCount; + clientCount -= 1; XDeleteContext(display, np->window, clientContext); XDeleteContext(display, np->parent, frameContext); + if(np->state.status & STAT_URGENT) { + UnregisterCallback(SignalUrgent, np); + } + /* Make sure this client isn't active */ if(activeClient == np && !shouldExit) { FocusNextStacked(np); @@ -1197,24 +1194,22 @@ if(activeClient == np) { /* Must be the last client. */ - SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, None); activeClient = NULL; - - JXSetInputFocus(display, rootWindow, RevertToPointerRoot, eventTime); + JXSetInputFocus(display, rootWindow, RevertToParent, eventTime); } /* If the window manager is exiting (ie, not the client), then * reparent etc. */ if(shouldExit && !(np->state.status & STAT_WMDIALOG)) { - if(np->state.status & (STAT_VMAX | STAT_HMAX)) { + if(np->state.maxFlags) { np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; JXMoveResizeWindow(display, np->window, - np->x, np->y, np->width, np->height); + np->x, np->y, np->width, np->height); } GravitateClient(np, 1); if(!(np->state.status & STAT_MAPPED) @@ -1232,7 +1227,7 @@ } if(np->name) { - JXFree(np->name); + Release(np->name); } if(np->instanceName) { JXFree(np->instanceName); @@ -1243,7 +1238,6 @@ RemoveClientFromTaskBar(np); RemoveClientStrut(np); - UpdatePager(); while(np->colormaps) { cp = np->colormaps->next; @@ -1255,47 +1249,52 @@ Release(np); - JXUngrabServer(display); - - RestackClients(); + RequireRestack(); } /** Get the active client (possibly NULL). */ -ClientNode *GetActiveClient() { - +ClientNode *GetActiveClient(void) +{ return activeClient; - } -/** Find a client given a window (searches frame windows too). */ -ClientNode *FindClientByWindow(Window w) { - +/** Find a client by parent or window. */ +ClientNode *FindClient(Window w) +{ ClientNode *np; + np = FindClientByWindow(w); + if(!np) { + np = FindClientByParent(w); + } + return np; +} +/** Find a client by window. */ +ClientNode *FindClientByWindow(Window w) +{ + ClientNode *np; if(!XFindContext(display, w, clientContext, (void*)&np)) { return np; } else { - return FindClientByParent(w); + return NULL; } - } /** Find a client by its frame window. */ -ClientNode *FindClientByParent(Window p) { - +ClientNode *FindClientByParent(Window p) +{ ClientNode *np; - if(!XFindContext(display, p, frameContext, (void*)&np)) { return np; } else { return NULL; } - } /** Reparent a client window. */ -void ReparentClient(ClientNode *np, char notOwner) { +void ReparentClient(ClientNode *np, char notOwner) +{ XSetWindowAttributes attr; int attrMask; @@ -1314,19 +1313,16 @@ | KeyReleaseMask | StructureNotifyMask; attr.do_not_propagate_mask = NoEventMask; - XChangeWindowAttributes(display, np->window, - CWEventMask | CWDontPropagate, &attr); + JXChangeWindowAttributes(display, np->window, + CWEventMask | CWDontPropagate, &attr); } - JXGrabButton(display, AnyButton, AnyModifier, np->window, - True, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); + JXGrabButton(display, AnyButton, AnyModifier, np->window, True, + ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); GrabKeys(np); attrMask = 0; - attrMask |= CWBackPixmap; - attr.background_pixmap = ParentRelative; - /* We can't use PointerMotionHint mask here since the exact location * of the mouse on the frame is important. */ attrMask |= CWEventMask; @@ -1348,20 +1344,26 @@ attrMask |= CWBackPixel; attr.background_pixel = colors[COLOR_TITLE_BG2]; + attrMask |= CWBorderPixel; + attr.border_pixel = 0; + + attrMask |= CWColormap; + attr.colormap = np->cmap; + x = np->x; y = np->y; width = np->width; height = np->height; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); x -= west; y -= north; width += east + west; height += north + south; /* Create the frame window. */ - np->parent = JXCreateWindow(display, rootWindow, - x, y, width, height, 0, rootDepth, InputOutput, - rootVisual, attrMask, &attr); + np->parent = JXCreateWindow(display, rootWindow, x, y, width, height, + 0, np->visual.depth, InputOutput, + np->visual.visual, attrMask, &attr); /* Update the window to get only the events we want. */ attrMask = CWDontPropagate; @@ -1372,53 +1374,34 @@ | ButtonMotionMask | KeyPressMask | KeyReleaseMask; + + /* Make sure client doesn't muck with these. */ + attrMask |= CWBackingStore; + attr.backing_store = NotUseful; + attrMask |= CWWinGravity; + attr.win_gravity = NorthWestGravity; + JXChangeWindowAttributes(display, np->window, attrMask, &attr); JXSetWindowBorderWidth(display, np->window, 0); /* Reparent the client window. */ JXReparentWindow(display, np->window, np->parent, west, north); -#ifdef USE_SHAPE - if(haveShape) { - JXShapeSelectInput(display, np->window, ShapeNotifyMask); - CheckShape(np); - } -#endif - } -/** Determine if a window uses the shape extension. */ -#ifdef USE_SHAPE -void CheckShape(ClientNode *np) { - - int xb, yb; - int xc, yc; - unsigned int wb, hb; - unsigned int wc, hc; - Bool boundingShaped, clipShaped; - - JXShapeQueryExtents(display, np->window, &boundingShaped, - &xb, &yb, &wb, &hb, &clipShaped, &xc, &yc, &wc, &hc); - - if(boundingShaped == True) { - SetShape(np); - } - -} -#endif - /** Send a configure event to a client window. */ -void SendConfigureEvent(ClientNode *np) { +void SendConfigureEvent(ClientNode *np) +{ XConfigureEvent event; const ScreenType *sp; Assert(np); + memset(&event, 0, sizeof(event)); event.type = ConfigureNotify; event.event = np->window; event.window = np->window; - if(np->state.status & STAT_FULLSCREEN) { sp = GetCurrentScreen(np->x, np->y); event.x = sp->x; @@ -1432,12 +1415,8 @@ event.height = np->height; } - event.border_width = 0; - event.above = None; - event.override_redirect = False; - JXSendEvent(display, np->window, False, StructureNotifyMask, - (XEvent*)&event); + (XEvent*)&event); } @@ -1446,19 +1425,17 @@ * client changed. This will change the active colormap(s) if the given * client is active. */ -void UpdateClientColormap(ClientNode *np) { - - XWindowAttributes attr; - ColormapNode *cp; - int wasInstalled; +void UpdateClientColormap(ClientNode *np) +{ Assert(np); if(np == activeClient) { - wasInstalled = 0; - cp = np->colormaps; + ColormapNode *cp = np->colormaps; + char wasInstalled = 0; while(cp) { + XWindowAttributes attr; if(JXGetWindowAttributes(display, cp->window, &attr)) { if(attr.colormap != None) { if(attr.colormap == np->cmap) { @@ -1478,81 +1455,30 @@ } -/** Set the opacity for active clients. */ -void SetActiveClientOpacity(const char *str) { +/** Update callback for clients with the urgency hint set. */ +void SignalUrgent(const TimeType *now, int x, int y, Window w, void *data) +{ - double temp; + ClientNode *np = (ClientNode*)data; - Assert(str); - - temp = atof(str); - if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { - Warning(_("invalid active client opacity: %s"), str); - activeOpacity = UINT_MAX; - } else { - activeOpacity = (unsigned int)(1.0 * UINT_MAX); + /* Redraw borders. */ + if(np->state.status & STAT_FLASH) { + np->state.status &= ~STAT_FLASH; + } else if(!(np->state.status & STAT_NOTURGENT)) { + np->state.status |= STAT_FLASH; } + DrawBorder(np); + RequireTaskUpdate(); + RequirePagerUpdate(); } -/** Set the opacity range for inactive clients. */ -void SetInactiveClientOpacity(const char *str) { - - double temp; - const char *str_u; - const char *str_d; - unsigned int first; - unsigned int second; - - Assert(str); - - /* Reset in case there's a problem. */ - maxInactiveOpacity = (unsigned int)(0.9 * UINT_MAX); - minInactiveOpacity = (unsigned int)(0.5 * UINT_MAX); - deltaInactiveOpacity = (unsigned int)(0.1 * UINT_MAX); - - /* Read the first (or only) bound of the range. */ - temp = atof(str); - if(JUNLIKELY(temp < 0.0 || temp > 1.0)) { - Warning(_("invalid inactive client opacity: %s"), str); - return; - } - first = (unsigned int)(temp * UINT_MAX); - second = first; - - /* Check for a range. */ - str_u = strchr(str, ':'); - if(str_u) { - - /* A range was specified. */ - temp = atof(str_u + 1); - if(JUNLIKELY(temp < 0.0 || temp > 1.0)) { - Warning(_("invalid inactive client opacity: %s"), str); - return; - } - second = (unsigned int)(temp * UINT_MAX); - - /* Check for a delta. */ - str_d = strchr(str_u + 1, ':'); - if(str_d) { - temp = atof(str_d + 1); - if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { - Warning(_("invalid inactive client opacity delta: %s"), str); - return; - } - deltaInactiveOpacity = (unsigned int)(temp * UINT_MAX); - } - - } - - /* Set the min/max opacities. */ - if(first > second) { - minInactiveOpacity = second; - maxInactiveOpacity = first; - } else { - minInactiveOpacity = first; - maxInactiveOpacity = second; +/** Unmap a client window and consume the UnmapNotify event. */ +void UnmapClient(ClientNode *np) +{ + if(np->state.status & STAT_MAPPED) { + np->state.status &= ~STAT_MAPPED; + JXUnmapWindow(display, np->window); } - } diff -Nru jwm-2.1.0+svn579/src/client.h jwm-2.3.1+0~16~ubuntu14.10.1/src/client.h --- jwm-2.1.0+svn579/src/client.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/client.h 2015-07-18 20:02:18.000000000 +0000 @@ -3,62 +3,92 @@ * @author Joe Wingbermuehle * @date 2004-2007 * - * @brief Header file client window functions. + * @brief Header file for client window functions. * */ #ifndef CLIENT_H #define CLIENT_H +#include "main.h" #include "border.h" #include "hint.h" -/** Window border flags. */ -typedef enum { - BORDER_NONE = 0, - BORDER_OUTLINE = 1 << 0, /**< Window has a border. */ - BORDER_TITLE = 1 << 1, /**< Window has a title bar. */ - BORDER_MIN = 1 << 2, /**< Window supports minimize. */ - BORDER_MAX = 1 << 3, /**< Window supports maximize. */ - BORDER_CLOSE = 1 << 4, /**< Window supports close. */ - BORDER_RESIZE = 1 << 5, /**< Window supports resizing. */ - BORDER_MOVE = 1 << 6, /**< Window supports moving. */ - BORDER_MAX_V = 1 << 7, /**< Maximize vertically. */ - BORDER_MAX_H = 1 << 8 /**< Maximize horizontally. */ -} BorderFlags; +struct TimeType; + +/** Window border flags. + * We use an unsigned short for storing these, so we get at least 16 + * on reasonable architectures. + */ +typedef unsigned short BorderFlags; +#define BORDER_NONE 0 +#define BORDER_OUTLINE (1 << 0) /**< Window has a border. */ +#define BORDER_TITLE (1 << 1) /**< Window has a title bar. */ +#define BORDER_MIN (1 << 2) /**< Window supports minimize. */ +#define BORDER_MAX (1 << 3) /**< Window supports maximize. */ +#define BORDER_CLOSE (1 << 4) /**< Window supports close. */ +#define BORDER_RESIZE (1 << 5) /**< Window supports resizing. */ +#define BORDER_MOVE (1 << 6) /**< Window supports moving. */ +#define BORDER_MAX_V (1 << 7) /**< Maximize vertically. */ +#define BORDER_MAX_H (1 << 8) /**< Maximize horizontally. */ +#define BORDER_SHADE (1 << 9) /**< Allow shading. */ +#define BORDER_CONSTRAIN (1 << 10) /**< Constrain to the screen. */ +#define BORDER_FULLSCREEN (1 << 11) /**< Allow fullscreen. */ /** The default border flags. */ -#define BORDER_DEFAULT ( \ - BORDER_OUTLINE \ - | BORDER_TITLE \ - | BORDER_MIN \ - | BORDER_MAX \ - | BORDER_CLOSE \ - | BORDER_RESIZE \ - | BORDER_MOVE \ - | BORDER_MAX_V \ - | BORDER_MAX_H ) - -/** Window status flags. */ -typedef enum { - STAT_NONE = 0, - STAT_ACTIVE = 1 << 0, /**< This client has focus. */ - STAT_MAPPED = 1 << 1, /**< This client is shown (on some desktop). */ - STAT_HMAX = 1 << 2, /**< This client is maximized horizonatally. */ - STAT_VMAX = 1 << 3, /**< This client is maximized vertically. */ - STAT_HIDDEN = 1 << 4, /**< This client is not on the current desktop. */ - STAT_STICKY = 1 << 5, /**< This client is on all desktops. */ - STAT_NOLIST = 1 << 6, /**< Skip this client in the task list. */ - STAT_MINIMIZED = 1 << 7, /**< This client is minimized. */ - STAT_SHADED = 1 << 8, /**< This client is shaded. */ - STAT_WMDIALOG = 1 << 9, /**< This is a JWM dialog window. */ - STAT_PIGNORE = 1 << 10, /**< Ignore the program-specified position. */ - STAT_SHAPE = 1 << 11, /**< This client uses the shape extension. */ - STAT_SDESKTOP = 1 << 12, /**< This client was minimized to show desktop. */ - STAT_FULLSCREEN = 1 << 13, /**< This client wants to be full screen. */ - STAT_OPACITY = 1 << 14, /**< This client has a fixed opacity. */ - STAT_NOFOCUS = 1 << 15 /**< Don't focus on map. */ -} StatusFlags; +#define BORDER_DEFAULT ( \ + BORDER_OUTLINE \ + | BORDER_TITLE \ + | BORDER_MIN \ + | BORDER_MAX \ + | BORDER_CLOSE \ + | BORDER_RESIZE \ + | BORDER_MOVE \ + | BORDER_MAX_V \ + | BORDER_MAX_H \ + | BORDER_SHADE \ + | BORDER_FULLSCREEN ) + +/** Window status flags. + * We use an unsigned int for storing these, so we get 32 on + * reasonable architectures. + */ +typedef unsigned int StatusFlags; +#define STAT_NONE 0 +#define STAT_ACTIVE (1 << 0) /**< Has focus. */ +#define STAT_MAPPED (1 << 1) /**< Shown (on some desktop). */ +#define STAT_HIDDEN (1 << 2) /**< Not on the current desktop. */ +#define STAT_STICKY (1 << 3) /**< This client is on all desktops. */ +#define STAT_NOLIST (1 << 4) /**< Skip this client in the task list. */ +#define STAT_MINIMIZED (1 << 5) /**< Minimized. */ +#define STAT_SHADED (1 << 6) /**< Shaded. */ +#define STAT_WMDIALOG (1 << 7) /**< This is a JWM dialog window. */ +#define STAT_PIGNORE (1 << 8) /**< Ignore the program-position. */ +#define STAT_SDESKTOP (1 << 9) /**< Minimized to show desktop. */ +#define STAT_FULLSCREEN (1 << 10) /**< Full screen. */ +#define STAT_OPACITY (1 << 11) /**< Fixed opacity. */ +#define STAT_NOFOCUS (1 << 12) /**< Don't focus on map. */ +#define STAT_CANFOCUS (1 << 13) /**< Client accepts input focus. */ +#define STAT_DELETE (1 << 14) /**< Client accepts WM_DELETE. */ +#define STAT_TAKEFOCUS (1 << 15) /**< Client uses WM_TAKE_FOCUS. */ +#define STAT_URGENT (1 << 16) /**< Urgency hint is set. */ +#define STAT_NOTURGENT (1 << 17) /**< Ignore the urgency hint. */ +#define STAT_CENTERED (1 << 18) /**< Use centered window placement. */ +#define STAT_TILED (1 << 19) /**< Use tiled window placement. */ +#define STAT_IIGNORE (1 << 20) /**< Ignore increment when maximized. */ +#define STAT_NOPAGER (1 << 21) /**< Don't show in pager. */ +#define STAT_SHAPED (1 << 22) /**< This window is shaped. */ +#define STAT_FLASH (1 << 23) /**< Flashing for urgency. */ + +/** Maximization flags. */ +typedef unsigned char MaxFlags; +#define MAX_NONE 0 /**< Don't maximize. */ +#define MAX_HORIZ (1 << 0) /**< Horizontal maximization. */ +#define MAX_VERT (1 << 1) /**< Vertical maximization. */ +#define MAX_LEFT (1 << 2) /**< Maximize on left. */ +#define MAX_RIGHT (1 << 3) /**< Maximize on right. */ +#define MAX_TOP (1 << 4) /**< Maximize on top. */ +#define MAX_BOTTOM (1 << 5) /**< Maximize on bottom. */ /** Colormap window linked list. */ typedef struct ColormapNode { @@ -77,6 +107,7 @@ /** Struture to store information about a client window. */ typedef struct ClientNode { + VisualData visual; /**< Client visual and depth. */ Window window; /**< The client window. */ Window parent; /**< The frame window. */ @@ -123,10 +154,19 @@ } ClientNode; +/** The number of clients (maintained in client.c). */ +extern unsigned int clientCount; + /** Find a client by window or parent window. * @param w The window. * @return The client (NULL if not found). */ +ClientNode *FindClient(Window w); + +/** Find a client by window. + * @param w The window. + * @return The client (NULL if not found). + */ ClientNode *FindClientByWindow(Window w); /** Find a client by its parent window. @@ -138,12 +178,14 @@ /** Get the active client. * @return The active client (NULL if no client is active). */ -ClientNode *GetActiveClient(); +ClientNode *GetActiveClient(void); -void InitializeClients(); -void StartupClients(); -void ShutdownClients(); -void DestroyClients(); +/*@{*/ +#define InitializeClients() (void)(0) +void StartupClients(void); +void ShutdownClients(void); +#define DestroyClients() (void)(0) +/*@}*/ /** Add a window to management. * @param w The client window. @@ -160,8 +202,9 @@ /** Minimize a client. * @param np The client to minimize. + * @param lower Set to lower the client in the stacking order. */ -void MinimizeClient(ClientNode *np); +void MinimizeClient(ClientNode *np, char lower); /** Shade a client. * @param np The client to shade. @@ -188,11 +231,10 @@ void RestoreClient(ClientNode *np, char raise); /** Maximize a client. - * @param np The client to maximize. - * @param horiz Set to maximize the client horizontally. - * @param vert Set to maximize the client vertically. + * @param np The client to maximize (NULL is allowed). + * @param flags The type of maximization to perform. */ -void MaximizeClient(ClientNode *np, char horiz, char vert); +void MaximizeClient(ClientNode *np, MaxFlags flags); /** Maximize a client using the default maximize settings. * @param np The client to maximize. @@ -211,7 +253,7 @@ void FocusClient(ClientNode *np); /** Set the keyboard focus back to the active client. */ -void RefocusClient(); +void RefocusClient(void); /** Tell a client to exit. * @param np The client to delete. @@ -228,16 +270,18 @@ */ void RaiseClient(ClientNode *np); -/** Lower a client to the bottom of its layer. - * @param np The client to lower. +/** Restack a client. + * @param np The client to restack. + * @param above A reference window (or None). + * @param detail The stack mode (Above, Below, etc). */ -void LowerClient(ClientNode *np); +void RestackClient(ClientNode *np, Window above, int detail); /** Restack the clients. * This is used when a client is mapped so that the stacking order * remains consistent. */ -void RestackClients(); +void RestackClients(void); /** Set the layer of a client. * @param np The client whose layer to set. @@ -275,11 +319,6 @@ */ void UpdateClientColormap(ClientNode *np); -/** Update the shape of a client using the shape extension. - * @param np The client to update. - */ -void SetShape(ClientNode *np); - /** Send a configure event to a client. * This will send updated location and size information to a client. * @param np The client to get the event. @@ -293,15 +332,9 @@ */ void SendClientMessage(Window w, AtomType type, AtomType message); -/** Set the opacity for active clients. - * @param str The opacity to use. - */ -void SetActiveClientOpacity(const char *str); - -/** Set the opacity range for inactive clients. - * @param str The opacity range to use. - */ -void SetInactiveClientOpacity(const char *str); +/** Update callback for clients with the urgency hint set. */ +void SignalUrgent(const struct TimeType *now, int x, int y, Window w, + void *data); #endif /* CLIENT_H */ diff -Nru jwm-2.1.0+svn579/src/clientlist.c jwm-2.3.1+0~16~ubuntu14.10.1/src/clientlist.c --- jwm-2.1.0+svn579/src/clientlist.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/clientlist.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,8 +10,9 @@ #include "jwm.h" #include "clientlist.h" #include "client.h" -#include "main.h" #include "key.h" +#include "event.h" +#include "tray.h" ClientNode *nodes[LAYER_COUNT]; ClientNode *nodeTail[LAYER_COUNT]; @@ -19,9 +20,11 @@ static Window *windowStack = NULL; /**< Image of the window stack. */ static int windowStackSize = 0; /**< Size of the image. */ static int windowStackCurrent = 0; /**< Current location in the image. */ +static char walkingWindows = 0; /**< Are we walking windows? */ /** Determine if a client is allowed focus. */ -int ShouldFocus(const ClientNode *np) { +char ShouldFocus(const ClientNode *np) +{ /* Only display clients on the current desktop or clients that are sticky. */ if(np->state.desktop != currentDesktop @@ -39,8 +42,7 @@ return 0; } - if( !(np->state.status & STAT_MAPPED) - && !(np->state.status & (STAT_MINIMIZED | STAT_SHADED))) { + if(!(np->state.status & (STAT_MAPPED | STAT_MINIMIZED | STAT_SHADED))) { return 0; } @@ -48,8 +50,18 @@ } +/** Start walking windows in client list order. */ +void StartWindowWalk(void) +{ + JXGrabKeyboard(display, rootWindow, False, GrabModeAsync, + GrabModeAsync, CurrentTime); + RaiseTrays(); + walkingWindows = 1; +} + /** Start walking the window stack. */ -void StartWindowStackWalk() { +void StartWindowStackWalk(void) +{ /* Get an image of the window stack. * Here we get the Window IDs rather than client pointers so @@ -67,7 +79,7 @@ /* First determine how much space to allocate for windows. */ count = 0; - for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { + for(layer = LAST_LAYER; layer >= FIRST_LAYER; layer--) { for(np = nodes[layer]; np; np = np->next) { if(ShouldFocus(np)) { ++count; @@ -85,7 +97,7 @@ /* Copy windows into the array. */ windowStackSize = 0; - for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { + for(layer = LAST_LAYER; layer >= FIRST_LAYER; layer--) { for(np = nodes[layer]; np; np = np->next) { if(ShouldFocus(np)) { windowStack[windowStackSize++] = np->window; @@ -100,15 +112,20 @@ JXGrabKeyboard(display, rootWindow, False, GrabModeAsync, GrabModeAsync, CurrentTime); + RaiseTrays(); + + walkingWindows = 1; + } /** Move to the next window in the window stack. */ -void WalkWindowStack(int forward) { +void WalkWindowStack(char forward) +{ ClientNode *np; - int x; if(windowStack != NULL) { + int x; /* Loop until we either raise a window or go through them all. */ for(x = 0; x < windowStackSize; x++) { @@ -120,7 +137,7 @@ if(windowStackCurrent == 0) { windowStackCurrent = windowStackSize; } - --windowStackCurrent; + windowStackCurrent -= 1; } /* Look up the window. */ @@ -144,8 +161,9 @@ } -/** Stop walking the window stack. */ -void StopWindowStackWalk() { +/** Stop walking the window stack or client list. */ +void StopWindowWalk(void) +{ ClientNode *np; @@ -168,14 +186,19 @@ windowStackSize = 0; windowStackCurrent = 0; - JXUngrabKeyboard(display, CurrentTime); + } + if(walkingWindows) { + JXUngrabKeyboard(display, CurrentTime); + LowerTrays(); + walkingWindows = 0; } } /** Focus the next client in the stacking order. */ -void FocusNextStacked(ClientNode *np) { +void FocusNextStacked(ClientNode *np) +{ int x; ClientNode *tp; @@ -189,7 +212,7 @@ return; } } - for(x = np->state.layer - 1; x >= LAYER_BOTTOM; x--) { + for(x = np->state.layer - 1; x >= FIRST_LAYER; x--) { for(tp = nodes[x]; tp; tp = tp->next) { if((tp->state.status & (STAT_MAPPED | STAT_SHADED)) && !(tp->state.status & STAT_HIDDEN)) { @@ -199,5 +222,8 @@ } } + /* No client to focus. */ + JXSetInputFocus(display, rootWindow, RevertToParent, eventTime); + } diff -Nru jwm-2.1.0+svn579/src/clientlist.h jwm-2.3.1+0~16~ubuntu14.10.1/src/clientlist.h --- jwm-2.1.0+svn579/src/clientlist.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/clientlist.h 2015-07-18 20:02:18.000000000 +0000 @@ -24,16 +24,19 @@ * @param np The client. * @return 1 if focus is allowed, 0 otherwise. */ -int ShouldFocus(const struct ClientNode *np); +char ShouldFocus(const struct ClientNode *np); + +/** Start walking the window client list. */ +void StartWindowWalk(void); /** Start walking the window stack. */ void StartWindowStackWalk(); /** Move to the next/previous window in the window stack. */ -void WalkWindowStack(int forward); +void WalkWindowStack(char forward); -/** Stop walking the window stack. */ -void StopWindowStackWalk(); +/** Stop walking the window stack or client list. */ +void StopWindowWalk(void); /** Set the keyboard focus to the next client. * This is used to focus the next client in the stacking order. diff -Nru jwm-2.1.0+svn579/src/clock.c jwm-2.3.1+0~16~ubuntu14.10.1/src/clock.c --- jwm-2.1.0+svn579/src/clock.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/clock.c 2015-07-18 20:02:18.000000000 +0000 @@ -18,25 +18,28 @@ #include "cursor.h" #include "popup.h" #include "misc.h" +#include "settings.h" +#include "event.h" +#include "action.h" /** Structure to respresent a clock tray component. */ typedef struct ClockType { - TrayComponentType *cp; /**< Common component data. */ + TrayComponentType *cp; /**< Common component data. */ - char *format; /**< The time format to use. */ - char *zone; /**< The time zone to use (NULL = local). */ - char *command; /**< A command to run when clicked. */ - char shortTime[80]; /**< Currently displayed time. */ + char *format; /**< The time format to use. */ + char *zone; /**< The time zone to use (NULL = local). */ + struct ActionType *actions; /**< Actions */ + TimeType lastTime; /**< Currently displayed time. */ /* The following are used to control popups. */ - int mousex; /**< Last mouse x-coordinate. */ - int mousey; /**< Last mouse y-coordinate. */ - TimeType mouseTime; /**< Time of the last mouse motion. */ + int mousex; /**< Last mouse x-coordinate. */ + int mousey; /**< Last mouse y-coordinate. */ + TimeType mouseTime; /**< Time of the last mouse motion. */ - int userWidth; /**< User-specified clock width (or 0). */ + int userWidth; /**< User-specified clock width (or 0). */ - struct ClockType *next; /**< Next clock in the list. */ + struct ClockType *next; /**< Next clock in the list. */ } ClockType; @@ -44,28 +47,33 @@ static const char *DEFAULT_FORMAT = "%I:%M %p"; static ClockType *clocks; -static TimeType lastUpdate = ZERO_TIME; static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void Destroy(TrayComponentType *cp); -static void ProcessClockButtonEvent(TrayComponentType *cp, - int x, int y, int mask); +static void ProcessClockButtonPress(TrayComponentType *cp, + int x, int y, int button); +static void ProcessClockButtonRelease(TrayComponentType *cp, + int x, int y, int button); static void ProcessClockMotionEvent(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); + +static void DrawClock(ClockType *clk, const TimeType *now); + +static void SignalClock(const struct TimeType *now, int x, int y, Window w, + void *data); -static void DrawClock(ClockType *clk, const TimeType *now, int x, int y); /** Initialize clocks. */ -void InitializeClock() { +void InitializeClock(void) +{ clocks = NULL; } /** Start clock(s). */ -void StartupClock() { - +void StartupClock(void) +{ ClockType *clk; - for(clk = clocks; clk; clk = clk->next) { if(clk->cp->requestedWidth == 0) { clk->cp->requestedWidth = 1; @@ -74,20 +82,13 @@ clk->cp->requestedHeight = GetStringHeight(FONT_CLOCK) + 4; } } - -} - -/** Stop clock(s). */ -void ShutdownClock() { } /** Destroy clock(s). */ -void DestroyClock() { - - ClockType *cp; - +void DestroyClock(void) +{ while(clocks) { - cp = clocks->next; + ClockType *cp = clocks->next; if(clocks->format) { Release(clocks->format); @@ -95,19 +96,18 @@ if(clocks->zone) { Release(clocks->zone); } - if(clocks->command) { - Release(clocks->command); - } + DestroyActions(clocks->actions); + UnregisterCallback(SignalClock, clocks); Release(clocks); clocks = cp; } - } /** Create a clock tray component. */ TrayComponentType *CreateClock(const char *format, const char *zone, - const char *command, int width, int height) { + int width, int height) +{ TrayComponentType *cp; ClockType *clk; @@ -116,8 +116,8 @@ clk->next = clocks; clocks = clk; - clk->mousex = -POPUP_DELTA; - clk->mousey = -POPUP_DELTA; + clk->mousex = -settings.doubleClickDelta; + clk->mousey = -settings.doubleClickDelta; clk->mouseTime.seconds = 0; clk->mouseTime.ms = 0; clk->userWidth = 0; @@ -126,12 +126,9 @@ format = DEFAULT_FORMAT; } clk->format = CopyString(format); - clk->zone = CopyString(zone); - - clk->command = CopyString(command); - - clk->shortTime[0] = 0; + clk->actions = NULL; + memset(&clk->lastTime, 0, sizeof(clk->lastTime)); cp = CreateTrayComponent(); cp->object = clk; @@ -148,32 +145,37 @@ cp->Create = Create; cp->Resize = Resize; cp->Destroy = Destroy; - cp->ProcessButtonPress = ProcessClockButtonEvent; + cp->ProcessButtonPress = ProcessClockButtonPress; + cp->ProcessButtonRelease = ProcessClockButtonRelease; cp->ProcessMotionEvent = ProcessClockMotionEvent; + RegisterCallback(Min(900, settings.popupDelay / 2), SignalClock, clk); + return cp; +} +/** Add an action to a clock. */ +void AddClockAction(TrayComponentType *cp, + const char *action, + int mask) +{ + ClockType *clock = (ClockType*)cp->object; + AddAction(&clock->actions, action, mask); } /** Initialize a clock tray component. */ -void Create(TrayComponentType *cp) { - - Assert(cp); - +void Create(TrayComponentType *cp) +{ cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, - rootDepth); - - JXSetForeground(display, rootGC, colors[COLOR_CLOCK_BG]); - JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); - + rootVisual.depth); } /** Resize a clock tray component. */ -void Resize(TrayComponentType *cp) { +void Resize(TrayComponentType *cp) +{ ClockType *clk; TimeType now; - int x, y; Assert(cp); @@ -186,128 +188,103 @@ } cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, - rootDepth); + rootVisual.depth); - clk->shortTime[0] = 0; + memset(&clk->lastTime, 0, sizeof(clk->lastTime)); GetCurrentTime(&now); - GetMousePosition(&x, &y); - DrawClock(clk, &now, x, y); + DrawClock(clk, &now); } /** Destroy a clock tray component. */ -void Destroy(TrayComponentType *cp) { - +void Destroy(TrayComponentType *cp) +{ Assert(cp); - if(cp->pixmap != None) { JXFreePixmap(display, cp->pixmap); } } -/** Process a click event on a clock tray component. */ -void ProcessClockButtonEvent(TrayComponentType *cp, int x, int y, int mask) { - - ClockType *clk; - - Assert(cp); - - clk = (ClockType*)cp->object; - - Assert(clk); - - if(clk->command) { - RunCommand(clk->command); - } +/** Process a press event on a clock tray component. */ +void ProcessClockButtonPress(TrayComponentType *cp, int x, int y, int button) +{ + const ClockType *clk = (ClockType*)cp->object; + ProcessActionPress(clk->actions, cp, x, y, button); +} +void ProcessClockButtonRelease(TrayComponentType *cp, int x, int y, int button) +{ + const ClockType *clk = (ClockType*)cp->object; + ProcessActionRelease(clk->actions, cp, x, y, button); } /** Process a motion event on a clock tray component. */ void ProcessClockMotionEvent(TrayComponentType *cp, - int x, int y, int mask) { - - ClockType *clk; - - Assert(cp); - - clk = (ClockType*)cp->object; + int x, int y, int mask) +{ + ClockType *clk = (ClockType*)cp->object; clk->mousex = cp->screenx + x; clk->mousey = cp->screeny + y; GetCurrentTime(&clk->mouseTime); - } /** Update a clock tray component. */ -void SignalClock(const TimeType *now, int x, int y) { +void SignalClock(const TimeType *now, int x, int y, Window w, void *data) +{ - ClockType *cp; - int shouldDraw; + ClockType *cp = (ClockType*)data; const char *longTime; - Assert(now); - - /* Determine if we should update the clock(s). */ - if(GetTimeDifference(&lastUpdate, now) > 900) { - shouldDraw = 1; - lastUpdate = *now; - } else { - shouldDraw = 0; - } - - /* Update each clock. */ - for(cp = clocks; cp; cp = cp->next) { - - if(shouldDraw) { - DrawClock(cp, now, x, y); - } - - if(abs(cp->mousex - x) < POPUP_DELTA - && abs(cp->mousey - y) < POPUP_DELTA) { - if(GetTimeDifference(now, &cp->mouseTime) >= popupDelay) { - longTime = GetTimeString("%c", cp->zone); - ShowPopup(x, y, longTime); - } + DrawClock(cp, now); + if(cp->cp->tray->window == w && + abs(cp->mousex - x) < settings.doubleClickDelta && + abs(cp->mousey - y) < settings.doubleClickDelta) { + if(GetTimeDifference(now, &cp->mouseTime) >= settings.popupDelay) { + longTime = GetTimeString("%c", cp->zone); + ShowPopup(x, y, longTime); } - } } /** Draw a clock tray component. */ -void DrawClock(ClockType *clk, const TimeType *now, int x, int y) { +void DrawClock(ClockType *clk, const TimeType *now) +{ TrayComponentType *cp; - const char *shortTime; + const char *timeString; int width; int rwidth; - Assert(clk); - Assert(now); - - /* Only draw if the label changed. */ - shortTime = GetTimeString(clk->format, clk->zone); - if(!strcmp(clk->shortTime, shortTime)) { + /* Only draw if the time changed. */ + if(now->seconds == clk->lastTime.seconds) { return; } - strcpy(clk->shortTime, shortTime); - - cp = clk->cp; /* Clear the area. */ - JXSetForeground(display, rootGC, colors[COLOR_CLOCK_BG]); - JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); + cp = clk->cp; + if(colors[COLOR_CLOCK_BG1] == colors[COLOR_CLOCK_BG2]) { + JXSetForeground(display, rootGC, colors[COLOR_CLOCK_BG1]); + JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, + cp->width, cp->height); + } else { + DrawHorizontalGradient(cp->pixmap, rootGC, + colors[COLOR_CLOCK_BG1], colors[COLOR_CLOCK_BG2], + 0, 0, cp->width, cp->height); + } /* Determine if the clock is the right size. */ - width = GetStringWidth(FONT_CLOCK, shortTime); + timeString = GetTimeString(clk->format, clk->zone); + width = GetStringWidth(FONT_CLOCK, timeString); rwidth = width + 4; if(rwidth == clk->cp->requestedWidth || clk->userWidth) { /* Draw the clock. */ - RenderString(cp->pixmap, FONT_CLOCK, COLOR_CLOCK_FG, + RenderString(&rootVisual, cp->pixmap, FONT_CLOCK, COLOR_CLOCK_FG, (cp->width - width) / 2, (cp->height - GetStringHeight(FONT_CLOCK)) / 2, - cp->width, NULL, shortTime); + cp->width, timeString); UpdateSpecificTray(clk->cp->tray, clk->cp); @@ -320,5 +297,3 @@ } } - - diff -Nru jwm-2.1.0+svn579/src/clock.h jwm-2.3.1+0~16~ubuntu14.10.1/src/clock.h --- jwm-2.1.0+svn579/src/clock.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/clock.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,32 +11,31 @@ #define CLOCK_H struct TrayComponentType; -struct TimeType; /*@{*/ -void InitializeClock(); -void StartupClock(); -void ShutdownClock(); -void DestroyClock(); +void InitializeClock(void); +void StartupClock(void); +#define ShutdownClock() (void)(0) +void DestroyClock(void); /*@}*/ /** Create a clock component for the tray. * @param format The format of the clock. * @param zone The timezone of the clock (NULL for local time). - * @param command The command to execute when the clock is clicked. * @param width The width of the clock (0 for auto). * @param height The height of the clock (0 for auto). */ -struct TrayComponentType *CreateClock(const char *format, const char *zone, - const char *command, int width, int height); - -/** Update clocks. - * This is called on a regular basis to update the time. - * @param now The current time. - * @param x The x-coordinate of the mouse. - * @param y The y-coordinate of the mouse. +struct TrayComponentType *CreateClock(const char *format, + const char *zone, + int width, int height); + +/** Add an action to a clock. + * @param cp The clock. + * @param action The action to take. + * @param mask The mouse button mask. */ -void SignalClock(const struct TimeType *now, int x, int y); +void AddClockAction(struct TrayComponentType *cp, + const char *action, + int mask); #endif /* CLOCK_H */ - diff -Nru jwm-2.1.0+svn579/src/color.c jwm-2.3.1+0~16~ubuntu14.10.1/src/color.c --- jwm-2.1.0+svn579/src/color.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/color.c 2015-07-18 20:02:18.000000000 +0000 @@ -13,11 +13,18 @@ #include "error.h" #include "misc.h" +/** Mapping between color types and default values. */ typedef struct { ColorType type; - const char *value; + unsigned int value; } DefaultColorNode; +/** Mapping from color type to the value it from which it inherits. */ +typedef struct { + ColorType dest; + ColorType src; +} ColorInheritNode; + unsigned long colors[COLOR_COUNT]; static unsigned long rgbColors[COLOR_COUNT]; @@ -31,55 +38,89 @@ static XftColor *xftColors[COLOR_COUNT] = { NULL }; #endif -static DefaultColorNode DEFAULT_COLORS[] = { +static const DefaultColorNode DEFAULT_COLORS[] = { - { COLOR_TITLE_FG, "black" }, - { COLOR_TITLE_ACTIVE_FG, "black" }, + { COLOR_TITLE_FG, 0xFFFFFF }, + { COLOR_TITLE_ACTIVE_FG, 0xFFFFFF }, - { COLOR_TITLE_BG1, "gray" }, - { COLOR_TITLE_BG2, "gray" }, - { COLOR_TITLE_ACTIVE_BG1, "red" }, - { COLOR_TITLE_ACTIVE_BG2, "red" }, - - { COLOR_BORDER_LINE, "black" }, - { COLOR_BORDER_ACTIVE_LINE, "black" }, - - { COLOR_TRAY_BG, "gray" }, - { COLOR_TRAY_FG, "black" }, - - { COLOR_TASK_FG, "black" }, - { COLOR_TASK_BG1, "gray" }, - { COLOR_TASK_BG2, "gray" }, - { COLOR_TASK_ACTIVE_FG, "white" }, - { COLOR_TASK_ACTIVE_BG1, "red" }, - { COLOR_TASK_ACTIVE_BG2, "red" }, - - { COLOR_PAGER_BG, "black" }, - { COLOR_PAGER_FG, "gray" }, - { COLOR_PAGER_ACTIVE_BG, "red" }, - { COLOR_PAGER_ACTIVE_FG, "red" }, - { COLOR_PAGER_OUTLINE, "black" }, - { COLOR_PAGER_TEXT, "black" }, - - { COLOR_MENU_BG, "gray" }, - { COLOR_MENU_FG, "black" }, - { COLOR_MENU_ACTIVE_BG1, "red" }, - { COLOR_MENU_ACTIVE_BG2, "red" }, - { COLOR_MENU_ACTIVE_FG, "white" }, - { COLOR_MENU_ACTIVE_OL, "black" }, - - { COLOR_POPUP_BG, "yellow" }, - { COLOR_POPUP_FG, "black" }, - { COLOR_POPUP_OUTLINE, "black" }, - - { COLOR_TRAYBUTTON_FG, "black" }, - { COLOR_TRAYBUTTON_BG, "gray" }, - - { COLOR_CLOCK_FG, "black" }, - { COLOR_CLOCK_BG, "gray" }, - { COLOR_COUNT, NULL } + { COLOR_TITLE_BG1, 0x333333 }, + { COLOR_TITLE_BG2, 0x333333 }, + { COLOR_TITLE_ACTIVE_BG1, 0x0077CC }, + { COLOR_TITLE_ACTIVE_BG2, 0x0077CC }, + + { COLOR_BORDER_LINE, 0x000000 }, + { COLOR_BORDER_ACTIVE_LINE, 0x000000 }, + + { COLOR_TRAY_FG, 0xFFFFFF }, + { COLOR_TRAY_BG1, 0x111111 }, + { COLOR_TRAY_BG2, 0x111111 }, + { COLOR_TRAY_ACTIVE_FG, 0xFFFFFF }, + { COLOR_TRAY_ACTIVE_BG1, 0x333333 }, + { COLOR_TRAY_ACTIVE_BG2, 0x333333 }, + + { COLOR_TASK_FG, 0xFFFFFF }, + { COLOR_TASK_BG1, 0x111111 }, + { COLOR_TASK_BG2, 0x111111 }, + { COLOR_TASK_BORDER, 0x000000 }, + { COLOR_TASK_ACTIVE_FG, 0xFFFFFF }, + { COLOR_TASK_ACTIVE_BG1, 0x333333 }, + { COLOR_TASK_ACTIVE_BG2, 0x333333 }, + + { COLOR_PAGER_BG, 0x111111 }, + { COLOR_PAGER_FG, 0x444444 }, + { COLOR_PAGER_ACTIVE_BG, 0x333333 }, + { COLOR_PAGER_ACTIVE_FG, 0x0077CC }, + { COLOR_PAGER_OUTLINE, 0x000000 }, + { COLOR_PAGER_TEXT, 0xFFFFFF }, + + { COLOR_MENU_BG, 0x333333 }, + { COLOR_MENU_FG, 0xFFFFFF }, + { COLOR_MENU_ACTIVE_BG1, 0x0077CC }, + { COLOR_MENU_ACTIVE_BG2, 0x0077CC }, + { COLOR_MENU_ACTIVE_FG, 0xFFFFFF }, + + { COLOR_POPUP_BG, 0x999999 }, + { COLOR_POPUP_FG, 0x000000 }, + { COLOR_POPUP_OUTLINE, 0x000000 }, + + { COLOR_TRAYBUTTON_FG, 0xFFFFFF }, + { COLOR_TRAYBUTTON_BG1, 0x111111 }, + { COLOR_TRAYBUTTON_BG2, 0x111111 }, + { COLOR_TRAYBUTTON_ACTIVE_FG, 0xFFFFFF }, + { COLOR_TRAYBUTTON_ACTIVE_BG1, 0x333333 }, + { COLOR_TRAYBUTTON_ACTIVE_BG2, 0x333333 }, + + { COLOR_CLOCK_FG, 0xFFFFFF }, + { COLOR_CLOCK_BG1, 0x111111 }, + { COLOR_CLOCK_BG2, 0x111111 }, + + { COLOR_TRAY_OUTLINE, 0x000000 }, + { COLOR_MENU_OUTLINE, 0x000000 } }; +static const unsigned int DEFAULT_COUNT + = sizeof(DEFAULT_COLORS) / sizeof(DEFAULT_COLORS[0]); + +static const ColorInheritNode INHERIT_COLORS[] = { + { COLOR_TASK_FG, COLOR_TRAY_FG }, + { COLOR_TASK_BG1, COLOR_TRAY_BG1 }, + { COLOR_TASK_BG2, COLOR_TRAY_BG2 }, + { COLOR_TASK_ACTIVE_FG, COLOR_TRAY_ACTIVE_FG }, + { COLOR_TASK_ACTIVE_BG1, COLOR_TRAY_ACTIVE_BG1 }, + { COLOR_TASK_ACTIVE_BG2, COLOR_TRAY_ACTIVE_BG2 }, + { COLOR_TRAYBUTTON_FG, COLOR_TRAY_FG }, + { COLOR_TRAYBUTTON_BG1, COLOR_TRAY_BG1 }, + { COLOR_TRAYBUTTON_BG2, COLOR_TRAY_BG2, }, + { COLOR_TRAYBUTTON_ACTIVE_FG, COLOR_TRAY_ACTIVE_FG }, + { COLOR_TRAYBUTTON_ACTIVE_BG1, COLOR_TRAY_ACTIVE_BG1 }, + { COLOR_TRAYBUTTON_ACTIVE_BG2, COLOR_TRAY_ACTIVE_BG2 }, + { COLOR_CLOCK_FG, COLOR_TRAY_FG }, + { COLOR_CLOCK_BG1, COLOR_TRAY_BG1 }, + { COLOR_CLOCK_BG2, COLOR_TRAY_BG2 }, + { COLOR_TASK_BORDER, COLOR_TASK_FG } +}; +static const unsigned int INHERIT_COUNT + = sizeof(INHERIT_COLORS) / sizeof(INHERIT_COLORS[0]); static char **names = NULL; @@ -91,7 +132,8 @@ static unsigned long blueMask; static void ComputeShiftMask(unsigned long maskIn, - unsigned long *shiftOut, unsigned long *maskOut); + unsigned long *shiftOut, + unsigned long *maskOut); static void GetDirectPixel(XColor *c); static void GetMappedPixel(XColor *c); @@ -101,34 +143,29 @@ static unsigned long ReadHex(const char *hex); static unsigned long GetRGBFromXColor(const XColor *c); -static XColor GetXColorFromRGB(unsigned long rgb); static int GetColorByName(const char *str, XColor *c); -static void InitializeNames(); +static void InitializeNames(void); +static XColor GetXColorFromRGB(unsigned long rgb); static void LightenColor(ColorType oldColor, ColorType newColor); static void DarkenColor(ColorType oldColor, ColorType newColor); -/** Initialize color data. */ -void InitializeColors() { - -} - /** Startup color support. */ -void StartupColors() { +void StartupColors(void) +{ - int x; + unsigned int x; int red, green, blue; XColor c; /* Determine how to convert between RGB triples and pixels. */ - Assert(rootVisual); - switch(rootVisual->class) { + switch(rootVisual.visual->class) { case DirectColor: case TrueColor: - ComputeShiftMask(rootVisual->red_mask, &redShift, &redMask); - ComputeShiftMask(rootVisual->green_mask, &greenShift, &greenMask); - ComputeShiftMask(rootVisual->blue_mask, &blueShift, &blueMask); + ComputeShiftMask(rootVisual.visual->red_mask, &redShift, &redMask); + ComputeShiftMask(rootVisual.visual->green_mask, &greenShift, &greenMask); + ComputeShiftMask(rootVisual.visual->blue_mask, &blueShift, &blueMask); map = NULL; break; default: @@ -153,7 +190,7 @@ c.flags = DoRed | DoGreen | DoBlue; JXAllocColor(display, rootColormap, &c); map[x] = c.pixel; - ++x; + x += 1; } } } @@ -170,30 +207,13 @@ break; } - /* Inherit unset colors from the tray for tray items. */ + /* Inherit unset colors. */ if(names) { - - if(!names[COLOR_TASK_BG1]) { - names[COLOR_TASK_BG1] = CopyString(names[COLOR_TRAY_BG]); - } - if(!names[COLOR_TASK_BG2]) { - names[COLOR_TASK_BG2] = CopyString(names[COLOR_TRAY_BG]); - } - - if(!names[COLOR_TRAYBUTTON_BG]) { - names[COLOR_TRAYBUTTON_BG] = CopyString(names[COLOR_TRAY_BG]); - } - if(!names[COLOR_CLOCK_BG]) { - names[COLOR_CLOCK_BG] = CopyString(names[COLOR_TRAY_BG]); - } - if(!names[COLOR_TASK_FG]) { - names[COLOR_TASK_FG] = CopyString(names[COLOR_TRAY_FG]); - } - if(!names[COLOR_TRAYBUTTON_FG]) { - names[COLOR_TRAYBUTTON_FG] = CopyString(names[COLOR_TRAY_FG]); - } - if(!names[COLOR_CLOCK_FG]) { - names[COLOR_CLOCK_FG] = CopyString(names[COLOR_TRAY_FG]); + for(x = 0; x < INHERIT_COUNT; x++) { + if(!names[INHERIT_COLORS[x].dest]) { + names[INHERIT_COLORS[x].dest] + = CopyString(names[INHERIT_COLORS[x].src]); + } } } @@ -211,6 +231,12 @@ } } + LightenColor(COLOR_TITLE_BG1, COLOR_TITLE_UP); + DarkenColor(COLOR_TITLE_BG1, COLOR_TITLE_DOWN); + + LightenColor(COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_UP); + DarkenColor(COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_DOWN); + if(names) { for(x = 0; x < COLOR_COUNT; x++) { if(names[x]) { @@ -221,25 +247,11 @@ names = NULL; } - LightenColor(COLOR_TRAY_BG, COLOR_TRAY_UP); - DarkenColor(COLOR_TRAY_BG, COLOR_TRAY_DOWN); - - LightenColor(COLOR_TASK_BG1, COLOR_TASK_UP); - DarkenColor(COLOR_TASK_BG1, COLOR_TASK_DOWN); - - LightenColor(COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_UP); - DarkenColor(COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_DOWN); - - LightenColor(COLOR_MENU_BG, COLOR_MENU_UP); - DarkenColor(COLOR_MENU_BG, COLOR_MENU_DOWN); - - LightenColor(COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_UP); - DarkenColor(COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_DOWN); - } /** Shutdown color support. */ -void ShutdownColors() { +void ShutdownColors(void) +{ #ifdef USE_XFT @@ -247,7 +259,7 @@ for(x = 0; x < COLOR_COUNT; x++) { if(xftColors[x]) { - JXftColorFree(display, rootVisual, rootColormap, xftColors[x]); + JXftColorFree(display, rootVisual.visual, rootColormap, xftColors[x]); Release(xftColors[x]); xftColors[x] = NULL; } @@ -266,11 +278,11 @@ } /** Release color data. */ -void DestroyColors() { - - int x; +void DestroyColors(void) +{ if(names) { + unsigned int x; for(x = 0; x < COLOR_COUNT; x++) { if(names[x]) { Release(names[x]); @@ -284,9 +296,10 @@ /** Compute the mask for computing colors in a linear RGB colormap. */ void ComputeShiftMask(unsigned long maskIn, unsigned long *shiftOut, - unsigned long *maskOut) { + unsigned long *maskOut) +{ - int shift; + unsigned int shift; Assert(shiftOut); Assert(maskOut); @@ -300,7 +313,7 @@ shift = 0; *maskOut = maskIn; while(maskIn && (maskIn & (1 << 31)) == 0) { - ++shift; + shift += 1; maskIn <<= 1; } *shiftOut = shift; @@ -308,7 +321,8 @@ } /** Get an RGB value from an XColor. */ -unsigned long GetRGBFromXColor(const XColor *c) { +unsigned long GetRGBFromXColor(const XColor *c) +{ unsigned int red, green, blue; unsigned long rgb; @@ -327,22 +341,9 @@ } -/** Convert an RGB value to an XColor. */ -XColor GetXColorFromRGB(unsigned long rgb) { - - XColor ret = { 0 }; - - ret.flags = DoRed | DoGreen | DoBlue; - ret.red = (unsigned short)(((rgb >> 16) & 0xFF) * 257); - ret.green = (unsigned short)(((rgb >> 8) & 0xFF) * 257); - ret.blue = (unsigned short)((rgb & 0xFF) * 257); - - return ret; - -} - /** Set the color to use for a component. */ -void SetColor(ColorType c, const char *value) { +void SetColor(ColorType c, const char *value) +{ if(JUNLIKELY(!value)) { Warning("empty color tag"); @@ -360,16 +361,16 @@ } /** Parse a color for a component. */ -int ParseColor(const char *value, XColor *c) { +char ParseColor(const char *value, XColor *c) +{ - unsigned long rgb; if(JUNLIKELY(!value)) { return 0; } if(value[0] == '#' && strlen(value) == 7) { - rgb = ReadHex(value + 1); + const unsigned long rgb = ReadHex(value + 1); c->red = ((rgb >> 16) & 0xFF) * 257; c->green = ((rgb >> 8) & 0xFF) * 257; c->blue = (rgb & 0xFF) * 257; @@ -387,16 +388,22 @@ } /** Set the specified color to its default. */ -void SetDefaultColor(ColorType type) { +void SetDefaultColor(ColorType type) +{ XColor c; - int x; + unsigned int x; - for(x = 0; DEFAULT_COLORS[x].value; x++) { + for(x = 0; x < DEFAULT_COUNT; x++) { if(DEFAULT_COLORS[x].type == type) { - ParseColor(DEFAULT_COLORS[x].value, &c); + const unsigned int rgb = DEFAULT_COLORS[x].value; + c.red = ((rgb >> 16) & 0xFF) * 257; + c.green = ((rgb >> 8) & 0xFF) * 257; + c.blue = (rgb & 0xFF) * 257; + c.flags = DoRed | DoGreen | DoBlue; + GetColor(&c); colors[type] = c.pixel; - rgbColors[type] = GetRGBFromXColor(&c); + rgbColors[type] = rgb; return; } } @@ -404,11 +411,11 @@ } /** Initialize color names to NULL. */ -void InitializeNames() { - - int x; +void InitializeNames(void) +{ if(names == NULL) { + unsigned int x; names = Allocate(sizeof(char*) * COLOR_COUNT); for(x = 0; x < COLOR_COUNT; x++) { names[x] = NULL; @@ -418,10 +425,11 @@ } /** Convert a hex value to an unsigned long. */ -unsigned long ReadHex(const char *hex) { +unsigned long ReadHex(const char *hex) +{ unsigned long value = 0; - int x; + unsigned int x; Assert(hex); @@ -440,79 +448,9 @@ } -/** Compute a color lighter than the input. */ -void LightenColor(ColorType oldColor, ColorType newColor) { - - XColor temp; - int red, green, blue; - - temp = GetXColorFromRGB(rgbColors[oldColor]); - - /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ - red = temp.red >> 8; - green = temp.green >> 8; - blue = temp.blue >> 8; - - /* Multiply by 1.45 which is 371. */ - red = (red * 371) >> 8; - green = (green * 371) >> 8; - blue = (blue * 371) >> 8; - - /* Convert back to 0-65535. */ - red |= red << 8; - green |= green << 8; - blue |= blue << 8; - - /* Cap at 65535. */ - red = Min(65535, red); - green = Min(65535, green); - blue = Min(65535, blue); - - temp.red = red; - temp.green = green; - temp.blue = blue; - - GetColor(&temp); - colors[newColor] = temp.pixel; - rgbColors[newColor] = GetRGBFromXColor(&temp); - -} - -/** Compute a color darker than the input. */ -void DarkenColor(ColorType oldColor, ColorType newColor) { - - XColor temp; - int red, green, blue; - - temp = GetXColorFromRGB(rgbColors[oldColor]); - - /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ - red = temp.red >> 8; - green = temp.green >> 8; - blue = temp.blue >> 8; - - /* Multiply by 0.55 which is 141. */ - red = (red * 141) >> 8; - green = (green * 141) >> 8; - blue = (blue * 141) >> 8; - - /* Convert back to 0-65535. */ - red |= red << 8; - green |= green << 8; - blue |= blue << 8; - - temp.red = red; - temp.green = green; - temp.blue = blue; - - GetColor(&temp); - colors[newColor] = temp.pixel; - rgbColors[newColor] = GetRGBFromXColor(&temp); - -} - /** Look up a color by name. */ -int GetColorByName(const char *str, XColor *c) { +int GetColorByName(const char *str, XColor *c) +{ Assert(str); Assert(c); @@ -528,7 +466,8 @@ } /** Compute the RGB components from an index into our RGB colormap. */ -void GetColorFromIndex(XColor *c) { +void GetColorFromIndex(XColor *c) +{ unsigned long red; unsigned long green; @@ -547,7 +486,8 @@ } /** Compute the pixel value from RGB components. */ -void GetDirectPixel(XColor *c) { +void GetDirectPixel(XColor *c) +{ unsigned long red; unsigned long green; @@ -571,22 +511,19 @@ } /** Compute the pixel value from RGB components. */ -void GetMappedPixel(XColor *c) { - +void GetMappedPixel(XColor *c) +{ Assert(c); - + Assert(map); GetDirectPixel(c); c->pixel = map[c->pixel]; - } /** Compute the pixel value from RGB components. */ -void GetColor(XColor *c) { - +void GetColor(XColor *c) +{ Assert(c); - Assert(rootVisual); - - switch(rootVisual->class) { + switch(rootVisual.visual->class) { case DirectColor: case TrueColor: GetDirectPixel(c); @@ -595,56 +532,51 @@ GetMappedPixel(c); return; } - } /** Get the RGB components from a pixel value. */ -void GetColorFromPixel(XColor *c) { +void GetColorFromPixel(XColor *c) +{ Assert(c); - - switch(rootVisual->class) { - case DirectColor: - case TrueColor: - /* Nothing to do. */ - break; - default: - /* Convert from a pixel value to a linear RGB space. */ - c->pixel = rmap[c->pixel & 255]; - break; - } + switch(rootVisual.visual->class) { + case DirectColor: + case TrueColor: + /* Nothing to do. */ + break; + default: + /* Convert from a pixel value to a linear RGB space. */ + c->pixel = rmap[c->pixel & 255]; + break; + } /* Extract the RGB components from the linear RGB pixel value. */ GetColorFromIndex(c); } - /** Get an RGB pixel value from RGB components. */ -void GetColorIndex(XColor *c) { - +void GetColorIndex(XColor *c) +{ Assert(c); - GetDirectPixel(c); - } /** Get an XFT color for the specified component. */ #ifdef USE_XFT -XftColor *GetXftColor(ColorType type) { - - unsigned long rgb; - XRenderColor rcolor; +XftColor *GetXftColor(ColorType type) +{ if(!xftColors[type]) { - rgb = rgbColors[type]; + XRenderColor rcolor; + const unsigned long rgb = rgbColors[type]; xftColors[type] = Allocate(sizeof(XftColor)); rcolor.alpha = 65535; rcolor.red = ((rgb >> 16) & 0xFF) * 257; rcolor.green = ((rgb >> 8) & 0xFF) * 257; rcolor.blue = (rgb & 0xFF) * 257; - JXftColorAllocValue(display, rootVisual, rootColormap, &rcolor, - xftColors[type]); + JXftColorAllocValue(display, rootVisual.visual, rootColormap, &rcolor, + xftColors[type]); } return xftColors[type]; @@ -652,3 +584,88 @@ } #endif +/** Convert an RGB value to an XColor. */ +XColor GetXColorFromRGB(unsigned long rgb) +{ + XColor ret = { 0 }; + + ret.flags = DoRed | DoGreen | DoBlue; + ret.red = (unsigned short)(((rgb >> 16) & 0xFF) * 257); + ret.green = (unsigned short)(((rgb >> 8) & 0xFF) * 257); + ret.blue = (unsigned short)((rgb & 0xFF) * 257); + + return ret; +} + +/** Compute a color lighter than the input. */ +void LightenColor(ColorType oldColor, ColorType newColor) +{ + + XColor temp; + int red, green, blue; + + temp = GetXColorFromRGB(rgbColors[oldColor]); + + /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ + red = temp.red >> 8; + green = temp.green >> 8; + blue = temp.blue >> 8; + + /* Multiply by 1.45 which is 371. */ + red = (red * 371) >> 8; + green = (green * 371) >> 8; + blue = (blue * 371) >> 8; + + /* Convert back to 0-65535. */ + red |= red << 8; + green |= green << 8; + blue |= blue << 8; + + /* Cap at 65535. */ + red = Min(65535, red); + green = Min(65535, green); + blue = Min(65535, blue); + + temp.red = red; + temp.green = green; + temp.blue = blue; + + GetColor(&temp); + colors[newColor] = temp.pixel; + rgbColors[newColor] = GetRGBFromXColor(&temp); + +} + +/** Compute a color darker than the input. */ +void DarkenColor(ColorType oldColor, ColorType newColor) +{ + + XColor temp; + int red, green, blue; + + temp = GetXColorFromRGB(rgbColors[oldColor]); + + /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ + red = temp.red >> 8; + green = temp.green >> 8; + blue = temp.blue >> 8; + + /* Multiply by 0.55 which is 141. */ + red = (red * 141) >> 8; + green = (green * 141) >> 8; + blue = (blue * 141) >> 8; + + /* Convert back to 0-65535. */ + red |= red << 8; + green |= green << 8; + blue |= blue << 8; + + temp.red = red; + temp.green = green; + temp.blue = blue; + + GetColor(&temp); + colors[newColor] = temp.pixel; + rgbColors[newColor] = GetRGBFromXColor(&temp); + +} diff -Nru jwm-2.1.0+svn579/src/color.h jwm-2.3.1+0~16~ubuntu14.10.1/src/color.h --- jwm-2.1.0+svn579/src/color.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/color.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,79 +11,66 @@ #define COLOR_H /** Enumeration of colors used for various JWM components. */ -typedef enum { - - COLOR_TITLE_FG, - COLOR_TITLE_ACTIVE_FG, - - COLOR_TITLE_BG1, - COLOR_TITLE_BG2, - COLOR_TITLE_ACTIVE_BG1, - COLOR_TITLE_ACTIVE_BG2, - - COLOR_BORDER_LINE, - COLOR_BORDER_ACTIVE_LINE, - - COLOR_TRAY_BG, - COLOR_TRAY_FG, - - COLOR_TASK_FG, - COLOR_TASK_BG1, - COLOR_TASK_BG2, - COLOR_TASK_ACTIVE_FG, - COLOR_TASK_ACTIVE_BG1, - COLOR_TASK_ACTIVE_BG2, - - COLOR_PAGER_BG, - COLOR_PAGER_FG, - COLOR_PAGER_ACTIVE_BG, - COLOR_PAGER_ACTIVE_FG, - COLOR_PAGER_OUTLINE, - COLOR_PAGER_TEXT, - - COLOR_MENU_BG, - COLOR_MENU_FG, - COLOR_MENU_ACTIVE_BG1, - COLOR_MENU_ACTIVE_BG2, - COLOR_MENU_ACTIVE_FG, - COLOR_MENU_ACTIVE_OL, - - /* Colors below this point are calculated from the above values. */ - - COLOR_TRAY_UP, - COLOR_TRAY_DOWN, - - COLOR_TASK_UP, - COLOR_TASK_DOWN, - COLOR_TASK_ACTIVE_UP, - COLOR_TASK_ACTIVE_DOWN, - - COLOR_MENU_UP, - COLOR_MENU_DOWN, - COLOR_MENU_ACTIVE_UP, - COLOR_MENU_ACTIVE_DOWN, - - COLOR_POPUP_BG, - COLOR_POPUP_FG, - COLOR_POPUP_OUTLINE, - - COLOR_TRAYBUTTON_BG, - COLOR_TRAYBUTTON_FG, - - COLOR_CLOCK_BG, - COLOR_CLOCK_FG, - - COLOR_COUNT - -} ColorType; +typedef unsigned char ColorType; +#define COLOR_TITLE_FG 0 +#define COLOR_TITLE_ACTIVE_FG 1 +#define COLOR_TITLE_BG1 2 +#define COLOR_TITLE_BG2 3 +#define COLOR_TITLE_ACTIVE_BG1 4 +#define COLOR_TITLE_ACTIVE_BG2 5 +#define COLOR_BORDER_LINE 6 +#define COLOR_BORDER_ACTIVE_LINE 7 +#define COLOR_TRAY_FG 8 +#define COLOR_TRAY_BG1 9 +#define COLOR_TRAY_BG2 10 +#define COLOR_TRAY_ACTIVE_FG 11 +#define COLOR_TRAY_ACTIVE_BG1 12 +#define COLOR_TRAY_ACTIVE_BG2 13 +#define COLOR_TRAY_OUTLINE 14 +#define COLOR_TASK_FG 15 +#define COLOR_TASK_BG1 16 +#define COLOR_TASK_BG2 17 +#define COLOR_TASK_BORDER 18 +#define COLOR_TASK_ACTIVE_FG 19 +#define COLOR_TASK_ACTIVE_BG1 20 +#define COLOR_TASK_ACTIVE_BG2 21 +#define COLOR_PAGER_BG 22 +#define COLOR_PAGER_FG 23 +#define COLOR_PAGER_ACTIVE_BG 24 +#define COLOR_PAGER_ACTIVE_FG 25 +#define COLOR_PAGER_OUTLINE 26 +#define COLOR_PAGER_TEXT 27 +#define COLOR_MENU_BG 28 +#define COLOR_MENU_FG 29 +#define COLOR_MENU_ACTIVE_BG1 30 +#define COLOR_MENU_ACTIVE_BG2 31 +#define COLOR_MENU_ACTIVE_FG 32 +#define COLOR_MENU_OUTLINE 33 +#define COLOR_POPUP_BG 34 +#define COLOR_POPUP_FG 35 +#define COLOR_POPUP_OUTLINE 36 +#define COLOR_TRAYBUTTON_FG 37 +#define COLOR_TRAYBUTTON_BG1 38 +#define COLOR_TRAYBUTTON_BG2 39 +#define COLOR_TRAYBUTTON_ACTIVE_FG 40 +#define COLOR_TRAYBUTTON_ACTIVE_BG1 41 +#define COLOR_TRAYBUTTON_ACTIVE_BG2 42 +#define COLOR_CLOCK_FG 43 +#define COLOR_CLOCK_BG1 44 +#define COLOR_CLOCK_BG2 45 +#define COLOR_TITLE_UP 46 +#define COLOR_TITLE_DOWN 47 +#define COLOR_TITLE_ACTIVE_UP 48 +#define COLOR_TITLE_ACTIVE_DOWN 49 +#define COLOR_COUNT 50 extern unsigned long colors[COLOR_COUNT]; /*@{*/ -void InitializeColors(); -void StartupColors(); -void ShutdownColors(); -void DestroyColors(); +#define InitializeColors() (void)(0) +void StartupColors(void); +void ShutdownColors(void); +void DestroyColors(void); /*@}*/ /** Set the color to use for a component. @@ -97,7 +84,7 @@ * @param color The color return value (with pixel and components filled). * @return 1 on success, 0 on failure. */ -int ParseColor(const char *value, XColor *color); +char ParseColor(const char *value, XColor *color); /** Get the color pixel from red, green, and blue values. * @param c The structure containing the rgb values and the pixel value. @@ -134,4 +121,3 @@ #endif #endif /* COLOR_H */ - diff -Nru jwm-2.1.0+svn579/src/command.c jwm-2.3.1+0~16~ubuntu14.10.1/src/command.c --- jwm-2.1.0+svn579/src/command.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/command.c 2015-07-18 20:02:18.000000000 +0000 @@ -19,43 +19,35 @@ struct CommandNode *next; /**< The next command in the list. */ } CommandNode; -static CommandNode *startupCommands; -static CommandNode *shutdownCommands; -static CommandNode *restartCommands; +static CommandNode *startupCommands = NULL; +static CommandNode *shutdownCommands = NULL; +static CommandNode *restartCommands = NULL; static void RunCommands(CommandNode *commands); static void ReleaseCommands(CommandNode **commands); static void AddCommand(CommandNode **commands, const char *command); -/** Initialize the command lists. */ -void InitializeCommands() { - startupCommands = NULL; - shutdownCommands = NULL; - restartCommands = NULL; -} - /** Process startup/restart commands. */ -void StartupCommands() { - +void StartupCommands(void) +{ if(isRestarting) { RunCommands(restartCommands); } else { RunCommands(startupCommands); } - } /** Process shutdown commands. */ -void ShutdownCommands() { - +void ShutdownCommands(void) +{ if(!shouldRestart) { RunCommands(shutdownCommands); } - } /** Destroy the command lists. */ -void DestroyCommands() { +void DestroyCommands(void) +{ ReleaseCommands(&startupCommands); ReleaseCommands(&shutdownCommands); ReleaseCommands(&restartCommands); @@ -73,12 +65,12 @@ } /** Release a command list. */ -void ReleaseCommands(CommandNode **commands) { +void ReleaseCommands(CommandNode **commands) +{ CommandNode *cp; Assert(commands); - while(*commands) { cp = (*commands)->next; Release((*commands)->command); @@ -89,12 +81,12 @@ } /** Add a command to a command list. */ -void AddCommand(CommandNode **commands, const char *command) { +void AddCommand(CommandNode **commands, const char *command) +{ CommandNode *cp; Assert(commands); - if(!command) { return; } @@ -102,13 +94,13 @@ cp = Allocate(sizeof(CommandNode)); cp->next = *commands; *commands = cp; - cp->command = CopyString(command); } /** Add a startup command. */ -void AddStartupCommand(const char *command) { +void AddStartupCommand(const char *command) +{ AddCommand(&startupCommands, command); } @@ -123,21 +115,20 @@ } /** Execute an external program. */ -void RunCommand(const char *command) { +void RunCommand(const char *command) +{ const char *displayString; - char *str; if(JUNLIKELY(!command)) { return; } displayString = DisplayString(display); - if(!fork()) { close(ConnectionNumber(display)); if(displayString && displayString[0]) { - str = malloc(strlen(displayString) + 9); + char *str = malloc(strlen(displayString) + 9); sprintf(str, "DISPLAY=%s", displayString); putenv(str); } diff -Nru jwm-2.1.0+svn579/src/command.h jwm-2.3.1+0~16~ubuntu14.10.1/src/command.h --- jwm-2.1.0+svn579/src/command.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/command.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,10 +11,10 @@ #define COMMAND_H /*@{*/ -void InitializeCommands(); -void StartupCommands(); -void ShutdownCommands(); -void DestroyCommands(); +#define InitializeCommands() (void)(0) +void StartupCommands(void); +void ShutdownCommands(void); +void DestroyCommands(void); /*@}*/ /** Add a command to be executed at startup. diff -Nru jwm-2.1.0+svn579/src/confirm.c jwm-2.3.1+0~16~ubuntu14.10.1/src/confirm.c --- jwm-2.1.0+svn579/src/confirm.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/confirm.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,22 +10,22 @@ #include "jwm.h" #include "confirm.h" #include "client.h" -#include "main.h" #include "font.h" #include "button.h" #include "screen.h" -#include "color.h" #include "misc.h" +#include "settings.h" +#include "key.h" #ifndef DISABLE_CONFIRM -typedef enum { - DBS_NORMAL = 0, - DBS_OK = 1, - DBS_CANCEL = 2 -} DialogButtonState; +/** Current state of dialog buttons. */ +typedef unsigned char DialogButtonState; +#define DBS_NORMAL 0 /**< No button pressed. */ +#define DBS_OK 1 /**< OK pressed. */ +#define DBS_CANCEL 2 /**< Cancel pressed. */ -typedef struct DialogType { +typedef struct { int x, y; int width, height; @@ -40,58 +40,64 @@ int lineCount; char **message; + Pixmap pmap; ClientNode *node; void (*action)(ClientNode*); - ClientNode *client; - - struct DialogType *prev; - struct DialogType *next; + Window client; } DialogType; -static const char *OK_STRING = "Ok"; -static const char *CANCEL_STRING = "Cancel"; - -static DialogType *dialogList = NULL; +static DialogType *dialog = NULL; static int minWidth = 0; -static void DrawConfirmDialog(DialogType *d); -static void DestroyConfirmDialog(DialogType *d); -static void ComputeDimensions(DialogType *d); -static void DrawMessage(DialogType *d); -static void DrawButtons(DialogType *d); -static DialogType *FindDialogByWindow(Window w); -static int HandleDialogExpose(const XExposeEvent *event); -static int HandleDialogButtonPress(const XButtonEvent *event); -static int HandleDialogButtonRelease(const XButtonEvent *event); - -/** Initialize the dialog processing data. */ -void InitializeDialogs() { -} - -/** Startup dialog processing. */ -void StartupDialogs() { +static void RunDialogAction(void); +static void DestroyConfirmDialog(void); +static void ComputeDimensions(const ClientNode *np); +static void DrawDialog(void); +static void DrawButtons(void); +static void ExposeConfirmDialog(void); +static char HandleDialogExpose(const XExposeEvent *event); +static char HandleDialogButtonPress(const XButtonEvent *event); +static char HandleDialogButtonRelease(const XButtonEvent *event); +static char HandleDialogKeyPress(const XKeyEvent *event); + +static const char * const GetOKString() +{ + return _("OK"); +} + +static const char * const GetCancelString() +{ + return _("Cancel"); } /** Stop dialog processing. */ -void ShutdownDialogs() { - - while(dialogList) { - DestroyConfirmDialog(dialogList); +void ShutdownDialogs(void) +{ + if(dialog) { + DestroyConfirmDialog(); + dialog = NULL; } - } -/** Destroy dialog processing data. */ -void DestroyDialogs() { +/** Run the action associated with the current dialog. */ +void RunDialogAction(void) +{ + if(dialog->client == None) { + (dialog->action)(NULL); + } else { + ClientNode *np = FindClientByWindow(dialog->client); + if(np) { + (dialog->action)(np); + } + } } /** Handle an event on a dialog window. */ -int ProcessDialogEvent(const XEvent *event) { - - int handled = 0; +char ProcessDialogEvent(const XEvent *event) +{ Assert(event); @@ -102,24 +108,20 @@ return HandleDialogButtonPress(&event->xbutton); case ButtonRelease: return HandleDialogButtonRelease(&event->xbutton); + case KeyPress: + return HandleDialogKeyPress(&event->xkey); default: - break; + return 0; } - return handled; - } /** Handle an expose event. */ -int HandleDialogExpose(const XExposeEvent *event) { - - DialogType *dp; - +char HandleDialogExpose(const XExposeEvent *event) +{ Assert(event); - - dp = FindDialogByWindow(event->window); - if(dp) { - DrawConfirmDialog(dp); + if(dialog && dialog->node->window == event->window) { + ExposeConfirmDialog(); return 1; } else { return 0; @@ -127,46 +129,45 @@ } /** Handle a mouse button release event. */ -int HandleDialogButtonRelease(const XButtonEvent *event) { - - DialogType *dp; - int x, y; - int cancelPressed, okPressed; +char HandleDialogButtonRelease(const XButtonEvent *event) +{ Assert(event); - dp = FindDialogByWindow(event->window); - if(dp) { - cancelPressed = 0; - okPressed = 0; - y = event->y; - if(y >= dp->buttony && y < dp->buttony + dp->buttonHeight) { - x = event->x; - if(x >= dp->okx && x < dp->okx + dp->buttonWidth) { + if(dialog && event->window == dialog->node->window) { + char cancelPressed = 0; + char okPressed = 0; + const int y = event->y; + if(y >= dialog->buttony && y < dialog->buttony + dialog->buttonHeight) { + const int x = event->x; + if(x >= dialog->okx && x < dialog->okx + dialog->buttonWidth) { okPressed = 1; - } else if(x >= dp->cancelx && x < dp->cancelx + dp->buttonWidth) { + } else if(x >= dialog->cancelx + && x < dialog->cancelx + dialog->buttonWidth) { cancelPressed = 1; } } if(okPressed) { - (dp->action)(dp->client); + RunDialogAction(); } if(cancelPressed || okPressed) { - DestroyConfirmDialog(dp); + DestroyConfirmDialog(); } else { - dp->buttonState = DBS_NORMAL; - DrawButtons(dp); + dialog->buttonState = DBS_NORMAL; + DrawButtons(); + ExposeConfirmDialog(); } return 1; } else { - for(dp = dialogList; dp; dp = dp->next) { - if(dp->buttonState != DBS_NORMAL) { - dp->buttonState = DBS_NORMAL; - DrawButtons(dp); + if(dialog) { + if(dialog->buttonState != DBS_NORMAL) { + dialog->buttonState = DBS_NORMAL; + DrawButtons(); + ExposeConfirmDialog(); } } @@ -177,43 +178,40 @@ } /** Handle a mouse button release event. */ -int HandleDialogButtonPress(const XButtonEvent *event) { - - DialogType *dp; - int cancelPressed; - int okPressed; - int x, y; +char HandleDialogButtonPress(const XButtonEvent *event) +{ Assert(event); /* Find the dialog on which the press occured (if any). */ - dp = FindDialogByWindow(event->window); - if(dp) { + if(dialog && event->window == dialog->node->window) { /* Determine which button was pressed (if any). */ - cancelPressed = 0; - okPressed = 0; - y = event->y; - if(y >= dp->buttony && y < dp->buttony + dp->buttonHeight) { - x = event->x; - if(x >= dp->okx && x < dp->okx + dp->buttonWidth) { + char cancelPressed = 0; + char okPressed = 0; + const int y = event->y; + if(y >= dialog->buttony && y < dialog->buttony + dialog->buttonHeight) { + const int x = event->x; + if(x >= dialog->okx && x < dialog->okx + dialog->buttonWidth) { okPressed = 1; - } else if(x >= dp->cancelx && x < dp->cancelx + dp->buttonWidth) { + } else if(x >= dialog->cancelx + && x < dialog->cancelx + dialog->buttonWidth) { cancelPressed = 1; } } - dp->buttonState = DBS_NORMAL; + dialog->buttonState = DBS_NORMAL; if(cancelPressed) { - dp->buttonState = DBS_CANCEL; + dialog->buttonState = DBS_CANCEL; } if(okPressed) { - dp->buttonState = DBS_OK; + dialog->buttonState = DBS_OK; } /* Draw the buttons. */ - DrawButtons(dp); + DrawButtons(); + ExposeConfirmDialog(); return 1; @@ -226,26 +224,33 @@ } -/** Find a dialog by window or frame. */ -DialogType *FindDialogByWindow(Window w) { - - DialogType *dp; - - for(dp = dialogList; dp; dp = dp->next) { - if(dp->node->window == w) { - return dp; +/** Handle a key press. */ +char HandleDialogKeyPress(const XKeyEvent *event) +{ + if(dialog && event->window == dialog->node->window) { + KeyType key = GetKey(event); + switch(key & 0xFF) { + case KEY_ENTER: + RunDialogAction(); + DestroyConfirmDialog(); + break; + case KEY_ESC: + DestroyConfirmDialog(); + break; + default: + break; } + return 1; + } else { + return 0; } - - return NULL; - } /** Show a confirm dialog. */ -void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) { +void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) +{ va_list ap; - DialogType *dp; XSetWindowAttributes attrs; XSizeHints shints; Window window; @@ -254,222 +259,242 @@ Assert(action); - dp = Allocate(sizeof(DialogType)); - dp->client = np; - dp->action = action; - dp->buttonState = DBS_NORMAL; - - dp->prev = NULL; - dp->next = dialogList; - if(dialogList) { - dialogList->prev = dp; + /* Only allow one dialog at a time. */ + if(dialog) { + DestroyConfirmDialog(); } - dialogList = dp; + + dialog = Allocate(sizeof(DialogType)); + dialog->client = np ? np->window : None; + dialog->action = action; + dialog->buttonState = DBS_NORMAL; /* Get the number of lines. */ va_start(ap, action); - for(dp->lineCount = 0; va_arg(ap, char*); dp->lineCount++); + for(dialog->lineCount = 0; va_arg(ap, char*); dialog->lineCount++); va_end(ap); - dp->message = Allocate(dp->lineCount * sizeof(char*)); + dialog->message = Allocate(dialog->lineCount * sizeof(char*)); va_start(ap, action); - for(x = 0; x < dp->lineCount; x++) { + for(x = 0; x < dialog->lineCount; x++) { str = va_arg(ap, char*); - dp->message[x] = CopyString(str); + dialog->message[x] = CopyString(str); } va_end(ap); - ComputeDimensions(dp); - - attrs.background_pixel = colors[COLOR_TRAY_BG]; - attrs.event_mask = ButtonReleaseMask | ExposureMask; + ComputeDimensions(np); + /* Create the pixmap used for rendering. */ + dialog->pmap = JXCreatePixmap(display, rootWindow, + dialog->width, dialog->height, + rootVisual.depth); + + /* Create the window. */ + attrs.background_pixel = colors[COLOR_MENU_BG]; + attrs.event_mask = ButtonPressMask + | ButtonReleaseMask + | KeyPressMask + | ExposureMask; window = JXCreateWindow(display, rootWindow, - dp->x, dp->y, dp->width, dp->height, 0, - CopyFromParent, InputOutput, CopyFromParent, - CWBackPixel | CWEventMask, &attrs); - - shints.x = dp->x; - shints.y = dp->y; + dialog->x, dialog->y, + dialog->width, dialog->height, 0, + CopyFromParent, InputOutput, CopyFromParent, + CWBackPixel | CWEventMask, &attrs); + shints.x = dialog->x; + shints.y = dialog->y; shints.flags = PPosition; JXSetWMNormalHints(display, window, &shints); + JXStoreName(display, window, _("Confirm")); - JXStoreName(display, window, "Confirm"); + /* Draw the dialog. */ + DrawDialog(); - dp->node = AddClientWindow(window, 0, 0); - Assert(dp->node); + /* Add the client and give it focus. */ + dialog->node = AddClientWindow(window, 0, 0); + Assert(dialog->node); if(np) { - dp->node->owner = np->window; + dialog->node->owner = np->window; } - dp->node->state.status |= STAT_WMDIALOG; - FocusClient(dp->node); + dialog->node->state.status |= STAT_WMDIALOG; + FocusClient(dialog->node); - DrawConfirmDialog(dp); + /* Grab the mouse. */ + JXGrabButton(display, AnyButton, AnyModifier, window, True, + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); - JXGrabButton(display, AnyButton, AnyModifier, window, - True, ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); } -/** Draw a confirm dialog. */ -void DrawConfirmDialog(DialogType *dp) { - - Assert(dp); - - DrawMessage(dp); - DrawButtons(dp); - +/** Copy the pixmap to the confirm dialog. */ +void ExposeConfirmDialog(void) +{ + Assert(dialog); + JXCopyArea(display, dialog->pmap, dialog->node->window, rootGC, + 0, 0, dialog->width, dialog->height, 0, 0); } /** Destroy a confirm dialog. */ -void DestroyConfirmDialog(DialogType *dp) { +void DestroyConfirmDialog(void) +{ int x; - Assert(dp); + Assert(dialog); /* This will take care of destroying the dialog window since * its parent will be destroyed. */ - RemoveClient(dp->node); + RemoveClient(dialog->node); - for(x = 0; x < dp->lineCount; x++) { - Release(dp->message[x]); - } - Release(dp->message); + /* Free the pixmap. */ + JXFreePixmap(display, dialog->pmap); - if(dp->next) { - dp->next->prev = dp->prev; - } - if(dp->prev) { - dp->prev->next = dp->next; - } else { - dialogList = dp->next; + /* Free the message. */ + for(x = 0; x < dialog->lineCount; x++) { + Release(dialog->message[x]); } - Release(dp); + Release(dialog->message); + + Release(dialog); + dialog = NULL; } /** Compute the size of a dialog window. */ -void ComputeDimensions(DialogType *dp) { +void ComputeDimensions(const ClientNode *np) +{ const ScreenType *sp; int width; int x; - Assert(dp); + Assert(dialog); /* Get the min width from the size of the buttons. */ if(!minWidth) { - minWidth = GetStringWidth(FONT_MENU, CANCEL_STRING) * 3; - width = GetStringWidth(FONT_MENU, OK_STRING) * 3; + minWidth = GetStringWidth(FONT_MENU, GetCancelString()) * 3; + width = GetStringWidth(FONT_MENU, GetOKString()) * 3; if(width > minWidth) { minWidth = width; } minWidth += 16 * 3; } - dp->width = minWidth; + dialog->width = minWidth; /* Take into account the size of the message. */ - for(x = 0; x < dp->lineCount; x++) { - width = GetStringWidth(FONT_MENU, dp->message[x]); - if(width > dp->width) { - dp->width = width; + for(x = 0; x < dialog->lineCount; x++) { + width = GetStringWidth(FONT_MENU, dialog->message[x]); + if(width > dialog->width) { + dialog->width = width; } } - dp->lineHeight = GetStringHeight(FONT_MENU); - dp->width += 8; - dp->height = (dp->lineCount + 2) * dp->lineHeight; + dialog->lineHeight = GetStringHeight(FONT_MENU); + dialog->width += 8; + dialog->height = (dialog->lineCount + 2) * dialog->lineHeight; - if(dp->client) { + if(np) { - dp->x = dp->client->x + (dp->client->width - dp->width) / 2; - dp->y = dp->client->y + (dp->client->height - dp->height) / 2; + dialog->x = np->x + (np->width - dialog->width) / 2; + dialog->y = np->y + (np->height - dialog->height) / 2; - if(dp->x < 0) { - dp->x = 0; + if(dialog->x < 0) { + dialog->x = 0; } - if(dp->y < 0) { - dp->y = 0; + if(dialog->y < 0) { + dialog->y = 0; } - if(dp->x + dp->width >= rootWidth) { - dp->x = rootWidth - dp->width - (borderWidth * 2); + if(dialog->x + dialog->width >= rootWidth) { + dialog->x = rootWidth - dialog->width - (settings.borderWidth * 2); } - if(dp->y + dp->height >= rootHeight) { - dp->y = rootHeight - dp->height - (borderWidth * 2 + titleHeight); + if(dialog->y + dialog->height >= rootHeight) { + dialog->y = rootHeight - dialog->height + - (settings.borderWidth * 2 + settings.titleHeight); } } else { sp = GetMouseScreen(); - dp->x = (sp->width - dp->width) / 2 + sp->x; - dp->y = (sp->height - dp->height) / 2 + sp->y; + dialog->x = (sp->width - dialog->width) / 2 + sp->x; + dialog->y = (sp->height - dialog->height) / 2 + sp->y; } } -/** Display the message on the dialog window. */ -void DrawMessage(DialogType *dp) { +/** Render the dialog to the pixmap. */ +void DrawDialog(void) +{ int yoffset; int x; - Assert(dp); + Assert(dialog); + /* Clear the dialog. */ + JXSetForeground(display, rootGC, colors[COLOR_MENU_BG]); + JXFillRectangle(display, dialog->pmap, rootGC, 0, 0, + dialog->width, dialog->height); + + /* Draw the message. */ yoffset = 4; - for(x = 0; x < dp->lineCount; x++) { - RenderString(dp->node->window, FONT_MENU, COLOR_TRAY_FG, - 4, yoffset, dp->width, NULL, dp->message[x]); - yoffset += dp->lineHeight; + for(x = 0; x < dialog->lineCount; x++) { + RenderString(&rootVisual, dialog->pmap, FONT_MENU, COLOR_MENU_FG, + 4, yoffset, dialog->width, dialog->message[x]); + yoffset += dialog->lineHeight; } + /* Draw the buttons. */ + DrawButtons(); + } /** Draw the buttons on the dialog window. */ -void DrawButtons(DialogType *dp) { +void DrawButtons(void) +{ ButtonNode button; int temp; - Assert(dp); + Assert(dialog); - dp->buttonWidth = GetStringWidth(FONT_MENU, CANCEL_STRING); - temp = GetStringWidth(FONT_MENU, OK_STRING); - if(temp > dp->buttonWidth) { - dp->buttonWidth = temp; + dialog->buttonWidth = GetStringWidth(FONT_MENU, GetCancelString()); + temp = GetStringWidth(FONT_MENU, GetOKString()); + if(temp > dialog->buttonWidth) { + dialog->buttonWidth = temp; } - dp->buttonWidth += 16; - dp->buttonHeight = dp->lineHeight + 4; + dialog->buttonWidth += 16; + dialog->buttonHeight = dialog->lineHeight + 4; - ResetButton(&button, dp->node->window, rootGC); + ResetButton(&button, dialog->pmap, &rootVisual); + button.border = 1; button.font = FONT_MENU; - button.width = dp->buttonWidth; - button.height = dp->buttonHeight; + button.width = dialog->buttonWidth; + button.height = dialog->buttonHeight; button.alignment = ALIGN_CENTER; - dp->okx = dp->width / 3 - dp->buttonWidth / 2; - dp->cancelx = 2 * dp->width / 3 - dp->buttonWidth / 2; - dp->buttony = dp->height - dp->lineHeight - dp->lineHeight / 2; + dialog->okx = dialog->width / 3 - dialog->buttonWidth / 2; + dialog->cancelx = 2 * dialog->width / 3 - dialog->buttonWidth / 2; + dialog->buttony = dialog->height - dialog->lineHeight + - dialog->lineHeight / 2; - if(dp->buttonState == DBS_OK) { - button.type = BUTTON_TASK_ACTIVE; + if(dialog->buttonState == DBS_OK) { + button.type = BUTTON_MENU_ACTIVE; } else { - button.type = BUTTON_TASK; + button.type = BUTTON_MENU; } - button.text = OK_STRING; - button.x = dp->okx; - button.y = dp->buttony; + button.text = GetOKString(); + button.x = dialog->okx; + button.y = dialog->buttony; DrawButton(&button); - if(dp->buttonState == DBS_CANCEL) { - button.type = BUTTON_TASK_ACTIVE; + if(dialog->buttonState == DBS_CANCEL) { + button.type = BUTTON_MENU_ACTIVE; } else { - button.type = BUTTON_TASK; + button.type = BUTTON_MENU; } - button.text = CANCEL_STRING; - button.x = dp->cancelx; - button.y = dp->buttony; + button.text = GetCancelString(); + button.x = dialog->cancelx; + button.y = dialog->buttony; DrawButton(&button); } @@ -477,17 +502,16 @@ #else /* DISABLE_CONFIRM */ /** Process an event on a dialog window. */ -int ProcessDialogEvent(const XEvent *event) { +char ProcessDialogEvent(const XEvent *event) +{ return 0; } /** Show a confirm dialog. */ -void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) { - +void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) +{ Assert(action); - (action)(np); - } #endif /* DISABLE_CONFIRM */ diff -Nru jwm-2.1.0+svn579/src/confirm.h jwm-2.3.1+0~16~ubuntu14.10.1/src/confirm.h --- jwm-2.1.0+svn579/src/confirm.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/confirm.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,24 +13,24 @@ struct ClientNode; /*@{*/ -void InitializeDialogs(); -void StartupDialogs(); -void ShutdownDialogs(); -void DestroyDialogs(); +#define InitializeDialogs() (void)(0) +#define StartupDialogs() (void)(0) +void ShutdownDialogs(void); +#define DestroyDialogs() (void)(0) /*@}*/ /** Handle an event on a dialog window. * @param event The event. * @return 1 if handled, 0 if not handled. */ -int ProcessDialogEvent(const XEvent *event); +char ProcessDialogEvent(const XEvent *event); /** Show a confirm dialog. * @param np A client window associated with the dialog. * @param action A callback to run if "OK" is clicked. */ void ShowConfirmDialog(struct ClientNode *np, - void (*action)(struct ClientNode*), ...); + void (*action)(struct ClientNode*), ...); #endif /* CONFIRM_H */ diff -Nru jwm-2.1.0+svn579/src/cursor.c jwm-2.3.1+0~16~ubuntu14.10.1/src/cursor.c --- jwm-2.1.0+svn579/src/cursor.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/cursor.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,83 +10,85 @@ #include "jwm.h" #include "cursor.h" #include "main.h" -#include "error.h" -static Cursor defaultCursor; -static Cursor moveCursor; -static Cursor northCursor; -static Cursor southCursor; -static Cursor eastCursor; -static Cursor westCursor; -static Cursor northEastCursor; -static Cursor northWestCursor; -static Cursor southEastCursor; -static Cursor southWestCursor; -static Cursor chooseCursor; +/** Cursor types. */ +typedef enum { + CURSOR_DEFAULT, + CURSOR_MOVE, + CURSOR_NORTH, + CURSOR_SOUTH, + CURSOR_EAST, + CURSOR_WEST, + CURSOR_NE, + CURSOR_NW, + CURSOR_SE, + CURSOR_SW, + CURSOR_CHOOSE, + CURSOR_COUNT +} CursorType; + +/** Cursors to load for the various cursor types. + * This must be ordered the same as CursorType. + */ +static const unsigned int cursor_shapes[CURSOR_COUNT] = { + XC_left_ptr, + XC_fleur, + XC_top_side, + XC_bottom_side, + XC_right_side, + XC_left_side, + XC_top_right_corner, + XC_top_left_corner, + XC_bottom_right_corner, + XC_bottom_left_corner, + XC_tcross +}; + +static Cursor cursors[CURSOR_COUNT]; static Cursor GetResizeCursor(BorderActionType action); static Cursor CreateCursor(unsigned int shape); static int mousex; static int mousey; - -/** Initialize cursor data. */ -void InitializeCursors() { -} +static Window mousew; /** Startup cursor support. */ -void StartupCursors() { +void StartupCursors(void) +{ - Window win1, win2; + Window win1; int winx, winy; unsigned int mask; + int x; - defaultCursor = CreateCursor(XC_left_ptr); - moveCursor = CreateCursor(XC_fleur); - northCursor = CreateCursor(XC_top_side); - southCursor = CreateCursor(XC_bottom_side); - eastCursor = CreateCursor(XC_right_side); - westCursor = CreateCursor(XC_left_side); - northEastCursor = CreateCursor(XC_ur_angle); - northWestCursor = CreateCursor(XC_ul_angle); - southEastCursor = CreateCursor(XC_lr_angle); - southWestCursor = CreateCursor(XC_ll_angle); - chooseCursor = CreateCursor(XC_tcross); + for(x = 0; x < CURSOR_COUNT; x++) { + cursors[x] = CreateCursor(cursor_shapes[x]); + } - JXQueryPointer(display, rootWindow, &win1, &win2, + JXQueryPointer(display, rootWindow, &win1, &mousew, &mousex, &mousey, &winx, &winy, &mask); } /** Create a cursor for the specified shape. */ -Cursor CreateCursor(unsigned int shape) { +Cursor CreateCursor(unsigned int shape) +{ return JXCreateFontCursor(display, shape); } /** Shutdown cursor support. */ -void ShutdownCursors() { - - JXFreeCursor(display, defaultCursor); - JXFreeCursor(display, moveCursor); - JXFreeCursor(display, northCursor); - JXFreeCursor(display, southCursor); - JXFreeCursor(display, eastCursor); - JXFreeCursor(display, westCursor); - JXFreeCursor(display, northEastCursor); - JXFreeCursor(display, northWestCursor); - JXFreeCursor(display, southEastCursor); - JXFreeCursor(display, southWestCursor); - JXFreeCursor(display, chooseCursor); - -} - -/** Destroy cursor data. */ -void DestroyCursors() { +void ShutdownCursors(void) +{ + int x; + for(x = 0; x < CURSOR_COUNT; x++) { + JXFreeCursor(display, cursors[x]); + } } /** Get the cursor for the specified location on the frame. */ -Cursor GetFrameCursor(BorderActionType action) { - +Cursor GetFrameCursor(BorderActionType action) +{ switch(action & 0x0F) { case BA_RESIZE: return GetResizeCursor(action); @@ -101,197 +103,151 @@ default: break; } - return defaultCursor; - + return cursors[CURSOR_DEFAULT]; } /** Get the cursor for resizing on the specified frame location. */ -Cursor GetResizeCursor(BorderActionType action) { - +Cursor GetResizeCursor(BorderActionType action) +{ if(action & BA_RESIZE_N) { if(action & BA_RESIZE_E) { - return northEastCursor; + return cursors[CURSOR_NE]; } else if(action & BA_RESIZE_W) { - return northWestCursor; + return cursors[CURSOR_NW]; } else { - return northCursor; + return cursors[CURSOR_NORTH]; } } else if(action & BA_RESIZE_S) { if(action & BA_RESIZE_E) { - return southEastCursor; + return cursors[CURSOR_SE]; } else if(action & BA_RESIZE_W) { - return southWestCursor; + return cursors[CURSOR_SW]; } else { - return southCursor; + return cursors[CURSOR_SOUTH]; } + } else if(action & BA_RESIZE_E) { + return cursors[CURSOR_EAST]; + } else if(action & BA_RESIZE_W) { + return cursors[CURSOR_WEST]; } else { - if(action & BA_RESIZE_E) { - return eastCursor; - } else { - return westCursor; - } + return cursors[CURSOR_DEFAULT]; } - } /** Grab the mouse for resizing a window. */ -int GrabMouseForResize(BorderActionType action) { - +char GrabMouseForResize(BorderActionType action) +{ Cursor cur; int result; + unsigned int mask; cur = GetFrameCursor(action); - - result = JXGrabPointer(display, rootWindow, False, ButtonPressMask - | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, - GrabModeAsync, None, cur, CurrentTime); - + mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask; + result = JXGrabPointer(display, rootWindow, False, mask, + GrabModeAsync, GrabModeAsync, None, + cur, CurrentTime); if(JLIKELY(result == GrabSuccess)) { + mousew = rootWindow; return 1; } else { return 0; } - } /** Grab the mouse for moving a window. */ -int GrabMouseForMove() { - +char GrabMouseForMove(void) +{ int result; - - result = JXGrabPointer(display, rootWindow, False, - ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); - + unsigned int mask; + mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask; + result = JXGrabPointer(display, rootWindow, False, mask, + GrabModeAsync, GrabModeAsync, None, + cursors[CURSOR_MOVE], CurrentTime); if(JLIKELY(result == GrabSuccess)) { + mousew = rootWindow; return 1; } else { return 0; } - } /** Grab the mouse. */ -int GrabMouse(Window w) { - +char GrabMouse(Window w) +{ int result; - - result = JXGrabPointer(display, w, False, - ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, defaultCursor, CurrentTime); - + unsigned int mask; + mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask; + result = JXGrabPointer(display, w, False, mask, + GrabModeAsync, GrabModeAsync, None, + cursors[CURSOR_DEFAULT], CurrentTime); if(JLIKELY(result == GrabSuccess)) { + mousew = w; return 1; } else { return 0; } - } /** Grab the mouse for choosing a window. */ -int GrabMouseForChoose() { - +char GrabMouseForChoose(void) +{ int result; - - result = JXGrabPointer(display, rootWindow, False, - ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, None, chooseCursor, CurrentTime); - + unsigned int mask; + mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask; + result = JXGrabPointer(display, rootWindow, False, mask, + GrabModeAsync, GrabModeAsync, None, + cursors[CURSOR_CHOOSE], CurrentTime); if(JLIKELY(result == GrabSuccess)) { + mousew = rootWindow; return 1; } else { return 0; } - } /** Set the default cursor for a window. */ -void SetDefaultCursor(Window w) { - - JXDefineCursor(display, w, defaultCursor); - +void SetDefaultCursor(Window w) +{ + JXDefineCursor(display, w, cursors[CURSOR_DEFAULT]); } /** Move the mouse to the specified coordinates on a window. */ -void MoveMouse(Window win, int x, int y) { - - Window win1, win2; +void MoveMouse(Window win, int x, int y) +{ + Window win1; int winx, winy; unsigned int mask; - JXWarpPointer(display, None, win, 0, 0, 0, 0, x, y); - - JXQueryPointer(display, rootWindow, &win1, &win2, + JXQueryPointer(display, rootWindow, &win1, &mousew, &mousex, &mousey, &winx, &winy, &mask); - } /** Set the current mouse position. */ -void SetMousePosition(int x, int y) { - +void SetMousePosition(int x, int y, Window w) +{ mousex = x; mousey = y; - + mousew = w; } /** Get the current mouse position. */ -void GetMousePosition(int *x, int *y) { - +void GetMousePosition(int *x, int *y, Window *w) +{ Assert(x); Assert(y); - *x = mousex; *y = mousey; - + *w = mousew; } /** Get the current mouse buttons pressed. */ -unsigned int GetMouseMask() { - - Window win1, win2; +unsigned int GetMouseMask(void) +{ + Window win1; int winx, winy; unsigned int mask; - - JXQueryPointer(display, rootWindow, &win1, &win2, - &mousex, &mousey, &winx, &winy, &mask); - + JXQueryPointer(display, rootWindow, &win1, &mousew, + &mousex, &mousey, &winx, &winy, &mask); return mask; - -} - -/** Set the double click speed to use. */ -void SetDoubleClickSpeed(const char *str) { - - int speed; - - if(str) { - speed = atoi(str); - if(JUNLIKELY(speed < MIN_DOUBLE_CLICK_SPEED - || speed > MAX_DOUBLE_CLICK_SPEED)) { - Warning(_("invalid DoubleClickSpeed: %d"), speed); - doubleClickSpeed = DEFAULT_DOUBLE_CLICK_SPEED; - } else { - doubleClickSpeed = speed; - } - } - -} - -/** Set the double click delta to use. */ -void SetDoubleClickDelta(const char *str) { - - int delta; - - if(str) { - delta = atoi(str); - if(JUNLIKELY(delta < MIN_DOUBLE_CLICK_DELTA - || delta > MAX_DOUBLE_CLICK_DELTA)) { - Warning(_("invalid DoubleClickDelta: %d"), delta); - doubleClickDelta = DEFAULT_DOUBLE_CLICK_DELTA; - } else { - doubleClickDelta = delta; - } - } - } diff -Nru jwm-2.1.0+svn579/src/cursor.h jwm-2.3.1+0~16~ubuntu14.10.1/src/cursor.h --- jwm-2.1.0+svn579/src/cursor.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/cursor.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,32 +13,32 @@ #include "border.h" /*@{*/ -void InitializeCursors(); -void StartupCursors(); -void ShutdownCursors(); -void DestroyCursors(); +#define InitializeCursors() (void)(0) +void StartupCursors(void); +void ShutdownCursors(void); +#define DestroyCursors() (void)(0) /*@}*/ /** Grab the mouse for resizing a window. * @param action The resize action. * @return 1 on success, 0 on failure. */ -int GrabMouseForResize(BorderActionType action); +char GrabMouseForResize(BorderActionType action); /** Grab the mouse for moving a window. * @return 1 on success, 0 on failure. */ -int GrabMouseForMove(); +char GrabMouseForMove(void); /** Grab the mouse. * @return 1 on success, 0 on failure. */ -int GrabMouse(Window w); +char GrabMouse(Window w); /** Grab the mouse to select a window. * @return 1 on success, 0 on failure. */ -int GrabMouseForChoose(); +char GrabMouseForChoose(void); /** Get the cursor to use given a border action. * @param action The border action. @@ -56,34 +56,26 @@ /** Set the current mouse position. * @param x The x-coordinate (relative to the current desktop). * @param y The y-coordinate (relative to the current desktop). + * @param w The window under the mouse. */ -void SetMousePosition(int x, int y); +void SetMousePosition(int x, int y, Window w); /** Get the current mouse position. * @param x Location to store the x-coordinate. * @param y Location to store the y-coordinate. + * @param w The window under the mouse. */ -void GetMousePosition(int *x, int *y); +void GetMousePosition(int *x, int *y, Window *w); /** Get a mask of the current mouse buttons pressed. * @return A mask of the current mouse buttons pressed. */ -unsigned int GetMouseMask(); +unsigned int GetMouseMask(void); /** Reset to the default cursor on a window. * @param w The window whose cursor to change. */ void SetDefaultCursor(Window w); -/** Set the double click speed. - * @param str The speed (ASCII, milliseconds). - */ -void SetDoubleClickSpeed(const char *str); - -/** Set the double click delta. - * @param str The delta (ASCII, pixels). - */ -void SetDoubleClickDelta(const char *str); - #endif /* CURSOR_H */ diff -Nru jwm-2.1.0+svn579/src/debug.c jwm-2.3.1+0~16~ubuntu14.10.1/src/debug.c --- jwm-2.1.0+svn579/src/debug.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/debug.c 2015-07-18 20:02:18.000000000 +0000 @@ -8,20 +8,21 @@ */ #include "debug.h" +#include +#include +#include /** Emit a message (if compiled with -DDEBUG). */ -void Debug(const char *str, ...) { +void Debug(const char *str, ...) +{ #ifdef DEBUG va_list ap; va_start(ap, str); - Assert(str); - fprintf(stderr, "DEBUG: "); vfprintf(stderr, str, ap); fprintf(stderr, "\n"); - va_end(ap); #endif /* DEBUG */ @@ -35,7 +36,7 @@ const char *file; unsigned int line; size_t size; - void *pointer; + char *pointer; struct MemoryType *next; } MemoryType; @@ -43,30 +44,27 @@ static const char *checkpointFile[CHECKPOINT_LIST_SIZE]; static unsigned int checkpointLine[CHECKPOINT_LIST_SIZE]; -static int checkpointOffset; +static unsigned int checkpointOffset; /** Start the debugger. */ -void DEBUG_StartDebug(const char *file, unsigned int line) { - int x; - +void DEBUG_StartDebug(const char *file, unsigned int line) +{ + unsigned int x; Debug("%s[%u]: debug mode started", file, line); - checkpointOffset = 0; for(x = 0; x < CHECKPOINT_LIST_SIZE; x++) { checkpointFile[x] = NULL; checkpointLine[x] = 0; } - } /** Stop the debugger. */ -void DEBUG_StopDebug(const char *file, unsigned int line) { - MemoryType *mp; - unsigned int count = 0; - +void DEBUG_StopDebug(const char *file, unsigned int line) +{ Debug("%s[%u]: debug mode stopped", file, line); - if(allocations) { + MemoryType *mp; + unsigned int count = 0; Debug("MEMORY: memory leaks follow"); for(mp = allocations; mp; mp = mp->next) { Debug(" %u bytes in %s at line %u", @@ -81,23 +79,20 @@ } else { Debug("MEMORY: no memory leaks"); } - } /** Set a checkpoint. */ -void DEBUG_SetCheckpoint(const char *file, unsigned int line) { - +void DEBUG_SetCheckpoint(const char *file, unsigned int line) +{ checkpointFile[checkpointOffset] = file; checkpointLine[checkpointOffset] = line; - checkpointOffset = (checkpointOffset + 1) % CHECKPOINT_LIST_SIZE; - } /** Display the location of the last checkpoint. */ -void DEBUG_ShowCheckpoint() { - int x, offset; - +void DEBUG_ShowCheckpoint(void) +{ + unsigned int x, offset; Debug("CHECKPOINT LIST (oldest)"); offset = checkpointOffset; for(x = 0; x < CHECKPOINT_LIST_SIZE; x++) { @@ -107,139 +102,134 @@ offset = (offset + 1) % CHECKPOINT_LIST_SIZE; } Debug("END OF CHECKPOINT LIST (most recent)"); - } /** Allocate memory and log. */ -void *DEBUG_Allocate(size_t size, const char *file, unsigned int line) { +void *DEBUG_Allocate(size_t size, const char *file, unsigned int line) +{ MemoryType *mp; - - if(size <= 0) { - Debug("MEMORY: %s[%u]: Attempt to allocate %d bytes of memory", - file, line, size); - } - mp = (MemoryType*)malloc(sizeof(MemoryType)); Assert(mp); - mp->file = file; mp->line = line; mp->size = size; - - mp->pointer = malloc(size + sizeof(char)); + mp->pointer = malloc(size + sizeof(char) + 8); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Memory allocation failed (%d bytes)", - file, line, size); + file, line, (int)size); Assert(0); } /* Make uninitialized accesses easy to find. */ memset(mp->pointer, 85, size); - /* Canary value for buffer overflow checking. */ - ((char*)mp->pointer)[size] = 42; + /* Canary value for buffer underflow/overflow checking. */ + mp->pointer[7] = 42; + mp->pointer[size + 8] = 42; mp->next = allocations; allocations = mp; - - return mp->pointer; + return mp->pointer + 8; } /** Reallocate memory and log. */ -void *DEBUG_Reallocate(void *ptr, size_t size, const char *file, - unsigned int line) { - +void *DEBUG_Reallocate(void *ptr, size_t size, + const char *file, + unsigned int line) +{ MemoryType *mp; - - if(size <= 0) { - Debug("MEMORY: %s[%u]: Attempt to reallocate %d bytes of memory", - file, line, size); - } if(!ptr) { Debug("MEMORY: %s[%u]: Attempt to reallocate NULL pointer. " - "Calling Allocate...", file, line); + "Calling Allocate...", file, line); return DEBUG_Allocate(size, file, line); } else { - + char *cptr = (char*)ptr - 8; for(mp = allocations; mp; mp = mp->next) { - if(mp->pointer == ptr) { - - if(((char*)ptr)[mp->size] != 42) { - Debug("MEMORY: %s[%u]: The canary is dead.", file, line); + if(mp->pointer == cptr) { + if(cptr[mp->size + 8] != 42) { + Debug("MEMORY: %s[%u]: The canary is dead (overflow).", + file, line); + } + if(cptr[7] != 42) { + Debug("MEMORY: %s[%u]: The canary is dead (underflow).", + file, line); } - mp->file = file; mp->line = line; mp->size = size; - mp->pointer = realloc(ptr, size + sizeof(char)); + mp->pointer = realloc(cptr, size + sizeof(char) + 8); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Failed to reallocate %d bytes.", - file, line, size); + file, line, (int)size); Assert(0); } - ((char*)mp->pointer)[size] = 42; - return mp->pointer; + mp->pointer[7] = 42; + mp->pointer[size + 8] = 42; + return mp->pointer + 8; } } Debug("MEMORY: %s[%u]: Attempt to reallocate unallocated pointer", - file, line); + file, line); mp = malloc(sizeof(MemoryType)); Assert(mp); mp->file = file; mp->line = line; mp->size = size; - mp->pointer = malloc(size + sizeof(char)); + mp->pointer = malloc(size + sizeof(char) + 8); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Failed to reallocate %d bytes.", - file, line, size); + file, line, (int)size); Assert(0); } memset(mp->pointer, 85, size); - ((char*)mp->pointer)[size] = 42; - + mp->pointer[7] = 42; + mp->pointer[size + 8] = 42; mp->next = allocations; allocations = mp; - - return mp->pointer; + return mp->pointer + 8; } - } /** Release memory and log. */ -void DEBUG_Release(void **ptr, const char *file, unsigned int line) { +void DEBUG_Release(void **ptr, const char *file, unsigned int line) +{ MemoryType *mp, *last; - if(!ptr) { Debug("MEMORY: %s[%u]: Invalid attempt to release", file, line); } else if(!*ptr) { Debug("MEMORY: %s[%u]: Attempt to delete NULL pointer", - file, line); + file, line); } else { + char *cptr = (char*)*ptr - 8; last = NULL; for(mp = allocations; mp; mp = mp->next) { - if(mp->pointer == *ptr) { + if(mp->pointer == cptr) { if(last) { last->next = mp->next; } else { allocations = mp->next; } - if(((char*)*ptr)[mp->size] != 42) { - Debug("MEMORY: %s[%u]: The canary is dead.", file, line); + if(cptr[mp->size + 8] != 42) { + Debug("MEMORY: %s[%u]: The canary is dead (overflow).", + file, line); + } + if(cptr[7] != 42) { + Debug("MEMORY: %s[%u]: The canary is dead (underflow).", + file, line); } - memset(*ptr, 0xFF, mp->size); + memset(cptr, 0xFF, mp->size + 8 + sizeof(char)); free(mp); - free(*ptr); + free(cptr); *ptr = NULL; return; } last = mp; } Debug("MEMORY: %s[%u]: Attempt to delete unallocated pointer", - file, line); - memset(*ptr, 0xFF, mp->size); + file, line); free(*ptr); /* This address should cause a segfault or bus error. */ diff -Nru jwm-2.1.0+svn579/src/debug.h jwm-2.3.1+0~16~ubuntu14.10.1/src/debug.h --- jwm-2.1.0+svn579/src/debug.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/debug.h 2015-07-18 20:02:18.000000000 +0000 @@ -28,10 +28,7 @@ #define DEBUG_H #ifndef MAKE_DEPEND -# include -# include # include -# include # ifdef HAVE_ALLOCA_H # include # endif @@ -77,7 +74,7 @@ DEBUG_Release( (void*)(& x), __FILE__, __LINE__ ) void DEBUG_SetCheckpoint(const char*, unsigned int); - void DEBUG_ShowCheckpoint(); + void DEBUG_ShowCheckpoint(void); void DEBUG_StartDebug(const char*, unsigned int); void DEBUG_StopDebug(const char*, unsigned int); diff -Nru jwm-2.1.0+svn579/src/desktop.c jwm-2.3.1+0~16~ubuntu14.10.1/src/desktop.c --- jwm-2.1.0+svn579/src/desktop.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/desktop.c 2015-07-18 20:02:18.000000000 +0000 @@ -12,70 +12,101 @@ #include "main.h" #include "client.h" #include "clientlist.h" -#include "hint.h" -#include "pager.h" #include "taskbar.h" #include "error.h" #include "menu.h" #include "misc.h" #include "background.h" +#include "settings.h" +#include "grab.h" +#include "event.h" -char **desktopNames = NULL; - -int showingDesktop; - -/** Initialize desktop data. */ -void InitializeDesktops() { -} +static char **desktopNames = NULL; +static char *showingDesktop = NULL; /** Startup desktop support. */ -void StartupDesktops() { +void StartupDesktops(void) +{ unsigned int x; if(desktopNames == NULL) { - desktopNames = Allocate(desktopCount * sizeof(char*)); - for(x = 0; x < desktopCount; x++) { + desktopNames = Allocate(settings.desktopCount * sizeof(char*)); + for(x = 0; x < settings.desktopCount; x++) { desktopNames[x] = NULL; } } - for(x = 0; x < desktopCount; x++) { + for(x = 0; x < settings.desktopCount; x++) { if(desktopNames[x] == NULL) { desktopNames[x] = Allocate(4 * sizeof(char)); snprintf(desktopNames[x], 4, "%d", x + 1); } } - - showingDesktop = 0; - -} - -/** Shutdown desktop support. */ -void ShutdownDesktops() { + if(showingDesktop == NULL) { + showingDesktop = Allocate(settings.desktopCount * sizeof(char)); + for(x = 0; x < settings.desktopCount; x++) { + showingDesktop[x] = 0; + } + } } /** Release desktop data. */ -void DestroyDesktops() { - - unsigned int x; +void DestroyDesktops(void) +{ if(desktopNames) { - for(x = 0; x < desktopCount; x++) { + unsigned int x; + for(x = 0; x < settings.desktopCount; x++) { Release(desktopNames[x]); } Release(desktopNames); desktopNames = NULL; } + if(showingDesktop) { + Release(showingDesktop); + showingDesktop = NULL; + } + +} + +/** Get the right desktop. */ +unsigned int GetRightDesktop(unsigned int desktop) +{ + const int y = desktop / settings.desktopWidth; + const int x = (desktop + 1) % settings.desktopWidth; + return y * settings.desktopWidth + x; +} + +/** Get the left desktop. */ +unsigned int GetLeftDesktop(unsigned int desktop) +{ + const int y = currentDesktop / settings.desktopWidth; + int x = currentDesktop % settings.desktopWidth; + x = x > 0 ? x - 1 : settings.desktopWidth - 1; + return y * settings.desktopWidth + x; +} + +/** Get the above desktop. */ +unsigned int GetAboveDesktop(unsigned int desktop) +{ + if(currentDesktop >= settings.desktopWidth) { + return currentDesktop - settings.desktopWidth; + } + return currentDesktop + (settings.desktopHeight - 1) * settings.desktopWidth; +} +/** Get the below desktop. */ +unsigned int GetBelowDesktop(unsigned int desktop) +{ + return (currentDesktop + settings.desktopWidth) % settings.desktopCount; } /** Change to the desktop to the right. */ -int RightDesktop() { - int x, y; - if(desktopWidth > 1) { - y = currentDesktop / desktopWidth; - x = (currentDesktop + 1) % desktopWidth; - ChangeDesktop(y * desktopWidth + x); +char RightDesktop(void) +{ + if(settings.desktopWidth > 1) { + const unsigned int desktop = GetRightDesktop(currentDesktop); + ChangeDesktop(desktop); return 1; } else { return 0; @@ -83,13 +114,11 @@ } /** Change to the desktop to the left. */ -int LeftDesktop() { - int x, y; - if(desktopWidth > 1) { - y = currentDesktop / desktopWidth; - x = currentDesktop % desktopWidth; - x = x > 0 ? x - 1 : desktopWidth - 1; - ChangeDesktop(y * desktopWidth + x); +char LeftDesktop(void) +{ + if(settings.desktopWidth > 1) { + const unsigned int desktop = GetLeftDesktop(currentDesktop); + ChangeDesktop(desktop); return 1; } else { return 0; @@ -97,13 +126,11 @@ } /** Change to the desktop above. */ -int AboveDesktop() { - if(desktopHeight > 1) { - if(currentDesktop >= desktopWidth) { - ChangeDesktop(currentDesktop - desktopWidth); - } else { - ChangeDesktop(currentDesktop + (desktopHeight - 1) * desktopWidth); - } +char AboveDesktop(void) +{ + if(settings.desktopHeight > 1) { + const int desktop = GetAboveDesktop(currentDesktop); + ChangeDesktop(desktop); return 1; } else { return 0; @@ -111,9 +138,11 @@ } /** Change to the desktop below. */ -int BelowDesktop() { - if(desktopHeight > 1) { - ChangeDesktop((currentDesktop + desktopWidth) % desktopCount); +char BelowDesktop(void) +{ + if(settings.desktopHeight > 1) { + const unsigned int desktop = GetBelowDesktop(currentDesktop); + ChangeDesktop(desktop); return 1; } else { return 0; @@ -121,16 +150,17 @@ } /** Change to the specified desktop. */ -void ChangeDesktop(unsigned int desktop) { +void ChangeDesktop(unsigned int desktop) +{ ClientNode *np; unsigned int x; - if(JUNLIKELY(desktop >= desktopCount)) { + if(JUNLIKELY(desktop >= settings.desktopCount)) { return; } - if(currentDesktop == desktop && !initializing) { + if(currentDesktop == desktop) { return; } @@ -164,21 +194,21 @@ currentDesktop = desktop; SetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, currentDesktop); + SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP, + showingDesktop[currentDesktop]); - RestackClients(); - - UpdatePager(); - UpdateTaskBar(); + RequireRestack(); + RequireTaskUpdate(); LoadBackground(desktop); } /** Create a desktop menu. */ -Menu *CreateDesktopMenu(unsigned int mask) { +Menu *CreateDesktopMenu(unsigned int mask, void *context) +{ Menu *menu; - MenuItem *item; int x; menu = Allocate(sizeof(Menu)); @@ -186,110 +216,135 @@ menu->items = NULL; menu->label = NULL; - for(x = desktopCount - 1; x >= 0; x--) { - - item = Allocate(sizeof(MenuItem)); - item->type = MENU_ITEM_NORMAL; - item->iconName = NULL; - item->submenu = NULL; + for(x = settings.desktopCount - 1; x >= 0; x--) { + const size_t len = strlen(desktopNames[x]); + MenuItem *item = CreateMenuItem(MENU_ITEM_NORMAL); item->next = menu->items; menu->items = item; item->action.type = MA_DESKTOP; + item->action.context = context; item->action.data.i = x; - item->name = Allocate(strlen(desktopNames[x]) + 3); - if(mask & (1 << x)) { - strcpy(item->name, "["); - strcat(item->name, desktopNames[x]); - strcat(item->name, "]"); - } else { - strcpy(item->name, " "); - strcat(item->name, desktopNames[x]); - strcat(item->name, " "); - } - + item->name = Allocate(len + 3); + item->name[0] = (mask & (1 << x)) ? '[' : ' '; + memcpy(&item->name[1], desktopNames[x], len); + item->name[len + 1] = (mask & (1 << x)) ? ']' : ' '; + item->name[len + 2] = 0; } return menu; } +/** Create a sendto menu. */ +Menu *CreateSendtoMenu(MenuActionType mask, void *context) +{ + + Menu *menu; + int x; + + menu = Allocate(sizeof(Menu)); + menu->itemHeight = 0; + menu->items = NULL; + menu->label = NULL; + + for(x = settings.desktopCount - 1; x >= 0; x--) { + const size_t len = strlen(desktopNames[x]); + MenuItem *item = CreateMenuItem(MENU_ITEM_NORMAL); + item->next = menu->items; + menu->items = item; + + item->action.type = MA_SENDTO | mask; + item->action.context = context; + item->action.data.i = x; + + item->name = Allocate(len + 3); + item->name[0] = (x == currentDesktop) ? '[' : ' '; + memcpy(&item->name[1], desktopNames[x], len); + item->name[len + 1] = (x == currentDesktop) ? ']' : ' '; + item->name[len + 2] = 0; + } + + return menu; +} + /** Toggle the "show desktop" state. */ -void ShowDesktop() { +void ShowDesktop(void) +{ ClientNode *np; int layer; + GrabServer(); for(layer = 0; layer < LAYER_COUNT; layer++) { for(np = nodes[layer]; np; np = np->next) { - - /* Skip "nolist" items. */ if(np->state.status & STAT_NOLIST) { continue; } - - if(showingDesktop) { - if(np->state.status & STAT_SDESKTOP) { - RestoreClient(np, 0); - } - } else if(np->state.desktop == currentDesktop - || (np->state.status & STAT_STICKY)) { - if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { - MinimizeClient(np); - np->state.status |= STAT_SDESKTOP; + if((np->state.desktop == currentDesktop) || + (np->state.status & STAT_STICKY)) { + if(showingDesktop[currentDesktop]) { + if(np->state.status & STAT_SDESKTOP) { + RestoreClient(np, 0); + } + } else { + if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { + MinimizeClient(np, 0); + np->state.status |= STAT_SDESKTOP; + } } } } } - - showingDesktop = !showingDesktop; - SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP, showingDesktop); - - RestackClients(); - -} - -/** Set the number of desktops to use. */ -void SetDesktopCount(const char *width, const char *height) { - - if(width) { - desktopWidth = atoi(width); - } else { - desktopWidth = DEFAULT_DESKTOP_WIDTH; - } - if(height) { - desktopHeight = atoi(height); + RequireRestack(); + RequireTaskUpdate(); + JXSync(display, True); + + if(showingDesktop[currentDesktop]) { + char first = 1; + JXSync(display, False); + for(layer = 0; layer < LAYER_COUNT; layer++) { + for(np = nodes[layer]; np; np = np->next) { + if(np->state.status & STAT_NOLIST) { + continue; + } + if((np->state.desktop == currentDesktop) || + (np->state.status & STAT_STICKY)) { + if(first) { + FocusClient(np); + first = 0; + } + DrawBorder(np); + } + } + } + showingDesktop[currentDesktop] = 0; } else { - desktopHeight = DEFAULT_DESKTOP_HEIGHT; - } - - desktopCount = desktopWidth * desktopHeight; - if(JUNLIKELY(desktopCount == 0)) { - Warning(_("invalid desktop count")); - desktopWidth = DEFAULT_DESKTOP_WIDTH; - desktopHeight = DEFAULT_DESKTOP_HEIGHT; - desktopCount = desktopWidth * desktopHeight; + showingDesktop[currentDesktop] = 1; } + SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP, + showingDesktop[currentDesktop]); + UngrabServer(); } /** Set the name for a desktop. */ -void SetDesktopName(unsigned int desktop, const char *str) { +void SetDesktopName(unsigned int desktop, const char *str) +{ - unsigned int x; if(JUNLIKELY(!str)) { Warning(_("empty Desktops Name tag")); return; } - Assert(desktop >= 0); - Assert(desktop < desktopCount); + Assert(desktop < settings.desktopWidth * settings.desktopHeight); if(!desktopNames) { - desktopNames = Allocate(desktopCount * sizeof(char*)); - for(x = 0; x < desktopCount; x++) { + unsigned int x; + desktopNames = Allocate(settings.desktopCount * sizeof(char*)); + for(x = 0; x < settings.desktopCount; x++) { desktopNames[x] = NULL; } } @@ -301,7 +356,9 @@ } /** Get the name of a desktop. */ -const char *GetDesktopName(unsigned int desktop) { +const char *GetDesktopName(unsigned int desktop) +{ + Assert(desktop < settings.desktopCount); if(desktopNames && desktopNames[desktop]) { return desktopNames[desktop]; } else { diff -Nru jwm-2.1.0+svn579/src/desktop.h jwm-2.3.1+0~16~ubuntu14.10.1/src/desktop.h --- jwm-2.1.0+svn579/src/desktop.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/desktop.h 2015-07-18 20:02:18.000000000 +0000 @@ -12,26 +12,24 @@ struct MenuType; -extern int showingDesktop; - /*@{*/ -void InitializeDesktops(); -void StartupDesktops(); -void ShutdownDesktops(); -void DestroyDesktops(); +#define InitializeDesktops() (void)(0) +void StartupDesktops(void); +#define ShutdownDesktops() (void)(0) +void DestroyDesktops(void); /*@}*/ -/** Switch to the desktop to the right. */ -int RightDesktop(); - -/** Switch to the desktop to the left. */ -int LeftDesktop(); - -/** Switch to the desktop above. */ -int AboveDesktop(); - -/** Switch to the desktop below. */ -int BelowDesktop(); +/** Get a relative desktop. */ +unsigned int GetRightDesktop(unsigned int desktop); +unsigned int GetLeftDesktop(unsigned int desktop); +unsigned int GetAboveDesktop(unsigned int desktop); +unsigned int GetBelowDesktop(unsigned int desktop); + +/** Switch to a relative desktop. */ +char RightDesktop(void); +char LeftDesktop(void); +char AboveDesktop(void); +char BelowDesktop(void); /** Switch to a specific desktop. * @param desktop The desktop to show (0 based). @@ -41,20 +39,21 @@ /** Toggle the "show desktop" state. * This will either minimize or restore all items on the current desktop. */ -void ShowDesktop(); +void ShowDesktop(void); /** Create a menu containing a list of desktops. * @param mask A bit mask of desktops to highlight. + * @param context Context to pass the action handler. * @return A menu containing all the desktops. */ -struct Menu *CreateDesktopMenu(unsigned int mask); +struct Menu *CreateDesktopMenu(unsigned int mask, void *context); -/** Set the number of desktops. - * This is called before startup. - * @param width ASCII representation of number of horizontal desktops. - * @param height ASCII representation of the number of vertical desktops. +/** Create a menu containing a list of desktops. + * @param mask Mask to OR onto the action. + * @param context Context to pass the action handler. + * @return A menu containing all the desktops. */ -void SetDesktopCount(const char *width, const char *height); +struct Menu *CreateSendtoMenu(unsigned char mask, void *context); /** Set the name of a desktop. * This is called before startup. @@ -70,4 +69,3 @@ const char *GetDesktopName(unsigned int desktop); #endif - diff -Nru jwm-2.1.0+svn579/src/dock.c jwm-2.3.1+0~16~ubuntu14.10.1/src/dock.c --- jwm-2.1.0+svn579/src/dock.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/dock.c 2015-07-18 20:02:18.000000000 +0000 @@ -13,6 +13,7 @@ #include "main.h" #include "error.h" #include "color.h" +#include "misc.h" #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 @@ -25,7 +26,7 @@ typedef struct DockNode { Window window; - int needs_reparent; + char needs_reparent; struct DockNode *next; @@ -47,29 +48,30 @@ static const char ORIENTATION_ATOM[] = "_NET_SYSTEM_TRAY_ORIENTATION"; static DockType *dock = NULL; -static int owner; +static char owner; static Atom dockAtom; static unsigned long orientation; -static int dockItemCount; static void SetSize(TrayComponentType *cp, int width, int height); static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void DockWindow(Window win); -static int UndockWindow(Window win); +static char UndockWindow(Window win); -static void UpdateDock(); +static void UpdateDock(void); +static void GetDockItemSize(DockNode *np, int *width, int *height); static void GetDockSize(int *width, int *height); /** Initialize dock data. */ -void InitializeDock() { - dockItemCount = 0; +void InitializeDock(void) +{ owner = 0; } /** Startup the dock. */ -void StartupDock() { +void StartupDock(void) +{ char *selectionName; @@ -92,7 +94,7 @@ dock->window = JXCreateSimpleWindow(display, rootWindow, /* x, y, width, height */ 0, 0, 1, 1, /* border_size, border_color */ 0, 0, - /* background */ colors[COLOR_TRAY_BG]); + /* background */ colors[COLOR_TRAY_BG2]); JXSelectInput(display, dock->window, SubstructureNotifyMask | SubstructureRedirectMask @@ -104,7 +106,8 @@ } /** Shutdown the dock. */ -void ShutdownDock() { +void ShutdownDock(void) +{ DockNode *np; @@ -131,18 +134,17 @@ } /** Destroy dock data. */ -void DestroyDock() { - +void DestroyDock(void) +{ if(dock) { Release(dock); dock = NULL; } - } /** Create a dock component. */ -TrayComponentType *CreateDock(int width) { - +TrayComponentType *CreateDock(int width) +{ TrayComponentType *cp; if(JUNLIKELY(dock != NULL && dock->cp != NULL)) { @@ -170,7 +172,8 @@ } /** Set the size of a dock component. */ -void SetSize(TrayComponentType *cp, int width, int height) { +void SetSize(TrayComponentType *cp, int width, int height) +{ Assert(cp); Assert(dock); @@ -192,7 +195,8 @@ } /** Initialize a dock component. */ -void Create(TrayComponentType *cp) { +void Create(TrayComponentType *cp) +{ XEvent event; Atom orientationAtom; @@ -247,20 +251,16 @@ } /** Resize a dock component. */ -void Resize(TrayComponentType *cp) { - - Assert(cp); - +void Resize(TrayComponentType *cp) +{ JXResizeWindow(display, cp->window, cp->width, cp->height); UpdateDock(); - } /** Handle a dock event. */ -void HandleDockEvent(const XClientMessageEvent *event) { - +void HandleDockEvent(const XClientMessageEvent *event) +{ Assert(event); - switch(event->data.l[1]) { case SYSTEM_TRAY_REQUEST_DOCK: DockWindow(event->data.l[2]); @@ -273,11 +273,11 @@ Debug("invalid opcode in dock event"); break; } - } /** Handle a resize request event. */ -int HandleDockResizeRequest(const XResizeRequestEvent *event) { +char HandleDockResizeRequest(const XResizeRequestEvent *event) +{ DockNode *np; @@ -289,10 +289,8 @@ for(np = dock->nodes; np; np = np->next) { if(np->window == event->window) { - JXResizeWindow(display, np->window, event->width, event->height); UpdateDock(); - return 1; } } @@ -301,9 +299,9 @@ } /** Handle a configure request event. */ -int HandleDockConfigureRequest(const XConfigureRequestEvent *event) { +char HandleDockConfigureRequest(const XConfigureRequestEvent *event) +{ - XWindowChanges wc; DockNode *np; Assert(event); @@ -314,14 +312,6 @@ for(np = dock->nodes; np; np = np->next) { if(np->window == event->window) { - wc.stack_mode = event->detail; - wc.sibling = event->above; - wc.border_width = event->border_width; - wc.x = event->x; - wc.y = event->y; - wc.width = event->width; - wc.height = event->height; - JXConfigureWindow(display, np->window, event->value_mask, &wc); UpdateDock(); return 1; } @@ -332,10 +322,11 @@ } /** Handle a reparent notify event. */ -int HandleDockReparentNotify(const XReparentEvent *event) { +char HandleDockReparentNotify(const XReparentEvent *event) +{ DockNode *np; - int handled; + char handled; Assert(event); @@ -370,37 +361,35 @@ } /** Handle a destroy event. */ -int HandleDockDestroy(Window win) { - +char HandleDockDestroy(Window win) +{ if(dock) { return UndockWindow(win); } else { return 0; } - } /** Handle a selection clear event. */ -int HandleDockSelectionClear(const XSelectionClearEvent *event) { - +char HandleDockSelectionClear(const XSelectionClearEvent *event) +{ if(event->selection == dockAtom) { Debug("lost _NET_SYSTEM_TRAY selection"); owner = 0; } - return 0; - } /** Add a window to the dock. */ -void DockWindow(Window win) { +void DockWindow(Window win) +{ DockNode *np; - /* If no dock is running, just return. */ - if(!dock) { - return; - } + /* If no dock is running, just return. */ + if(!dock) { + return; + } /* Make sure we have a valid window to add. */ if(JUNLIKELY(win == None)) { @@ -420,7 +409,6 @@ np->needs_reparent = 0; np->next = dock->nodes; dock->nodes = np; - dockItemCount += 1; /* Update the requested size. */ GetDockSize(&dock->cp->requestedWidth, &dock->cp->requestedHeight); @@ -442,15 +430,16 @@ } /** Remove a window from the dock. */ -int UndockWindow(Window win) { +char UndockWindow(Window win) +{ DockNode *np; DockNode *last; - /* If no dock is running, just return. */ - if(!dock) { - return 0; - } + /* If no dock is running, just return. */ + if(!dock) { + return 0; + } last = NULL; for(np = dock->nodes; np; np = np->next) { @@ -463,7 +452,6 @@ dock->nodes = np->next; } Release(np); - dockItemCount -= 1; /* Update the requested size. */ GetDockSize(&dock->cp->requestedWidth, &dock->cp->requestedHeight); @@ -481,15 +469,15 @@ } /** Layout items on the dock. */ -void UpdateDock() { +void UpdateDock(void) +{ - XWindowAttributes attr; + XConfigureEvent event; DockNode *np; int x, y; int width, height; int xoffset, yoffset; int itemSize; - int ratio; Assert(dock); @@ -505,33 +493,16 @@ x = 1; y = 1; + memset(&event, 0, sizeof(event)); for(np = dock->nodes; np; np = np->next) { - xoffset = 0; - yoffset = 0; - width = itemSize; - height = itemSize; - - if(JXGetWindowAttributes(display, np->window, &attr)) { - - /* Fixed point with 16 bit fraction. */ - ratio = (attr.width << 16) / attr.height; - - if(ratio > 65536) { - if(width > attr.width) { - width = attr.width; - } - height = (width << 16) / ratio; - } else { - if(height > attr.height) { - height = attr.height; - } - width = (height * ratio) >> 16; - } - - xoffset = (itemSize - width) / 2; + GetDockItemSize(np, &width, &height); + if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { + xoffset = 0; yoffset = (itemSize - height) / 2; - + } else { + xoffset = (itemSize - width) / 2; + yoffset = 0; } JXMoveResizeWindow(display, np->window, x + xoffset, y + yoffset, @@ -543,69 +514,82 @@ x + xoffset, y + yoffset); } + event.type = ConfigureNotify; + event.event = np->window; + event.window = np->window; + event.x = x + xoffset; + event.y = y + yoffset; + event.width = width; + event.height = height; + JXSendEvent(display, np->window, False, StructureNotifyMask, + (XEvent*)&event); + if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { - x += itemSize; - if(x >= dock->cp->width) { - x = 0; - y += itemSize; - } + x += width; } else { - y += itemSize; - if(y >= dock->cp->height) { - y = 0; - x += itemSize; - } + y += height; } } } -/** Get the size of the dock. */ -void GetDockSize(int *width, int *height) { - +/** Get the size of a particular window on the dock. */ +void GetDockItemSize(DockNode *np, int *width, int *height) +{ int itemSize; - int constraint; - int span; - int columns; - Assert(dock != NULL); - - /* Determine the dimension that constrains the size of items. */ + /* Determine the default size of items in the dock. */ if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { - constraint = dock->cp->height; + itemSize = dock->cp->height - 2; } else { - constraint = dock->cp->width; + itemSize = dock->cp->width - 2; } - - /* Determine the size of each item on the dock. */ - itemSize = constraint; if(dock->itemSize > 0 && itemSize > dock->itemSize) { itemSize = dock->itemSize; } - span = constraint / itemSize; - columns = (dockItemCount + span - 1) / span; - if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { + /* Determine the size of the window. */ + *width = itemSize; + *height = itemSize; - /* Horizontal tray. Place top to bottom and then left to right. */ - *height = constraint; - if(columns == 0) { - *width = 1; - } else { - *width = itemSize * columns + 2; - } +} + +/** Get the size of the dock. */ +void GetDockSize(int *width, int *height) +{ + DockNode *np; + + Assert(dock != NULL); + /* Determine the dimension that is fixed. */ + if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { + *width = 0; + *height = dock->cp->height; } else { + *width = dock->cp->width; + *height = 0; + } - /* Vertical tray. Place left to right and then top to bottom. */ - *width = constraint; - if(columns == 0) { - *height = 1; + /* Determine the size of the items on the dock. */ + for(np = dock->nodes; np; np = np->next) { + int itemWidth, itemHeight; + GetDockItemSize(np, &itemWidth, &itemHeight); + if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { + /* Horizontal tray; height fixed, placement is left to right. */ + *width += itemWidth; } else { - *height = itemSize * columns + 2; + /* Vertical tray; width fixed, placement is top to bottom. */ + *height += itemHeight; } + } + /* Don't allow the dock to have zero size since a size of + * zero indicates a variable sized component. */ + if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { + *width = Max(*width, 1); + } else { + *height = Max(*height, 1); } } diff -Nru jwm-2.1.0+svn579/src/dock.h jwm-2.3.1+0~16~ubuntu14.10.1/src/dock.h --- jwm-2.1.0+svn579/src/dock.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/dock.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,10 +13,10 @@ struct TrayComponentType; /*@{*/ -void InitializeDock(); -void StartupDock(); -void ShutdownDock(); -void DestroyDock(); +void InitializeDock(void); +void StartupDock(void); +void ShutdownDock(void); +void DestroyDock(void); /*@}*/ /** Create a dock to be used for notifications. @@ -34,31 +34,31 @@ * @param win The window that was destroyed. * @return 1 if handled, 0 otherwise. */ -int HandleDockDestroy(Window win); +char HandleDockDestroy(Window win); /** Handle a selection clear event. * @param event The selection clear event. * @return 1 if handled, 0 otherwise. */ -int HandleDockSelectionClear(const XSelectionClearEvent *event); +char HandleDockSelectionClear(const XSelectionClearEvent *event); /** Handle a resize request. * @param event The resize request event. * @return 1 if handled, 0 otherwise. */ -int HandleDockResizeRequest(const XResizeRequestEvent *event); +char HandleDockResizeRequest(const XResizeRequestEvent *event); /** Handle a configure request. * @param event The configure request event. * @return 1 if handled, 0 otherwise. */ -int HandleDockConfigureRequest(const XConfigureRequestEvent *event); +char HandleDockConfigureRequest(const XConfigureRequestEvent *event); /** Handle a reparent notify event. * @param event The reparent notify event. * @return 1 if handled, 0 otherwise. */ -int HandleDockReparentNotify(const XReparentEvent *event); +char HandleDockReparentNotify(const XReparentEvent *event); #endif diff -Nru jwm-2.1.0+svn579/src/error.c jwm-2.3.1+0~16~ubuntu14.10.1/src/error.c --- jwm-2.1.0+svn579/src/error.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/error.c 2015-07-18 20:02:18.000000000 +0000 @@ -90,7 +90,7 @@ snprintf(code, sizeof(code), "%d", e->request_code); XGetErrorDatabaseText(display, "XRequest", code, "?", - buffer, sizeof(buffer)); + buffer, sizeof(buffer)); Debug(" Request Code: %d (%s)", e->request_code, buffer); Debug(" Minor Code: %d", e->minor_code); Debug(" Resource ID: 0x%lx", (unsigned long)e->resourceid); diff -Nru jwm-2.1.0+svn579/src/event.c jwm-2.3.1+0~16~ubuntu14.10.1/src/event.c --- jwm-2.1.0+svn579/src/event.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/event.c 2015-07-18 20:02:18.000000000 +0000 @@ -12,83 +12,130 @@ #include "client.h" #include "clientlist.h" -#include "clock.h" #include "confirm.h" #include "cursor.h" #include "desktop.h" #include "dock.h" -#include "hint.h" #include "icon.h" #include "key.h" -#include "main.h" #include "move.h" -#include "pager.h" #include "place.h" -#include "popup.h" #include "resize.h" #include "root.h" #include "swallow.h" #include "taskbar.h" #include "timing.h" -#include "tray.h" -#include "traybutton.h" #include "winmenu.h" -#include "error.h" +#include "settings.h" +#include "tray.h" +#include "popup.h" +#include "pager.h" +#include "grab.h" #define MIN_TIME_DELTA 50 Time eventTime = CurrentTime; -static void Signal(); +typedef struct CallbackNode { + TimeType last; + int freq; + SignalCallback callback; + void *data; + struct CallbackNode *next; +} CallbackNode; + +static CallbackNode *callbacks = NULL; + +static char restack_pending = 0; +static char task_update_pending = 0; +static char pager_update_pending = 0; + +static void Signal(void); static void DispatchBorderButtonEvent(const XButtonEvent *event, ClientNode *np); static void HandleConfigureRequest(const XConfigureRequestEvent *event); -static int HandleConfigureNotify(const XConfigureEvent *event); -static int HandleExpose(const XExposeEvent *event); -static int HandlePropertyNotify(const XPropertyEvent *event); +static char HandleConfigureNotify(const XConfigureEvent *event); +static char HandleExpose(const XExposeEvent *event); +static char HandlePropertyNotify(const XPropertyEvent *event); static void HandleClientMessage(const XClientMessageEvent *event); static void HandleColormapChange(const XColormapEvent *event); -static int HandleDestroyNotify(const XDestroyWindowEvent *event); +static char HandleDestroyNotify(const XDestroyWindowEvent *event); static void HandleMapRequest(const XMapEvent *event); static void HandleUnmapNotify(const XUnmapEvent *event); static void HandleButtonEvent(const XButtonEvent *event); +static void ToggleMaximized(ClientNode *np, MaxFlags flags); static void HandleKeyPress(const XKeyEvent *event); static void HandleKeyRelease(const XKeyEvent *event); static void HandleEnterNotify(const XCrossingEvent *event); -static void HandleLeaveNotify(const XCrossingEvent *event); static void HandleMotionNotify(const XMotionEvent *event); -static int HandleSelectionClear(const XSelectionClearEvent *event); +static char HandleSelectionClear(const XSelectionClearEvent *event); static void HandleNetMoveResize(const XClientMessageEvent *event, ClientNode *np); +static void HandleNetWMMoveResize(const XClientMessageEvent *evnet, + ClientNode *np); +static void HandleNetRestack(const XClientMessageEvent *event, + ClientNode *np); static void HandleNetWMState(const XClientMessageEvent *event, ClientNode *np); +static void HandleFrameExtentsRequest(const XClientMessageEvent *event); +static void UpdateState(ClientNode *np); +static void DiscardEnterEvents(); #ifdef USE_SHAPE static void HandleShapeEvent(const XShapeEvent *event); #endif /** Wait for an event and process it. */ -void WaitForEvent(XEvent *event) { +char WaitForEvent(XEvent *event) +{ struct timeval timeout; + CallbackNode *cp; fd_set fds; + long sleepTime; int fd; - int handled; + char handled; +#ifdef ConnectionNumber + fd = ConnectionNumber(display); +#else fd = JXConnectionNumber(display); +#endif + + /* Compute how long we should sleep. */ + sleepTime = 10 * 1000; /* 10 seconds. */ + for(cp = callbacks; cp; cp = cp->next) { + if(cp->freq > 0 && cp->freq < sleepTime) { + sleepTime = cp->freq; + } + } do { + if(restack_pending) { + RestackClients(); + restack_pending = 0; + } + if(task_update_pending) { + UpdateTaskBar(); + } + if(pager_update_pending) { + UpdatePager(); + } + while(JXPending(display) == 0) { FD_ZERO(&fds); FD_SET(fd, &fds); - timeout.tv_usec = 0; - timeout.tv_sec = 1; + timeout.tv_sec = sleepTime / 1000; + timeout.tv_usec = (sleepTime % 1000) * 1000; if(select(fd + 1, &fds, NULL, NULL, &timeout) <= 0) { Signal(); } + if(JUNLIKELY(shouldExit)) { + return 0; + } } Signal(); @@ -133,7 +180,24 @@ handled = HandleDockResizeRequest(&event->xresizerequest); break; case MotionNotify: - SetMousePosition(event->xmotion.x_root, event->xmotion.y_root); + SetMousePosition(event->xmotion.x_root, event->xmotion.y_root, + event->xmotion.window); + handled = 0; + break; + case ButtonPress: + case ButtonRelease: + SetMousePosition(event->xbutton.x_root, event->xbutton.y_root, + event->xbutton.window); + handled = 0; + break; + case EnterNotify: + SetMousePosition(event->xcrossing.x_root, event->xcrossing.y_root, + event->xcrossing.window); + handled = 0; + break; + case LeaveNotify: + SetMousePosition(event->xcrossing.x_root, event->xcrossing.y_root, + None); handled = 0; break; case ReparentNotify: @@ -177,37 +241,40 @@ } while(handled && !shouldExit); + return !handled; + } /** Wake up components that need to run at certain times. */ -void Signal() { +void Signal(void) +{ static TimeType last = ZERO_TIME; + CallbackNode *cp; TimeType now; + Window w; int x, y; GetCurrentTime(&now); - if(GetTimeDifference(&now, &last) < MIN_TIME_DELTA) { return; } last = now; - GetMousePosition(&x, &y); - - SignalTaskbar(&now, x, y); - SignalTrayButton(&now, x, y); - SignalClock(&now, x, y); - SignalTray(&now, x, y); - SignalPager(&now, x, y); - SignalPopup(&now, x, y); + GetMousePosition(&x, &y, &w); + for(cp = callbacks; cp; cp = cp->next) { + if(cp->freq == 0 || GetTimeDifference(&now, &cp->last) >= cp->freq) { + cp->last = now; + (cp->callback)(&now, x, y, w, cp->data); + } + } } /** Process an event. */ -void ProcessEvent(XEvent *event) { - +void ProcessEvent(XEvent *event) +{ switch(event->type) { case ButtonPress: case ButtonRelease: @@ -222,14 +289,12 @@ case EnterNotify: HandleEnterNotify(&event->xcrossing); break; - case LeaveNotify: - HandleLeaveNotify(&event->xcrossing); - break; case MotionNotify: while(JXCheckTypedEvent(display, MotionNotify, event)); UpdateTime(event); HandleMotionNotify(&event->xmotion); break; + case LeaveNotify: case DestroyNotify: case Expose: case ConfigureNotify: @@ -241,98 +306,96 @@ } /** Discard motion events for the specified window. */ -void DiscardMotionEvents(XEvent *event, Window w) { - +void DiscardMotionEvents(XEvent *event, Window w) +{ XEvent temp; - + JXSync(display, False); while(JXCheckTypedEvent(display, MotionNotify, &temp)) { - UpdateTime(event); - SetMousePosition(temp.xmotion.x_root, temp.xmotion.y_root); + UpdateTime(&temp); + SetMousePosition(temp.xmotion.x_root, temp.xmotion.y_root, + temp.xmotion.window); if(temp.xmotion.window == w) { *event = temp; } } +} +/** Discard key events for the specified window. */ +void DiscardKeyEvents(XEvent *event, Window w) +{ + JXSync(display, False); + while(JXCheckTypedWindowEvent(display, w, KeyPress, event)) { + UpdateTime(event); + } } -/** Process a selection clear event. */ -int HandleSelectionClear(const XSelectionClearEvent *event) { +/** Discard enter notify events. */ +void DiscardEnterEvents() +{ + XEvent event; + JXSync(display, False); + while(JXCheckMaskEvent(display, EnterWindowMask, &event)) { + UpdateTime(&event); + SetMousePosition(event.xmotion.x_root, event.xmotion.y_root, + event.xmotion.window); + } +} +/** Process a selection clear event. */ +char HandleSelectionClear(const XSelectionClearEvent *event) +{ + if(event->selection == managerSelection) { + /* Lost WM selection. */ + shouldExit = 1; + return 1; + } return HandleDockSelectionClear(event); - } /** Process a button event. */ -void HandleButtonEvent(const XButtonEvent *event) { +void HandleButtonEvent(const XButtonEvent *event) +{ - int x, y; ClientNode *np; int north, south, east, west; np = FindClientByParent(event->window); if(np) { if(event->type == ButtonPress) { + FocusClient(np); RaiseClient(np); - if(focusModel == FOCUS_CLICK) { - FocusClient(np); - } - } - switch(event->button) { - case Button1: - DispatchBorderButtonEvent(event, np); - break; - case Button2: - MoveClient(np, event->x, event->y, - (event->state & Mod1Mask) ? 0 : 1); - break; - case Button3: - GetBorderSize(np, &north, &south, &east, &west); - x = event->x + np->x - west; - y = event->y + np->y - north; - ShowWindowMenu(np, x, y); - break; - case Button4: - ShadeClient(np); - break; - case Button5: - UnshadeClient(np); - break; - default: - break; } + DispatchBorderButtonEvent(event, np); } else if(event->window == rootWindow && event->type == ButtonPress) { if(!ShowRootMenu(event->button, event->x, event->y)) { - if(event->button == 4) { + if(event->button == Button4) { LeftDesktop(); - } else if(event->button == 5) { + } else if(event->button == Button5) { RightDesktop(); } } } else { + const unsigned int mask = event->state & ~lockMask; np = FindClientByWindow(event->window); if(np) { switch(event->button) { case Button1: case Button2: + FocusClient(np); RaiseClient(np); - if(focusModel == FOCUS_CLICK) { - FocusClient(np); - } - if(event->state & Mod1Mask) { - GetBorderSize(np, &north, &south, &east, &west); - MoveClient(np, event->x + west, event->y + north, 0); + if(mask == Mod1Mask) { + GetBorderSize(&np->state, &north, &south, &east, &west); + MoveClient(np, event->x + west, event->y + north); } break; case Button3: - if(event->state & Mod1Mask) { - GetBorderSize(np, &north, &south, &east, &west); + if(mask == Mod1Mask) { + GetBorderSize(&np->state, &north, &south, &east, &west); ResizeClient(np, BA_RESIZE | BA_RESIZE_E | BA_RESIZE_S, event->x + west, event->y + north); } else { + FocusClient(np); RaiseClient(np); - if(focusModel == FOCUS_CLICK) { - FocusClient(np); - } } break; default: @@ -345,16 +408,25 @@ } -/** Process a key press event. */ -void HandleKeyPress(const XKeyEvent *event) { +/** Toggle maximized state. */ +void ToggleMaximized(ClientNode *np, MaxFlags flags) +{ + if(np) { + if(np->state.maxFlags == flags) { + MaximizeClient(np, MAX_NONE); + } else { + MaximizeClient(np, flags); + } + } +} +/** Process a key press event. */ +void HandleKeyPress(const XKeyEvent *event) +{ ClientNode *np; KeyType key; - key = GetKey(event); - np = GetActiveClient(); - switch(key & 0xFF) { case KEY_EXEC: RunKeyCommand(event); @@ -381,6 +453,7 @@ ShowAllTrays(); break; case KEY_NEXT: + StartWindowWalk(); FocusNext(); break; case KEY_NEXTSTACK: @@ -388,6 +461,7 @@ WalkWindowStack(1); break; case KEY_PREV: + StartWindowWalk(); FocusPrevious(); break; case KEY_PREVSTACK: @@ -429,14 +503,36 @@ break; case KEY_MIN: if(np) { - MinimizeClient(np); + MinimizeClient(np, 1); } break; case KEY_MAX: if(np) { - MaximizeClient(np, 1, 1); + if(np->state.maxFlags) { + MaximizeClient(np, MAX_NONE); + } else { + MaximizeClient(np, MAX_HORIZ | MAX_VERT); + } } break; + case KEY_MAXTOP: + ToggleMaximized(np, MAX_TOP | MAX_HORIZ); + break; + case KEY_MAXBOTTOM: + ToggleMaximized(np, MAX_BOTTOM | MAX_HORIZ); + break; + case KEY_MAXLEFT: + ToggleMaximized(np, MAX_LEFT | MAX_VERT); + break; + case KEY_MAXRIGHT: + ToggleMaximized(np, MAX_RIGHT | MAX_VERT); + break; + case KEY_MAXV: + ToggleMaximized(np, MAX_VERT); + break; + case KEY_MAXH: + ToggleMaximized(np, MAX_HORIZ); + break; case KEY_ROOT: ShowKeyMenu(event); break; @@ -460,59 +556,130 @@ } } break; + case KEY_SENDR: + if(np) { + SetClientDesktop(np, GetRightDesktop(np->state.desktop)); + } + break; + case KEY_SENDL: + if(np) { + SetClientDesktop(np, GetLeftDesktop(np->state.desktop)); + } + break; + case KEY_SENDU: + if(np) { + SetClientDesktop(np, GetAboveDesktop(np->state.desktop)); + } + break; + case KEY_SENDD: + if(np) { + SetClientDesktop(np, GetBelowDesktop(np->state.desktop)); + } + break; default: break; } - + DiscardEnterEvents(); } /** Handle a key release event. */ -void HandleKeyRelease(const XKeyEvent *event) { - +void HandleKeyRelease(const XKeyEvent *event) +{ KeyType key; key = GetKey(event); if(((key & 0xFF) != KEY_NEXTSTACK) && + ((key & 0xFF) != KEY_NEXT) && + ((key & 0xFF) != KEY_PREV) && ((key & 0xFF) != KEY_PREVSTACK)) { - StopWindowStackWalk(); + StopWindowWalk(); } - } /** Process a configure request. */ -void HandleConfigureRequest(const XConfigureRequestEvent *event) { - +void HandleConfigureRequest(const XConfigureRequestEvent *event) +{ XWindowChanges wc; ClientNode *np; - int north, south, east, west; - int changed; - int handled; - handled = HandleDockConfigureRequest(event); - if(handled) { + if(HandleDockConfigureRequest(event)) { return; } np = FindClientByWindow(event->window); - if(np && np->window == event->window) { + if(np) { - changed = 0; + int deltax, deltay; + char changed = 0; + char resized = 0; + + GetGravityDelta(np, np->gravity, &deltax, &deltay); if((event->value_mask & CWWidth) && (event->width != np->width)) { + switch(np->gravity) { + case EastGravity: + case NorthEastGravity: + case SouthEastGravity: + /* Right side should not move. */ + np->x -= event->width - np->width; + break; + case WestGravity: + case NorthWestGravity: + case SouthWestGravity: + /* Left side should not move. */ + break; + case CenterGravity: + /* Center of the window should not move. */ + np->x -= (event->width - np->width) / 2; + break; + default: + break; + } np->width = event->width; changed = 1; + resized = 1; } if((event->value_mask & CWHeight) && (event->height != np->height)) { + switch(np->gravity) { + case NorthGravity: + case NorthEastGravity: + case NorthWestGravity: + /* Top should not move. */ + break; + case SouthGravity: + case SouthEastGravity: + case SouthWestGravity: + /* Bottom should not move. */ + np->y -= event->height - np->height; + break; + case CenterGravity: + /* Center of the window should not move. */ + np->y -= (event->height - np->height) / 2; + break; + default: + break; + } np->height = event->height; changed = 1; + resized = 1; } - if((event->value_mask & CWX) && (event->x != np->x)) { - np->x = event->x; + if((event->value_mask & CWX) && (event->x - deltax != np->x)) { + np->x = event->x - deltax; changed = 1; } - if((event->value_mask & CWY) && (event->y != np->y)) { - np->y = event->y; + if((event->value_mask & CWY) && (event->y - deltay != np->y)) { + np->y = event->y - deltay; changed = 1; } + /* Update stacking. */ + if((event->value_mask & CWStackMode)) { + Window above = None; + if(event->value_mask & CWSibling) { + above = event->above; + } + RestackClient(np, above, event->detail); + } + + /* Return early if there's nothing to do. */ if(!changed) { return; } @@ -520,28 +687,25 @@ if(np->controller) { (np->controller)(0); } + if(np->state.maxFlags) { + MaximizeClient(np, MAX_NONE); + } - GetBorderSize(np, &north, &south, &east, &west); - - ResetRoundedRectWindow(np->parent); + if(np->state.border & BORDER_CONSTRAIN) { + resized = 1; + } + if(resized) { + ConstrainSize(np); + ConstrainPosition(np); + ResetBorder(np); + } else { + int north, south, east, west; + GetBorderSize(&np->state, &north, &south, &east, &west); + JXMoveWindow(display, np->parent, np->x - west, np->y - north); + } - wc.stack_mode = Above; - wc.sibling = np->parent; - wc.border_width = 0; - - ConstrainSize(np); - - wc.x = np->x; - wc.y = np->y; - wc.width = np->width + east + west; - wc.height = np->height + north + south; - JXConfigureWindow(display, np->parent, event->value_mask, &wc); - - wc.x = west; - wc.y = north; - wc.width = np->width; - wc.height = np->height; - JXConfigureWindow(display, np->window, event->value_mask, &wc); + SendConfigureEvent(np); + RequirePagerUpdate(); } else { @@ -557,38 +721,32 @@ JXConfigureWindow(display, event->window, event->value_mask, &wc); } - } /** Process a configure notify event. */ -int HandleConfigureNotify(const XConfigureEvent *event) { - +char HandleConfigureNotify(const XConfigureEvent *event) +{ if(event->window != rootWindow) { return 0; } - if(rootWidth != event->width || rootHeight != event->height) { rootWidth = event->width; rootHeight = event->height; shouldRestart = 1; shouldExit = 1; } - return 1; - } /** Process an enter notify event. */ -void HandleEnterNotify(const XCrossingEvent *event) { - +void HandleEnterNotify(const XCrossingEvent *event) +{ ClientNode *np; Cursor cur; - - SetMousePosition(event->x_root, event->y_root); - - np = FindClientByWindow(event->window); + np = FindClient(event->window); if(np) { - if(!(np->state.status & STAT_ACTIVE) && (focusModel == FOCUS_SLOPPY)) { + if( !(np->state.status & STAT_ACTIVE) + && (settings.focusModel == FOCUS_SLOPPY)) { FocusClient(np); } if(np->parent == event->window) { @@ -603,50 +761,41 @@ } -/** Process a leave notify event. */ -void HandleLeaveNotify(const XCrossingEvent *event) { - - SetMousePosition(event->x_root, event->y_root); - -} - /** Handle an expose event. */ -int HandleExpose(const XExposeEvent *event) { - +char HandleExpose(const XExposeEvent *event) +{ ClientNode *np; - - np = FindClientByWindow(event->window); + np = FindClientByParent(event->window); if(np) { - if(event->window == np->parent) { - DrawBorder(np, event); - return 1; - } else if(event->window == np->window - && np->state.status & STAT_WMDIALOG) { + if(event->count == 0) { + DrawBorder(np); + } + return 1; + } else { + np = FindClientByWindow(event->window); + if(np) { + if(np->state.status & STAT_WMDIALOG) { - /* Dialog expose events are handled elsewhere. */ - return 0; + /* Dialog expose events are handled elsewhere. */ + return 0; - } else { + } else { - /* Ignore other expose events. */ - return 1; + /* Ignore other expose events for client windows. */ + return 1; + } } - } else { return event->count ? 1 : 0; } - } /** Handle a property notify event. */ -int HandlePropertyNotify(const XPropertyEvent *event) { - - ClientNode *np; - int changed; - - np = FindClientByWindow(event->window); +char HandlePropertyNotify(const XPropertyEvent *event) +{ + ClientNode *np = FindClientByWindow(event->window); if(np) { - changed = 0; + char changed = 0; switch(event->atom) { case XA_WM_NAME: ReadWMName(np); @@ -654,9 +803,23 @@ break; case XA_WM_NORMAL_HINTS: ReadWMNormalHints(np); + if(ConstrainSize(np)) { + ResetBorder(np); + } changed = 1; break; case XA_WM_HINTS: + if(np->state.status & STAT_URGENT) { + UnregisterCallback(SignalUrgent, np); + } + ReadWMHints(np->window, &np->state, 1); + if(np->state.status & STAT_URGENT) { + RegisterCallback(URGENCY_DELAY, SignalUrgent, np); + } + break; + case XA_WM_TRANSIENT_FOR: + JXGetTransientForHint(display, np->window, &np->owner); + break; case XA_WM_ICON_NAME: case XA_WM_CLIENT_MACHINE: break; @@ -664,6 +827,8 @@ if(event->atom == atoms[ATOM_WM_COLORMAP_WINDOWS]) { ReadWMColormaps(np); UpdateClientColormap(np); + } else if(event->atom == atoms[ATOM_WM_PROTOCOLS]) { + ReadWMProtocols(np->window, &np->state); } else if(event->atom == atoms[ATOM_NET_WM_ICON]) { LoadIcon(np); changed = 1; @@ -674,14 +839,21 @@ ReadClientStrut(np); } else if(event->atom == atoms[ATOM_NET_WM_STRUT]) { ReadClientStrut(np); + } else if(event->atom == atoms[ATOM_MOTIF_WM_HINTS]) { + UpdateState(np); + WriteState(np); + ResetBorder(np); + } else if(event->atom == atoms[ATOM_NET_WM_WINDOW_OPACITY]) { + ReadWMOpacity(np); + SetOpacity(np, np->state.opacity, 1); } break; } if(changed) { - DrawBorder(np, NULL); - UpdateTaskBar(); - UpdatePager(); + DrawBorder(np); + RequireTaskUpdate(); + RequirePagerUpdate(); } if(np->state.status & STAT_WMDIALOG) { return 0; @@ -694,7 +866,8 @@ } /** Handle a client message. */ -void HandleClientMessage(const XClientMessageEvent *event) { +void HandleClientMessage(const XClientMessageEvent *event) +{ ClientNode *np; #ifdef DEBUG @@ -714,7 +887,7 @@ SetClientWithdrawn(np); break; case IconicState: - MinimizeClient(np); + MinimizeClient(np, 1); break; case NormalState: RestoreClient(np, 1); @@ -726,6 +899,7 @@ } else if(event->message_type == atoms[ATOM_NET_ACTIVE_WINDOW]) { RestoreClient(np, 1); + UnshadeClient(np); FocusClient(np); } else if(event->message_type == atoms[ATOM_NET_WM_DESKTOP]) { @@ -738,7 +912,8 @@ (np->controller)(0); } - if(event->data.l[0] >= 0 && event->data.l[0] < (long)desktopCount) { + if( event->data.l[0] >= 0 + && event->data.l[0] < (long)settings.desktopCount) { np->state.status &= ~STAT_STICKY; SetClientDesktop(np, event->data.l[0]); } @@ -752,15 +927,17 @@ HandleNetMoveResize(event, np); - } else if(event->message_type == atoms[ATOM_NET_WM_STATE]) { + } else if(event->message_type == atoms[ATOM_NET_WM_MOVERESIZE]) { - HandleNetWMState(event, np); + HandleNetWMMoveResize(event, np); - } else if(event->message_type == atoms[ATOM_NET_SHOWING_DESKTOP]) { + } else if(event->message_type == atoms[ATOM_NET_RESTACK_WINDOW]) { - if(event->data.l[0] != showingDesktop) { - ShowDesktop(); - } + HandleNetRestack(event, np); + + } else if(event->message_type == atoms[ATOM_NET_WM_STATE]) { + + HandleNetWMState(event, np); } else { @@ -782,6 +959,8 @@ ReloadMenu(); } else if(event->message_type == atoms[ATOM_NET_CURRENT_DESKTOP]) { ChangeDesktop(event->data.l[0]); + } else if(event->message_type == atoms[ATOM_NET_SHOWING_DESKTOP]) { + ShowDesktop(); } else { #ifdef DEBUG atomName = JXGetAtomName(display, event->message_type); @@ -790,6 +969,10 @@ #endif } + } else if(event->message_type == atoms[ATOM_NET_REQUEST_FRAME_EXTENTS]) { + + HandleFrameExtentsRequest(event); + } else if(event->message_type == atoms[ATOM_NET_SYSTEM_TRAY_OPCODE]) { HandleDockEvent(event); @@ -806,91 +989,175 @@ } /** Handle a _NET_MOVERESIZE_WINDOW request. */ -void HandleNetMoveResize(const XClientMessageEvent *event, ClientNode *np) { +void HandleNetMoveResize(const XClientMessageEvent *event, ClientNode *np) +{ long flags; - long x, y; - long width, height; + int gravity; int deltax, deltay; - int north, south, east, west; Assert(event); Assert(np); flags = event->data.l[0] >> 8; + gravity = event->data.l[0] & 0xFF; + if(gravity == 0) { + gravity = np->gravity; + } + GetGravityDelta(np, gravity, &deltax, &deltay); - x = np->x; - y = np->y; - width = np->width; - height = np->height; - + if(flags & (1 << 2)) { + const long width = event->data.l[3]; + switch(gravity) { + case EastGravity: + case NorthEastGravity: + case SouthEastGravity: + /* Right side should not move. */ + np->x -= width - np->width; + break; + case WestGravity: + case NorthWestGravity: + case SouthWestGravity: + /* Left side should not move. */ + break; + case CenterGravity: + /* Center of the window should not move. */ + np->x -= (width - np->width) / 2; + break; + default: + break; + } + np->width = width; + } + if(flags & (1 << 3)) { + const long height = event->data.l[4]; + switch(gravity) { + case NorthGravity: + case NorthEastGravity: + case NorthWestGravity: + /* Top should not move. */ + break; + case SouthGravity: + case SouthEastGravity: + case SouthWestGravity: + /* Bottom should not move. */ + np->y -= height - np->height; + break; + case CenterGravity: + /* Center of the window should not move. */ + np->y -= (height - np->height) / 2; + break; + default: + break; + } + np->height = height; + } if(flags & (1 << 0)) { - x = event->data.l[1]; + np->x = event->data.l[1] - deltax; } if(flags & (1 << 1)) { - y = event->data.l[2]; + np->y = event->data.l[2] - deltay; } - if(flags & (1 << 2)) { - width = event->data.l[3]; + + /* Don't let maximized clients be moved or resized. */ + if(JUNLIKELY(np->state.status & STAT_FULLSCREEN)) { + SetClientFullScreen(np, 0); } - if(flags & (1 << 3)) { - height = event->data.l[4]; + if(JUNLIKELY(np->state.maxFlags)) { + MaximizeClient(np, MAX_NONE); } - GetBorderSize(np, &north, &south, &east, &west); - GetGravityDelta(np, &deltax, &deltay); + ConstrainSize(np); + ResetBorder(np); + SendConfigureEvent(np); + RequirePagerUpdate(); + +} - x -= deltax; - y -= deltay; +/** Handle a _NET_WM_MOVERESIZE request. */ +void HandleNetWMMoveResize(const XClientMessageEvent *event, ClientNode *np) +{ - np->x = x; - np->y = y; - np->width = width; - np->height = height; + const long x = event->data.l[0] - np->x; + const long y = event->data.l[1] - np->y; + const long direction = event->data.l[2]; - if(JUNLIKELY(np->state.status & STAT_FULLSCREEN)) { - Warning(_("Fullscreen state will be shaped!")); + switch(direction) { + case 0: /* top-left */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_N | BA_RESIZE_W, x, y); + break; + case 1: /* top */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_N, x, y); + break; + case 2: /* top-right */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_N | BA_RESIZE_E, x, y); + break; + case 3: /* right */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_E, x, y); + break; + case 4: /* bottom-right */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_S | BA_RESIZE_E, x, y); + break; + case 5: /* bottom */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_S, x, y); + break; + case 6: /* bottom-left */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_S | BA_RESIZE_W, x, y); + break; + case 7: /* left */ + ResizeClient(np, BA_RESIZE | BA_RESIZE_W, x, y); + break; + case 8: /* move */ + MoveClient(np, x, y); + break; + case 9: /* resize-keyboard */ + ResizeClientKeyboard(np); + break; + case 10: /* move-keyboard */ + MoveClientKeyboard(np); + break; + case 11: /* cancel */ + if(np->controller) { + (np->controller)(0); + } + break; + default: + break; } - /** Reset shaped bound */ - ResetRoundedRectWindow(np->parent); - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->window, west, north, - np->width, np->height); - - WriteState(np); - SendConfigureEvent(np); +} +/** Handle a _NET_RESTACK_WINDOW request. */ +void HandleNetRestack(const XClientMessageEvent *event, ClientNode *np) +{ + const Window sibling = event->data.l[1]; + const int detail = event->data.l[2]; + RestackClient(np, sibling, detail); } /** Handle a _NET_WM_STATE request. */ -void HandleNetWMState(const XClientMessageEvent *event, ClientNode *np) { +void HandleNetWMState(const XClientMessageEvent *event, ClientNode *np) +{ - int actionMaxH; - int actionMaxV; - int actionStick; - int actionShade; - int actionFullScreen; - int actionMinimize; - int actionNolist; - int actionBelow; - int actionAbove; - int x; + unsigned int x; + MaxFlags maxFlags; + char actionStick; + char actionShade; + char actionFullScreen; + char actionMinimize; + char actionNolist; + char actionNopager; + char actionBelow; + char actionAbove; /* Up to two actions to be applied together. */ - actionMaxH = 0; - actionMaxV = 0; + maxFlags = MAX_NONE; actionStick = 0; actionShade = 0; actionFullScreen = 0; actionMinimize = 0; actionNolist = 0; + actionNopager = 0; actionBelow = 0; actionAbove = 0; @@ -900,10 +1167,10 @@ actionStick = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]) { - actionMaxV = 1; + maxFlags |= MAX_VERT; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]) { - actionMaxH = 1; + maxFlags |= MAX_HORIZ; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_SHADED]) { actionShade = 1; @@ -917,6 +1184,9 @@ == (long)atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]) { actionNolist = 1; } else if(event->data.l[x] + == (long)atoms[ATOM_NET_WM_STATE_SKIP_PAGER]) { + actionNopager = 1; + } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_BELOW]) { actionBelow = 1; } else if(event->data.l[x] @@ -930,10 +1200,8 @@ if(actionStick) { SetClientSticky(np, 0); } - if(actionMaxH || actionMaxV) { - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - MaximizeClient(np, 0, 0); - } + if(maxFlags != MAX_NONE && np->state.maxFlags) { + MaximizeClient(np, np->state.maxFlags & ~maxFlags); } if(actionShade) { UnshadeClient(np); @@ -946,21 +1214,25 @@ } if(actionNolist) { np->state.status &= ~STAT_NOLIST; - UpdateTaskBar(); + RequireTaskUpdate(); + } + if(actionNopager) { + np->state.status &= ~STAT_NOPAGER; + RequirePagerUpdate(); } if(actionBelow && np->state.layer == LAYER_BELOW) { - SetClientLayer(np, LAYER_NORMAL); + SetClientLayer(np, np->state.defaultLayer); } if(actionAbove && np->state.layer == LAYER_ABOVE) { - SetClientLayer(np, LAYER_NORMAL); + SetClientLayer(np, np->state.defaultLayer); } break; case 1: /* Add */ if(actionStick) { SetClientSticky(np, 1); } - if(!(np->state.status & (STAT_HMAX | STAT_VMAX))) { - MaximizeClient(np, actionMaxH, actionMaxV); + if(maxFlags != MAX_NONE) { + MaximizeClient(np, np->state.maxFlags | maxFlags); } if(actionShade) { ShadeClient(np); @@ -969,16 +1241,20 @@ SetClientFullScreen(np, 1); } if(actionMinimize) { - MinimizeClient(np); + MinimizeClient(np, 1); } if(actionNolist) { np->state.status |= STAT_NOLIST; - UpdateTaskBar(); + RequireTaskUpdate(); + } + if(actionNopager) { + np->state.status |= STAT_NOPAGER; + RequirePagerUpdate(); } - if(actionBelow && np->state.layer == LAYER_NORMAL) { + if(actionBelow) { SetClientLayer(np, LAYER_BELOW); } - if(actionAbove && np->state.layer == LAYER_NORMAL) { + if(actionAbove) { SetClientLayer(np, LAYER_ABOVE); } break; @@ -990,8 +1266,8 @@ SetClientSticky(np, 1); } } - if(actionMaxH || actionMaxV) { - MaximizeClient(np, actionMaxH, actionMaxV); + if(maxFlags) { + MaximizeClient(np, np->state.maxFlags ^ maxFlags); } if(actionShade) { if(np->state.status & STAT_SHADED) { @@ -1008,47 +1284,66 @@ } } if(actionBelow) { - if(np->state.layer == LAYER_NORMAL) { + if(np->state.layer == LAYER_BELOW) { + SetClientLayer(np, np->state.defaultLayer); + } else { SetClientLayer(np, LAYER_BELOW); - } else if(np->state.layer == LAYER_BELOW) { - SetClientLayer(np, LAYER_NORMAL); } } if(actionAbove) { - if(np->state.layer == LAYER_NORMAL) { + if(np->state.layer == LAYER_ABOVE) { + SetClientLayer(np, np->state.defaultLayer); + } else { SetClientLayer(np, LAYER_ABOVE); - } else if(np->state.layer == LAYER_ABOVE) { - SetClientLayer(np, LAYER_NORMAL); } } /* Note that we don't handle toggling of hidden per EWMH * recommendations. */ if(actionNolist) { np->state.status ^= STAT_NOLIST; - UpdateTaskBar(); + RequireTaskUpdate(); + } + if(actionNopager) { + np->state.status ^= STAT_NOPAGER; + RequirePagerUpdate(); } break; default: Debug("bad _NET_WM_STATE action: %ld", event->data.l[0]); break; } + + /* Update _NET_WM_STATE if needed. + * The state update is handled elsewhere for the other actions. + */ + if(actionNolist | actionNopager | actionAbove | actionBelow) { + WriteState(np); + } + +} + +/** Handle a _NET_REQUEST_FRAME_EXTENTS request. */ +void HandleFrameExtentsRequest(const XClientMessageEvent *event) +{ + ClientState state; + state = ReadWindowState(event->window, 0); + WriteFrameExtents(event->window, &state); } /** Handle a motion notify event. */ -void HandleMotionNotify(const XMotionEvent *event) { +void HandleMotionNotify(const XMotionEvent *event) +{ ClientNode *np; Cursor cur; - BorderActionType action; if(event->is_hint) { return; } - SetMousePosition(event->x_root, event->y_root); - np = FindClientByParent(event->window); - if(np && (np->state.border & BORDER_OUTLINE)) { + if(np) { + BorderActionType action; action = GetBorderActionType(np, event->x, event->y); if(np->borderAction != action) { np->borderAction = action; @@ -1061,22 +1356,21 @@ /** Handle a shape event. */ #ifdef USE_SHAPE -void HandleShapeEvent(const XShapeEvent *event) { - +void HandleShapeEvent(const XShapeEvent *event) +{ ClientNode *np; - np = FindClientByWindow(event->window); if(np) { - SetShape(np); + np->state.status |= STAT_SHAPED; + ResetBorder(np); } - } #endif /* USE_SHAPE */ /** Handle a colormap event. */ -void HandleColormapChange(const XColormapEvent *event) { +void HandleColormapChange(const XColormapEvent *event) +{ ClientNode *np; - if(event->new == True) { np = FindClientByWindow(event->window); if(np) { @@ -1084,122 +1378,112 @@ UpdateClientColormap(np); } } - } /** Handle a map request. */ -void HandleMapRequest(const XMapEvent *event) { - +void HandleMapRequest(const XMapEvent *event) +{ ClientNode *np; - Assert(event); - - if(CheckSwallowMap(event)) { + if(CheckSwallowMap(event->window)) { return; } - np = FindClientByWindow(event->window); if(!np) { - JXSync(display, False); - JXGrabServer(display); + GrabServer(); np = AddClientWindow(event->window, 0, 1); if(np) { - if(focusModel == FOCUS_CLICK && !(np->state.status & STAT_NOFOCUS)) { + if(!(np->state.status & STAT_NOFOCUS)) { FocusClient(np); } } else { JXMapWindow(display, event->window); } - JXSync(display, False); - JXUngrabServer(display); + UngrabServer(); } else { if(!(np->state.status & STAT_MAPPED)) { - np->state = ReadWindowState(np->window); + UpdateState(np); np->state.status |= STAT_MAPPED; + XMapWindow(display, np->window); + XMapWindow(display, np->parent); if(!(np->state.status & STAT_STICKY)) { np->state.desktop = currentDesktop; } - JXMapWindow(display, np->window); - JXMapWindow(display, np->parent); if(!(np->state.status & STAT_NOFOCUS)) { - RaiseClient(np); FocusClient(np); + RaiseClient(np); } - UpdateTaskBar(); - UpdatePager(); + WriteState(np); + RequireTaskUpdate(); + RequirePagerUpdate(); } } - RestackClients(); + RequireRestack(); } /** Handle an unmap notify event. */ -void HandleUnmapNotify(const XUnmapEvent *event) { - +void HandleUnmapNotify(const XUnmapEvent *event) +{ ClientNode *np; XEvent e; Assert(event); - np = FindClientByWindow(event->window); - if(np && np->window == event->window) { - - if(JXCheckTypedWindowEvent(display, np->window, DestroyNotify, &e)) { - UpdateTime(&e); - HandleDestroyNotify(&e.xdestroywindow); + if(event->window != event->event) { + /* Allow ICCCM synthetic UnmapNotify events through. */ + if (event->event != rootWindow || !event->send_event) { return; } + } + + np = FindClientByWindow(event->window); + if(np) { + + /* Grab the server to prevent the client from destroying the + * window after we check for a DestroyNotify. */ + GrabServer(); if(np->controller) { (np->controller)(1); } - if(np->state.status & STAT_MAPPED) { - + if(JXCheckTypedWindowEvent(display, np->window, DestroyNotify, &e)) { + UpdateTime(&e); + RemoveClient(np); + } else if((np->state.status & STAT_MAPPED) || event->send_event) { np->state.status &= ~STAT_MAPPED; - JXUnmapWindow(display, np->parent); - + JXUngrabButton(display, AnyButton, AnyModifier, np->window); + GravitateClient(np, 1); + JXReparentWindow(display, np->window, rootWindow, np->x, np->y); WriteState(np); - UpdateTaskBar(); - UpdatePager(); - - if(np->state.status & STAT_ACTIVE) { - FocusNextStacked(np); - } - + JXRemoveFromSaveSet(display, np->window); + RemoveClient(np); } + UngrabServer(); } - } /** Handle a destroy notify event. */ -int HandleDestroyNotify(const XDestroyWindowEvent *event) { - +char HandleDestroyNotify(const XDestroyWindowEvent *event) +{ ClientNode *np; - np = FindClientByWindow(event->window); - if(np && np->window == event->window) { - + if(np) { if(np->controller) { (np->controller)(1); } - RemoveClient(np); - return 1; - - } else if(!np) { - + } else { return HandleDockDestroy(event->window); - } - - return 0; - } /** Take the appropriate action for a click on a client border. */ -void DispatchBorderButtonEvent(const XButtonEvent *event, ClientNode *np) { +void DispatchBorderButtonEvent(const XButtonEvent *event, + ClientNode *np) +{ static Time lastClickTime = 0; static int lastX = 0, lastY = 0; @@ -1207,75 +1491,165 @@ BorderActionType action; int bsize; + /* Middle click starts a move unless it's over the maximize button. */ action = GetBorderActionType(np, event->x, event->y); + if(event->button == Button2 && action != BA_MAXIMIZE) { + MoveClient(np, event->x, event->y); + return; + } + /* Determine the size of the border. */ + if(np->state.border & BORDER_OUTLINE) { + bsize = settings.borderWidth; + } else { + bsize = 0; + } + + /* Other buttons are context sensitive. */ switch(action & 0x0F) { - case BA_RESIZE: + case BA_RESIZE: /* Border */ if(event->type == ButtonPress) { - ResizeClient(np, action, event->x, event->y); + if(event->button == Button1) { + ResizeClient(np, action, event->x, event->y); + } else if(event->button == Button3) { + ShowWindowMenu(np, np->x + event->x - bsize, + np->y + event->y - settings.titleHeight - bsize); + } } break; - case BA_MOVE: - if(event->type == ButtonPress) { - if(doubleClickActive - && abs(event->time - lastClickTime) > 0 - && abs(event->time - lastClickTime) <= doubleClickSpeed - && abs(event->x - lastX) <= doubleClickDelta - && abs(event->y - lastY) <= doubleClickDelta) { - MaximizeClientDefault(np); - doubleClickActive = 0; - } else { - if(MoveClient(np, event->x, event->y, - (event->state & Mod1Mask) ? 0 : 1)) { + case BA_MOVE: /* Title bar */ + if(event->button == Button1) { + if(event->type == ButtonPress) { + if(doubleClickActive + && event->time != lastClickTime + && event->time - lastClickTime <= settings.doubleClickSpeed + && abs(event->x - lastX) <= settings.doubleClickDelta + && abs(event->y - lastY) <= settings.doubleClickDelta) { + MaximizeClientDefault(np); doubleClickActive = 0; } else { - doubleClickActive = 1; - lastClickTime = event->time; - lastX = event->x; - lastY = event->y; + if(MoveClient(np, event->x, event->y)) { + doubleClickActive = 0; + } else { + doubleClickActive = 1; + lastClickTime = event->time; + lastX = event->x; + lastY = event->y; + } } } + } else if(event->button == Button3) { + ShowWindowMenu(np, np->x + event->x - bsize, + np->y + event->y - settings.titleHeight - bsize); + } else if(event->button == Button4) { + ShadeClient(np); + } else if(event->button == Button5) { + UnshadeClient(np); } break; - case BA_MENU: - if(event->type == ButtonPress) { - if(np->state.border & BORDER_OUTLINE) { - bsize = borderWidth; - } else { - bsize = 0; - } + case BA_MENU: /* Menu button */ + if(event->button == Button4) { + ShadeClient(np); + } else if(event->button == Button5) { + UnshadeClient(np); + } else if(event->type == ButtonPress) { ShowWindowMenu(np, np->x + event->x - bsize, - np->y + event->y - titleHeight - bsize); + np->y + event->y - settings.titleHeight - bsize); } break; - case BA_CLOSE: - if(event->type == ButtonRelease) { + case BA_CLOSE: /* Close button */ + if(event->type == ButtonRelease + && (event->button == Button1 || event->button == Button3)) { DeleteClient(np); } break; - case BA_MAXIMIZE: + case BA_MAXIMIZE: /* Maximize button */ if(event->type == ButtonRelease) { - MaximizeClientDefault(np); + switch(event->button) { + case Button1: + MaximizeClientDefault(np); + break; + case Button2: + MaximizeClient(np, np->state.maxFlags ^ MAX_VERT); + break; + case Button3: + MaximizeClient(np, np->state.maxFlags ^ MAX_HORIZ); + break; + default: + break; + } } break; - case BA_MINIMIZE: + case BA_MINIMIZE: /* Minimize button */ if(event->type == ButtonRelease) { - MinimizeClient(np); + if(event->button == Button3) { + if(np->state.status & STAT_SHADED) { + UnshadeClient(np); + } else { + ShadeClient(np); + } + } else if(event->button == Button1) { + MinimizeClient(np, 1); + } } break; default: break; } + DiscardEnterEvents(); +} + +/** Update window state information. */ +void UpdateState(ClientNode *np) +{ + char alreadyMapped; + + /* Remove from the layer list. */ + if(np->prev != NULL) { + np->prev->next = np->next; + } else { + Assert(nodes[np->state.layer] == np); + nodes[np->state.layer] = np->next; + } + if(np->next != NULL) { + np->next->prev = np->prev; + } else { + Assert(nodeTail[np->state.layer] == np); + nodeTail[np->state.layer] = np->prev; + } + + /* Read the state (and new layer). */ + alreadyMapped = (np->state.status & STAT_MAPPED) ? 1 : 0; + if(np->state.status & STAT_URGENT) { + UnregisterCallback(SignalUrgent, np); + } + np->state = ReadWindowState(np->window, alreadyMapped); + if(np->state.status & STAT_URGENT) { + RegisterCallback(URGENCY_DELAY, SignalUrgent, np); + } + + /* We don't handle mapping the window, so restore its mapped state. */ + if(!alreadyMapped) { + np->state.status &= ~STAT_MAPPED; + } + + /* Add to the layer list. */ + np->prev = NULL; + np->next = nodes[np->state.layer]; + if(np->next == NULL) { + nodeTail[np->state.layer] = np; + } else { + np->next->prev = np; + } + nodes[np->state.layer] = np; } /** Update the last event time. */ -void UpdateTime(const XEvent *event) { - +void UpdateTime(const XEvent *event) +{ Time t = CurrentTime; - Assert(event); - switch(event->type) { case KeyPress: case KeyRelease: @@ -1283,7 +1657,7 @@ break; case ButtonPress: case ButtonRelease: - t = event->xkey.time; + t = event->xbutton.time; break; case MotionNotify: t = event->xmotion.time; @@ -1307,12 +1681,56 @@ default: break; } - if(t != CurrentTime) { if(t > eventTime || t < eventTime - 60000) { eventTime = t; } } +} + +/** Register a callback. */ +void RegisterCallback(int freq, SignalCallback callback, void *data) +{ + CallbackNode *cp; + cp = Allocate(sizeof(CallbackNode)); + cp->last.seconds = 0; + cp->last.ms = 0; + cp->freq = freq; + cp->callback = callback; + cp->data = data; + cp->next = callbacks; + callbacks = cp; +} + +/** Unregister a callback. */ +void UnregisterCallback(SignalCallback callback, void *data) +{ + CallbackNode **cp; + for(cp = &callbacks; *cp; cp = &(*cp)->next) { + if((*cp)->callback == callback && (*cp)->data == data) { + CallbackNode *temp = *cp; + *cp = (*cp)->next; + Release(temp); + return; + } + } + Assert(0); +} +/** Restack clients before waiting for an event. */ +void RequireRestack() +{ + restack_pending = 1; } +/** Update the task bar before waiting for an event. */ +void RequireTaskUpdate() +{ + task_update_pending = 1; +} + +/** Update the pager before waiting for an event. */ +void RequirePagerUpdate() +{ + pager_update_pending = 1; +} diff -Nru jwm-2.1.0+svn579/src/event.h jwm-2.3.1+0~16~ubuntu14.10.1/src/event.h --- jwm-2.1.0+svn579/src/event.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/event.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,11 +10,20 @@ #ifndef EVENT_H #define EVENT_H +struct TimeType; + +typedef void (*SignalCallback)(const struct TimeType *now, + int x, int y, + Window w, + void *data); + /** Last event time. */ extern Time eventTime; -/** Wait for an event and process it. */ -void WaitForEvent(); +/** Wait for an event and process it. + * @return 1 if there is an event to process, 0 otherwise. + */ +char WaitForEvent(XEvent *event); /** Process an event. * @param event The event to process. @@ -27,10 +36,38 @@ */ void DiscardMotionEvents(XEvent *event, Window w); +/** Discard excess key events. + * @param event The event to return. + * @param w The window whose events to discard. + */ +void DiscardKeyEvents(XEvent *event, Window w); + /** Update the last event time. * @param event The event containing the time to use. */ void UpdateTime(const XEvent *event); +/** Register a callback. + * @param freq The frequency in milliseconds. + * @param callback The callback function. + * @param data Data to pass to the callback. + */ +void RegisterCallback(int freq, SignalCallback callback, void *data); + +/** Unregister a callback. + * @param callback The callback to remove. + * @param data The data passed to the register function. + */ +void UnregisterCallback(SignalCallback callback, void *data); + +/** Restack clients before waiting for an event. */ +void RequireRestack(); + +/** Update the task bar before waiting for an event. */ +void RequireTaskUpdate(); + +/** Update the pager before waiting for an event. */ +void RequirePagerUpdate(); + #endif /* EVENT_H */ diff -Nru jwm-2.1.0+svn579/src/font.c jwm-2.3.1+0~16~ubuntu14.10.1/src/font.c --- jwm-2.1.0+svn579/src/font.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/font.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,40 +11,72 @@ #include "font.h" #include "main.h" #include "error.h" -#include "color.h" #include "misc.h" -static const char *DEFAULT_FONT = "-*-courier-*-r-*-*-14-*-*-*-*-*-*-*"; +#ifdef USE_ICONV +# ifdef HAVE_LANGINFO_H +# include +# endif +# ifdef HAVE_ICONV_H +# include +# endif +#endif + +#ifdef USE_XFT +static const char *DEFAULT_FONT = "FreeSans-9"; +#else +static const char *DEFAULT_FONT = "fixed"; +#endif + +static char *GetUTF8String(const char *str); +static void ReleaseUTF8String(char *utf8String); static char *fontNames[FONT_COUNT]; +#ifdef USE_ICONV +static const char *UTF8_CODESET = "UTF-8"; +static iconv_t fromUTF8 = (iconv_t)-1; +static iconv_t toUTF8 = (iconv_t)-1; +#endif + #ifdef USE_XFT static XftFont *fonts[FONT_COUNT]; #else static XFontStruct *fonts[FONT_COUNT]; -static GC fontGC; #endif /** Initialize font data. */ -void InitializeFonts() { - - int x; +void InitializeFonts(void) +{ +#ifdef USE_ICONV + const char *codeset; +#endif + unsigned int x; for(x = 0; x < FONT_COUNT; x++) { fonts[x] = NULL; fontNames[x] = NULL; } + /* Allocate a conversion descriptor if we're not using UTF-8. */ +#ifdef USE_ICONV + codeset = nl_langinfo(CODESET); + if(strcmp(codeset, UTF8_CODESET)) { + toUTF8 = iconv_open(UTF8_CODESET, codeset); + fromUTF8 = iconv_open(codeset, UTF8_CODESET); + } else { + toUTF8 = (iconv_t)-1; + fromUTF8 = (iconv_t)-1; + } +#endif + } /** Startup font support. */ -void StartupFonts() { +void StartupFonts(void) +{ -#ifndef USE_XFT - XGCValues gcValues; - unsigned long gcMask; -#endif - int x; + unsigned int x; /* Inherit unset fonts from the tray for tray items. */ if(!fontNames[FONT_TASK]) { @@ -73,7 +105,7 @@ } } if(!fonts[x]) { - fonts[x] = JXftFontOpenXlfd(display, rootScreen, DEFAULT_FONT); + fonts[x] = JXftFontOpenName(display, rootScreen, DEFAULT_FONT); } if(JUNLIKELY(!fonts[x])) { FatalError(_("could not load the default font: %s"), DEFAULT_FONT); @@ -97,19 +129,14 @@ } } - gcMask = GCGraphicsExposures; - gcValues.graphics_exposures = False; - fontGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); - #endif /* USE_XFT */ } /** Shutdown font support. */ -void ShutdownFonts() { - - int x; - +void ShutdownFonts(void) +{ + unsigned int x; for(x = 0; x < FONT_COUNT; x++) { if(fonts[x]) { #ifdef USE_XFT @@ -120,176 +147,280 @@ fonts[x] = NULL; } } - -#ifndef USE_XFT - - JXFreeGC(display, fontGC); - -#endif - - } /** Destroy font data. */ -void DestroyFonts() { - - int x; - +void DestroyFonts(void) +{ + unsigned int x; for(x = 0; x < FONT_COUNT; x++) { if(fontNames[x]) { Release(fontNames[x]); fontNames[x] = NULL; } } +#ifdef USE_ICONV + if(fromUTF8 != (iconv_t)-1) { + iconv_close(fromUTF8); + fromUTF8 = (iconv_t)-1; + } + if(toUTF8 != (iconv_t)-1) { + iconv_close(toUTF8); + toUTF8 = (iconv_t)-1; + } +#endif +} + +/** Convert a string from UTF-8. */ +char *ConvertFromUTF8(char *str) +{ + char *result = (char*)str; +#ifdef USE_ICONV + if(fromUTF8 != (iconv_t)-1) { + char *inBuf = (char*)str; + char *outBuf; + size_t inLeft = strlen(str); + size_t outLeft = 4 * inLeft; + size_t rc; + result = Allocate(outLeft + 1); + outBuf = result; + rc = iconv(fromUTF8, &inBuf, &inLeft, &outBuf, &outLeft); + if(rc == (size_t)-1) { + Warning("iconv conversion from UTF-8 failed"); + iconv_close(fromUTF8); + fromUTF8 = (iconv_t)-1; + Release(result); + result = (char*)str; + } else { + Release(str); + *outBuf = 0; + } + } +#endif + return result; +} +/** Convert a string to UTF-8. */ +char *GetUTF8String(const char *str) +{ + char *utf8String = (char*)str; +#ifdef USE_ICONV + if(toUTF8 != (iconv_t)-1) { + char *inBuf = (char*)str; + char *outBuf; + size_t inLeft = strlen(str); + size_t outLeft = 4 * inLeft; + size_t rc; + utf8String = Allocate(outLeft + 1); + outBuf = utf8String; + rc = iconv(toUTF8, &inBuf, &inLeft, &outBuf, &outLeft); + if(rc == (size_t)-1) { + Warning("iconv conversion to UTF-8 failed"); + iconv_close(toUTF8); + toUTF8 = (iconv_t)-1; + Release(utf8String); + utf8String = (char*)str; + } else { + *outBuf = 0; + } + } +#endif + return utf8String; +} + +/** Release a UTF-8 string. */ +void ReleaseUTF8String(char *utf8String) +{ +#ifdef USE_ICONV + if(toUTF8 != (iconv_t)-1) { + Release(utf8String); + } +#endif } /** Get the width of a string. */ -int GetStringWidth(FontType type, const char *str) { +int GetStringWidth(FontType ft, const char *str) +{ #ifdef USE_XFT - XGlyphInfo extents; - unsigned int length; - - Assert(str); - Assert(fonts[type]); - - length = strlen(str); +#endif +#ifdef USE_FRIBIDI + FriBidiChar *temp_i; + FriBidiChar *temp_o; + FriBidiParType type = FRIBIDI_PAR_ON; + int unicodeLength; +#endif + int len; + char *output; + int result; + char *utf8String; - JXftTextExtentsUtf8(display, fonts[type], (const unsigned char*)str, - length, &extents); + /* Convert to UTF-8 if necessary. */ + utf8String = GetUTF8String(str); - return extents.xOff; + /* Length of the UTF-8 string. */ + len = strlen(utf8String); + /* Apply the bidi algorithm if requested. */ +#ifdef USE_FRIBIDI + temp_i = AllocateStack((len + 1) * sizeof(FriBidiChar)); + temp_o = AllocateStack((len + 1) * sizeof(FriBidiChar)); + unicodeLength = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, + utf8String, len, temp_i); + fribidi_log2vis(temp_i, unicodeLength, &type, temp_o, NULL, NULL, NULL); + output = AllocateStack(4 * len + 1); + fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, temp_o, unicodeLength, + (char*)output); + len = strlen(output); #else + output = utf8String; +#endif - Assert(str); - Assert(fonts[type]); - - return XTextWidth(fonts[type], str, strlen(str)); + /* Get the width of the string. */ +#ifdef USE_XFT + JXftTextExtentsUtf8(display, fonts[ft], (const unsigned char*)output, + len, &extents); + result = extents.xOff; +#else + result = XTextWidth(fonts[ft], output, len); +#endif + /* Clean up. */ +#ifdef USE_FRIBIDI + ReleaseStack(temp_i); + ReleaseStack(temp_o); + ReleaseStack(output); #endif + ReleaseUTF8String(utf8String); + + return result; } /** Get the height of a string. */ -int GetStringHeight(FontType type) { - - Assert(fonts[type]); - - return fonts[type]->ascent + fonts[type]->descent; - +int GetStringHeight(FontType ft) +{ + Assert(fonts[ft]); + return fonts[ft]->ascent + fonts[ft]->descent; } /** Set the font to use for a component. */ -void SetFont(FontType type, const char *value) { - +void SetFont(FontType type, const char *value) +{ if(JUNLIKELY(!value)) { Warning(_("empty Font tag")); return; } - if(fontNames[type]) { Release(fontNames[type]); } - fontNames[type] = CopyString(value); - } /** Display a string. */ -void RenderString(Drawable d, FontType font, ColorType color, - int x, int y, int width, Region region, const char *str) { - -#ifdef USE_XFT - XftDraw *xd; -#endif - +void RenderString(const VisualData *visual, Drawable d, + FontType font, ColorType color, + int x, int y, int width, const char *str) +{ XRectangle rect; Region renderRegion; int len; char *output; - #ifdef USE_FRIBIDI - - FriBidiChar *temp; - FriBidiCharType type = FRIBIDI_TYPE_ON; + FriBidiChar *temp_i; + FriBidiChar *temp_o; + FriBidiParType type = FRIBIDI_PAR_ON; int unicodeLength; - #endif +#ifdef USE_XFT + XftDraw *xd; + XGlyphInfo extents; +#else + XGCValues gcValues; + unsigned long gcMask; + GC gc; +#endif + char *utf8String; - if(!str) { + /* Early return for empty strings. */ + if(!str || !str[0]) { return; } - len = strlen(str); - if(len == 0) { - return; - } + /* Convert to UTF-8 if necessary. */ + utf8String = GetUTF8String(str); - /* Get the bounds for the string based on the specified width. */ - rect.x = x; - rect.y = y; - rect.width = Min(GetStringWidth(font, str), width) + 2; - rect.height = GetStringHeight(font); + /* Get the length of the UTF-8 string. */ + len = strlen(utf8String); - /* Create a region to use. */ - renderRegion = XCreateRegion(); +#ifdef USE_XFT + xd = XftDrawCreate(display, d, visual->visual, rootColormap); +#else + gcMask = GCGraphicsExposures; + gcValues.graphics_exposures = False; + gc = JXCreateGC(display, d, gcMask, &gcValues); +#endif - /* Combine the width bounds with the region to use. */ - XUnionRectWithRegion(&rect, renderRegion, renderRegion); - /* Combine the provided region with the region to use. */ - if(region) { - XIntersectRegion(region, renderRegion, renderRegion); - } - /* Apply the bidi algorithm if requested. */ - #ifdef USE_FRIBIDI - - temp = AllocateStack((len + 1) * sizeof(FriBidiChar)); - unicodeLength = fribidi_utf8_to_unicode((char*)str, len, temp); - - fribidi_log2vis(temp, unicodeLength, &type, temp, NULL, NULL, NULL); - - fribidi_unicode_to_utf8(temp, len, (char*)temp); - output = (char*)temp; - + temp_i = AllocateStack((len + 1) * sizeof(FriBidiChar)); + temp_o = AllocateStack((len + 1) * sizeof(FriBidiChar)); + unicodeLength = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, + utf8String, len, temp_i); + fribidi_log2vis(temp_i, unicodeLength, &type, temp_o, NULL, NULL, NULL); + output = AllocateStack(4 * len + 1); + fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, temp_o, unicodeLength, + (char*)output); + len = strlen(output); #else + output = utf8String; +#endif - output = (char*)str; - + /* Get the bounds for the string based on the specified width. */ + rect.x = x; + rect.y = y; + rect.height = GetStringHeight(font); +#ifdef USE_XFT + JXftTextExtentsUtf8(display, fonts[font], (const unsigned char*)output, + len, &extents); + rect.width = extents.xOff; +#else + rect.width = XTextWidth(fonts[font], output, len); #endif + rect.width = Min(rect.width, width) + 2; - /* Display the string. */ + /* Combine the width bounds with the region to use. */ + renderRegion = XCreateRegion(); + XUnionRectWithRegion(&rect, renderRegion, renderRegion); + /* Display the string. */ #ifdef USE_XFT - - xd = XftDrawCreate(display, d, rootVisual, rootColormap); - XftDrawSetClip(xd, renderRegion); + JXftDrawSetClip(xd, renderRegion); JXftDrawStringUtf8(xd, GetXftColor(color), fonts[font], x, y + fonts[font]->ascent, (const unsigned char*)output, len); - XftDrawDestroy(xd); - + JXftDrawChange(xd, rootWindow); #else - - JXSetForeground(display, fontGC, colors[color]); - XSetRegion(display, fontGC, renderRegion); - JXSetFont(display, fontGC, fonts[font]->fid); - JXDrawString(display, d, fontGC, x, y + fonts[font]->ascent, output, len); - + JXSetForeground(display, gc, colors[color]); + JXSetRegion(display, gc, renderRegion); + JXSetFont(display, gc, fonts[font]->fid); + JXDrawString(display, d, gc, x, y + fonts[font]->ascent, output, len); #endif /* Free any memory used for UTF conversion. */ - #ifdef USE_FRIBIDI - + ReleaseStack(temp_i); + ReleaseStack(temp_o); ReleaseStack(output); - #endif + ReleaseUTF8String(utf8String); XDestroyRegion(renderRegion); -} +#ifdef USE_XFT + XftDrawDestroy(xd); +#else + JXFreeGC(display, gc); +#endif +} diff -Nru jwm-2.1.0+svn579/src/font.h jwm-2.3.1+0~16~ubuntu14.10.1/src/font.h --- jwm-2.1.0+svn579/src/font.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/font.h 2015-07-18 20:02:18.000000000 +0000 @@ -12,26 +12,24 @@ #include "color.h" -/** Enumeration of different components that use fonts. */ -typedef enum { +struct VisualData; - FONT_BORDER, - FONT_MENU, - FONT_TASK, - FONT_POPUP, - FONT_CLOCK, - FONT_TRAY, - FONT_TRAYBUTTON, - FONT_PAGER, - - FONT_COUNT - -} FontType; - -void InitializeFonts(); -void StartupFonts(); -void ShutdownFonts(); -void DestroyFonts(); +/** Enumeration of different components that use fonts. */ +typedef unsigned char FontType; +#define FONT_BORDER 0 +#define FONT_MENU 1 +#define FONT_TASK 2 +#define FONT_POPUP 3 +#define FONT_CLOCK 4 +#define FONT_TRAY 5 +#define FONT_TRAYBUTTON 6 +#define FONT_PAGER 7 +#define FONT_COUNT 8 + +void InitializeFonts(void); +void StartupFonts(void); +void ShutdownFonts(void); +void DestroyFonts(void); /** Set the font to use for a component. * @param type The font component. @@ -40,30 +38,37 @@ void SetFont(FontType type, const char *value); /** Render a string. + * @param visual The visual and depth. * @param d The drawable on which to render the string. * @param font The font to use. * @param color The text color to use. * @param x The x-coordinate at which to render. * @param y The y-coordinate at which to render. * @param width The maximum width allowed. - * @param region A clip region (may be None). * @param str The string to render. */ -void RenderString(Drawable d, FontType font, ColorType color, - int x, int y, int width, Region region, const char *str); +void RenderString(const struct VisualData *visual, Drawable d, + FontType font, ColorType color, + int x, int y, int width, const char *str); /** Get the width of a string. - * @param type The font used to determine the width. + * @param ft The font used to determine the width. * @param str The string whose width to get. * @return The width of the string in pixels. */ -int GetStringWidth(FontType type, const char *str); +int GetStringWidth(FontType ft, const char *str); /** Get the height of a string. - * @param type The font used to determine the height. + * @param ft The font used to determine the height. * @return The height in pixels. */ -int GetStringHeight(FontType type); +int GetStringHeight(FontType ft); + +/** Convert a string from UTF-8. + * Note that the string passed into this function is freed via Release + * if the same string is not returned from the function. + */ +char *ConvertFromUTF8(char *str); #endif /* FONT_H */ diff -Nru jwm-2.1.0+svn579/src/grab.c jwm-2.3.1+0~16~ubuntu14.10.1/src/grab.c --- jwm-2.1.0+svn579/src/grab.c 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/grab.c 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,34 @@ +/** + * @file grab.c + * @author Joe Wingbermuehle + * @date 2013 + * + * @brief Functions for managing server grabs. + * + */ + +#include "jwm.h" +#include "main.h" + +static unsigned int grabCount = 0; + +/** Grab the server and sync. */ +void GrabServer(void) +{ + if(grabCount == 0) { + JXGrabServer(display); + JXSync(display, False); + } + grabCount += 1; +} + +/** Ungrab the server. */ +void UngrabServer(void) +{ + Assert(grabCount > 0); + grabCount -= 1; + if(grabCount == 0) { + JXUngrabServer(display); + } +} + diff -Nru jwm-2.1.0+svn579/src/grab.h jwm-2.3.1+0~16~ubuntu14.10.1/src/grab.h --- jwm-2.1.0+svn579/src/grab.h 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/grab.h 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,20 @@ +/** + * @file grab.h + * @author Joe Wingbermuehle + * @date 2013 + * + * @brief Header file for managing server grabs. + * + */ + +#ifndef GRAB_H +#define GRAB_H + +/** Grab the server and sync. */ +void GrabServer(void); + +/** Ungrab the server. */ +void UngrabServer(void); + +#endif /* GRAB_H */ + diff -Nru jwm-2.1.0+svn579/src/gradient.c jwm-2.3.1+0~16~ubuntu14.10.1/src/gradient.c --- jwm-2.1.0+svn579/src/gradient.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/gradient.c 2015-07-18 20:02:18.000000000 +0000 @@ -14,8 +14,10 @@ /** Draw a horizontal gradient. */ void DrawHorizontalGradient(Drawable d, GC g, - long fromColor, long toColor, - int x, int y, unsigned int width, unsigned int height) { + long fromColor, long toColor, + int x, int y, + unsigned int width, unsigned int height) +{ const int shift = 15; unsigned int line; diff -Nru jwm-2.1.0+svn579/src/gradient.h jwm-2.3.1+0~16~ubuntu14.10.1/src/gradient.h --- jwm-2.1.0+svn579/src/gradient.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/gradient.h 2015-07-18 20:02:18.000000000 +0000 @@ -22,8 +22,9 @@ * @param height The height of the area to fill. */ void DrawHorizontalGradient(Drawable d, GC g, - long fromColor, long toColor, - int x, int y, unsigned int width, unsigned int height); + long fromColor, long toColor, + int x, int y, + unsigned int width, unsigned int height); #endif /* GRADIENT_H */ diff -Nru jwm-2.1.0+svn579/src/group.c jwm-2.3.1+0~16~ubuntu14.10.1/src/group.c --- jwm-2.1.0+svn579/src/group.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/group.c 2015-07-18 20:02:18.000000000 +0000 @@ -13,15 +13,13 @@ #include "icon.h" #include "error.h" #include "match.h" -#include "desktop.h" -#include "main.h" #include "misc.h" +#include "settings.h" /** What part of the window to match. */ -typedef enum { - MATCH_NAME, /**< Match the window name. */ - MATCH_CLASS /**< Match the window class. */ -} MatchType; +typedef unsigned int MatchType; +#define MATCH_NAME 0 /**< Match the window name. */ +#define MATCH_CLASS 1 /**< Match the window class. */ /** List of match patterns for a group. */ typedef struct PatternListType { @@ -33,7 +31,8 @@ /** List of options for a group. */ typedef struct OptionListType { OptionType option; - char *value; + char *svalue; + unsigned int uvalue; struct OptionListType *next; } OptionListType; @@ -52,23 +51,10 @@ MatchType match); static void ApplyGroup(const GroupType *gp, ClientNode *np); -/** Initialize group data. */ -void InitializeGroups() { -} - -/** Startup group support. */ -void StartupGroups() { -} - -/** Shutdown group support. */ -void ShutdownGroups() { -} - /** Destroy group data. */ -void DestroyGroups() { - +void DestroyGroups(void) +{ GroupType *gp; - while(groups) { gp = groups->next; ReleasePatternList(groups->patterns); @@ -76,127 +62,121 @@ Release(groups); groups = gp; } - } /** Release a group pattern list. */ -void ReleasePatternList(PatternListType *lp) { - +void ReleasePatternList(PatternListType *lp) +{ PatternListType *tp; - while(lp) { tp = lp->next; Release(lp->pattern); Release(lp); lp = tp; } - } /** Release a group option list. */ -void ReleaseOptionList(OptionListType *lp) { - +void ReleaseOptionList(OptionListType *lp) +{ OptionListType *tp; - while(lp) { tp = lp->next; - if(lp->value) { - Release(lp->value); + if(lp->svalue) { + Release(lp->svalue); } Release(lp); lp = tp; } - } /** Create an empty group. */ -GroupType *CreateGroup() { +GroupType *CreateGroup(void) +{ GroupType *tp; - tp = Allocate(sizeof(GroupType)); tp->patterns = NULL; tp->options = NULL; tp->next = groups; groups = tp; - return tp; } /** Add a window class to a group. */ -void AddGroupClass(GroupType *gp, const char *pattern) { - +void AddGroupClass(GroupType *gp, const char *pattern) +{ Assert(gp); - if(JLIKELY(pattern)) { AddPattern(&gp->patterns, pattern, MATCH_CLASS); } else { Warning(_("invalid group class")); } - } /** Add a window name to a group. */ -void AddGroupName(GroupType *gp, const char *pattern) { - +void AddGroupName(GroupType *gp, const char *pattern) +{ Assert(gp); - if(JLIKELY(pattern)) { AddPattern(&gp->patterns, pattern, MATCH_NAME); } else { Warning(_("invalid group name")); } - } /** Add a pattern to a pattern list. */ -void AddPattern(PatternListType **lp, const char *pattern, MatchType match) { - +void AddPattern(PatternListType **lp, const char *pattern, MatchType match) +{ PatternListType *tp; - Assert(lp); Assert(pattern); - tp = Allocate(sizeof(PatternListType)); tp->next = *lp; *lp = tp; - tp->pattern = CopyString(pattern); tp->match = match; - } /** Add an option to a group. */ -void AddGroupOption(GroupType *gp, OptionType option) { - +void AddGroupOption(GroupType *gp, OptionType option) +{ OptionListType *lp; - lp = Allocate(sizeof(OptionListType)); lp->option = option; - lp->value = NULL; + lp->svalue = NULL; lp->next = gp->options; gp->options = lp; - } -/** Add an option (with value) to a group. */ -void AddGroupOptionValue(GroupType *gp, OptionType option, - const char *value) { - +/** Add an option (with a string) to a group. */ +void AddGroupOptionString(GroupType *gp, OptionType option, + const char *value) +{ OptionListType *lp; - Assert(value); - lp = Allocate(sizeof(OptionListType)); lp->option = option; - lp->value = CopyString(value); + lp->svalue = CopyString(value); lp->next = gp->options; gp->options = lp; - } +/** Add an option (with an unsigned integer) to a group. */ +void AddGroupOptionUnsigned(GroupType *gp, OptionType option, + unsigned int value) +{ + OptionListType *lp; + Assert(value); + lp = Allocate(sizeof(OptionListType)); + lp->option = option; + lp->svalue = NULL; + lp->uvalue = value; + lp->next = gp->options; + gp->options = lp; +} /** Apply groups to a client. */ -void ApplyGroups(ClientNode *np) { - +void ApplyGroups(ClientNode *np) +{ PatternListType *lp; GroupType *gp; char hasClass; @@ -205,7 +185,6 @@ char matchesName; Assert(np); - for(gp = groups; gp; gp = gp->next) { hasClass = 0; hasName = 0; @@ -234,15 +213,13 @@ } /** Apply a group to a client. */ -void ApplyGroup(const GroupType *gp, ClientNode *np) { +void ApplyGroup(const GroupType *gp, ClientNode *np) +{ OptionListType *lp; - unsigned int temp; - double tempf; Assert(gp); Assert(np); - for(lp = gp->options; lp; lp = lp->next) { switch(lp->option) { case OPTION_STICKY: @@ -251,6 +228,9 @@ case OPTION_NOLIST: np->state.status |= STAT_NOLIST; break; + case OPTION_NOPAGER: + np->state.status |= STAT_NOPAGER; + break; case OPTION_BORDER: np->state.border |= BORDER_OUTLINE; break; @@ -262,32 +242,30 @@ break; case OPTION_NOTITLE: np->state.border &= ~BORDER_TITLE; + np->state.border &= ~BORDER_SHADE; break; case OPTION_LAYER: - temp = atoi(lp->value); - if(JLIKELY(temp <= LAYER_COUNT)) { - SetClientLayer(np, temp); - } else { - Warning(_("invalid group layer: %s"), lp->value); - } + np->state.layer = lp->uvalue; break; case OPTION_DESKTOP: - temp = atoi(lp->value); - if(JLIKELY(temp >= 1 && temp <= desktopCount)) { - np->state.desktop = temp - 1; + if(JLIKELY(lp->uvalue >= 1 && lp->uvalue <= settings.desktopCount)) { + np->state.desktop = lp->uvalue - 1; } else { - Warning(_("invalid group desktop: %s"), lp->value); + Warning(_("invalid group desktop: %d"), lp->uvalue); } break; case OPTION_ICON: DestroyIcon(np->icon); - np->icon = LoadNamedIcon(lp->value); + np->icon = LoadNamedIcon(lp->svalue, 1, 1); break; case OPTION_PIGNORE: np->state.status |= STAT_PIGNORE; break; + case OPTION_IIGNORE: + np->state.status |= STAT_IIGNORE; + break; case OPTION_MAXIMIZED: - np->state.status |= STAT_HMAX | STAT_VMAX; + np->state.maxFlags |= MAX_HORIZ | MAX_VERT; break; case OPTION_MINIMIZED: np->state.status |= STAT_MINIMIZED; @@ -296,13 +274,8 @@ np->state.status |= STAT_SHADED; break; case OPTION_OPACITY: - tempf = atof(lp->value); - if(JLIKELY(tempf > 0.0 && tempf <= 1.0)) { - np->state.opacity = (unsigned int)(tempf * UINT_MAX); - np->state.status |= STAT_OPACITY; - } else { - Warning(_("invalid group opacity: %s"), lp->value); - } + np->state.opacity = lp->uvalue; + np->state.status |= STAT_OPACITY; break; case OPTION_MAX_V: np->state.border &= ~BORDER_MAX_H; @@ -313,6 +286,42 @@ case OPTION_NOFOCUS: np->state.status |= STAT_NOFOCUS; break; + case OPTION_NOSHADE: + np->state.border &= ~BORDER_SHADE; + break; + case OPTION_NOMIN: + np->state.border &= ~BORDER_MIN; + break; + case OPTION_NOMAX: + np->state.border &= ~BORDER_MAX; + break; + case OPTION_NOCLOSE: + np->state.border &= ~BORDER_CLOSE; + break; + case OPTION_NOMOVE: + np->state.border &= ~BORDER_MOVE; + break; + case OPTION_NORESIZE: + np->state.border &= ~BORDER_RESIZE; + break; + case OPTION_CENTERED: + np->state.status |= STAT_CENTERED; + break; + case OPTION_TILED: + np->state.status |= STAT_TILED; + break; + case OPTION_NOTURGENT: + np->state.status |= STAT_NOTURGENT; + break; + case OPTION_CONSTRAIN: + np->state.border |= BORDER_CONSTRAIN; + break; + case OPTION_FULLSCREEN: + np->state.status |= STAT_FULLSCREEN; + break; + case OPTION_NOFULLSCREEN: + np->state.border &= ~BORDER_FULLSCREEN; + break; default: Debug("invalid option: %d", lp->option); break; diff -Nru jwm-2.1.0+svn579/src/group.h jwm-2.3.1+0~16~ubuntu14.10.1/src/group.h --- jwm-2.1.0+svn579/src/group.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/group.h 2015-07-18 20:02:18.000000000 +0000 @@ -14,36 +14,51 @@ struct GroupType; /** Enumeration of group options. */ -typedef enum { - OPTION_INVALID = 0, - OPTION_STICKY = 1, /**< Start in the sticky state. */ - OPTION_LAYER = 2, /**< Start on a specific layer. */ - OPTION_DESKTOP = 3, /**< Start on a specific desktop. */ - OPTION_ICON = 4, /**< Set the icon to use. */ - OPTION_NOLIST = 5, /**< Don't display in the task list. */ - OPTION_BORDER = 6, /**< Force a window border. */ - OPTION_NOBORDER = 7, /**< Don't draw a window border. */ - OPTION_TITLE = 8, /**< Force a window title bar. */ - OPTION_NOTITLE = 9, /**< Don't draw a window title bar. */ - OPTION_PIGNORE = 10, /**< Ignore program-specified location. */ - OPTION_MAXIMIZED = 11, /**< Start maximized. */ - OPTION_MINIMIZED = 12, /**< Start minimized. */ - OPTION_SHADED = 13, /**< Start shaded. */ - OPTION_OPACITY = 14, /**< Set the opacity. */ - OPTION_MAX_H = 15, /**< Use horizontal maximization. */ - OPTION_MAX_V = 16, /**< Use vertical maximization. */ - OPTION_NOFOCUS = 17 /**< Don't focus on map. */ -} OptionType; - -void InitializeGroups(); -void StartupGroups(); -void ShutdownGroups(); -void DestroyGroups(); +typedef unsigned char OptionType; +#define OPTION_INVALID 0 +#define OPTION_STICKY 1 /**< Start in the sticky state. */ +#define OPTION_LAYER 2 /**< Start on a specific layer. */ +#define OPTION_DESKTOP 3 /**< Start on a specific desktop. */ +#define OPTION_ICON 4 /**< Set the icon to use. */ +#define OPTION_NOLIST 5 /**< Don't display in the task list. */ +#define OPTION_BORDER 6 /**< Force a window border. */ +#define OPTION_NOBORDER 7 /**< Don't draw a window border. */ +#define OPTION_TITLE 8 /**< Force a window title bar. */ +#define OPTION_NOTITLE 9 /**< Don't draw a window title bar. */ +#define OPTION_PIGNORE 10 /**< Ignore program-specified location. */ +#define OPTION_MAXIMIZED 11 /**< Start maximized. */ +#define OPTION_MINIMIZED 12 /**< Start minimized. */ +#define OPTION_SHADED 13 /**< Start shaded. */ +#define OPTION_OPACITY 14 /**< Set the opacity. */ +#define OPTION_MAX_H 15 /**< Use horizontal maximization. */ +#define OPTION_MAX_V 16 /**< Use vertical maximization. */ +#define OPTION_NOFOCUS 17 /**< Don't focus on map. */ +#define OPTION_NOSHADE 18 /**< Don't allow shading. */ +#define OPTION_CENTERED 19 /**< Centered placement. */ +#define OPTION_TILED 20 /**< Tiled placement. */ +#define OPTION_IIGNORE 21 /**< Ignore increment when maximized. */ +#define OPTION_NOPAGER 22 /**< Do not show in pager. */ +#define OPTION_NOTURGENT 23 /**< Ignore the urgency hint. */ +#define OPTION_CONSTRAIN 24 /**< Constrain the window to the screen. */ +#define OPTION_FULLSCREEN 25 /**< Start fullscreen. */ +#define OPTION_NOMIN 26 /**< Disallow minimization. */ +#define OPTION_NOMAX 27 /**< Disallow maximization. */ +#define OPTION_NOCLOSE 28 /**< Disallow closing (from title bar). */ +#define OPTION_NOMOVE 29 /**< Disallow moving. */ +#define OPTION_NORESIZE 30 /**< Disallow resizing. */ +#define OPTION_NOFULLSCREEN 31 /**< Disallow fullscreen. */ + +/*@{*/ +#define InitializeGroups() (void)(0) +#define StartupGroups() (void)(0) +#define ShutdownGroups() (void)(0) +void DestroyGroups(void); +/*@}*/ /** Create an empty group. * @return An empty group. */ -struct GroupType *CreateGroup(); +struct GroupType *CreateGroup(void); /** Add a window class to a group. * @param gp The group. @@ -63,13 +78,21 @@ */ void AddGroupOption(struct GroupType *gp, OptionType option); -/** Add a group option that takes a value. +/** Add a group option that takes a string. * @param gp The group. * @param option The option. * @param value The option value. */ -void AddGroupOptionValue(struct GroupType *gp, OptionType option, - const char *value); +void AddGroupOptionString(struct GroupType *gp, OptionType option, + const char *value); + +/** Add a group option that takes an unsigned integer. + * @param gp The group. + * @param option The option. + * @param value The option value. + */ +void AddGroupOptionUnsigned(struct GroupType *gp, OptionType option, + unsigned int value); /** Apply any matching groups to a client. * @param np The client. diff -Nru jwm-2.1.0+svn579/src/help.c jwm-2.3.1+0~16~ubuntu14.10.1/src/help.c --- jwm-2.1.0+svn579/src/help.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/help.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,75 +10,81 @@ #include "jwm.h" #include "help.h" +static void DisplayUsage(void); + /** Display program name, version, and compiled options . */ -void DisplayAbout() { - printf("JWM v%s by Joe Wingbermuehle\n", PACKAGE_VERSION); +void DisplayAbout(void) +{ + printf("JWM v" PACKAGE_VERSION " by Joe Wingbermuehle\n"); DisplayCompileOptions(); } /** Display compiled options. */ -void DisplayCompileOptions() { - - printf("compiled options: "); - +void DisplayCompileOptions(void) +{ + printf("compiled options: " #ifndef DISABLE_CONFIRM - printf("confirm "); + "confirm " #endif - #ifdef DEBUG - printf("debug "); + "debug " #endif - #ifdef USE_FRIBIDI - printf("fribidi "); + "fribidi " #endif - #ifdef USE_ICONS - printf("icons "); + "icons " +#endif +#ifdef USE_JPEG + "jpeg " +#endif +#ifdef ENABLE_NLS + "nls " #endif - #ifdef USE_PNG - printf("png "); + "png " #endif - #ifdef USE_SHAPE - printf("shape "); + "shape " +#endif +#if defined(USE_CAIRO) && defined(USE_RSVG) + "svg " +#endif +#ifdef USE_XBM + "xbm " #endif - #ifdef USE_XFT - printf("xft "); + "xft " #endif - #ifdef USE_XINERAMA - printf("xinerama "); + "xinerama " #endif - #ifdef USE_XPM - printf("xpm "); + "xpm " #endif - #ifdef USE_XRENDER - printf("xrender "); + "xrender " #endif - - printf("\nsystem configuration: %s\n", SYSTEM_CONFIG); - + "\nsystem configuration: " SYSTEM_CONFIG "\n"); } /** Display all help. */ -void DisplayHelp() { +void DisplayHelp(void) +{ DisplayUsage(); - printf(" -display X Set the X display to use\n"); - printf(" -exit Exit JWM (send _JWM_EXIT to the root)\n"); - printf(" -h Display this help message\n"); - printf(" -p Parse the configuration file and exit\n"); - printf(" -reload Reload menu (send _JWM_RELOAD to the root)\n"); - printf(" -restart Restart JWM (send _JWM_RESTART to the root)\n"); - printf(" -v Display version information\n"); + printf(" -display X Set the X display to use\n" + " -exit Exit JWM (send _JWM_EXIT to the root)\n" + " -f file Use specified configuration file\n" + " -h Display this help message\n" + " -p Parse the configuration file and exit\n" + " -reload Reload menu (send _JWM_RELOAD to the root)\n" + " -restart Restart JWM (send _JWM_RESTART to the root)\n" + " -v Display version information\n"); } /** Display program usage information. */ -void DisplayUsage() { +void DisplayUsage(void) +{ DisplayAbout(); printf("usage: jwm [ options ]\n"); } diff -Nru jwm-2.1.0+svn579/src/help.h jwm-2.3.1+0~16~ubuntu14.10.1/src/help.h --- jwm-2.1.0+svn579/src/help.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/help.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,16 +11,13 @@ #define HELP_H /** Display program name, version, and compiled options . */ -void DisplayAbout(); +void DisplayAbout(void); /** Display compiled options. */ -void DisplayCompileOptions(); +void DisplayCompileOptions(void); /** Display all help. */ -void DisplayHelp(); - -/** Display program usage information. */ -void DisplayUsage(); +void DisplayHelp(void); #endif /* HELP_H */ diff -Nru jwm-2.1.0+svn579/src/hint.c jwm-2.3.1+0~16~ubuntu14.10.1/src/hint.c --- jwm-2.1.0+svn579/src/hint.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/hint.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,10 +11,10 @@ #include "jwm.h" #include "hint.h" #include "client.h" -#include "main.h" -#include "tray.h" #include "desktop.h" #include "misc.h" +#include "font.h" +#include "settings.h" /* MWM Defines */ #define MWM_HINTS_FUNCTIONS (1L << 0) @@ -66,11 +66,16 @@ Atom atoms[ATOM_COUNT]; +const char jwmRestart[] = "_JWM_RESTART"; +const char jwmExit[] = "_JWM_EXIT"; +const char jwmReload[] = "_JWM_RELOAD"; +const char opacityAtom[] = "_NET_WM_WINDOW_OPACITY"; + static const AtomNode atomList[] = { { &atoms[ATOM_COMPOUND_TEXT], "COMPOUND_TEXT" }, { &atoms[ATOM_UTF8_STRING], "UTF8_STRING" }, - { &atoms[ATOM_XSETROOT_ID], "_XSETROOT_ID" }, + { &atoms[ATOM_XROOTPMAP_ID], "_XROOTPMAP_ID" }, { &atoms[ATOM_WM_STATE], "WM_STATE" }, { &atoms[ATOM_WM_PROTOCOLS], "WM_PROTOCOLS" }, @@ -100,14 +105,18 @@ { &atoms[ATOM_NET_WM_STATE_FULLSCREEN], "_NET_WM_STATE_FULLSCREEN" }, { &atoms[ATOM_NET_WM_STATE_HIDDEN], "_NET_WM_STATE_HIDDEN" }, { &atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR], "_NET_WM_STATE_SKIP_TASKBAR" }, + { &atoms[ATOM_NET_WM_STATE_SKIP_PAGER], "_NET_WM_STATE_SKIP_PAGER" }, { &atoms[ATOM_NET_WM_STATE_BELOW], "_NET_WM_STATE_BELOW" }, { &atoms[ATOM_NET_WM_STATE_ABOVE], "_NET_WM_STATE_ABOVE" }, + { &atoms[ATOM_NET_WM_STATE_DEMANDS_ATTENTION], + "_NET_WM_STATE_DEMANDS_ATTENTION"}, { &atoms[ATOM_NET_WM_ALLOWED_ACTIONS], "_NET_WM_ALLOWED_ACTIONS" }, { &atoms[ATOM_NET_WM_ACTION_MOVE], "_NET_WM_ACTION_MOVE" }, { &atoms[ATOM_NET_WM_ACTION_RESIZE], "_NET_WM_ACTION_RESIZE" }, { &atoms[ATOM_NET_WM_ACTION_MINIMIZE], "_NET_WM_ACTION_MINIMIZE" }, { &atoms[ATOM_NET_WM_ACTION_SHADE], "_NET_WM_ACTION_SHADE" }, { &atoms[ATOM_NET_WM_ACTION_STICK], "_NET_WM_ACTION_STICK" }, + { &atoms[ATOM_NET_WM_ACTION_FULLSCREEN], "_NET_WM_ACTION_FULLSCREEN" }, { &atoms[ATOM_NET_WM_ACTION_MAXIMIZE_HORZ], "_NET_WM_ACTION_MAXIMIZE_HORZ"}, { &atoms[ATOM_NET_WM_ACTION_MAXIMIZE_VERT], "_NET_WM_ACTION_MAXIMIZE_VERT"}, { &atoms[ATOM_NET_WM_ACTION_CHANGE_DESKTOP], @@ -117,40 +126,61 @@ { &atoms[ATOM_NET_WM_ACTION_ABOVE], "_NET_WM_ACTION_ABOVE" }, { &atoms[ATOM_NET_CLOSE_WINDOW], "_NET_CLOSE_WINDOW" }, { &atoms[ATOM_NET_MOVERESIZE_WINDOW], "_NET_MOVERESIZE_WINDOW" }, + { &atoms[ATOM_NET_RESTACK_WINDOW], "_NET_RESTACK_WINDOW" }, + { &atoms[ATOM_NET_REQUEST_FRAME_EXTENTS], "_NET_REQUEST_FRAME_EXTENTS" }, + { &atoms[ATOM_NET_WM_PID], "_NET_WM_PID" }, { &atoms[ATOM_NET_WM_NAME], "_NET_WM_NAME" }, + { &atoms[ATOM_NET_WM_VISIBLE_NAME], "_NET_WM_VISIBLE_NAME" }, + { &atoms[ATOM_NET_WM_HANDLED_ICONS], "_NET_WM_HANDLED_ICONS" }, { &atoms[ATOM_NET_WM_ICON], "_NET_WM_ICON" }, + { &atoms[ATOM_NET_WM_ICON_NAME], "_NET_WM_ICON_NAME" }, + { &atoms[ATOM_NET_WM_USER_TIME], "_NET_WM_USER_TIME" }, + { &atoms[ATOM_NET_WM_USER_TIME_WINDOW], "_NET_WM_USER_TIME_WINDOW" }, + { &atoms[ATOM_NET_WM_VISIBLE_ICON_NAME], "_NET_WM_VISIBLE_ICON_NAME" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE], "_NET_WM_WINDOW_TYPE" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DESKTOP],"_NET_WM_WINDOW_TYPE_DESKTOP" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DOCK], "_NET_WM_WINDOW_TYPE_DOCK" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_SPLASH], "_NET_WM_WINDOW_TYPE_SPLASH" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DIALOG], "_NET_WM_WINDOW_TYPE_DIALOG" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_NORMAL], "_NET_WM_WINDOW_TYPE_NORMAL" }, + { &atoms[ATOM_NET_WM_WINDOW_TYPE_MENU], "_NET_WM_WINDOW_TYPE_MENU" }, + { &atoms[ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION], + "_NET_WM_WINDOW_TYPE_NOTIFICATION"}, + { &atoms[ATOM_NET_WM_WINDOW_TYPE_TOOLBAR], "_NET_WM_WINDOW_TYPE_TOOLBAR"}, + { &atoms[ATOM_NET_WM_WINDOW_TYPE_UTILITY], "_NET_WM_WINDOW_TYPE_UTILITY"}, { &atoms[ATOM_NET_CLIENT_LIST], "_NET_CLIENT_LIST" }, { &atoms[ATOM_NET_CLIENT_LIST_STACKING], "_NET_CLIENT_LIST_STACKING" }, { &atoms[ATOM_NET_WM_STRUT_PARTIAL], "_NET_WM_STRUT_PARTIAL" }, { &atoms[ATOM_NET_WM_STRUT], "_NET_WM_STRUT" }, + { &atoms[ATOM_NET_WM_WINDOW_OPACITY], &opacityAtom[0] }, + { &atoms[ATOM_NET_WM_MOVERESIZE], "_NET_WM_MOVERESIZE" }, { &atoms[ATOM_NET_SYSTEM_TRAY_OPCODE], "_NET_SYSTEM_TRAY_OPCODE" }, - { &atoms[ATOM_NET_WM_WINDOW_OPACITY], "_NET_WM_WINDOW_OPACITY" }, { &atoms[ATOM_MOTIF_WM_HINTS], "_MOTIF_WM_HINTS" }, - { &atoms[ATOM_JWM_RESTART], "_JWM_RESTART" }, - { &atoms[ATOM_JWM_EXIT], "_JWM_EXIT" }, - { &atoms[ATOM_JWM_RELOAD], "_JWM_RELOAD" } + { &atoms[ATOM_JWM_RESTART], &jwmRestart[0] }, + { &atoms[ATOM_JWM_EXIT], &jwmExit[0] }, + { &atoms[ATOM_JWM_RELOAD], &jwmReload[0] }, + { &atoms[ATOM_JWM_WM_STATE_MAXIMIZED_TOP], + "_JWM_WM_STATE_MAXIMIZED_TOP" }, + { &atoms[ATOM_JWM_WM_STATE_MAXIMIZED_BOTTOM], + "_JWM_WM_STATE_MAXIMIZED_BOTTOM" }, + { &atoms[ATOM_JWM_WM_STATE_MAXIMIZED_LEFT], + "_JWM_WM_STATE_MAXIMIZED_LEFT" }, + { &atoms[ATOM_JWM_WM_STATE_MAXIMIZED_RIGHT], + "_JWM_WM_STATE_MAXIMIZED_RIGHT" } }; +static char CheckShape(Window win); static void WriteNetState(ClientNode *np); static void WriteNetAllowed(ClientNode *np); -static void ReadWMHints(Window win, ClientState *state); +static void ReadWMState(Window win, ClientState *state); static void ReadMotifHints(Window win, ClientState *state); -/** Initialize hints data. */ -void InitializeHints() { -} - /** Set root hints and intern atoms. */ -void StartupHints() { +void StartupHints(void) +{ unsigned long *array; char *data; @@ -161,12 +191,9 @@ /* Determine how much space we will need on the stack and allocate it. */ count = 0; - for(x = 0; x < desktopCount; x++) { + for(x = 0; x < settings.desktopCount; x++) { count += strlen(GetDesktopName(x)) + 1; } - if(count < 4 * desktopCount * sizeof(unsigned long)) { - count = 4 * desktopCount * sizeof(unsigned long); - } if(count < 2 * sizeof(unsigned long)) { count = 2 * sizeof(unsigned long); } @@ -187,52 +214,50 @@ supported[x - FIRST_NET_ATOM] = atoms[x]; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_SUPPORTED], - XA_ATOM, 32, PropModeReplace, (unsigned char*)supported, - LAST_NET_ATOM - FIRST_NET_ATOM + 1); + XA_ATOM, 32, PropModeReplace, (unsigned char*)supported, + LAST_NET_ATOM - FIRST_NET_ATOM + 1); /* _NET_NUMBER_OF_DESKTOPS */ - SetCardinalAtom(rootWindow, ATOM_NET_NUMBER_OF_DESKTOPS, desktopCount); + SetCardinalAtom(rootWindow, ATOM_NET_NUMBER_OF_DESKTOPS, + settings.desktopCount); /* _NET_DESKTOP_NAMES */ count = 0; - for(x = 0; x < desktopCount; x++) { + for(x = 0; x < settings.desktopCount; x++) { strcpy(data + count, GetDesktopName(x)); count += strlen(GetDesktopName(x)) + 1; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_NAMES], - atoms[ATOM_UTF8_STRING], 8, PropModeReplace, - (unsigned char*)data, count); - - /* _NET_WORKAREA */ - for(x = 0; x < desktopCount; x++) { - array[x * 4 + 0] = 0; - array[x * 4 + 1] = 0; - array[x * 4 + 2] = rootWidth; - array[x * 4 + 3] = rootHeight; - } - JXChangeProperty(display, rootWindow, atoms[ATOM_NET_WORKAREA], - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)array, desktopCount * 4); + atoms[ATOM_UTF8_STRING], 8, PropModeReplace, + (unsigned char*)data, count); /* _NET_DESKTOP_GEOMETRY */ array[0] = rootWidth; array[1] = rootHeight; JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_GEOMETRY], - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)array, 2); + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)array, 2); /* _NET_DESKTOP_VIEWPORT */ array[0] = 0; array[1] = 0; JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_VIEWPORT], - XA_CARDINAL, 32, PropModeReplace, - (unsigned char*)array, 2); + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)array, 2); - win = GetSupportingWindow(); + /* _NET_WM_NAME */ + win = supportingWindow; JXChangeProperty(display, win, atoms[ATOM_NET_WM_NAME], - atoms[ATOM_UTF8_STRING], 8, PropModeReplace, - (unsigned char*)"JWM", 3); + atoms[ATOM_UTF8_STRING], 8, PropModeReplace, + (unsigned char*)"JWM", 3); + /* _NET_WM_PID */ + array[0] = getpid(); + JXChangeProperty(display, win, atoms[ATOM_NET_WM_PID], + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)array, 1); + + /* _NET_SUPPORTING_WM_CHECK */ SetWindowAtom(rootWindow, ATOM_NET_SUPPORTING_WM_CHECK, win); SetWindowAtom(win, ATOM_NET_SUPPORTING_WM_CHECK, win); @@ -240,33 +265,23 @@ } -/** Shutdown hints. */ -void ShutdownHints() { -} - -/** Destroy hints data. */ -void DestroyHints() { -} - /** Determine the current desktop. */ -void ReadCurrentDesktop() { - +void ReadCurrentDesktop(void) +{ unsigned long temp; - currentDesktop = 0; - if(GetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, &temp)) { ChangeDesktop(temp); } else { - ChangeDesktop(0); + SetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, currentDesktop); } - } -/** Read client protocls/hints. +/** Read client hints. * This is called while the client is being added to management. */ -void ReadClientProtocols(ClientNode *np) { +void ReadClientInfo(ClientNode *np, char alreadyMapped) +{ Status status; ClientNode *pp; @@ -283,23 +298,31 @@ np->owner = None; } - np->state = ReadWindowState(np->window); + /* Read the window state. */ + np->state = ReadWindowState(np->window, alreadyMapped); if(np->minWidth == np->maxWidth && np->minHeight == np->maxHeight) { np->state.border &= ~BORDER_RESIZE; } - /* Set the client to the same layer as its owner. */ + /* Read WM protocols. */ + ReadWMProtocols(np->window, &np->state); + + ReadWMOpacity(np); + + /* Make sure this client is on at least as high of a layer + * as its owner. */ if(np->owner != None) { pp = FindClientByWindow(np->owner); if(pp) { - np->state.layer = pp->state.layer; + np->state.layer = Max(pp->state.layer, np->state.layer); } } } /** Write the window state hint for a client. */ -void WriteState(ClientNode *np) { +void WriteState(ClientNode *np) +{ unsigned long data[2]; @@ -309,53 +332,81 @@ data[0] = NormalState; } else if(np->state.status & STAT_MINIMIZED) { data[0] = IconicState; + } else if(np->state.status & STAT_SHADED) { + data[0] = NormalState; } else { data[0] = WithdrawnState; } data[1] = None; - JXChangeProperty(display, np->window, atoms[ATOM_WM_STATE], - atoms[ATOM_WM_STATE], 32, PropModeReplace, - (unsigned char*)data, 2); + if(data[0] == WithdrawnState) { + JXDeleteProperty(display, np->window, atoms[ATOM_WM_STATE]); + } else { + JXChangeProperty(display, np->window, atoms[ATOM_WM_STATE], + atoms[ATOM_WM_STATE], 32, PropModeReplace, + (unsigned char*)data, 2); + } WriteNetState(np); WriteNetAllowed(np); - /* Write the opacity. */ - if(np->state.opacity == UINT_MAX) { +} + +/** Set the opacity of a client. */ +void SetOpacity(ClientNode *np, unsigned int opacity, char force) +{ + + if(np->state.opacity == opacity && !force) { + return; + } + + np->state.opacity = opacity; + if(opacity == 0xFFFFFFFF) { JXDeleteProperty(display, np->parent, atoms[ATOM_NET_WM_WINDOW_OPACITY]); } else { - SetCardinalAtom(np->parent, ATOM_NET_WM_WINDOW_OPACITY, - np->state.opacity); + SetCardinalAtom(np->parent, ATOM_NET_WM_WINDOW_OPACITY, opacity); } - - /* Flush to the server. */ - JXSync(display, False); - } /** Write the net state hint for a client. */ -void WriteNetState(ClientNode *np) { +void WriteNetState(ClientNode *np) +{ - unsigned long values[8]; - int north, south, east, west; + unsigned long values[16]; int index; Assert(np); - /* We remove the _NET_WM_STATE for withdrawn windows. */ - if(!(np->state.status & STAT_MAPPED)) { + /* We remove the _NET_WM_STATE and _NET_WM_DESKTOP for withdrawn windows. */ + if(!(np->state.status & (STAT_MAPPED | STAT_MINIMIZED | STAT_SHADED))) { JXDeleteProperty(display, np->window, atoms[ATOM_NET_WM_STATE]); + JXDeleteProperty(display, np->window, atoms[ATOM_NET_WM_DESKTOP]); return; } index = 0; - if(np->state.status & STAT_HMAX) { + if(np->state.status & STAT_MINIMIZED) { + values[index++] = atoms[ATOM_NET_WM_STATE_HIDDEN]; + } + + if(np->state.maxFlags & MAX_HORIZ) { values[index++] = atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]; } - if(np->state.status & STAT_VMAX) { + if(np->state.maxFlags & MAX_VERT) { values[index++] = atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]; } + if(np->state.maxFlags & MAX_TOP) { + values[index++] = atoms[ATOM_JWM_WM_STATE_MAXIMIZED_TOP]; + } + if(np->state.maxFlags & MAX_BOTTOM) { + values[index++] = atoms[ATOM_JWM_WM_STATE_MAXIMIZED_BOTTOM]; + } + if(np->state.maxFlags & MAX_LEFT) { + values[index++] = atoms[ATOM_JWM_WM_STATE_MAXIMIZED_LEFT]; + } + if(np->state.maxFlags & MAX_RIGHT) { + values[index++] = atoms[ATOM_JWM_WM_STATE_MAXIMIZED_RIGHT]; + } if(np->state.status & STAT_SHADED) { values[index++] = atoms[ATOM_NET_WM_STATE_SHADED]; @@ -373,16 +424,37 @@ values[index++] = atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]; } - if(np->state.layer == LAYER_BELOW) { - values[index++] = atoms[ATOM_NET_WM_STATE_BELOW]; - } else if(np->state.layer == LAYER_ABOVE) { - values[index++] = atoms[ATOM_NET_WM_STATE_ABOVE]; + if(np->state.status & STAT_NOPAGER) { + values[index++] = atoms[ATOM_NET_WM_STATE_SKIP_PAGER]; + } + + if(np->state.layer != np->state.defaultLayer) { + if(np->state.layer == LAYER_BELOW) { + values[index++] = atoms[ATOM_NET_WM_STATE_BELOW]; + } else if(np->state.layer == LAYER_ABOVE) { + values[index++] = atoms[ATOM_NET_WM_STATE_ABOVE]; + } + } + + if(np->state.status & STAT_URGENT) { + values[index++] = atoms[ATOM_NET_WM_STATE_DEMANDS_ATTENTION]; } JXChangeProperty(display, np->window, atoms[ATOM_NET_WM_STATE], - XA_ATOM, 32, PropModeReplace, (unsigned char*)values, index); + XA_ATOM, 32, PropModeReplace, + (unsigned char*)values, index); - GetBorderSize(np, &north, &south, &east, &west); + WriteFrameExtents(np->window, &np->state); + +} + +/** Set _NET_FRAME_EXTENTS. */ +void WriteFrameExtents(Window win, const ClientState *state) +{ + unsigned long values[4]; + int north, south, east, west; + + GetBorderSize(state, &north, &south, &east, &west); /* left, right, top, bottom */ values[0] = west; @@ -390,22 +462,24 @@ values[2] = north; values[3] = south; - JXChangeProperty(display, np->window, atoms[ATOM_NET_FRAME_EXTENTS], - XA_CARDINAL, 32, PropModeReplace, (unsigned char*)values, 4); + JXChangeProperty(display, win, atoms[ATOM_NET_FRAME_EXTENTS], + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)values, 4); } /** Write the allowed action property. */ -void WriteNetAllowed(ClientNode *np) { +void WriteNetAllowed(ClientNode *np) +{ unsigned long values[12]; - int index; + unsigned int index; Assert(np); index = 0; - if(np->state.border & BORDER_TITLE) { + if(np->state.border & BORDER_SHADE) { values[index++] = atoms[ATOM_NET_WM_ACTION_SHADE]; } @@ -416,6 +490,7 @@ if(np->state.border & BORDER_MAX) { values[index++] = atoms[ATOM_NET_WM_ACTION_MAXIMIZE_HORZ]; values[index++] = atoms[ATOM_NET_WM_ACTION_MAXIMIZE_VERT]; + values[index++] = atoms[ATOM_NET_WM_ACTION_FULLSCREEN]; } if(np->state.border & BORDER_CLOSE) { @@ -439,12 +514,35 @@ values[index++] = atoms[ATOM_NET_WM_ACTION_ABOVE]; JXChangeProperty(display, np->window, atoms[ATOM_NET_WM_ALLOWED_ACTIONS], - XA_ATOM, 32, PropModeReplace, (unsigned char*)values, index); + XA_ATOM, 32, PropModeReplace, + (unsigned char*)values, index); + +} +/** Check if a window uses the shape extension. */ +char CheckShape(Window win) +{ +#ifdef USE_SHAPE + int shaped = 0; + int r1; + unsigned int r2; + if(haveShape) { + JXShapeSelectInput(display, win, ShapeNotifyMask); + XShapeQueryExtents(display, win, &shaped, + &r1, &r1, &r2, &r2, + &r1, &r1, &r1, &r2, &r2); + return shaped ? 1 : 0; + } else { + return 0; + } +#else + return 0; +#endif } /** Read all hints needed to determine the current window state. */ -ClientState ReadWindowState(Window win) { +ClientState ReadWindowState(Window win, char alreadyMapped) +{ ClientState result; Status status; @@ -455,40 +553,39 @@ unsigned char *temp; Atom *state; unsigned long card; - int maxVert, maxHorz; - int fullScreen; + Window utwin; Assert(win != None); - result.status = STAT_NONE; + result.status = STAT_MAPPED; + result.maxFlags = MAX_NONE; result.border = BORDER_DEFAULT; result.layer = LAYER_NORMAL; + result.defaultLayer = LAYER_NORMAL; result.desktop = currentDesktop; - result.opacity = 0xFFFFFFFF; + result.opacity = UINT_MAX; - ReadWMHints(win, &result); + ReadWMHints(win, &result, alreadyMapped); + ReadWMState(win, &result); ReadMotifHints(win, &result); /* _NET_WM_DESKTOP */ if(GetCardinalAtom(win, ATOM_NET_WM_DESKTOP, &card)) { if(card == ~0UL) { result.status |= STAT_STICKY; - } else if(card < desktopCount) { + } else if(card < settings.desktopCount) { result.desktop = card; } else { - result.desktop = desktopCount - 1; + result.desktop = settings.desktopCount - 1; } } /* _NET_WM_STATE */ - status = JXGetWindowProperty(display, win, - atoms[ATOM_NET_WM_STATE], 0, 32, False, XA_ATOM, &realType, - &realFormat, &count, &extra, &temp); - if(status == Success) { + status = JXGetWindowProperty(display, win, atoms[ATOM_NET_WM_STATE], 0, 32, + False, XA_ATOM, &realType, &realFormat, + &count, &extra, &temp); + if(status == Success && realFormat != 0) { if(count > 0) { - maxVert = 0; - maxHorz = 0; - fullScreen = 0; state = (Atom*)temp; for(x = 0; x < count; x++) { if(state[x] == atoms[ATOM_NET_WM_STATE_STICKY]) { @@ -496,31 +593,33 @@ } else if(state[x] == atoms[ATOM_NET_WM_STATE_SHADED]) { result.status |= STAT_SHADED; } else if(state[x] == atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]) { - maxVert = 1; + result.maxFlags |= MAX_VERT; } else if(state[x] == atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]) { - maxHorz = 1; + result.maxFlags |= MAX_HORIZ; + } else if(state[x] == atoms[ATOM_JWM_WM_STATE_MAXIMIZED_TOP]) { + result.maxFlags |= MAX_TOP; + } else if(state[x] == atoms[ATOM_JWM_WM_STATE_MAXIMIZED_BOTTOM]) { + result.maxFlags |= MAX_BOTTOM; + } else if(state[x] == atoms[ATOM_JWM_WM_STATE_MAXIMIZED_LEFT]) { + result.maxFlags |= MAX_LEFT; + } else if(state[x] == atoms[ATOM_JWM_WM_STATE_MAXIMIZED_RIGHT]) { + result.maxFlags |= MAX_RIGHT; } else if(state[x] == atoms[ATOM_NET_WM_STATE_FULLSCREEN]) { - fullScreen = 1; - result.layer = LAYER_TOP; + result.status |= STAT_FULLSCREEN; } else if(state[x] == atoms[ATOM_NET_WM_STATE_HIDDEN]) { result.status |= STAT_MINIMIZED; } else if(state[x] == atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]) { result.status |= STAT_NOLIST; + } else if(state[x] == atoms[ATOM_NET_WM_STATE_SKIP_PAGER]) { + result.status |= STAT_NOPAGER; } else if(state[x] == atoms[ATOM_NET_WM_STATE_ABOVE]) { result.layer = LAYER_ABOVE; } else if(state[x] == atoms[ATOM_NET_WM_STATE_BELOW]) { result.layer = LAYER_BELOW; + } else if(state[x] == atoms[ATOM_NET_WM_STATE_DEMANDS_ATTENTION]) { + result.status |= STAT_URGENT; } } - if(maxHorz) { - result.status |= STAT_HMAX; - } - if(maxVert) { - result.status |= STAT_VMAX; - } - if(fullScreen) { - result.status |= STAT_FULLSCREEN; - } } if(temp) { JXFree(temp); @@ -531,25 +630,23 @@ status = JXGetWindowProperty(display, win, atoms[ATOM_NET_WM_WINDOW_TYPE], 0, 32, False, XA_ATOM, &realType, &realFormat, &count, &extra, &temp); - if(status == Success) { + if(status == Success && realFormat != 0) { /* Loop until we hit a window type we recognize. */ state = (Atom*)temp; for(x = 0; x < count; x++) { if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_NORMAL]) { break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_DESKTOP]) { - if(result.layer == LAYER_NORMAL) { - result.layer = LAYER_BOTTOM; - } - result.border = BORDER_NONE; - result.status |= STAT_STICKY; - result.status |= STAT_NOLIST; + result.defaultLayer = LAYER_DESKTOP; + result.border = BORDER_NONE; + result.status |= STAT_STICKY; + result.status |= STAT_NOLIST; + result.status |= STAT_NOFOCUS; break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_DOCK]) { - result.border = BORDER_NONE; - if(result.layer == LAYER_NORMAL) { - result.layer = LAYER_ABOVE; - } + result.border = BORDER_NONE; + result.defaultLayer = LAYER_ABOVE; + result.status |= STAT_NOFOCUS; break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_SPLASH]) { result.border = BORDER_NONE; @@ -558,6 +655,22 @@ result.border &= ~BORDER_MIN; result.status |= STAT_NOLIST; break; + } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_MENU]) { + result.border &= ~BORDER_MAX; + result.status |= STAT_NOLIST; + } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION]) { + result.border = BORDER_NONE; + result.status |= STAT_NOLIST; + result.status |= STAT_NOFOCUS; + } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_TOOLBAR]) { + result.border &= ~BORDER_MAX; + result.defaultLayer = LAYER_ABOVE; + result.status |= STAT_STICKY; + result.status |= STAT_NOLIST; + result.status |= STAT_NOFOCUS; + } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_UTILITY]) { + result.border &= ~BORDER_MAX; + result.status |= STAT_NOFOCUS; } else { Debug("Unknown _NET_WM_WINDOW_TYPE: %lu", state[x]); } @@ -567,9 +680,26 @@ } } - /* _NET_WM_WINDOW_OPACITY */ - if(GetCardinalAtom(win, ATOM_NET_WM_WINDOW_OPACITY, &card)) { - result.opacity = card; + /* _NET_WM_USER_TIME_WINDOW */ + if(!GetWindowAtom(win, ATOM_NET_WM_USER_TIME_WINDOW, &utwin)) { + utwin = win; + } + + /* _NET_WM_USER_TIME */ + if(GetCardinalAtom(utwin, ATOM_NET_WM_USER_TIME, &card)) { + if(card == 0) { + result.status |= STAT_NOFOCUS; + } + } + + /* Use the default layer if the layer wasn't set explicitly. */ + if(result.layer == LAYER_NORMAL) { + result.layer = result.defaultLayer; + } + + /* Check if this window uses the shape extension. */ + if(CheckShape(win)) { + result.status |= STAT_SHAPED; } return result; @@ -577,7 +707,8 @@ } /** Determine the title to display for a client. */ -void ReadWMName(ClientNode *np) { +void ReadWMName(ClientNode *np) +{ unsigned long count; int status; @@ -585,44 +716,46 @@ Atom realType; int realFormat; unsigned char *name; -#ifdef USE_XUTF8 - XTextProperty tprop; - char **text_list; - int tcount; -#endif - - Assert(np); if(np->name) { - JXFree(np->name); + Release(np->name); } status = JXGetWindowProperty(display, np->window, - atoms[ATOM_NET_WM_NAME], 0, 1024, False, - atoms[ATOM_UTF8_STRING], &realType, &realFormat, &count, &extra, &name); - if(status != Success) { + atoms[ATOM_NET_WM_NAME], 0, 1024, False, + atoms[ATOM_UTF8_STRING], &realType, + &realFormat, &count, &extra, &name); + if(status != Success || realFormat == 0) { np->name = NULL; } else { - np->name = (char*)name; + const size_t size = strlen((char*)name) + 1; + np->name = Allocate(size); + memcpy(np->name, name, size); + JXFree(name); + np->name = ConvertFromUTF8(np->name); } #ifdef USE_XUTF8 if(!np->name) { status = JXGetWindowProperty(display, np->window, - XA_WM_NAME, 0, 1024, False, atoms[ATOM_COMPOUND_TEXT], - &realType, &realFormat, &count, &extra, &name); + XA_WM_NAME, 0, 1024, False, + atoms[ATOM_COMPOUND_TEXT], + &realType, &realFormat, &count, + &extra, &name); if(status == Success && realFormat == 8) { + char **tlist; + XTextProperty tprop; + int tcount; tprop.value = name; tprop.encoding = atoms[ATOM_COMPOUND_TEXT]; tprop.format = realFormat; - tprop.nitems = strlen((char *)name); - if(Xutf8TextPropertyToTextList(display, &tprop, &text_list, &tcount) + tprop.nitems = strlen((char*)name); + if(XmbTextPropertyToTextList(display, &tprop, &tlist, &tcount) == Success && tcount > 0) { - np->name = Xmalloc(strlen(text_list[0]) + 1); - if(np->name) { - strcpy(np->name, text_list[0]); - } - XFreeStringList(text_list); + const size_t len = strlen(tlist[0]) + 1; + np->name = Allocate(len); + memcpy(np->name, tlist[0], len); + XFreeStringList(tlist); } JXFree(name); } @@ -630,31 +763,32 @@ #endif if(!np->name) { - if(JXFetchName(display, np->window, &np->name) == 0) { - np->name = NULL; + char *temp = NULL; + if(JXFetchName(display, np->window, &temp)) { + const size_t len = strlen(temp) + 1; + np->name = Allocate(len); + memcpy(np->name, temp, len); + JXFree(temp); } } } /** Read the window class for a client. */ -void ReadWMClass(ClientNode *np) { - +void ReadWMClass(ClientNode *np) +{ XClassHint hint; - Assert(np); - if(JXGetClassHint(display, np->window, &hint)) { np->instanceName = hint.res_name; np->className = hint.res_class; } - } /** Read the protocols hint for a window. */ -ClientProtocolType ReadWMProtocols(Window w) { +void ReadWMProtocols(Window w, ClientState *state) +{ - ClientProtocolType result; unsigned long count, x; int status; unsigned long extra; @@ -665,31 +799,31 @@ Assert(w != None); - result = PROT_NONE; + state->status &= ~STAT_TAKEFOCUS; + state->status &= ~STAT_DELETE; status = JXGetWindowProperty(display, w, atoms[ATOM_WM_PROTOCOLS], - 0, 32, False, XA_ATOM, &realType, &realFormat, &count, &extra, &temp); + 0, 32, False, XA_ATOM, &realType, &realFormat, + &count, &extra, &temp); p = (Atom*)temp; - - if(status != Success || !p) { - return result; + if(status != Success || realFormat == 0 || !p) { + return; } for(x = 0; x < count; x++) { if(p[x] == atoms[ATOM_WM_DELETE_WINDOW]) { - result |= PROT_DELETE; + state->status |= STAT_DELETE; } else if(p[x] == atoms[ATOM_WM_TAKE_FOCUS]) { - result |= PROT_TAKE_FOCUS; + state->status |= STAT_TAKEFOCUS; } } JXFree(p); - return result; - } /** Read the "normal hints" for a client. */ -void ReadWMNormalHints(ClientNode *np) { +void ReadWMNormalHints(ClientNode *np) +{ XSizeHints hints; long temp; @@ -748,18 +882,6 @@ np->aspect.miny = hints.min_aspect.y; np->aspect.maxx = hints.max_aspect.x; np->aspect.maxy = hints.max_aspect.y; - if(np->aspect.minx < 1) { - np->aspect.minx = 1; - } - if(np->aspect.miny < 1) { - np->aspect.miny = 1; - } - if(np->aspect.maxx < 1) { - np->aspect.maxx = 1; - } - if(np->aspect.maxy < 1) { - np->aspect.maxy = 1; - } } if(np->sizeFlags & PWinGravity) { @@ -771,17 +893,18 @@ } /** Read colormap information for a client. */ -void ReadWMColormaps(ClientNode *np) { +void ReadWMColormaps(ClientNode *np) +{ Window *windows; ColormapNode *cp; int count; - int x; Assert(np); if(JXGetWMColormapWindows(display, np->window, &windows, &count)) { if(count > 0) { + int x; /* Free old colormaps. */ while(np->colormaps) { @@ -810,39 +933,88 @@ } +/** Read the WM state for a window. */ +void ReadWMState(Window win, ClientState *state) +{ + + Status status; + unsigned long count; + unsigned long extra; + Atom realType; + int realFormat; + unsigned int *temp; + + status = JXGetWindowProperty(display, win, atoms[ATOM_WM_STATE], 0, 2, + False, atoms[ATOM_WM_STATE], + &realType, &realFormat, + &count, &extra, (unsigned char**)&temp); + if(JLIKELY(status == Success && realFormat != 0 && count == 2)) { + switch(temp[0]) { + case IconicState: + state->status |= STAT_MINIMIZED; + break; + case WithdrawnState: + state->status &= ~STAT_MAPPED; + break; + default: + break; + } + JXFree(temp); + } + +} + /** Read the WM hints for a window. */ -void ReadWMHints(Window win, ClientState *state) { +void ReadWMHints(Window win, ClientState *state, char alreadyMapped) +{ XWMHints *wmhints; Assert(win != None); Assert(state); + state->status |= STAT_CANFOCUS; wmhints = JXGetWMHints(display, win); if(wmhints) { - if(wmhints->flags & StateHint) { + if(!alreadyMapped && (wmhints->flags & StateHint)) { switch(wmhints->initial_state) { case IconicState: state->status |= STAT_MINIMIZED; break; case WithdrawnState: + state->status &= ~STAT_MAPPED; + break; default: - if(!(state->status & (STAT_MINIMIZED | STAT_NOLIST))) { - state->status |= STAT_MAPPED; - } + break; } + } + if((wmhints->flags & InputHint) && wmhints->input == False) { + state->status &= ~STAT_CANFOCUS; + } + if(wmhints->flags & XUrgencyHint) { + state->status |= STAT_URGENT; } else { - state->status |= STAT_MAPPED; + state->status &= ~(STAT_URGENT | STAT_FLASH); } JXFree(wmhints); - } else { - state->status |= STAT_MAPPED; } } +/** Read _NET_WM_WINDOW_OPACITY. */ +void ReadWMOpacity(ClientNode *np) { + unsigned long card; + if(GetCardinalAtom(np->window, ATOM_NET_WM_WINDOW_OPACITY, &card)) { + np->state.status |= STAT_OPACITY; + } else { + card = UINT_MAX; + } + np->state.opacity = (unsigned int)card; +} + /** Read _MOTIF_WM_HINTS */ -void ReadMotifHints(Window win, ClientState *state) { +void ReadMotifHints(Window win, ClientState *state) +{ PropMwmHints *mhints; Atom type; @@ -853,9 +1025,10 @@ Assert(win != None); Assert(state); - if(JXGetWindowProperty(display, win, atoms[ATOM_MOTIF_WM_HINTS], - 0L, 20L, False, atoms[ATOM_MOTIF_WM_HINTS], &type, &format, - &itemCount, &bytesLeft, &data) != Success) { + if(JXGetWindowProperty(display, win, atoms[ATOM_MOTIF_WM_HINTS], 0L, 20L, + False, atoms[ATOM_MOTIF_WM_HINTS], &type, &format, + &itemCount, &bytesLeft, &data) != Success + || format == 0) { return; } @@ -891,12 +1064,6 @@ if(!(mhints->decorations & MWM_DECOR_TITLE)) { state->border &= ~BORDER_TITLE; } - if(!(mhints->decorations & MWM_DECOR_MINIMIZE)) { - state->border &= ~BORDER_MIN; - } - if(!(mhints->decorations & MWM_DECOR_MAXIMIZE)) { - state->border &= ~BORDER_MAX; - } } JXFree(mhints); @@ -904,7 +1071,8 @@ } /** Read a cardinal atom. */ -int GetCardinalAtom(Window window, AtomType atom, unsigned long *value) { +char GetCardinalAtom(Window window, AtomType atom, unsigned long *value) +{ unsigned long count; int status; @@ -912,16 +1080,16 @@ Atom realType; int realFormat; unsigned char *data; - int ret; + char ret; Assert(window != None); Assert(value); status = JXGetWindowProperty(display, window, atoms[atom], 0, 1, False, - XA_CARDINAL, &realType, &realFormat, &count, &extra, &data); - + XA_CARDINAL, &realType, &realFormat, + &count, &extra, &data); ret = 0; - if(status == Success && data) { + if(status == Success && realFormat != 0 && data) { if(count == 1) { *value = *(unsigned long*)data; ret = 1; @@ -933,24 +1101,34 @@ } +/** Set a cardinal atom. */ +void SetCardinalAtom(Window window, AtomType atom, unsigned long value) +{ + Assert(window != None); + JXChangeProperty(display, window, atoms[atom], XA_CARDINAL, 32, + PropModeReplace, (unsigned char*)&value, 1); +} + /** Read a window atom. */ -int GetWindowAtom(Window window, AtomType atom, Window *value) { +char GetWindowAtom(Window window, AtomType atom, Window *value) +{ + unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *data; - int ret; + char ret; Assert(window != None); Assert(value); status = JXGetWindowProperty(display, window, atoms[atom], 0, 1, False, - XA_WINDOW, &realType, &realFormat, &count, &extra, &data); - + XA_WINDOW, &realType, &realFormat, + &count, &extra, &data); ret = 0; - if(status == Success && data) { + if(status == Success && realFormat != 0 && data) { if(count == 1) { *value = *(Window*)data; ret = 1; @@ -962,33 +1140,19 @@ } -/** Set a cardinal atom. */ -void SetCardinalAtom(Window window, AtomType atom, unsigned long value) { - - Assert(window != None); - - JXChangeProperty(display, window, atoms[atom], XA_CARDINAL, 32, - PropModeReplace, (unsigned char*)&value, 1); - -} - /** Set a window atom. */ -void SetWindowAtom(Window window, AtomType atom, unsigned long value) { - +void SetWindowAtom(Window window, AtomType atom, unsigned long value) +{ Assert(window != None); - JXChangeProperty(display, window, atoms[atom], XA_WINDOW, 32, - PropModeReplace, (unsigned char*)&value, 1); - + PropModeReplace, (unsigned char*)&value, 1); } /** Set a pixmap atom. */ -void SetPixmapAtom(Window window, AtomType atom, Pixmap value) { - +void SetPixmapAtom(Window window, AtomType atom, Pixmap value) +{ Assert(window != None); - JXChangeProperty(display, window, atoms[atom], XA_PIXMAP, 32, - PropModeReplace, (unsigned char*)&value, 1); - + PropModeReplace, (unsigned char*)&value, 1); } diff -Nru jwm-2.1.0+svn579/src/hint.h jwm-2.3.1+0~16~ubuntu14.10.1/src/hint.h --- jwm-2.1.0+svn579/src/hint.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/hint.h 2015-07-18 20:02:18.000000000 +0000 @@ -18,7 +18,7 @@ /* Misc */ ATOM_COMPOUND_TEXT, ATOM_UTF8_STRING, - ATOM_XSETROOT_ID, + ATOM_XROOTPMAP_ID, /* Standard atoms */ ATOM_WM_STATE, @@ -51,8 +51,10 @@ ATOM_NET_WM_STATE_FULLSCREEN, ATOM_NET_WM_STATE_HIDDEN, ATOM_NET_WM_STATE_SKIP_TASKBAR, + ATOM_NET_WM_STATE_SKIP_PAGER, ATOM_NET_WM_STATE_BELOW, ATOM_NET_WM_STATE_ABOVE, + ATOM_NET_WM_STATE_DEMANDS_ATTENTION, ATOM_NET_WM_ALLOWED_ACTIONS, ATOM_NET_WM_ACTION_MOVE, @@ -60,6 +62,7 @@ ATOM_NET_WM_ACTION_MINIMIZE, ATOM_NET_WM_ACTION_SHADE, ATOM_NET_WM_ACTION_STICK, + ATOM_NET_WM_ACTION_FULLSCREEN, ATOM_NET_WM_ACTION_MAXIMIZE_HORZ, ATOM_NET_WM_ACTION_MAXIMIZE_VERT, ATOM_NET_WM_ACTION_CHANGE_DESKTOP, @@ -69,26 +72,39 @@ ATOM_NET_CLOSE_WINDOW, ATOM_NET_MOVERESIZE_WINDOW, + ATOM_NET_RESTACK_WINDOW, + ATOM_NET_REQUEST_FRAME_EXTENTS, + ATOM_NET_WM_PID, ATOM_NET_WM_NAME, + ATOM_NET_WM_VISIBLE_NAME, + ATOM_NET_WM_HANDLED_ICONS, ATOM_NET_WM_ICON, + ATOM_NET_WM_ICON_NAME, + ATOM_NET_WM_USER_TIME, + ATOM_NET_WM_USER_TIME_WINDOW, + ATOM_NET_WM_VISIBLE_ICON_NAME, ATOM_NET_WM_WINDOW_TYPE, ATOM_NET_WM_WINDOW_TYPE_DESKTOP, ATOM_NET_WM_WINDOW_TYPE_DOCK, ATOM_NET_WM_WINDOW_TYPE_SPLASH, ATOM_NET_WM_WINDOW_TYPE_DIALOG, ATOM_NET_WM_WINDOW_TYPE_NORMAL, + ATOM_NET_WM_WINDOW_TYPE_MENU, + ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION, + ATOM_NET_WM_WINDOW_TYPE_TOOLBAR, + ATOM_NET_WM_WINDOW_TYPE_UTILITY, ATOM_NET_CLIENT_LIST, ATOM_NET_CLIENT_LIST_STACKING, ATOM_NET_WM_STRUT_PARTIAL, + ATOM_NET_WM_WINDOW_OPACITY, ATOM_NET_WM_STRUT, + ATOM_NET_WM_MOVERESIZE, ATOM_NET_SYSTEM_TRAY_OPCODE, - ATOM_NET_WM_WINDOW_OPACITY, - /* MWM atoms */ ATOM_MOTIF_WM_HINTS, @@ -96,57 +112,65 @@ ATOM_JWM_RESTART, ATOM_JWM_EXIT, ATOM_JWM_RELOAD, + ATOM_JWM_WM_STATE_MAXIMIZED_TOP, + ATOM_JWM_WM_STATE_MAXIMIZED_BOTTOM, + ATOM_JWM_WM_STATE_MAXIMIZED_LEFT, + ATOM_JWM_WM_STATE_MAXIMIZED_RIGHT, ATOM_COUNT } AtomType; +extern const char jwmRestart[]; +extern const char jwmExit[]; +extern const char jwmReload[]; +extern const char opacityAtom[]; + #define FIRST_NET_ATOM ATOM_NET_SUPPORTED -#define LAST_NET_ATOM ATOM_NET_SYSTEM_TRAY_OPCODE +#define LAST_NET_ATOM ATOM_NET_WM_STRUT #define FIRST_MWM_ATOM ATOM_MOTIF_WM_HINTS #define LAST_MWM_ATOM ATOM_MOTIF_WM_HINTS /** Enumeration of window layers. */ -typedef enum { - LAYER_BOTTOM = 0, - LAYER_BELOW = 2, - LAYER_NORMAL = 4, - LAYER_ABOVE = 6, - DEFAULT_TRAY_LAYER = 8, - LAYER_TOP = 12, - LAYER_COUNT = 13 -} WinLayerType; +typedef unsigned char WinLayerType; +#define LAYER_DESKTOP 0 +#define LAYER_BELOW 1 +#define LAYER_NORMAL 2 +#define LAYER_ABOVE 3 +#define LAYER_COUNT 4 + +#define FIRST_LAYER LAYER_DESKTOP +#define LAST_LAYER LAYER_ABOVE +#define DEFAULT_TRAY_LAYER LAYER_ABOVE /** Client state information. */ typedef struct ClientState { - unsigned int status; /**< Status bit mask. */ - unsigned int border; /**< Border bit mask. */ - unsigned int layer; /**< Window layer. */ - unsigned int desktop; /**< Desktop. */ - unsigned int opacity; /**< Opacity (0 - 0xFFFFFFFF). */ + unsigned int status; /**< Status bit mask. */ + unsigned int opacity; /**< Opacity (0 - 0xFFFFFFFF). */ + unsigned short border; /**< Border bit mask. */ + unsigned short desktop; /**< Desktop. */ + unsigned char maxFlags; /**< Maximization status. */ + unsigned char layer; /**< Current window layer. */ + unsigned char defaultLayer; /**< Default window layer. */ } ClientState; -/** Client protocols (to be used as a bit mask). */ -typedef enum { - PROT_NONE = 0, - PROT_DELETE = 1, - PROT_TAKE_FOCUS = 2 -} ClientProtocolType; - extern Atom atoms[ATOM_COUNT]; -void InitializeHints(); -void StartupHints(); -void ShutdownHints(); -void DestroyHints(); +/*@{*/ +#define InitializeHints() (void)(0) +void StartupHints(void); +#define ShutdownHints() (void)(0) +#define DestroyHints() (void)(0) +/*@}*/ /** Determine the current desktop. */ -void ReadCurrentDesktop(); +void ReadCurrentDesktop(void); -/** Read client protocols +/** Read client info. * @param np The client. + * @param alreadyMapped Set if the client is already mapped. */ -void ReadClientProtocols(struct ClientNode *np); +void ReadClientInfo(struct ClientNode *np, char alreadyMapped); /** Read a client's name. * @param np The client. @@ -165,9 +189,9 @@ /** Read the WM_PROTOCOLS property for a window. * @param w The window. - * @return The protocols. + * @param state The client state to update. */ -ClientProtocolType ReadWMProtocols(Window w); +void ReadWMProtocols(Window w, ClientState *state); /** Read colormap information for a client. * @param np The client. @@ -181,30 +205,48 @@ /** Read the current state of a window. * @param win The window. + * @param alreadyMapped Set if the window is already mapped. * @return The window state. */ -ClientState ReadWindowState(Window win); +ClientState ReadWindowState(Window win, char alreadyMapped); + +/** Read WM hints. + * @param win The window. + * @param state The state hints to update. + * @param alreadyMapped Set if the window is already mapped. + */ +void ReadWMHints(Window win, ClientState *state, char alreadyMapped); + +/** Read opacity. + * @param np The client. + */ +void ReadWMOpacity(struct ClientNode *np); /** Set the state of a client window. * @param np The client. */ void WriteState(struct ClientNode *np); -/** Read a cardinal atom. - * @param window The window. - * @param atom The atom to read. - * @param value A pointer to the location to save the atom. - * @return 1 on success, 0 on failure. +/** Set the opacity of a client window. + * @param np The client. + * @param opacity The opacity to set. + * @param force Set the opacity even if it hasn't changed. */ -int GetCardinalAtom(Window window, AtomType atom, unsigned long *value); +void SetOpacity(struct ClientNode *np, unsigned int opacity, char force); -/** Read a window atom. +/** Set the frame extents of a window. + * @param win The window. + * @param state The client state. + */ +void WriteFrameExtents(Window win, const ClientState *state); + +/** Read a cardinal atom. * @param window The window. * @param atom The atom to read. * @param value A pointer to the location to save the atom. * @return 1 on success, 0 on failure. */ -int GetWindowAtom(Window window, AtomType atom, Window *value); +char GetCardinalAtom(Window window, AtomType atom, unsigned long *value); /** Set a cardinal atom. * @param window The window. @@ -213,6 +255,14 @@ */ void SetCardinalAtom(Window window, AtomType atom, unsigned long value); +/** Read a window atom. + * @param window The window. + * @param atom The atom to read. + * @param value A pointer to the location to save the atom. + * @return 1 on success, 0 on failure. + */ +char GetWindowAtom(Window window, AtomType atom, Window *value); + /** Set a window atom. * @param window The window. * @param atom The atom to set. diff -Nru jwm-2.1.0+svn579/src/icon.c jwm-2.3.1+0~16~ubuntu14.10.1/src/icon.c --- jwm-2.1.0+svn579/src/icon.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/icon.c 2015-07-18 20:02:18.000000000 +0000 @@ -16,6 +16,7 @@ #include "misc.h" #include "hint.h" #include "color.h" +#include "settings.h" IconNode emptyIcon; @@ -32,82 +33,90 @@ struct IconPathNode *next; } IconPathNode; -static int iconSize = 0; static IconNode **iconHash; static IconPathNode *iconPaths; static IconPathNode *iconPathsTail; static GC iconGC; +static char iconSizeSet = 0; -static void SetIconSize(); static void DoDestroyIcon(int index, IconNode *icon); static void ReadNetWMIcon(ClientNode *np); -static IconNode *GetDefaultIcon(); +static void ReadWMHintIcon(ClientNode *np); +static IconNode *CreateIcon(void); +static IconNode *GetDefaultIcon(void); static IconNode *CreateIconFromData(const char *name, char **data); -static IconNode *CreateIconFromFile(const char *fileName); +static IconNode *CreateIconFromDrawable(Drawable d, Pixmap mask); +static IconNode *CreateIconFromFile(const char *fileName, + char save, char preserveAspect); static IconNode *CreateIconFromBinary(const unsigned long *data, unsigned int length); -static IconNode *LoadNamedIconHelper(const char *name, const char *path); +static IconNode *LoadNamedIconHelper(const char *name, const char *path, + char save, char preserveAspect); +#if defined(USE_ICONS) static IconNode *LoadSuffixedIcon(const char *path, const char *name, const char *suffix); +#endif -static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height); +static ImageNode *GetBestImage(IconNode *icon, int rwidth, int rheight); +static ScaledIconNode *GetScaledIcon(IconNode *icon, ImageNode *iconImage, + long fg, int rwidth, int rheight); static void InsertIcon(IconNode *icon); static IconNode *FindIcon(const char *name); -static int GetHash(const char *str); +static unsigned int GetHash(const char *str); /** Initialize icon data. * This must be initialized before parsing the configuration. */ -void InitializeIcons() { - - int x; - +void InitializeIcons(void) +{ + unsigned int x; iconPaths = NULL; iconPathsTail = NULL; - iconHash = Allocate(sizeof(IconNode*) * HASH_SIZE); for(x = 0; x < HASH_SIZE; x++) { iconHash[x] = NULL; } - memset(&emptyIcon, 0, sizeof(emptyIcon)); - + iconSizeSet = 0; } /** Startup icon support. */ -void StartupIcons() { - +void StartupIcons(void) +{ XGCValues gcValues; + XIconSize iconSize; unsigned long gcMask; - gcMask = GCGraphicsExposures; gcValues.graphics_exposures = False; iconGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); + iconSize.min_width = settings.titleHeight - 4; + iconSize.min_height = settings.titleHeight - 4; + iconSize.max_width = iconSize.min_width; + iconSize.max_height = iconSize.min_height; + iconSize.width_inc = 1; + iconSize.height_inc = 1; + JXSetIconSizes(display, rootWindow, &iconSize, 1); } /** Shutdown icon support. */ -void ShutdownIcons() { - - int x; - +void ShutdownIcons(void) +{ + unsigned int x; for(x = 0; x < HASH_SIZE; x++) { while(iconHash[x]) { DoDestroyIcon(x, iconHash[x]); } } - JXFreeGC(display, iconGC); - } /** Destroy icon data. */ -void DestroyIcons() { - +void DestroyIcons(void) +{ IconPathNode *pn; - while(iconPaths) { pn = iconPaths->next; Release(iconPaths->path); @@ -115,42 +124,19 @@ iconPaths = pn; } iconPathsTail = NULL; - if(iconHash) { Release(iconHash); iconHash = NULL; } } -/** Set the preferred icon sizes on the root window. */ -void SetIconSize() { - - XIconSize size; - - if(!iconSize) { - - /* FIXME: compute values based on the sizes we can actually use. */ - iconSize = 32; - - size.min_width = iconSize; - size.min_height = iconSize; - size.max_width = iconSize; - size.max_height = iconSize; - size.width_inc = iconSize; - size.height_inc = iconSize; - - JXSetIconSizes(display, rootWindow, &size, 1); - - } - -} - /** Add an icon search path. */ -void AddIconPath(char *path) { +void AddIconPath(char *path) +{ IconPathNode *ip; int length; - int addSep; + char addSep; if(!path) { return; @@ -185,11 +171,11 @@ } /** Draw an icon. */ -void PutIcon(IconNode *icon, Drawable d, int x, int y, - int width, int height) { - +void PutIcon(const VisualData *visual, IconNode *icon, Drawable d, long fg, + int x, int y, int width, int height) +{ + ImageNode *imageNode; ScaledIconNode *node; - int ix, iy; Assert(icon); @@ -198,17 +184,20 @@ } /* Scale the icon. */ - node = GetScaledIcon(icon, width, height); - + imageNode = GetBestImage(icon, width, height); + node = GetScaledIcon(icon, imageNode, fg, width, height); if(node) { - ix = x + (width - node->width) / 2; - iy = y + (height - node->height) / 2; + const int ix = x + (width - node->width) / 2; + const int iy = y + (height - node->height) / 2; /* If we support xrender, use it. */ - if(PutScaledRenderIcon(icon, node, d, ix, iy)) { +#ifdef USE_XRENDER + if(haveRender) { + PutScaledRenderIcon(visual, imageNode, d, ix, iy); return; } +#endif /* Draw the icon the old way. */ if(node->image != None) { @@ -221,7 +210,7 @@ /* Draw the icon. */ JXCopyArea(display, node->image, d, iconGC, 0, 0, - node->width, node->height, ix, iy); + node->width, node->height, ix, iy); /* Reset the clip mask. */ if(node->mask != None) { @@ -236,24 +225,29 @@ } /** Load the icon for a client. */ -void LoadIcon(ClientNode *np) { +void LoadIcon(ClientNode *np) +{ IconPathNode *ip; Assert(np); - SetIconSize(); - /* If client already has an icon, destroy it first. */ DestroyIcon(np->icon); np->icon = NULL; - /* Attempt to read _NET_WM_ICON for an icon */ + /* Attempt to read _NET_WM_ICON for an icon. */ ReadNetWMIcon(np); if(np->icon) { return; } + /* Attempt to read an icon from XWMHints. */ + ReadWMHintIcon(np); + if(np->icon) { + return; + } + /* Attempt to find an icon for this program in the icon directory */ if(np->instanceName) { for(ip = iconPaths; ip; ip = ip->next) { @@ -279,6 +273,13 @@ } #endif +#ifdef USE_ICONS + np->icon = LoadSuffixedIcon(ip->path, np->instanceName, ".xbm"); + if(np->icon) { + return; + } +#endif + } } @@ -288,19 +289,22 @@ } /** Load an icon given a name, path, and suffix. */ +#if defined(USE_ICONS) IconNode *LoadSuffixedIcon(const char *path, const char *name, - const char *suffix) { + const char *suffix) +{ IconNode *result; ImageNode *image; char *iconName; + unsigned int len; Assert(path); Assert(name); Assert(suffix); - iconName = Allocate(strlen(name) - + strlen(path) + strlen(suffix) + 1); + len = strlen(name) + strlen(path) + strlen(suffix); + iconName = Allocate(len + 1); strcpy(iconName, path); strcat(iconName, name); strcat(iconName, suffix); @@ -315,7 +319,7 @@ if(image) { result = CreateIcon(); result->name = iconName; - result->image = image; + result->images = image; InsertIcon(result); return result; } else { @@ -324,22 +328,22 @@ } } +#endif /* defined(USE_PNG) || defined(USE_XPM) || defined(USE_JPEG) */ /** Load an icon from a file. */ -IconNode *LoadNamedIcon(const char *name) { +IconNode *LoadNamedIcon(const char *name, char save, char preserveAspect) +{ IconPathNode *ip; IconNode *icon; Assert(name); - SetIconSize(); - if(name[0] == '/') { - return CreateIconFromFile(name); + return CreateIconFromFile(name, save, preserveAspect); } else { for(ip = iconPaths; ip; ip = ip->next) { - icon = LoadNamedIconHelper(name, ip->path); + icon = LoadNamedIconHelper(name, ip->path, save, preserveAspect); if(icon) { return icon; } @@ -350,7 +354,9 @@ } /** Helper for loading icons by name. */ -IconNode *LoadNamedIconHelper(const char *name, const char *path) { +IconNode *LoadNamedIconHelper(const char *name, const char *path, + char save, char preserveAspect) +{ IconNode *result; char *temp; @@ -358,7 +364,7 @@ temp = AllocateStack(strlen(name) + strlen(path) + 1); strcpy(temp, path); strcat(temp, name); - result = CreateIconFromFile(temp); + result = CreateIconFromFile(temp, save, preserveAspect); ReleaseStack(temp); return result; @@ -366,34 +372,54 @@ } /** Read the icon property from a client. */ -void ReadNetWMIcon(ClientNode *np) { - +void ReadNetWMIcon(ClientNode *np) +{ + static const long MAX_LENGTH = 1 << 20; unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *data; - status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_ICON], - 0, 256 * 256 * 4, False, XA_CARDINAL, &realType, &realFormat, &count, - &extra, &data); - - if(status == Success && data) { + 0, MAX_LENGTH, False, XA_CARDINAL, + &realType, &realFormat, &count, &extra, &data); + if(status == Success && realFormat != 0 && data) { np->icon = CreateIconFromBinary((unsigned long*)data, count); JXFree(data); } - } +/** Read the icon WMHint property from a client. */ +void ReadWMHintIcon(ClientNode *np) +{ + XWMHints *hints; + hints = JXGetWMHints(display, np->window); + if(hints) { + Drawable d = None; + Pixmap mask = None; + if(hints->flags & IconMaskHint) { + mask = hints->icon_mask; + } + if(hints->flags & IconPixmapHint) { + d = hints->icon_pixmap; + } + if(d != None) { + np->icon = CreateIconFromDrawable(d, mask); + } + JXFree(hints); + } +} /** Create the default icon. */ -IconNode *GetDefaultIcon() { +IconNode *GetDefaultIcon(void) +{ return CreateIconFromData("default", x_xpm); } /** Create an icon from XPM image data. */ -IconNode *CreateIconFromData(const char *name, char **data) { +IconNode *CreateIconFromData(const char *name, char **data) +{ ImageNode *image; IconNode *result; @@ -411,7 +437,7 @@ if(image) { result = CreateIcon(); result->name = CopyString(name); - result->image = image; + result->images = image; InsertIcon(result); return result; } else { @@ -420,8 +446,24 @@ } +IconNode *CreateIconFromDrawable(Drawable d, Pixmap mask) +{ + ImageNode *image; + + image = LoadImageFromDrawable(d, mask); + if(image) { + IconNode *result = CreateIcon(); + result->images = image; + return result; + } else { + return NULL; + } +} + /** Create an icon from the specified file. */ -IconNode *CreateIconFromFile(const char *fileName) { +IconNode *CreateIconFromFile(const char *fileName, + char save, char preserveAspect) +{ ImageNode *image; IconNode *result; @@ -439,9 +481,12 @@ image = LoadImage(fileName); if(image) { result = CreateIcon(); - result->name = CopyString(fileName); - result->image = image; - InsertIcon(result); + result->preserveAspect = preserveAspect; + result->images = image; + if(save) { + result->name = CopyString(fileName); + InsertIcon(result); + } return result; } else { return NULL; @@ -449,46 +494,88 @@ } +/** Get the best image for the requested size. */ +ImageNode *GetBestImage(IconNode *icon, int rwidth, int rheight) +{ + /* Find the best image to use. + * Select the smallest image to completely cover the + * requested size. If no image completely covers the + * requested size, select the one that overlaps the most area. + * If no size is specified, use the largest. */ + ImageNode *best = icon->images; + ImageNode *ip = icon->images->next; + while(ip) { + const int best_area = best->width * best->height; + const int other_area = ip->width * ip->height; + int best_overlap; + int other_overlap; + if(rwidth == 0 && rheight == 0) { + best_overlap = 0; + other_overlap = 0; + } else if(rwidth == 0) { + best_overlap = Min(best->height, rheight); + other_overlap = Min(ip->height, rheight); + } else if(rheight == 0) { + best_overlap = Min(best->width, rwidth); + other_overlap = Min(ip->width, rwidth); + } else { + best_overlap = Min(best->width, rwidth) + * Min(best->height, rheight); + other_overlap = Min(ip->width, rwidth) + * Min(ip->height, rheight); + } + if(other_overlap > best_overlap) { + best = ip; + } else if(other_overlap == best_overlap) { + if(other_area < best_area) { + best = ip; + } + } + ip = ip->next; + } + return best; +} + /** Get a scaled icon. */ -ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) { +ScaledIconNode *GetScaledIcon(IconNode *icon, ImageNode *iconImage, + long fg, int rwidth, int rheight) +{ XColor color; XImage *image; + XPoint *points; ScaledIconNode *np; GC maskGC; int x, y; - int index, yindex; int scalex, scaley; /* Fixed point. */ int srcx, srcy; /* Fixed point. */ int ratio; /* Fixed point. */ int nwidth, nheight; unsigned char *data; - Assert(icon); - Assert(icon->image); - if(rwidth == 0) { - rwidth = icon->image->width; + rwidth = iconImage->width; } if(rheight == 0) { - rheight = icon->image->height; + rheight = iconImage->height; } - ratio = (icon->image->width << 16) / icon->image->height; - nwidth = Min(rwidth, (rheight * ratio) >> 16); - nheight = Min(rheight, (nwidth << 16) / ratio); - nwidth = (nheight * ratio) >> 16; - if(nwidth < 1) { - nwidth = 1; - } - if(nheight < 1) { - nheight = 1; + if(icon->preserveAspect) { + ratio = (iconImage->width << 16) / iconImage->height; + nwidth = Min(rwidth, (rheight * ratio) >> 16); + nheight = Min(rheight, (nwidth << 16) / ratio); + nwidth = (nheight * ratio) >> 16; + } else { + nheight = rheight; + nwidth = rwidth; } + nwidth = Max(1, nwidth); + nheight = Max(1, nheight); /* Check if this size already exists. * Note that XRender scales on the fly. */ - for(np = icon->nodes; np; np = np->next) { + for(np = iconImage->nodes; np; np = np->next) { #ifdef USE_XRENDER if(np->imagePicture != None) { np->width = nwidth; @@ -497,25 +584,38 @@ } #endif if(np->width == nwidth && np->height == nheight) { - return np; + if(!iconImage->bitmap || np->fg == fg) { + return np; + } } } /* See if we can use XRender to create the icon. */ - np = CreateScaledRenderIcon(icon, nwidth, nheight); - if(np) { +#ifdef USE_XRENDER + if(haveRender) { + np = CreateScaledRenderIcon(iconImage, fg); + + /* Don't keep the image data around after creating the icon. */ + Release(iconImage->data); + iconImage->data = NULL; + + np->width = nwidth; + np->height = nheight; + return np; } +#endif /* Create a new ScaledIconNode the old-fashioned way. */ np = Allocate(sizeof(ScaledIconNode)); + np->fg = fg; np->width = nwidth; np->height = nheight; - np->next = icon->nodes; + np->next = iconImage->nodes; #ifdef USE_XRENDER np->imagePicture = None; #endif - icon->nodes = np; + iconImage->nodes = np; /* Create a mask. */ np->mask = JXCreatePixmap(display, rootWindow, nwidth, nheight, 1); @@ -525,47 +625,62 @@ JXSetForeground(display, maskGC, 1); /* Create a temporary XImage for scaling. */ - image = JXCreateImage(display, rootVisual, rootDepth, ZPixmap, 0, - NULL, nwidth, nheight, 8, 0); + image = JXCreateImage(display, rootVisual.visual, rootVisual.depth, + ZPixmap, 0, NULL, nwidth, nheight, 8, 0); image->data = Allocate(sizeof(unsigned long) * nwidth * nheight); /* Determine the scale factor. */ - scalex = (icon->image->width << 16) / nwidth; - scaley = (icon->image->height << 16) / nheight; + scalex = (iconImage->width << 16) / nwidth; + scaley = (iconImage->height << 16) / nheight; - data = icon->image->data; + points = Allocate(sizeof(XPoint) * nwidth); + data = iconImage->data; srcy = 0; for(y = 0; y < nheight; y++) { + const int yindex = (srcy >> 16) * iconImage->width; + int pindex = 0; srcx = 0; - yindex = (srcy >> 16) * icon->image->width; for(x = 0; x < nwidth; x++) { - index = 4 * (yindex + (srcx >> 16)); - - color.red = data[index + 1]; - color.red |= color.red << 8; - color.green = data[index + 2]; - color.green |= color.green << 8; - color.blue = data[index + 3]; - color.blue |= color.blue << 8; - GetColor(&color); - - XPutPixel(image, x, y, color.pixel); - - if(data[index] >= 128) { - JXDrawPoint(display, np->mask, maskGC, x, y); + if(iconImage->bitmap) { + const int index = yindex + (srcx >> 16); + const int offset = index >> 3; + const int mask = 1 << (index & 7); + if(data[offset] & mask) { + points[pindex].x = x; + points[pindex].y = y; + XPutPixel(image, x, y, fg); + pindex += 1; + } + } else { + const int yindex = (srcy >> 16) * iconImage->width; + const int index = 4 * (yindex + (srcx >> 16)); + color.red = data[index + 1]; + color.red |= color.red << 8; + color.green = data[index + 2]; + color.green |= color.green << 8; + color.blue = data[index + 3]; + color.blue |= color.blue << 8; + GetColor(&color); + XPutPixel(image, x, y, color.pixel); + if(data[index] >= 128) { + points[pindex].x = x; + points[pindex].y = y; + pindex += 1; + } } - srcx += scalex; } - + JXDrawPoints(display, np->mask, maskGC, points, pindex, CoordModeOrigin); srcy += scaley; } + Release(points); /* Release the mask GC. */ JXFreeGC(display, maskGC); /* Create the color data pixmap. */ - np->image = JXCreatePixmap(display, rootWindow, nwidth, nheight, rootDepth); + np->image = JXCreatePixmap(display, rootWindow, nwidth, nheight, + rootVisual.depth); /* Render the image to the color data pixmap. */ JXPutImage(display, np->image, rootGC, image, 0, 0, 0, 0, nwidth, nheight); @@ -580,99 +695,107 @@ /** Create an icon from binary data (as specified via window properties). */ IconNode *CreateIconFromBinary(const unsigned long *input, - unsigned int length) { - - unsigned long height, width; - IconNode *result; - unsigned char *data; - unsigned int x, index; + unsigned int length) +{ + IconNode *result = NULL; + unsigned int offset = 0; if(!input) { return NULL; } - width = input[0]; - height = input[1]; + while(offset < length) { - if(JUNLIKELY(width * height + 2 > length)) { - Debug("invalid image size: %d x %d + 2 > %d", width, height, length); - return NULL; - } else if(JUNLIKELY(width == 0 || height == 0)) { - Debug("invalid image size: %d x %d", width, height); - return NULL; - } + const unsigned int width = input[offset + 0]; + const unsigned int height = input[offset + 1]; + unsigned char *data; + ImageNode *image; + unsigned int x, index; - result = CreateIcon(); + if(JUNLIKELY(width * height + 2 > length - offset)) { + Debug("invalid image size: %d x %d + 2 > %d", + width, height, length - offset); + return result; + } else if(JUNLIKELY(width == 0 || height == 0)) { + Debug("invalid image size: %d x %d", width, height); + return result; + } - result->image = Allocate(sizeof(ImageNode)); - result->image->width = width; - result->image->height = height; + if(result == NULL) { + result = CreateIcon(); + } - result->image->data = Allocate(4 * width * height); - data = result->image->data; + image = CreateImage(width, height, 0); + image->next = result->images; + result->images = image; + data = image->data; - /* Note: the data types here might be of different sizes. */ - index = 0; - for(x = 0; x < width * height; x++) { - data[index++] = input[x + 2] >> 24; - data[index++] = (input[x + 2] >> 16) & 0xFF; - data[index++] = (input[x + 2] >> 8) & 0xFF; - data[index++] = input[x + 2] & 0xFF; - } + /* Note: the data types here might be of different sizes. */ + index = 0; + for(x = 0; x < width * height; x++) { + data[index++] = (input[offset + x + 2] >> 24) & 0xFF; + data[index++] = (input[offset + x + 2] >> 16) & 0xFF; + data[index++] = (input[offset + x + 2] >> 8) & 0xFF; + data[index++] = (input[offset + x + 2] >> 0) & 0xFF; + } - /* Don't insert this icon since it is transient. */ + /* Move to the next size. */ + offset += 2 + width * height; - return result; + /* Don't insert this icon into the hash since it is transient. */ + } + + return result; } /** Create an empty icon node. */ -IconNode *CreateIcon() { - +IconNode *CreateIcon(void) +{ IconNode *icon; - icon = Allocate(sizeof(IconNode)); icon->name = NULL; - icon->image = NULL; - icon->nodes = NULL; - icon->useRender = 1; + icon->images = NULL; icon->next = NULL; icon->prev = NULL; - + icon->preserveAspect = 1; return icon; - } /** Helper method for destroy icons. */ -void DoDestroyIcon(int index, IconNode *icon) { - - ScaledIconNode *np; - +void DoDestroyIcon(int index, IconNode *icon) +{ if(icon) { - while(icon->nodes) { - np = icon->nodes->next; + ImageNode *image = icon->images; + while(image) { + ScaledIconNode *np = image->nodes; + while(np) { + ScaledIconNode *next_node = np->next; #ifdef USE_XRENDER - if(icon->nodes->imagePicture != None) { - JXRenderFreePicture(display, icon->nodes->imagePicture); - } + if(np->imagePicture != None) { + JXRenderFreePicture(display, np->imagePicture); + } + if(np->alphaPicture != None) { + JXRenderFreePicture(display, np->alphaPicture); + } #endif + if(np->image != None) { + JXFreePixmap(display, np->image); + } + if(np->mask != None) { + JXFreePixmap(display, np->mask); + } - if(icon->nodes->image != None) { - JXFreePixmap(display, icon->nodes->image); - } - if(icon->nodes->mask != None) { - JXFreePixmap(display, icon->nodes->mask); + Release(np); + np = next_node; } - - Release(icon->nodes); - icon->nodes = np; + image = image->next; } - if(icon->name) { Release(icon->name); } - DestroyImage(icon->image); + DestroyImage(icon->images); if(icon->prev) { icon->prev->next = icon->next; @@ -687,45 +810,34 @@ } /** Destroy an icon. */ -void DestroyIcon(IconNode *icon) { - - int index; - +void DestroyIcon(IconNode *icon) +{ if(icon && !icon->name) { - index = GetHash(icon->name); + const unsigned int index = GetHash(icon->name); DoDestroyIcon(index, icon); } - } /** Insert an icon to the icon hash table. */ -void InsertIcon(IconNode *icon) { - - int index; - +void InsertIcon(IconNode *icon) +{ + unsigned int index; Assert(icon); Assert(icon->name); - index = GetHash(icon->name); - icon->prev = NULL; if(iconHash[index]) { iconHash[index]->prev = icon; } icon->next = iconHash[index]; iconHash[index] = icon; - } /** Find a icon in the icon hash table. */ -IconNode *FindIcon(const char *name) { - - IconNode *icon; - int index; - - index = GetHash(name); - - icon = iconHash[index]; +IconNode *FindIcon(const char *name) +{ + const unsigned int index = GetHash(name); + IconNode *icon = iconHash[index]; while(icon) { if(!strcmp(icon->name, name)) { return icon; @@ -734,24 +846,20 @@ } return NULL; - } /** Get the hash for a string. */ -int GetHash(const char *str) { - - int x; +unsigned int GetHash(const char *str) +{ unsigned int hash = 0; - if(str) { + unsigned int x; for(x = 0; str[x]; x++) { hash = (hash + (hash << 5)) ^ (unsigned int)str[x]; } hash &= (HASH_SIZE - 1); } - return hash; - } #endif /* USE_ICONS */ diff -Nru jwm-2.1.0+svn579/src/icon.h jwm-2.3.1+0~16~ubuntu14.10.1/src/icon.h --- jwm-2.1.0+svn579/src/icon.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/icon.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,12 +11,14 @@ #define ICON_H struct ClientNode; +struct VisualData; /** Structure to hold a scaled icon. */ typedef struct ScaledIconNode { int width; /**< The scaled width of the icon. */ int height; /**< The scaled height of the icon. */ + long fg; /**< Foreground color for bitmaps. */ Pixmap image; Pixmap mask; @@ -33,13 +35,14 @@ typedef struct IconNode { char *name; /**< The name of the icon. */ - struct ImageNode *image; /**< The image data. */ - struct ScaledIconNode *nodes; /**< Scaled versions of the icon. */ - int useRender; /**< 1 if render can be used. */ - + struct ImageNode *images; /**< Images associated with this icon. */ + struct IconNode *next; /**< The next icon in the list. */ struct IconNode *prev; /**< The previous icon in the list. */ + char preserveAspect; /**< Set to preserve the aspect ratio + * of the icon when scaling. */ + } IconNode; extern IconNode emptyIcon; @@ -47,10 +50,10 @@ #ifdef USE_ICONS /*@{*/ -void InitializeIcons(); -void StartupIcons(); -void ShutdownIcons(); -void DestroyIcons(); +void InitializeIcons(void); +void StartupIcons(void); +void ShutdownIcons(void); +void DestroyIcons(void); /*@}*/ /** Add an icon path. @@ -62,15 +65,17 @@ /** Render an icon. * This will scale an icon if necessary to fit the requested size. The * aspect ratio of the icon is preserved. + * @param visual Visual data to use. * @param icon The icon to render. * @param d The drawable on which to place the icon. + * @param fg The foreground color. * @param x The x offset on the drawable to render the icon. * @param y The y offset on the drawable to render the icon. * @param width The width of the icon to display. * @param height The height of the icon to display. */ -void PutIcon(IconNode *icon, Drawable d, int x, int y, - int width, int height); +void PutIcon(const struct VisualData *visual, IconNode *icon, Drawable d, + long fg, int x, int y, int width, int height); /** Load an icon for a client. * @param np The client. @@ -79,33 +84,30 @@ /** Load an icon. * @param name The name of the icon to load. + * @param save Set if this icon should be saved in the icon hash. + * @param preserveAspect Set to preserve the aspect ratio when scaling. * @return A pointer to the icon (NULL if not found). */ -IconNode *LoadNamedIcon(const char *name); +IconNode *LoadNamedIcon(const char *name, char save, char preserveAspect); /** Destroy an icon. * @param icon The icon to destroy. */ void DestroyIcon(IconNode *icon); -/** Create and initialize a new icon structure. - * @return The new icon structure. - */ -IconNode *CreateIcon(); - #else -#define ICON_DUMMY_FUNCTION 0 +#define ICON_DUMMY_FUNCTION ((void)0) -#define InitializeIcons() ICON_DUMMY_FUNCTION -#define StartupIcons() ICON_DUMMY_FUNCTION -#define ShutdownIcons() ICON_DUMMY_FUNCTION -#define DestroyIcons() ICON_DUMMY_FUNCTION -#define AddIconPath( a ) ICON_DUMMY_FUNCTION -#define PutIcon( a, b, c, d, e, f ) ICON_DUMMY_FUNCTION -#define LoadIcon( a ) ICON_DUMMY_FUNCTION -#define LoadNamedIcon( a ) ICON_DUMMY_FUNCTION -#define DestroyIcon( a ) ICON_DUMMY_FUNCTION +#define InitializeIcons() ICON_DUMMY_FUNCTION +#define StartupIcons() ICON_DUMMY_FUNCTION +#define ShutdownIcons() ICON_DUMMY_FUNCTION +#define DestroyIcons() ICON_DUMMY_FUNCTION +#define AddIconPath( a ) ICON_DUMMY_FUNCTION +#define PutIcon( a, b, c, d, e, f, g, h ) ICON_DUMMY_FUNCTION +#define LoadIcon( a ) ICON_DUMMY_FUNCTION +#define LoadNamedIcon( a, b, c ) NULL +#define DestroyIcon( a ) ICON_DUMMY_FUNCTION #endif /* USE_ICONS */ diff -Nru jwm-2.1.0+svn579/src/image.c jwm-2.3.1+0~16~ubuntu14.10.1/src/image.c --- jwm-2.1.0+svn579/src/image.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/image.c 2015-07-18 20:02:18.000000000 +0000 @@ -19,6 +19,13 @@ # ifdef USE_JPEG # include # endif +# ifdef USE_CAIRO +# include +# include +# endif +# ifdef USE_RSVG +# include +# endif #endif /* MAKE_DEPEND */ #include "image.h" @@ -26,6 +33,11 @@ #include "error.h" #include "color.h" +#ifdef USE_CAIRO +#ifdef USE_RSVG +static ImageNode *LoadSVGImage(const char *fileName); +#endif +#endif #ifdef USE_JPEG static ImageNode *LoadJPEGImage(const char *fileName); #endif @@ -35,22 +47,28 @@ #ifdef USE_XPM static ImageNode *LoadXPMImage(const char *fileName); #endif +#ifdef USE_XBM +static ImageNode *LoadXBMImage(const char *fileName); +#endif +#ifdef USE_ICONS static ImageNode *CreateImageFromXImages(XImage *image, XImage *shape); +#endif #ifdef USE_XPM static int AllocateColor(Display *d, Colormap cmap, char *name, - XColor *c, void *closure); + XColor *c, void *closure); static int FreeColors(Display *d, Colormap cmap, Pixel *pixels, int n, - void *closure); + void *closure); #endif /** Load an image from the specified file. */ -ImageNode *LoadImage(const char *fileName) { +ImageNode *LoadImage(const char *fileName) +{ - ImageNode *result; + ImageNode *result = NULL; if(!fileName) { - return NULL; + return result; } /* Attempt to load the file as a PNG image. */ @@ -69,6 +87,16 @@ } #endif + /* Attempt to load the file as an SVG image. */ +#ifdef USE_CAIRO +#ifdef USE_RSVG + result = LoadSVGImage(fileName); + if(result) { + return result; + } +#endif +#endif + /* Attempt to load the file as an XPM image. */ #ifdef USE_XPM result = LoadXPMImage(fileName); @@ -77,12 +105,21 @@ } #endif - return NULL; + /* Attempt to load the file as an XBM image. */ +#ifdef USE_XBM + result = LoadXBMImage(fileName); + if(result) { + return result; + } +#endif + + return result; } /** Load an image from the specified XPM data. */ -ImageNode *LoadImageFromData(char **data) { +ImageNode *LoadImageFromData(char **data) +{ ImageNode *result = NULL; @@ -114,12 +151,36 @@ } +/** Load an image from a pixmap. */ +#ifdef USE_ICONS +ImageNode *LoadImageFromDrawable(Drawable pmap, Pixmap mask) +{ + XImage *mask_image = NULL; + XImage *icon_image; + Window rwindow; + int x, y; + unsigned int width, height; + unsigned int border_width; + unsigned int depth; + + JXGetGeometry(display, pmap, &rwindow, &x, &y, &width, &height, + &border_width, &depth); + icon_image = JXGetImage(display, pmap, 0, 0, width, height, + AllPlanes, ZPixmap); + if(mask != None) { + mask_image = JXGetImage(display, mask, 0, 0, width, height, 1, ZPixmap); + } + return CreateImageFromXImages(icon_image, mask_image); +} +#endif + /** Load a PNG image from the given file name. * Since libpng uses longjmp, this function is not reentrant to simplify * the issues surrounding longjmp and local variables. */ #ifdef USE_PNG -ImageNode *LoadPNGImage(const char *fileName) { +ImageNode *LoadPNGImage(const char *fileName) +{ static ImageNode *result; static FILE *fd; @@ -168,15 +229,11 @@ fclose(fd); } if(rows) { - Release(rows); - } - if(result) { - if(result->data) { - Release(result->data); - } - Release(result); + ReleaseStack(rows); } + DestroyImage(result); Warning(_("error reading PNG image: %s"), fileName); + return NULL; } pngInfo = png_create_info_struct(pngData); @@ -200,12 +257,9 @@ png_read_info(pngData, pngInfo); - result = Allocate(sizeof(ImageNode)); - png_get_IHDR(pngData, pngInfo, &width, &height, - &bitDepth, &colorType, NULL, NULL, NULL); - result->width = (int)width; - result->height = (int)height; + &bitDepth, &colorType, NULL, NULL, NULL); + result = CreateImage(width, height, 0); png_set_expand(pngData); @@ -226,10 +280,7 @@ png_read_update_info(pngData, pngInfo); rowBytes = png_get_rowbytes(pngData, pngInfo); - result->data = Allocate(rowBytes * result->height); - rows = AllocateStack(result->height * sizeof(result->data)); - y = 0; for(x = 0; x < result->height; x++) { rows[x] = &result->data[y]; @@ -264,7 +315,8 @@ longjmp(es->jbuffer, 1); } -ImageNode *LoadJPEGImage(const char *fileName) { +ImageNode *LoadJPEGImage(const char *fileName) +{ static ImageNode *result; static struct jpeg_decompress_struct cinfo; @@ -292,16 +344,10 @@ /* Control will return here if an error was encountered. */ if(setjmp(jerr.jbuffer)) { - - if(result) { - DestroyImage(result); - } - + DestroyImage(result); jpeg_destroy_decompress(&cinfo); fclose(fd); - return NULL; - } /* Prepare to load the file. */ @@ -315,11 +361,9 @@ jpeg_start_decompress(&cinfo); rowStride = cinfo.output_width * cinfo.output_components; buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, - JPOOL_IMAGE, rowStride, 1); + JPOOL_IMAGE, rowStride, 1); - result = Allocate(sizeof(ImageNode)); - result->width = cinfo.image_width; - result->height = cinfo.image_height; + result = CreateImage(cinfo.image_width, cinfo.image_height, 0); result->data = Allocate(4 * result->width * result->height); /* Read lines. */ @@ -356,9 +400,80 @@ } #endif /* USE_JPEG */ +#ifdef USE_CAIRO +#ifdef USE_RSVG +ImageNode *LoadSVGImage(const char *fileName) +{ + +#if !GLIB_CHECK_VERSION(2, 35, 0) + static char initialized = 0; +#endif + ImageNode *result = NULL; + RsvgHandle *rh; + RsvgDimensionData dim; + GError *e; + cairo_surface_t *target; + cairo_t *context; + int stride; + int i; + + Assert(fileName); + +#if !GLIB_CHECK_VERSION(2, 35, 0) + if(!initialized) { + initialized = 1; + g_type_init(); + } +#endif + + /* Load the image from the file. */ + e = NULL; + rh = rsvg_handle_new_from_file(fileName, &e); + if(!rh) { + return NULL; + } + + rsvg_handle_get_dimensions(rh, &dim); + + result = CreateImage(dim.width, dim.height, 0); + memset(result->data, 0, dim.width * dim.height * 4); + + /* Create the target surface. */ + stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, dim.width); + target = cairo_image_surface_create_for_data(result->data, + CAIRO_FORMAT_ARGB32, + dim.width, dim.height, stride); + context = cairo_create(target); + cairo_paint_with_alpha(context, 0.0); + rsvg_handle_render_cairo(rh, context); + cairo_destroy(context); + cairo_surface_destroy(target); + g_object_unref(rh); + + for(i = 0; i < 4 * dim.width * dim.height; i += 4) { + const unsigned int temp = *(unsigned int*)&result->data[i]; + const unsigned int alpha = (temp >> 24) & 0xFF; + const unsigned int red = (temp >> 16) & 0xFF; + const unsigned int green = (temp >> 8) & 0xFF; + const unsigned int blue = (temp >> 0) & 0xFF; + result->data[i + 0] = alpha; + if(alpha > 0) { + result->data[i + 1] = (red * 255) / alpha; + result->data[i + 2] = (green * 255) / alpha; + result->data[i + 3] = (blue * 255) / alpha; + } + } + + return result; + +} +#endif /* USE_RSVG */ +#endif /* USE_CAIRO */ + /** Load an XPM image from the specified file. */ #ifdef USE_XPM -ImageNode *LoadXPMImage(const char *fileName) { +ImageNode *LoadXPMImage(const char *fileName) +{ ImageNode *result = NULL; @@ -387,8 +502,30 @@ } #endif /* USE_XPM */ +/** Load an XBM image from the specified file. */ +#ifdef USE_XBM +ImageNode *LoadXBMImage(const char *fileName) +{ + ImageNode *result = NULL; + unsigned int width, height; + int hotx, hoty; + unsigned char *data; + int rc; + + rc = XReadBitmapFileData(fileName, &width, &height, &data, &hotx, &hoty); + if(rc == BitmapSuccess) { + result = CreateImage(width, height, 1); + XFree(data); + } + + return result; +} +#endif /* USE_XBM */ + /** Create an image from XImages giving color and shape information. */ -ImageNode *CreateImageFromXImages(XImage *image, XImage *shape) { +#ifdef USE_ICONS +ImageNode *CreateImageFromXImages(XImage *image, XImage *shape) +{ ImageNode *result; XColor color; @@ -396,11 +533,7 @@ int index; int x, y; - result = Allocate(sizeof(ImageNode)); - result->data = Allocate(4 * image->width * image->height); - result->width = image->width; - result->height = image->height; - + result = CreateImage(image->width, image->height, 0); index = 0; for(y = 0; y < image->height; y++) { for(x = 0; x < image->width; x++) { @@ -428,19 +561,42 @@ return result; } +#endif /* USE_ICONS */ + +ImageNode *CreateImage(unsigned int width, unsigned int height, char bitmap) +{ + unsigned int image_size; + if(bitmap) { + image_size = (width * height + 7) / 8; + } else { + image_size = 4 * width * height; + } + ImageNode *image = Allocate(sizeof(ImageNode)); + image->data = Allocate(image_size); + image->next = NULL; + image->nodes = NULL; + image->bitmap = 0; + image->width = width; + image->height = height; + return image; +} /** Destroy an image node. */ void DestroyImage(ImageNode *image) { - if(image) { - Release(image->data); + while(image) { + ImageNode *next = image->next; + if(image->data) { + Release(image->data); + } Release(image); + image = next; } } /** Callback to allocate a color for libxpm. */ #ifdef USE_XPM int AllocateColor(Display *d, Colormap cmap, char *name, - XColor *c, void *closure) + XColor *c, void *closure) { if(name) { @@ -460,10 +616,8 @@ */ #ifdef USE_XPM int FreeColors(Display *d, Colormap cmap, Pixel *pixels, int n, - void *closure) { - + void *closure) +{ return 1; - } #endif /* USE_XPM */ - diff -Nru jwm-2.1.0+svn579/src/image.h jwm-2.3.1+0~16~ubuntu14.10.1/src/image.h --- jwm-2.1.0+svn579/src/image.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/image.h 2015-07-18 20:02:18.000000000 +0000 @@ -1,7 +1,7 @@ /** * @file image.h * @author Joe Wingbermuehle - * @date 2005-2006 + * @date 2005-2014 * * @brief Functions to load images. * @@ -10,12 +10,17 @@ #ifndef IMAGE_H #define IMAGE_H +struct ScaledIconNode; + /** Structure to represent an image. */ typedef struct ImageNode { - int width; /**< Width of the image. */ - int height; /**< Height of the image. */ - unsigned char *data; /**< Image data. */ + struct ImageNode *next; /**< Next image node (if multiple sizes). */ + struct ScaledIconNode *nodes; /**< Icons associated with this image. */ + unsigned char *data; /**< Image data. */ + int width; /**< Width of the image. */ + int height; /**< Height of the image. */ + char bitmap; /**< 1 if a bitmap, 0 otherwise. */ } ImageNode; @@ -28,14 +33,28 @@ /** Load an image from data. * The data must be in the format from the EWMH spec. * @param data The image data. - * @return A new image node (NULL if there were errors. + * @return A new image node (NULL if there were errors). */ ImageNode *LoadImageFromData(char **data); +/** Load an image from a Drawable. + * @param pmap The drawable. + * @param mask The mask (may be None). + * @return a new image node (NULL if there were errors). + */ +ImageNode *LoadImageFromDrawable(Drawable pmap, Pixmap mask); + +/** Create an image node. + * @param width The image width. + * @param height The image height. + * @param bitmap 1 if a bitmap, 0 otherwise. + * @return A newly allocated image node. + */ +ImageNode *CreateImage(unsigned int width, unsigned int height, char bitmap); + /** Destroy an image node. * @param image The image to destroy. */ void DestroyImage(ImageNode *image); #endif /* IMAGE_H */ - diff -Nru jwm-2.1.0+svn579/src/jwm.h jwm-2.3.1+0~16~ubuntu14.10.1/src/jwm.h --- jwm-2.1.0+svn579/src/jwm.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/jwm.h 2015-07-18 20:02:18.000000000 +0000 @@ -16,6 +16,7 @@ # include # include +# include # include # include @@ -113,51 +114,19 @@ # endif #endif -#define DEFAULT_DESKTOP_WIDTH 4 -#define DEFAULT_DESKTOP_HEIGHT 1 - -#define MAX_INCLUDE_DEPTH 16 - -#define MAX_BORDER_WIDTH 32 -#define MIN_BORDER_WIDTH 1 -#define DEFAULT_BORDER_WIDTH 4 - -#define MAX_TITLE_HEIGHT 64 -#define MIN_TITLE_HEIGHT 2 -#define DEFAULT_TITLE_HEIGHT 20 - -#define MAX_DOUBLE_CLICK_DELTA 32 -#define MIN_DOUBLE_CLICK_DELTA 0 -#define DEFAULT_DOUBLE_CLICK_DELTA 2 - -#define MAX_DOUBLE_CLICK_SPEED 2000 -#define MIN_DOUBLE_CLICK_SPEED 1 -#define DEFAULT_DOUBLE_CLICK_SPEED 400 - -#define MAX_SNAP_DISTANCE 32 -#define MIN_SNAP_DISTANCE 1 -#define DEFAULT_SNAP_DISTANCE 5 - -#define MAX_TRAY_BORDER 32 -#define MIN_TRAY_BORDER 0 -#define DEFAULT_TRAY_BORDER 1 - -#define MAX_WINDOW_WIDTH (1 << 15) -#define MAX_WINDOW_HEIGHT (1 << 15) - -#define MOVE_DELTA 3 - -#define RESTART_DELAY 50000 +/** Maximum window size. + * Making this larger will require code changes in some places where + * there are fixed point calculations. */ +#define MAX_WINDOW_WIDTH (1 << 15) +#define MAX_WINDOW_HEIGHT (1 << 15) + +#define MAX_INCLUDE_DEPTH 16 /**< Max includes. */ +#define MOVE_DELTA 3 /**< Pixels before trigging a move. */ +#define RESTART_DELAY 1000 /**< Max timeout in ms before restarting. */ +#define URGENCY_DELAY 500 /**< Flash timeout in ms for urgency. */ #define SHELL_NAME "/bin/sh" -#define DEFAULT_MENU_TITLE "JWM" - -/** Fixed radius of 4x4 */ -#ifdef USE_SHAPE -# define CORNER_RADIUS 4 -#endif - #ifdef __GNUC__ # if __GNUC__ >= 3 # define JLIKELY(x) __builtin_expect(!!(x), 1) diff -Nru jwm-2.1.0+svn579/src/jxlib.h jwm-2.3.1+0~16~ubuntu14.10.1/src/jxlib.h --- jwm-2.1.0+svn579/src/jxlib.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/jxlib.h 2015-07-18 20:02:18.000000000 +0000 @@ -43,6 +43,9 @@ #define JXClearWindow( a, b ) \ ( SetCheckpoint(), XClearWindow( a, b ) ) +#define JXClearArea( a, b, c, d, e, f, g ) \ + ( SetCheckpoint(), XClearArea( a, b, c, d, e, f, g ) ) + #define JXCloseDisplay( a ) \ ( SetCheckpoint(), XCloseDisplay( a ) ) @@ -106,6 +109,9 @@ #define JXDrawPoint( a, b, c, d, e ) \ ( SetCheckpoint(), XDrawPoint( a, b, c, d, e ) ) +#define JXDrawPoints( a, b, c, d, e, f ) \ + ( SetCheckpoint(), XDrawPoints( a, b, c, d, e, f ) ) + #define JXDrawLine( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XDrawLine( a, b, c, d, e, f, g ) ) @@ -124,6 +130,9 @@ #define JXFillArcs( a, b, c, d, e ) \ ( SetCheckpoint(), XFillArcs( a, b, c, d, e ) ) +#define JXSetLineAttributes( a, b, c, d, e, f ) \ + ( SetCheckpoint(), XSetLineAttributes( a, b, c, d, e, f ) ) + #define JXDrawString( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XDrawString( a, b, c, d, e, f, g ) ) @@ -287,6 +296,9 @@ #define JXRestackWindows( a, b, c ) \ ( SetCheckpoint(), XRestackWindows( a, b, c ) ) +#define JXRaiseWindow( a, b ) \ + ( SetCheckpoint(), XRaiseWindow( a, b ) ) + #define JXSelectInput( a, b, c ) \ ( SetCheckpoint(), XSelectInput( a, b, c ) ) @@ -314,6 +326,9 @@ #define JXSetForeground( a, b, c ) \ ( SetCheckpoint(), XSetForeground( a, b, c ) ) +#define JXGetInputFocus( a, b, c ) \ + ( SetCheckpoint(), XGetInputFocus( a, b, c ) ) + #define JXSetInputFocus( a, b, c, d ) \ ( SetCheckpoint(), XSetInputFocus( a, b, c, d ) ) @@ -345,6 +360,9 @@ ( SetCheckpoint(), \ XShapeQueryExtents( a, b, c, d, e, f, g, h, i, j, k, l ) ) +#define JXShapeGetRectangles( a, b, c, d, e ) \ + ( SetCheckpoint(), XShapeGetRectangles( a, b, c, d, e ) ) + #define JXShapeSelectInput( a, b, c ) \ ( SetCheckpoint(), XShapeSelectInput( a, b, c ) ) @@ -384,6 +402,12 @@ #define JXGetSelectionOwner( a, b ) \ ( SetCheckpoint(), XGetSelectionOwner( a, b ) ) +#define JXSetRegion( a, b, c ) \ + ( SetCheckpoint(), XSetRegion( a, b, c ) ) + +#define JXGetGeometry( a, b, c, d, e, f, g, h, i ) \ + ( SetCheckpoint(), XGetGeometry( a, b, c, d, e, f, g, h, i ) ) + /* XFT */ #define JXftFontOpenName( a, b, c ) \ @@ -419,6 +443,9 @@ #define JXftFontClose( a, b ) \ ( SetCheckpoint(), XftFontClose( a, b ) ) +#define JXftDrawSetClip( a, b ) \ + ( SetCheckpoint(), XftDrawSetClip( a, b ) ) + /* Xrender */ #define JXRenderQueryExtension( a, b, c ) \ diff -Nru jwm-2.1.0+svn579/src/key.c jwm-2.3.1+0~16~ubuntu14.10.1/src/key.c --- jwm-2.1.0+svn579/src/key.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/key.c 2015-07-18 20:02:18.000000000 +0000 @@ -14,7 +14,6 @@ #include "clientlist.h" #include "command.h" #include "error.h" -#include "main.h" #include "misc.h" #include "root.h" #include "tray.h" @@ -73,31 +72,30 @@ }; static KeyNode *bindings; -static unsigned int lockMask; +unsigned int lockMask; static unsigned int GetModifierMask(XModifierKeymap *modmap, KeySym key); static unsigned int ParseModifierString(const char *str); static KeySym ParseKeyString(const char *str); -static int ShouldGrab(KeyType key); +static char ShouldGrab(KeyType key); static void GrabKey(KeyNode *np, Window win); /** Initialize key data. */ -void InitializeKeys() { - +void InitializeKeys(void) +{ bindings = NULL; lockMask = 0; - } /** Startup key bindings. */ -void StartupKeys() { +void StartupKeys(void) +{ XModifierKeymap *modmap; KeyNode *np; TrayType *tp; int x; - /* Get the keys that we don't care about (num lock, etc). */ modmap = JXGetModifierMapping(display); for(x = 0; x < sizeof(lockMods) / sizeof(lockMods[0]); x++) { @@ -129,15 +127,15 @@ } - } /** Shutdown key bindings. */ -void ShutdownKeys() { +void ShutdownKeys(void) +{ ClientNode *np; TrayType *tp; - int layer; + unsigned int layer; /* Ungrab keys on client windows. */ for(layer = 0; layer < LAYER_COUNT; layer++) { @@ -157,10 +155,9 @@ } /** Destroy key data. */ -void DestroyKeys() { - +void DestroyKeys(void) +{ KeyNode *np; - while(bindings) { np = bindings->next; if(bindings->command) { @@ -169,14 +166,13 @@ Release(bindings); bindings = np; } - } /** Grab a key. */ -void GrabKey(KeyNode *np, Window win) { - - int x; - int index, maxIndex; +void GrabKey(KeyNode *np, Window win) +{ + unsigned int x; + unsigned int index, maxIndex; unsigned int mask; /* Don't attempt to grab if there is nothing to grab. */ @@ -206,7 +202,8 @@ } /** Get the key action from an event. */ -KeyType GetKey(const XKeyEvent *event) { +KeyType GetKey(const XKeyEvent *event) +{ KeyNode *np; unsigned int state; @@ -226,7 +223,8 @@ } /** Run a command invoked from a key binding. */ -void RunKeyCommand(const XKeyEvent *event) { +void RunKeyCommand(const XKeyEvent *event) +{ KeyNode *np; unsigned int state; @@ -244,10 +242,10 @@ } /** Show a root menu caused by a key binding. */ -void ShowKeyMenu(const XKeyEvent *event) { +void ShowKeyMenu(const XKeyEvent *event) +{ KeyNode *np; - int button; unsigned int state; /* Remove the lock key modifiers. */ @@ -255,8 +253,8 @@ for(np = bindings; np; np = np->next) { if(np->state == state && np->code == event->keycode) { - button = atoi(np->command); - if(button >= 0 && button <= 9) { + const int button = GetRootMenuIndexFromString(np->command); + if(JLIKELY(button >= 0)) { ShowRootMenu(button, 0, 0); } return; @@ -266,7 +264,8 @@ } /** Determine if a key should be grabbed on client windows. */ -int ShouldGrab(KeyType key) { +char ShouldGrab(KeyType key) +{ switch(key & 0xFF) { case KEY_NEXT: case KEY_NEXTSTACK: @@ -292,6 +291,16 @@ case KEY_RESTART: case KEY_EXIT: case KEY_FULLSCREEN: + case KEY_SENDR: + case KEY_SENDL: + case KEY_SENDU: + case KEY_SENDD: + case KEY_MAXTOP: + case KEY_MAXBOTTOM: + case KEY_MAXLEFT: + case KEY_MAXRIGHT: + case KEY_MAXV: + case KEY_MAXH: return 1; default: return 0; @@ -299,7 +308,8 @@ } /** Grab keys on a client window. */ -void GrabKeys(ClientNode *np) { +void GrabKeys(ClientNode *np) +{ KeyNode *kp; @@ -334,11 +344,11 @@ } /** Parse a modifier mask string. */ -unsigned int ParseModifierString(const char *str) { - +unsigned int ParseModifierString(const char *str) +{ unsigned int mask; - int x, y; - int found; + unsigned int x, y; + char found; if(!str) { return MASK_NONE; @@ -367,32 +377,31 @@ } /** Parse a key string. */ -KeySym ParseKeyString(const char *str) { - +KeySym ParseKeyString(const char *str) +{ KeySym symbol; - symbol = JXStringToKeysym(str); if(JUNLIKELY(symbol == NoSymbol)) { Warning(_("invalid key symbol: \"%s\""), str); } - return symbol; - } /** Insert a key binding. */ void InsertBinding(KeyType key, const char *modifiers, - const char *stroke, const char *code, const char *command) { + const char *stroke, const char *code, + const char *command) +{ KeyNode *np; unsigned int mask; char *temp; - int offset; KeySym sym; mask = ParseModifierString(modifiers); if(stroke && strlen(stroke) > 0) { + int offset; for(offset = 0; stroke[offset]; offset++) { if(stroke[offset] == '#') { @@ -462,19 +471,17 @@ } /** Validate key bindings. */ -void ValidateKeys() { - +void ValidateKeys(void) +{ KeyNode *kp; - int bindex; - for(kp = bindings; kp; kp = kp->next) { if((kp->key & 0xFF) == KEY_ROOT && kp->command) { - bindex = atoi(kp->command); + const int bindex = GetRootMenuIndexFromString(kp->command); if(JUNLIKELY(!IsRootMenuDefined(bindex))) { - Warning(_("key binding: root menu %d not defined"), bindex); + Warning(_("key binding: root menu \"%s\" not defined"), + kp->command); } } } - } diff -Nru jwm-2.1.0+svn579/src/key.h jwm-2.3.1+0~16~ubuntu14.10.1/src/key.h --- jwm-2.1.0+svn579/src/key.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/key.h 2015-07-18 20:02:18.000000000 +0000 @@ -12,45 +12,60 @@ struct ClientNode; -/** Enumeration of key binding types. */ -typedef enum { - KEY_NONE, - KEY_UP, - KEY_DOWN, - KEY_RIGHT, - KEY_LEFT, - KEY_ESC, - KEY_ENTER, - KEY_NEXT, - KEY_NEXTSTACK, - KEY_PREV, - KEY_PREVSTACK, - KEY_CLOSE, - KEY_MIN, - KEY_MAX, - KEY_SHADE, - KEY_STICK, - KEY_MOVE, - KEY_RESIZE, - KEY_ROOT, - KEY_WIN, - KEY_DESKTOP, - KEY_RDESKTOP, - KEY_LDESKTOP, - KEY_UDESKTOP, - KEY_DDESKTOP, - KEY_SHOWDESK, - KEY_SHOWTRAY, - KEY_EXEC, - KEY_RESTART, - KEY_EXIT, - KEY_FULLSCREEN -} KeyType; - -void InitializeKeys(); -void StartupKeys(); -void ShutdownKeys(); -void DestroyKeys(); +/** Enumeration of key binding types. + * Note that we use the high bits to store additional information + * for some key types (for example the desktop number). + */ +typedef unsigned short KeyType; +#define KEY_NONE 0 +#define KEY_UP 1 +#define KEY_DOWN 2 +#define KEY_RIGHT 3 +#define KEY_LEFT 4 +#define KEY_ESC 5 +#define KEY_ENTER 6 +#define KEY_NEXT 7 +#define KEY_NEXTSTACK 8 +#define KEY_PREV 9 +#define KEY_PREVSTACK 10 +#define KEY_CLOSE 11 +#define KEY_MIN 12 +#define KEY_MAX 13 +#define KEY_SHADE 14 +#define KEY_STICK 15 +#define KEY_MOVE 16 +#define KEY_RESIZE 17 +#define KEY_ROOT 18 +#define KEY_WIN 19 +#define KEY_DESKTOP 20 +#define KEY_RDESKTOP 21 +#define KEY_LDESKTOP 22 +#define KEY_UDESKTOP 23 +#define KEY_DDESKTOP 24 +#define KEY_SHOWDESK 25 +#define KEY_SHOWTRAY 26 +#define KEY_EXEC 27 +#define KEY_RESTART 28 +#define KEY_EXIT 29 +#define KEY_FULLSCREEN 30 +#define KEY_SENDR 31 +#define KEY_SENDL 32 +#define KEY_SENDU 33 +#define KEY_SENDD 34 +#define KEY_MAXTOP 35 +#define KEY_MAXBOTTOM 36 +#define KEY_MAXLEFT 37 +#define KEY_MAXRIGHT 38 +#define KEY_MAXV 39 +#define KEY_MAXH 40 + +void InitializeKeys(void); +void StartupKeys(void); +void ShutdownKeys(void); +void DestroyKeys(void); + +/** Mask of 'lock' keys. */ +extern unsigned int lockMask; /** Get the action to take from a key event. * @param event The event. @@ -69,8 +84,8 @@ * @param code The key code (not needed if stroke given). * @param command Extra parameter needed for some key binding types. */ -void InsertBinding(KeyType key, const char *modifiers, - const char *stroke, const char *code, const char *command); +void InsertBinding(KeyType key, const char *modifiers, const char *stroke, + const char *code, const char *command); /** Run a command caused by a key binding. * @param event The event causing the command to be run. @@ -86,7 +101,6 @@ * This will log an error if an invalid key binding is found. * This is called after parsing the configuration file. */ -void ValidateKeys(); +void ValidateKeys(void); #endif /* KEY_H */ - diff -Nru jwm-2.1.0+svn579/src/lex.c jwm-2.3.1+0~16~ubuntu14.10.1/src/lex.c --- jwm-2.1.0+svn579/src/lex.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/lex.c 2015-07-18 20:02:18.000000000 +0000 @@ -1,7 +1,7 @@ /** * @file lex.c * @author Joe Wingbermuehle - * @date 2004-2006 + * @date 2004-2014 * * @brief XML lexer functions. * @@ -15,112 +15,121 @@ /** Amount to increase allocations by when reading text. */ static const int BLOCK_SIZE = 16; -/** Literal names for tokens. - * This order is important. It must match the order of the enumeration - * in lex.h. +/** Mapping between token names and tokens. + * These must be sorted. */ -static const char *TOKEN_MAP[] = { - "[invalid]", - "Active", - "ActiveBackground", - "ActiveForeground", - "Background", - "Border", - "ButtonClose", - "ButtonMax", - "ButtonMaxActive", - "ButtonMin", - "Class", - "Clock", - "ClockStyle", - "Close", - "Desktops", - "Desktop", - "Dock", - "DoubleClickSpeed", - "DoubleClickDelta", - "Exit", - "FocusModel", - "Font", - "Foreground", - "Group", - "Height", - "IconPath", - "Inactive", - "Include", - "JWM", - "Key", - "Kill", - "Layer", - "Maximize", - "Menu", - "MenuStyle", - "Minimize", - "Move", - "MoveMode", - "Name", - "Opacity", - "Option", - "Outline", - "Pager", - "PagerStyle", - "Popup", - "PopupStyle", - "Program", - "Resize", - "ResizeMode", - "Restart", - "RestartCommand", - "RootMenu", - "SendTo", - "Separator", - "Shade", - "ShutdownCommand", - "SnapMode", - "Spacer", - "StartupCommand", - "Stick", - "Swallow", - "TaskListStyle", - "TaskList", - "Text", - "Title", - "Tray", - "TrayButton", - "TrayButtonStyle", - "TrayStyle", - "Width", - "WindowStyle" +static const StringMappingType TOKEN_MAP[] = { + { "Active", TOK_ACTIVE }, + { "Background", TOK_BACKGROUND }, + { "Button", TOK_BUTTON }, + { "ButtonClose", TOK_BUTTONCLOSE }, + { "ButtonMax", TOK_BUTTONMAX }, + { "ButtonMaxActive", TOK_BUTTONMAXACTIVE }, + { "ButtonMin", TOK_BUTTONMIN }, + { "Class", TOK_CLASS }, + { "Clock", TOK_CLOCK }, + { "ClockStyle", TOK_CLOCKSTYLE }, + { "Close", TOK_CLOSE }, + { "Corner", TOK_CORNER }, + { "Desktop", TOK_DESKTOP }, + { "Desktops", TOK_DESKTOPS }, + { "Dock", TOK_DOCK }, + { "DoubleClickDelta", TOK_DOUBLECLICKDELTA }, + { "DoubleClickSpeed", TOK_DOUBLECLICKSPEED }, + { "Dynamic", TOK_DYNAMIC }, + { "Exit", TOK_EXIT }, + { "FocusModel", TOK_FOCUSMODEL }, + { "Font", TOK_FONT }, + { "Foreground", TOK_FOREGROUND }, + { "Group", TOK_GROUP }, + { "Height", TOK_HEIGHT }, + { "IconPath", TOK_ICONPATH }, + { "Include", TOK_INCLUDE }, + { "JWM", TOK_JWM }, + { "Key", TOK_KEY }, + { "Kill", TOK_KILL }, + { "Layer", TOK_LAYER }, + { "Maximize", TOK_MAXIMIZE }, + { "Menu", TOK_MENU }, + { "MenuStyle", TOK_MENUSTYLE }, + { "Minimize", TOK_MINIMIZE }, + { "Move", TOK_MOVE }, + { "MoveMode", TOK_MOVEMODE }, + { "Name", TOK_NAME }, + { "Opacity", TOK_OPACITY }, + { "Option", TOK_OPTION }, + { "Outline", TOK_OUTLINE }, + { "Pager", TOK_PAGER }, + { "PagerStyle", TOK_PAGERSTYLE }, + { "Popup", TOK_POPUP }, + { "PopupStyle", TOK_POPUPSTYLE }, + { "Program", TOK_PROGRAM }, + { "Resize", TOK_RESIZE }, + { "ResizeMode", TOK_RESIZEMODE }, + { "Restart", TOK_RESTART }, + { "RestartCommand", TOK_RESTARTCOMMAND }, + { "RootMenu", TOK_ROOTMENU }, + { "SendTo", TOK_SENDTO }, + { "Separator", TOK_SEPARATOR }, + { "Shade", TOK_SHADE }, + { "ShutdownCommand", TOK_SHUTDOWNCOMMAND }, + { "SnapMode", TOK_SNAPMODE }, + { "Spacer", TOK_SPACER }, + { "StartupCommand", TOK_STARTUPCOMMAND }, + { "Stick", TOK_STICK }, + { "Swallow", TOK_SWALLOW }, + { "TaskList", TOK_TASKLIST }, + { "TaskListStyle", TOK_TASKLISTSTYLE }, + { "Text", TOK_TEXT }, + { "Tray", TOK_TRAY }, + { "TrayButton", TOK_TRAYBUTTON }, + { "TrayButtonStyle", TOK_TRAYBUTTONSTYLE }, + { "TrayStyle", TOK_TRAYSTYLE }, + { "Width", TOK_WIDTH }, + { "WindowStyle", TOK_WINDOWSTYLE } }; +static const unsigned int TOKEN_MAP_COUNT + = sizeof(TOKEN_MAP) / sizeof(TOKEN_MAP[0]); -static TokenNode *head, *current; +static TokenNode *head; -static TokenNode *CreateNode(TokenNode *parent, const char *file, int line); +static TokenNode *CreateNode(TokenNode *current, + const char *file, + unsigned int line); static AttributeNode *CreateAttribute(TokenNode *np); -static int IsElementEnd(char ch); -static int IsValueEnd(char ch); -static int IsAttributeEnd(char ch); -static int IsSpace(char ch, int *lineNumber); +static char IsElementEnd(char ch); +static char IsValueEnd(char ch); +static char IsAttributeEnd(char ch); static char *ReadElementName(const char *line); -static char *ReadElementValue(const char *line, const char *file, - int *lineNumber); -static char *ReadAttributeValue(const char *line, const char *file, - int *lineNumber); +static char *ReadValue(const char *line, + const char *file, + char (*IsEnd)(char), + unsigned int *offset, + unsigned int *lineNumber); +static char *ReadElementValue(const char *line, + const char *file, + unsigned int *offset, + unsigned int *lineNumber); +static char *ReadAttributeValue(const char *line, + const char *file, + unsigned int *offset, + unsigned int *lineNumber); static int ParseEntity(const char *entity, char *ch, - const char *file, int line); + const char *file, unsigned int line); static TokenType LookupType(const char *name, TokenNode *np); -/** Tokenize a data. */ -TokenNode *Tokenize(const char *line, const char *fileName) { - - TokenNode *np; +/** Tokenize data. */ +TokenNode *Tokenize(const char *line, const char *fileName) +{ AttributeNode *ap; + TokenNode *current; char *temp; - int inElement; - int x; - int found; - int lineNumber; + unsigned int x; + unsigned int offset; + unsigned int lineNumber; + char inElement; + char found; head = NULL; current = NULL; @@ -128,147 +137,162 @@ lineNumber = 1; x = 0; - /* Skip any initial white space */ - while(IsSpace(line[x], &lineNumber)) ++x; + /* Skip any initial white space. */ + while(IsSpace(line[x], &lineNumber)) { + x += 1; + } - /* Skip any XML stuff */ + /* Skip any XML stuff. */ if(!strncmp(line + x, "", 2)) { x += 2; break; } - ++x; + x += 1; } } + /* Process the XML data. */ while(line[x]) { + /* Skip comments and white space. */ do { - while(IsSpace(line[x], &lineNumber)) ++x; + /* Skip white space. */ + while(IsSpace(line[x], &lineNumber)) { + x += 1; + } /* Skip comments */ found = 0; if(!strncmp(line + x, "", 3)) { x += 3; found = 1; break; } - ++x; + x += 1; } } + } while(found); switch(line[x]) { case '<': - ++x; + x += 1; if(line[x] == '/') { - ++x; - temp = ReadElementName(line + x); + /* Close tag. */ + x += 1; + temp = ReadElementName(line + x); if(current) { - if(JLIKELY(temp)) { - if(JUNLIKELY(current->type != LookupType(temp, NULL))) { - Warning(_("%s[%d]: close tag \"%s\" does not " + Warning(_("%s[%u]: close tag \"%s\" does not " "match open tag \"%s\""), fileName, lineNumber, temp, GetTokenName(current)); } - } else { - Warning(_("%s[%d]: unexpected and invalid close tag"), + Warning(_("%s[%u]: unexpected and invalid close tag"), fileName, lineNumber); } - current = current->parent; } else { if(temp) { - Warning(_("%s[%d]: close tag \"%s\" without open tag"), + Warning(_("%s[%u]: close tag \"%s\" without open tag"), fileName, lineNumber, temp); } else { - Warning(_("%s[%d]: invalid close tag"), fileName, lineNumber); + Warning(_("%s[%u]: invalid close tag"), fileName, lineNumber); } } - if(temp) { x += strlen(temp); Release(temp); } } else { - np = current; - current = NULL; - np = CreateNode(np, fileName, lineNumber); + + /* Open tag. */ + current = CreateNode(current, fileName, lineNumber); temp = ReadElementName(line + x); if(JLIKELY(temp)) { x += strlen(temp); - LookupType(temp, np); + LookupType(temp, current); Release(temp); } else { - Warning(_("%s[%d]: invalid open tag"), fileName, lineNumber); + Warning(_("%s[%u]: invalid open tag"), fileName, lineNumber); } + } inElement = 1; break; case '/': + + /* End of open/close tag. */ if(inElement) { - ++x; + x += 1; if(JLIKELY(line[x] == '>' && current)) { - ++x; + x += 1; current = current->parent; inElement = 0; } else { - Warning(_("%s[%d]: invalid tag"), fileName, lineNumber); + Warning(_("%s[%u]: invalid tag"), fileName, lineNumber); } } else { goto ReadDefault; } + break; case '>': - ++x; + + /* End of open tag. */ + x += 1; inElement = 0; break; + default: ReadDefault: if(inElement) { + + /* In the open tag; read attributes. */ ap = CreateAttribute(current); ap->name = ReadElementName(line + x); if(ap->name) { x += strlen(ap->name); if(line[x] == '=') { - ++x; + x += 1; } if(line[x] == '\"') { - ++x; + x += 1; } ap->value = ReadAttributeValue(line + x, fileName, - &lineNumber); - if(ap->value) { - x += strlen(ap->value); - } + &offset, &lineNumber); + x += offset; if(line[x] == '\"') { - ++x; + x += 1; } } + } else { - temp = ReadElementValue(line + x, fileName, &lineNumber); + + /* In tag body; read text. */ + temp = ReadElementValue(line + x, fileName, &offset, &lineNumber); + x += offset; if(temp) { - x += strlen(temp); if(current) { if(current->value) { current->value = Reallocate(current->value, - strlen(current->value) + strlen(temp) + 1); + strlen(current->value) + + strlen(temp) + 1); strcat(current->value, temp); Release(temp); } else { @@ -276,7 +300,7 @@ } } else { if(JUNLIKELY(temp[0])) { - Warning(_("%s[%d]: unexpected text: \"%s\""), + Warning(_("%s[%u]: unexpected text: \"%s\""), fileName, lineNumber, temp); } Release(temp); @@ -294,9 +318,10 @@ * The entity value is returned in ch and the length of the entity * is returned as the value of the function. */ -int ParseEntity(const char *entity, char *ch, const char *file, int line) { +int ParseEntity(const char *entity, char *ch, const char *file, + unsigned int line) +{ char *temp; - int x; if(!strncmp(""", entity, 6)) { *ch = '\"'; @@ -314,6 +339,7 @@ *ch = '\''; return 6; } else { + unsigned int x; for(x = 0; entity[x]; x++) { if(entity[x] == ';') { break; @@ -330,7 +356,8 @@ } /** Determine if ch is the end of a tag/attribute name. */ -int IsElementEnd(char ch) { +char IsElementEnd(char ch) +{ switch(ch) { case ' ': case '\t': @@ -349,7 +376,8 @@ } /** Determine if ch is the end of an attribute value. */ -int IsAttributeEnd(char ch) { +char IsAttributeEnd(char ch) +{ switch(ch) { case 0: case '\"': @@ -360,7 +388,8 @@ } /** Determine if ch is the end of tag data. */ -int IsValueEnd(char ch) { +char IsValueEnd(char ch) +{ switch(ch) { case 0: case '<': @@ -370,29 +399,15 @@ } } -/** Determine if ch is a space character. */ -int IsSpace(char ch, int *lineNumber) { - switch(ch) { - case ' ': - case '\t': - case '\r': - return 1; - case '\n': - ++*lineNumber; - return 1; - default: - return 0; - } -} - /** Get the name of the next element. */ -char *ReadElementName(const char *line) { +char *ReadElementName(const char *line) +{ char *buffer; - int len; + unsigned int len; /* Get the length of the element. */ - for (len = 0; !IsElementEnd(line[len]); len++); + for(len = 0; !IsElementEnd(line[len]); len++); /* Allocate space for the element. */ buffer = Allocate(len + 1); @@ -403,18 +418,23 @@ } -/** Get the value of the current element. */ -char *ReadElementValue(const char *line, const char *file, int *lineNumber) { +/** Read the value of an element or attribute. */ +char *ReadValue(const char *line, + const char *file, + char (*IsEnd)(char), + unsigned int *offset, + unsigned int *lineNumber) +{ char *buffer; char ch; - int len, max; - int x; + unsigned int len, max; + unsigned int x; len = 0; max = BLOCK_SIZE; buffer = Allocate(max + 1); - for(x = 0; !IsValueEnd(line[x]); x++) { + for(x = 0; !(IsEnd)(line[x]); x++) { if(line[x] == '&') { x += ParseEntity(line + x, &ch, file, *lineNumber) - 1; if(ch) { @@ -424,73 +444,53 @@ } } else { if(line[x] == '\n') { - ++*lineNumber; + *lineNumber += 1; } buffer[len] = line[x]; } - ++len; + len += 1; if(len >= max) { max += BLOCK_SIZE; buffer = Reallocate(buffer, max + 1); + if(JUNLIKELY(buffer == NULL)) { + FatalError(_("out of memory")); + } } } buffer[len] = 0; Trim(buffer); + *offset = x; return buffer; } -/** Get the value of the current attribute. */ -char *ReadAttributeValue(const char *line, const char *file, - int *lineNumber) { - - char *buffer; - char ch; - int len, max; - int x; - - len = 0; - max = BLOCK_SIZE; - buffer = Allocate(max + 1); - - for(x = 0; !IsAttributeEnd(line[x]); x++) { - if(line[x] == '&') { - x += ParseEntity(line + x, &ch, file, *lineNumber) - 1; - if(ch) { - buffer[len] = ch; - } else { - buffer[len] = line[x]; - } - } else { - if(line[x] == '\n') { - ++*lineNumber; - } - buffer[len] = line[x]; - } - ++len; - if(len >= max) { - max += BLOCK_SIZE; - buffer = Reallocate(buffer, max + 1); - } - } - buffer[len] = 0; +/** Get the value of the current element. */ +char *ReadElementValue(const char *line, + const char *file, + unsigned int *offset, + unsigned int *lineNumber) +{ + return ReadValue(line, file, IsValueEnd, offset, lineNumber); +} - return buffer; +/** Get the value of the current attribute. */ +char *ReadAttributeValue(const char *line, + const char *file, + unsigned int *offset, + unsigned int *lineNumber) +{ + return ReadValue(line, file, IsAttributeEnd, offset, lineNumber); } /** Get the token for a tag name. */ -TokenType LookupType(const char *name, TokenNode *np) { - unsigned int x; - - Assert(name); - - for(x = 0; x < sizeof(TOKEN_MAP) / sizeof(char*); x++) { - if(!strcmp(name, TOKEN_MAP[x])) { - if(np) { - np->type = x; - } - return x; +TokenType LookupType(const char *name, TokenNode *np) +{ + const int x = FindValue(TOKEN_MAP, TOKEN_MAP_COUNT, name); + if(x >= 0) { + if(np) { + np->type = x; } + return x; } if(JUNLIKELY(np)) { @@ -503,23 +503,25 @@ } /** Get a string representation of a token. */ -const char *GetTokenName(const TokenNode *tp) { +const char *GetTokenName(const TokenNode *tp) +{ if(tp->invalidName) { return tp->invalidName; - } else if(tp->type >= sizeof(TOKEN_MAP) / sizeof(const char*)) { - return "[invalid]"; } else { - return TOKEN_MAP[tp->type]; + return GetTokenTypeName(tp->type); } } /** Get the string representation of a token. */ const char *GetTokenTypeName(TokenType type) { - return TOKEN_MAP[type]; + const char *key = FindKey(TOKEN_MAP, TOKEN_MAP_COUNT, type); + return key ? key : "[invalid]"; } /** Create an empty XML tag node. */ -TokenNode *CreateNode(TokenNode *parent, const char *file, int line) { +TokenNode *CreateNode(TokenNode *current, const char *file, + unsigned int line) +{ TokenNode *np; np = Allocate(sizeof(TokenNode)); @@ -528,7 +530,7 @@ np->attributes = NULL; np->subnodeHead = NULL; np->subnodeTail = NULL; - np->parent = parent; + np->parent = current; np->next = NULL; np->fileName = Allocate(strlen(file) + 1); @@ -536,35 +538,86 @@ np->line = line; np->invalidName = NULL; - if(!head) { - head = np; - } - if(parent) { - if(parent->subnodeHead) { - parent->subnodeTail->next = np; + if(current) { + + /* A node contained inside another node. */ + if(current->subnodeHead) { + current->subnodeTail->next = np; } else { - parent->subnodeHead = np; + current->subnodeHead = np; } - parent->subnodeTail = np; - } else if(current) { - current->next = np; + current->subnodeTail = np; + + } else if(!head) { + + /* The top-level node. */ + head = np; + + } else { + + /* A duplicate top-level node. + * This is probably a configuration error. + */ + ReleaseTokens(np); + np = head->subnodeTail ? head->subnodeTail : head; + } - current = np; return np; } /** Create an empty XML attribute node. */ -AttributeNode *CreateAttribute(TokenNode *np) { +AttributeNode *CreateAttribute(TokenNode *np) +{ AttributeNode *ap; - ap = Allocate(sizeof(AttributeNode)); ap->name = NULL; ap->value = NULL; - ap->next = np->attributes; np->attributes = ap; - return ap; } +/** Release a token list. */ +void ReleaseTokens(TokenNode *np) +{ + + AttributeNode *ap; + TokenNode *tp; + + while(np) { + tp = np->next; + + while(np->attributes) { + ap = np->attributes->next; + if(np->attributes->name) { + Release(np->attributes->name); + } + if(np->attributes->value) { + Release(np->attributes->value); + } + Release(np->attributes); + np->attributes = ap; + } + + if(np->subnodeHead) { + ReleaseTokens(np->subnodeHead); + } + + if(np->value) { + Release(np->value); + } + + if(np->invalidName) { + Release(np->invalidName); + } + + if(np->fileName) { + Release(np->fileName); + } + + Release(np); + np = tp; + } + +} diff -Nru jwm-2.1.0+svn579/src/lex.h jwm-2.3.1+0~16~ubuntu14.10.1/src/lex.h --- jwm-2.1.0+svn579/src/lex.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/lex.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,19 +10,14 @@ #ifndef LEX_H #define LEX_H -/** Tokens. - * Note that any change made to this typedef must be reflected in - * TOKEN_MAP in lex.c. - */ +/** Tokens. */ typedef enum { TOK_INVALID, TOK_ACTIVE, - TOK_ACTIVEBACKGROUND, - TOK_ACTIVEFOREGROUND, TOK_BACKGROUND, - TOK_BORDER, + TOK_BUTTON, TOK_BUTTONCLOSE, TOK_BUTTONMAX, TOK_BUTTONMAXACTIVE, @@ -31,11 +26,13 @@ TOK_CLOCK, TOK_CLOCKSTYLE, TOK_CLOSE, - TOK_DESKTOPS, + TOK_CORNER, TOK_DESKTOP, + TOK_DESKTOPS, TOK_DOCK, - TOK_DOUBLECLICKSPEED, TOK_DOUBLECLICKDELTA, + TOK_DOUBLECLICKSPEED, + TOK_DYNAMIC, TOK_EXIT, TOK_FOCUSMODEL, TOK_FONT, @@ -43,7 +40,6 @@ TOK_GROUP, TOK_HEIGHT, TOK_ICONPATH, - TOK_INACTIVE, TOK_INCLUDE, TOK_JWM, TOK_KEY, @@ -78,10 +74,9 @@ TOK_STARTUPCOMMAND, TOK_STICK, TOK_SWALLOW, - TOK_TASKLISTSTYLE, TOK_TASKLIST, + TOK_TASKLISTSTYLE, TOK_TEXT, - TOK_TITLE, TOK_TRAY, TOK_TRAYBUTTON, TOK_TRAYBUTTONSTYLE, @@ -107,7 +102,7 @@ char *invalidName; /**< Name of the tag if invalid. */ char *value; /**< Body of the tag. */ char *fileName; /**< Name of the file containing this tag. */ - int line; /**< Line number of the start of this tag. */ + unsigned int line; /**< Line number of the start of this tag. */ struct AttributeNode *attributes; /**< Linked list of attributes. */ struct TokenNode *parent; /**< Parent tag. */ struct TokenNode *subnodeHead; /**< Start of children. */ @@ -136,5 +131,9 @@ */ const char *GetTokenTypeName(TokenType type); -#endif /* LEX_H */ +/** Release token nodes. + * @param np The top-level token to release. + */ +void ReleaseTokens(TokenNode *np); +#endif /* LEX_H */ diff -Nru jwm-2.1.0+svn579/src/main.c jwm-2.3.1+0~16~ubuntu14.10.1/src/main.c --- jwm-2.1.0+svn579/src/main.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/main.c 2015-07-18 20:02:18.000000000 +0000 @@ -9,7 +9,6 @@ #include "jwm.h" #include "main.h" -#include "lex.h" #include "parse.h" #include "help.h" #include "error.h" @@ -22,11 +21,9 @@ #include "cursor.h" #include "confirm.h" #include "font.h" -#include "hint.h" #include "group.h" #include "key.h" #include "icon.h" -#include "outline.h" #include "taskbar.h" #include "tray.h" #include "traybutton.h" @@ -41,16 +38,20 @@ #include "dock.h" #include "misc.h" #include "background.h" +#include "settings.h" +#include "timing.h" +#include "grab.h" Display *display = NULL; Window rootWindow; int rootWidth, rootHeight; -int rootDepth; int rootScreen; Colormap rootColormap; -Visual *rootVisual; +VisualData rootVisual; GC rootGC; int colormapCount; +Window supportingWindow; +Atom managerSelection; char shouldExit = 0; char shouldRestart = 0; @@ -58,49 +59,39 @@ char initializing = 0; char shouldReload = 0; -unsigned int desktopWidth = 4; -unsigned int desktopHeight = 1; -unsigned int desktopCount = 4; unsigned int currentDesktop = 0; char *exitCommand = NULL; -int borderWidth = DEFAULT_BORDER_WIDTH; -int titleHeight = DEFAULT_TITLE_HEIGHT; - -unsigned int doubleClickSpeed; -unsigned int doubleClickDelta; - -FocusModelType focusModel = FOCUS_SLOPPY; - XContext clientContext; XContext frameContext; #ifdef USE_SHAPE -int haveShape; +char haveShape; int shapeEvent; #endif #ifdef USE_XRENDER -int haveRender; +char haveRender; #endif static const char *CONFIG_FILE = "/.jwmrc"; -static void Initialize(); -static void Startup(); -static void Shutdown(); -static void Destroy(); - -static void OpenConnection(); -static void CloseConnection(); -static void StartupConnection(); -static void ShutdownConnection(); -static void EventLoop(); +static void Initialize(void); +static void Startup(void); +static void Shutdown(void); +static void Destroy(void); + +static void OpenConnection(void); +static void CloseConnection(void); +static Bool SelectionReleased(Display *d, XEvent *e, XPointer arg); +static void StartupConnection(void); +static void ShutdownConnection(void); +static void EventLoop(void); static void HandleExit(int sig); static void DoExit(int code); -static void SendRestart(); -static void SendExit(); -static void SendReload(); +static void SendRestart(void); +static void SendExit(void); +static void SendReload(void); static void SendJWMMessage(const char *message); static char *displayString = NULL; @@ -108,10 +99,17 @@ char *configPath = NULL; /** The main entry point. */ -int main(int argc, char *argv[]) { - +int main(int argc, char *argv[]) +{ char *temp; int x; + enum { + ACTION_RUN, + ACTION_RESTART, + ACTION_EXIT, + ACTION_RELOAD, + ACTION_PARSE + } action; StartDebug(); @@ -126,6 +124,7 @@ } /* Parse command line options. */ + action = ACTION_RUN; for(x = 1; x < argc; x++) { if(!strcmp(argv[x], "-v")) { DisplayAbout(); @@ -134,27 +133,44 @@ DisplayHelp(); DoExit(0); } else if(!strcmp(argv[x], "-p")) { - Initialize(); - ParseConfig(configPath); - DoExit(0); + action = ACTION_PARSE; } else if(!strcmp(argv[x], "-restart")) { - SendRestart(); - DoExit(0); + action = ACTION_RESTART; } else if(!strcmp(argv[x], "-exit")) { - SendExit(); - DoExit(0); - } else if(!strcmp(argv[x], "-reload")) { - SendReload(); - DoExit(0); + action = ACTION_EXIT; + } else if(!strcmp(argv[x], "-reload")) { + action = ACTION_RELOAD; } else if(!strcmp(argv[x], "-display") && x + 1 < argc) { displayString = argv[++x]; + } else if(!strcmp(argv[x], "-f") && x + 1 < argc) { + Release(configPath); + configPath = CopyString(argv[++x]); } else { - DisplayUsage(); + printf("unrecognized option: %s\n", argv[x]); + DisplayHelp(); DoExit(1); } } -#ifdef HAVE_SETLOCALE + switch(action) { + case ACTION_PARSE: + Initialize(); + ParseConfig(configPath); + DoExit(0); + case ACTION_RESTART: + SendRestart(); + DoExit(0); + case ACTION_EXIT: + SendExit(); + DoExit(0); + case ACTION_RELOAD: + SendReload(); + DoExit(0); + default: + break; + } + +#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) setlocale(LC_ALL, ""); #endif #ifdef HAVE_GETTEXT @@ -169,7 +185,7 @@ isRestarting = shouldRestart; shouldExit = 0; shouldRestart = 0; - shouldReload = 0; + shouldReload = 0; /* Prepare JWM components. */ Initialize(); @@ -207,7 +223,8 @@ } /** Exit with the specified status code. */ -void DoExit(int code) { +void DoExit(int code) +{ Destroy(); @@ -225,29 +242,43 @@ } /** Main JWM event loop. */ -void EventLoop() { +void EventLoop(void) +{ XEvent event; + TimeType start; /* Loop processing events until it's time to exit. */ while(JLIKELY(!shouldExit)) { - WaitForEvent(&event); - ProcessEvent(&event); + if(JLIKELY(WaitForEvent(&event))) { + ProcessEvent(&event); + } } - /* Give windows (swallow windows especially) time to map. */ - usleep(RESTART_DELAY); - /* Process events one last time. */ - while(JXPending(display) > 0) { - WaitForEvent(&event); - ProcessEvent(&event); + GetCurrentTime(&start); + for(;;) { + if(JXPending(display) == 0) { + if(!IsSwallowPending()) { + break; + } else { + TimeType now; + GetCurrentTime(&now); + if(GetTimeDifference(&start, &now) > RESTART_DELAY) { + break; + } + } + } + if(WaitForEvent(&event)) { + ProcessEvent(&event); + } } } /** Open a connection to the X server. */ -void OpenConnection() { +void OpenConnection(void) +{ display = JXOpenDisplay(displayString); if(JUNLIKELY(!display)) { @@ -263,9 +294,9 @@ rootWindow = RootWindow(display, rootScreen); rootWidth = DisplayWidth(display, rootScreen); rootHeight = DisplayHeight(display, rootScreen); - rootDepth = DefaultDepth(display, rootScreen); + rootVisual.depth = DefaultDepth(display, rootScreen); + rootVisual.visual = DefaultVisual(display, rootScreen); rootColormap = DefaultColormap(display, rootScreen); - rootVisual = DefaultVisual(display, rootScreen); rootGC = DefaultGC(display, rootScreen); colormapCount = MaxCmapsOfScreen(ScreenOfDisplay(display, rootScreen)); @@ -274,8 +305,20 @@ } +/** Predicate for XIfEvent to determine if we got the WM_Sn selection. */ +Bool SelectionReleased(Display *d, XEvent *e, XPointer arg) +{ + if(e->type == DestroyNotify) { + if(e->xdestroywindow.window == *(Window*)arg) { + return True; + } + } + return False; +} + /** Prepare the connection. */ -void StartupConnection() { +void StartupConnection(void) +{ XSetWindowAttributes attr; #ifdef USE_SHAPE @@ -286,6 +329,10 @@ int renderError; #endif struct sigaction sa; + char name[32]; + Window win; + XEvent event; + int revert; initializing = 1; OpenConnection(); @@ -294,6 +341,45 @@ XSynchronize(display, True); #endif + /* Create the supporting window used to verify JWM is running. */ + supportingWindow = JXCreateSimpleWindow(display, rootWindow, + 0, 0, 1, 1, 0, 0, 0); + + /* Get the atom used for the window manager selection. */ + snprintf(name, 32, "WM_S%d", rootScreen); + managerSelection = JXInternAtom(display, name, False); + + /* Get the current window manager and take the selection. */ + GrabServer(); + win = JXGetSelectionOwner(display, managerSelection); + if(win != None) { + JXSelectInput(display, win, StructureNotifyMask); + } + JXSetSelectionOwner(display, managerSelection, + supportingWindow, CurrentTime); + UngrabServer(); + + /* Wait for the current selection owner to give up the selection. */ + if(win != None) { + /* Note that we need to wait for the current selection owner + * to exit before we can expect to select SubstructureRedirectMask. */ + XIfEvent(display, &event, SelectionReleased, (XPointer)&win); + JXSync(display, False); + } + + event.xclient.display = display; + event.xclient.type = ClientMessage; + event.xclient.window = rootWindow; + event.xclient.message_type = JXInternAtom(display, "MANAGER", False); + event.xclient.format = 32; + event.xclient.data.l[0] = CurrentTime; + event.xclient.data.l[1] = managerSelection; + event.xclient.data.l[2] = supportingWindow; + event.xclient.data.l[3] = 2; + event.xclient.data.l[4] = 0; + JXSendEvent(display, rootWindow, False, StructureNotifyMask, &event); + JXSync(display, False); + JXSetErrorHandler(ErrorHandler); clientContext = XUniqueContext(); @@ -343,30 +429,41 @@ } #endif + /* Make sure we have input focus. */ + win = None; + JXGetInputFocus(display, &win, &revert); + if(win == None) { + JXSetInputFocus(display, rootWindow, RevertToParent, CurrentTime); + } + initializing = 0; } /** Close the X server connection. */ -void CloseConnection() { +void CloseConnection(void) +{ JXFlush(display); JXCloseDisplay(display); } /** Close the X server connection. */ -void ShutdownConnection() { +void ShutdownConnection(void) +{ CloseConnection(); } /** Signal handler. */ -void HandleExit(int sig) { +void HandleExit(int sig) +{ shouldExit = 1; } /** Initialize data structures. * This is called before the X connection is opened. */ -void Initialize() { +void Initialize(void) +{ InitializeBackgrounds(); InitializeBorders(); @@ -385,12 +482,12 @@ InitializeHints(); InitializeIcons(); InitializeKeys(); - InitializeOutline(); InitializePager(); InitializePlacement(); InitializePopup(); InitializeRootMenu(); InitializeScreens(); + InitializeSettings(); InitializeSwallow(); InitializeTaskBar(); InitializeTray(); @@ -400,16 +497,16 @@ /** Startup the various JWM components. * This is called after the X connection is opened. */ -void Startup() { +void Startup(void) +{ /* This order is important. */ - StartupCommands(); - /* First we grab the server to prevent clients from changing things * while we're still loading. */ - JXGrabServer(display); + GrabServer(); + StartupSettings(); StartupScreens(); StartupGroups(); @@ -418,7 +515,6 @@ StartupBackgrounds(); StartupFonts(); StartupCursors(); - StartupOutline(); StartupPager(); StartupClock(); @@ -444,11 +540,11 @@ ReadCurrentDesktop(); JXFlush(display); - RestackClients(); + RequireRestack(); /* Allow clients to do their thing. */ JXSync(display, True); - JXUngrabServer(display); + UngrabServer(); StartupSwallow(); @@ -460,18 +556,21 @@ /* Draw the background (if backgrounds are used). */ LoadBackground(currentDesktop); + /* Run any startup commands. */ + StartupCommands(); + } /** Shutdown the various JWM components. * This is called before the X connection is closed. */ -void Shutdown() { +void Shutdown(void) +{ /* This order is important. */ ShutdownSwallow(); - ShutdownOutline(); # ifndef DISABLE_CONFIRM ShutdownDialogs(); # endif @@ -497,6 +596,7 @@ ShutdownPlacement(); ShutdownHints(); ShutdownScreens(); + ShutdownSettings(); ShutdownCommands(); @@ -506,7 +606,8 @@ * This is called after the X connection is closed. * Note that it is possible for this to be called more than once. */ -void Destroy() { +void Destroy(void) +{ DestroyBackgrounds(); DestroyBorders(); DestroyClients(); @@ -524,12 +625,12 @@ DestroyHints(); DestroyIcons(); DestroyKeys(); - DestroyOutline(); DestroyPager(); DestroyPlacement(); DestroyPopup(); DestroyRootMenu(); DestroyScreens(); + DestroySettings(); DestroySwallow(); DestroyTaskBar(); DestroyTray(); @@ -537,36 +638,34 @@ } /** Send _JWM_RESTART to the root window. */ -void SendRestart() { - SendJWMMessage("_JWM_RESTART"); +void SendRestart(void) +{ + SendJWMMessage(jwmRestart); } /** Send _JWM_EXIT to the root window. */ -void SendExit() { - SendJWMMessage("_JWM_EXIT"); +void SendExit(void) +{ + SendJWMMessage(jwmExit); } /** Send _JWM_RELOAD to the root window. */ -void SendReload() { - SendJWMMessage("_JWM_RELOAD"); +void SendReload(void) +{ + SendJWMMessage(jwmReload); } /** Send a JWM message to the root window. */ -void SendJWMMessage(const char *message) { - +void SendJWMMessage(const char *message) +{ XEvent event; - OpenConnection(); - memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.window = rootWindow; event.xclient.message_type = JXInternAtom(display, message, False); event.xclient.format = 32; - JXSendEvent(display, rootWindow, False, SubstructureRedirectMask, &event); - CloseConnection(); - } diff -Nru jwm-2.1.0+svn579/src/main.h jwm-2.3.1+0~16~ubuntu14.10.1/src/main.h --- jwm-2.1.0+svn579/src/main.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/main.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,27 +10,24 @@ #ifndef MAIN_H #define MAIN_H -/** Enumeration of focus models. */ -typedef enum { - FOCUS_SLOPPY = 0, - FOCUS_CLICK = 1 -} FocusModelType; +typedef struct VisualData { + Visual *visual; + int depth; +} VisualData; extern Display *display; extern Window rootWindow; extern int rootWidth, rootHeight; -extern int rootDepth; extern int rootScreen; extern Colormap rootColormap; -extern Visual *rootVisual; +extern VisualData rootVisual; extern GC rootGC; extern int colormapCount; +extern Window supportingWindow; +extern Atom managerSelection; extern char *exitCommand; -extern unsigned int desktopWidth; -extern unsigned int desktopHeight; -extern unsigned int desktopCount; extern unsigned int currentDesktop; extern char shouldExit; @@ -39,23 +36,15 @@ extern char shouldReload; extern char initializing; -extern int borderWidth; -extern int titleHeight; - -extern unsigned int doubleClickSpeed; -extern unsigned int doubleClickDelta; - -extern FocusModelType focusModel; - extern XContext clientContext; extern XContext frameContext; #ifdef USE_SHAPE -extern int haveShape; +extern char haveShape; extern int shapeEvent; #endif #ifdef USE_XRENDER -extern int haveRender; +extern char haveRender; #endif extern char *configPath; diff -Nru jwm-2.1.0+svn579/src/Makefile.in jwm-2.3.1+0~16~ubuntu14.10.1/src/Makefile.in --- jwm-2.1.0+svn579/src/Makefile.in 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/Makefile.in 2015-07-18 20:02:18.000000000 +0000 @@ -1,17 +1,18 @@ - CC = @CC@ CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ BINDIR = $(DESTDIR)@BINDIR@ VPATH=.:os -OBJECTS = background.o border.o button.o client.o clientlist.o clock.o \ - color.o command.o confirm.o cursor.o debug.o desktop.o dock.o event.o \ - error.o font.o gradient.o group.o help.o hint.o icon.o image.o \ - key.o lex.o main.o match.o menu.o misc.o move.o outline.o pager.o \ - parse.o place.o popup.o render.o resize.o root.o screen.o spacer.o \ - status.o swallow.o taskbar.o timing.o tray.o traybutton.o winmenu.o +OBJECTS = action.o background.o border.o button.o client.o clientlist.o \ + clock.o color.o command.o confirm.o cursor.o debug.o desktop.o dock.o \ + event.o error.o font.o grab.o gradient.o group.o help.o hint.o icon.o \ + image.o key.o lex.o main.o match.o menu.o misc.o move.o outline.o pager.o \ + parse.o place.o popup.o render.o resize.o root.o screen.o settings.o \ + spacer.o status.o swallow.o taskbar.o timing.o tray.o traybutton.o \ + winmenu.o EXE = jwm @@ -22,16 +23,20 @@ install: all install -d $(BINDIR) install $(EXE) $(BINDIR)/$(EXE) + +install-strip: install strip $(BINDIR)/$(EXE) -depend: - makedepend -m -DMAKE_DEPEND -- $(CFLAGS) -- *.c +uninstall: + rm -f $(BINDIR)/$(EXE) $(EXE): $(OBJECTS) $(CC) -o $(EXE) $(OBJECTS) $(LDFLAGS) .c.o: - $(CC) -c $(CFLAGS) $< + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< + +$(OBJECTS): *.h ../config.h clean: rm -f $(OBJECTS) $(EXE) core diff -Nru jwm-2.1.0+svn579/src/match.c jwm-2.3.1+0~16~ubuntu14.10.1/src/match.c --- jwm-2.1.0+svn579/src/match.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/match.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,15 +10,15 @@ #include "jwm.h" #include "match.h" -#include #include /** Determine if expression matches pattern. */ -int Match(const char *pattern, const char *expression) { +char Match(const char *pattern, const char *expression) +{ - regex_t re; - regmatch_t rm; - int rc; + regex_t re; + regmatch_t rm; + int rc; if(!pattern && !expression) { return 1; @@ -26,16 +26,15 @@ return 0; } + if(regcomp(&re, pattern, REG_EXTENDED) != 0) { + return 0; + } - if(regcomp(&re, pattern, REG_EXTENDED) != 0) { - return 0; - } - - rc = regexec(&re, expression, 0, &rm, 0); + rc = regexec(&re, expression, 0, &rm, 0); - regfree(&re); + regfree(&re); - return rc == 0 ? 1 : 0; + return rc == 0 ? 1 : 0; } diff -Nru jwm-2.1.0+svn579/src/match.h jwm-2.3.1+0~16~ubuntu14.10.1/src/match.h --- jwm-2.1.0+svn579/src/match.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/match.h 2015-07-18 20:02:18.000000000 +0000 @@ -15,7 +15,7 @@ * @param expression The expression to check. * @return 1 if there is a match, 0 otherwise. */ -int Match(const char *pattern, const char *expression); +char Match(const char *pattern, const char *expression); #endif /* MATCH_H */ diff -Nru jwm-2.1.0+svn579/src/menu.c jwm-2.3.1+0~16~ubuntu14.10.1/src/menu.c --- jwm-2.1.0+svn579/src/menu.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/menu.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,39 +11,40 @@ #include "menu.h" #include "font.h" #include "client.h" -#include "color.h" #include "icon.h" -#include "image.h" -#include "main.h" #include "cursor.h" #include "key.h" #include "button.h" #include "event.h" -#include "error.h" #include "root.h" +#include "settings.h" +#include "desktop.h" +#include "parse.h" +#include "winmenu.h" +#include "screen.h" + +#define BASE_ICON_OFFSET 3 +#define MENU_BORDER_SIZE 1 + +typedef unsigned char MenuSelectionType; +#define MENU_NOSELECTION 0 +#define MENU_LEAVE 1 +#define MENU_SUBSELECT 2 + +static char ShowSubmenu(Menu *menu, Menu *parent, + RunMenuCommandType runner, + int x, int y); -#define BASE_ICON_OFFSET 3 - -typedef enum { - MENU_NOSELECTION = 0, - MENU_LEAVE = 1, - MENU_SUBSELECT = 2 -} MenuSelectionType; - -/** Submenu arrow, 4 x 7 pixels */ -static char menu_bitmap[] = { - 0x01, 0x03, 0x07, 0x0F, 0x07, 0x03, 0x01 -}; - -static int ShowSubmenu(Menu *menu, Menu *parent, int x, int y); - +static void PatchMenu(Menu *menu); +static void UnpatchMenu(Menu *menu); static void CreateMenu(Menu *menu, int x, int y); static void HideMenu(Menu *menu); static void DrawMenu(Menu *menu); -static void RedrawMenuTree(Menu *menu); -static int MenuLoop(Menu *menu); -static MenuSelectionType UpdateMotion(Menu *menu, XEvent *event); +static char MenuLoop(Menu *menu, RunMenuCommandType runner); +static MenuSelectionType UpdateMotion(Menu *menu, + RunMenuCommandType runner, + XEvent *event); static void UpdateMenu(Menu *menu); static void DrawMenuItem(Menu *menu, MenuItem *item, int index); @@ -52,15 +53,22 @@ static int GetPreviousMenuIndex(Menu *menu); static int GetMenuIndex(Menu *menu, int index); static void SetPosition(Menu *tp, int index); -static int IsMenuValid(const Menu *menu); - -static MenuAction *menuAction = NULL; -static unsigned int menuOpacity = UINT_MAX; +static char IsMenuValid(const Menu *menu); int menuShown = 0; +/** Create an empty menu item. */ +MenuItem *CreateMenuItem(MenuItemType type) +{ + MenuItem *item = Allocate(sizeof(MenuItem)); + memset(item, 0, sizeof(MenuItem)); + item->type = type; + return item; +} + /** Initialize a menu. */ -void InitializeMenu(Menu *menu) { +void InitializeMenu(Menu *menu) +{ MenuItem *np; int index, temp; @@ -80,20 +88,12 @@ menu->itemHeight = GetStringHeight(FONT_MENU); for(np = menu->items; np; np = np->next) { if(np->iconName) { - np->icon = LoadNamedIcon(np->iconName); + np->icon = LoadNamedIcon(np->iconName, 1, 1); if(np->icon) { - if(userHeight == 0) { - if(menu->itemHeight < (int)np->icon->image->height) { - menu->itemHeight = np->icon->image->height; - } - if(menu->textOffset < (int)np->icon->image->width + 4) { - menu->textOffset = np->icon->image->width + 4; - } - } hasIcon = 1; } - } else { - np->icon = NULL; + } else if(np->icon) { + hasIcon = 1; } menu->itemCount += 1; } @@ -101,6 +101,8 @@ if(userHeight) { menu->itemHeight = userHeight + BASE_ICON_OFFSET * 2; + } + if(hasIcon) { menu->textOffset = menu->itemHeight + BASE_ICON_OFFSET * 2; } @@ -116,7 +118,7 @@ } } - menu->height = 1; + menu->height = 0; if(menu->label) { menu->height += menu->itemHeight; } @@ -147,17 +149,18 @@ np->icon = &emptyIcon; } if(np->submenu) { - hasSubmenu = 7; + hasSubmenu = (menu->itemHeight + 3) / 4; InitializeMenu(np->submenu); } } - menu->height += 2; - menu->width += 12 + hasSubmenu + menu->textOffset; + menu->width += hasSubmenu + menu->textOffset; + menu->width += 7; } /** Show a menu. */ -void ShowMenu(Menu *menu, RunMenuCommandType runner, int x, int y) { +void ShowMenu(Menu *menu, RunMenuCommandType runner, int x, int y) +{ int mouseStatus, keyboardStatus; @@ -165,6 +168,9 @@ if(JUNLIKELY(!IsMenuValid(menu))) { return; } + if(JUNLIKELY(shouldExit)) { + return; + } mouseStatus = GrabMouse(rootWindow); keyboardStatus = JXGrabKeyboard(display, rootWindow, False, @@ -173,17 +179,13 @@ return; } - ShowSubmenu(menu, NULL, x, y); + ShowSubmenu(menu, NULL, runner, x, y); + UnpatchMenu(menu); JXUngrabKeyboard(display, CurrentTime); JXUngrabPointer(display, CurrentTime); RefocusClient(); - if(menuAction) { - (runner)(menuAction); - menuAction = NULL; - } - if(shouldReload) { ReloadMenu(); } @@ -191,18 +193,19 @@ } /** Destroy a menu. */ -void DestroyMenu(Menu *menu) { +void DestroyMenu(Menu *menu) +{ MenuItem *np; - if(menu) { while(menu->items) { np = menu->items->next; if(menu->items->name) { Release(menu->items->name); } - switch(menu->items->action.type) { + switch(menu->items->action.type & MA_ACTION_MASK) { case MA_EXECUTE: case MA_EXIT: + case MA_DYNAMIC: if(menu->items->action.data.str) { Release(menu->items->action.data.str); } @@ -226,20 +229,23 @@ Release(menu->offsets); } Release(menu); - menu = NULL; } } /** Show a submenu. */ -int ShowSubmenu(Menu *menu, Menu *parent, int x, int y) { +char ShowSubmenu(Menu *menu, Menu *parent, + RunMenuCommandType runner, + int x, int y) +{ - int status; + char status; + PatchMenu(menu); menu->parent = parent; CreateMenu(menu, x, y); menuShown += 1; - status = MenuLoop(menu); + status = MenuLoop(menu, runner); menuShown -= 1; HideMenu(menu); @@ -248,20 +254,77 @@ } +/** Prepare a menu to be shown. */ +void PatchMenu(Menu *menu) +{ + MenuItem *item; + for(item = menu->items; item; item = item->next) { + Menu *submenu = NULL; + switch(item->action.type & MA_ACTION_MASK) { + case MA_DESKTOP_MENU: + submenu = CreateDesktopMenu(1 << currentDesktop, + item->action.context); + break; + case MA_SENDTO_MENU: + submenu = CreateSendtoMenu( + item->action.type & ~MA_ACTION_MASK, + item->action.context); + break; + case MA_WINDOW_MENU: + submenu = CreateWindowMenu(item->action.context); + break; + case MA_DYNAMIC: + if(!item->submenu) { + submenu = ParseDynamicMenu(item->action.data.str); + } + break; + default: + break; + } + if(submenu) { + InitializeMenu(submenu); + item->submenu = submenu; + } + } +} + +/** Remove temporary items from a menu. */ +void UnpatchMenu(Menu *menu) +{ + MenuItem *item; + for(item = menu->items; item; item = item->next) { + if(item->submenu) { + UnpatchMenu(item->submenu); + switch(item->action.type & MA_ACTION_MASK) { + case MA_DESKTOP_MENU: + case MA_SENDTO_MENU: + case MA_WINDOW_MENU: + case MA_DYNAMIC: + DestroyMenu(item->submenu); + item->submenu = NULL; + break; + default: + break; + } + } + } +} + /** Menu process loop. * Returns 0 if no selection was made or 1 if a selection was made. */ -int MenuLoop(Menu *menu) { +char MenuLoop(Menu *menu, RunMenuCommandType runner) +{ XEvent event; MenuItem *ip; - int count; - int hadMotion; + Window pressw; int pressx, pressy; + char hadMotion; hadMotion = 0; - GetMousePosition(&pressx, &pressy); + GetMousePosition(&pressx, &pressy, &pressw); for(;;) { @@ -269,7 +332,16 @@ switch(event.type) { case Expose: - RedrawMenuTree(menu); + if(event.xexpose.count == 0) { + Menu *mp = menu; + while(mp) { + if(mp->window == event.xexpose.window) { + DrawMenu(mp); + break; + } + mp = mp->parent; + } + } break; case ButtonPress: @@ -280,7 +352,7 @@ case KeyPress: case MotionNotify: hadMotion = 1; - switch(UpdateMotion(menu, &event)) { + switch(UpdateMotion(menu, runner, &event)) { case MENU_NOSELECTION: /* no selection */ break; case MENU_LEAVE: /* mouse left the menu */ @@ -302,21 +374,20 @@ if(!hadMotion) { break; } - if(abs(event.xbutton.x_root - pressx) < doubleClickDelta) { - if(abs(event.xbutton.y_root - pressy) < doubleClickDelta) { + if(abs(event.xbutton.x_root - pressx) < settings.doubleClickDelta) { + if(abs(event.xbutton.y_root - pressy) < settings.doubleClickDelta) { break; } } - - if(menu->currentIndex >= 0) { - count = 0; - for(ip = menu->items; ip; ip = ip->next) { - if(count == menu->currentIndex) { - menuAction = &ip->action; - break; - } - ++count; - } + + if(menu->parent && menu->currentIndex < 0) { + ip = GetMenuItem(menu->parent, menu->parent->currentIndex); + } else { + ip = GetMenuItem(menu, menu->currentIndex); + } + if(ip != NULL) { + ip->action.button = event.xbutton.button; + (runner)(&ip->action); } return 1; default: @@ -327,7 +398,8 @@ } /** Create and map a menu. */ -void CreateMenu(Menu *menu, int x, int y) { +void CreateMenu(Menu *menu, int x, int y) +{ XSetWindowAttributes attr; unsigned long attrMask; @@ -336,16 +408,22 @@ menu->lastIndex = -1; menu->currentIndex = -1; - if(x + menu->width > rootWidth) { + if(menu->parent) { + menu->screen = menu->parent->screen; + } else { + menu->screen = GetCurrentScreen(x + menu->width / 2, + y + menu->height / 2); + } + if(x + menu->width > menu->screen->x + menu->screen->width) { if(menu->parent) { x = menu->parent->x - menu->width; } else { - x = rootWidth - menu->width; + x = menu->screen->x + menu->screen->width - menu->width; } } temp = y; - if(y + menu->height > rootHeight) { - y = rootHeight - menu->height; + if(y + menu->height > menu->screen->y + menu->screen->height) { + y = menu->screen->y + menu->screen->height - menu->height; } if(y < 0) { y = 0; @@ -366,13 +444,20 @@ attrMask |= CWSaveUnder; attr.save_under = True; - menu->window = JXCreateWindow(display, rootWindow, x, y, - menu->width, menu->height, 0, CopyFromParent, InputOutput, - CopyFromParent, attrMask, &attr); + attrMask |= CWBorderPixel; + attr.border_pixel = colors[COLOR_MENU_OUTLINE]; - if(menuOpacity < UINT_MAX) { - SetCardinalAtom(menu->window, ATOM_NET_WM_WINDOW_OPACITY, menuOpacity); - JXSync(display, False); + menu->window = JXCreateWindow(display, rootWindow, x, y, + menu->width, menu->height, + MENU_BORDER_SIZE, + CopyFromParent, InputOutput, + CopyFromParent, attrMask, &attr); + menu->pixmap = JXCreatePixmap(display, menu->window, + menu->width, menu->height, rootVisual.depth); + + if(settings.menuOpacity < UINT_MAX) { + SetCardinalAtom(menu->window, ATOM_NET_WM_WINDOW_OPACITY, + settings.menuOpacity); } JXMapRaised(display, menu->window); @@ -380,30 +465,22 @@ } /** Hide a menu. */ -void HideMenu(Menu *menu) { - +void HideMenu(Menu *menu) +{ JXDestroyWindow(display, menu->window); - -} - -/** Redraw a menu and its submenus. */ -void RedrawMenuTree(Menu *menu) { - - if(menu->parent) { - RedrawMenuTree(menu->parent); - } - - DrawMenu(menu); - UpdateMenu(menu); - + JXFreePixmap(display, menu->pixmap); } /** Draw a menu. */ -void DrawMenu(Menu *menu) { +void DrawMenu(Menu *menu) +{ MenuItem *np; int x; - XSegment segments[4]; + + JXSetForeground(display, rootGC, colors[COLOR_MENU_BG]); + JXFillRectangle(display, menu->pixmap, rootGC, 0, 0, + menu->width, menu->height); if(menu->label) { DrawMenuItem(menu, NULL, -1); @@ -414,34 +491,16 @@ DrawMenuItem(menu, np, x); ++x; } - - JXSetForeground(display, rootGC, colors[COLOR_MENU_UP]); - segments[0].x1 = 0; segments[0].y1 = 0; - segments[0].x2 = menu->width - 1; segments[0].y2 = 0; - segments[1].x1 = 0; segments[1].y1 = 1; - segments[1].x2 = menu->width - 2; segments[1].y2 = 1; - segments[2].x1 = 0; segments[2].y1 = 2; - segments[2].x2 = 0; segments[2].y2 = menu->height - 1; - segments[3].x1 = 1; segments[3].y1 = 2; - segments[3].x2 = 1; segments[3].y2 = menu->height - 2; - JXDrawSegments(display, menu->window, rootGC, segments, 4); - - JXSetForeground(display, rootGC, colors[COLOR_MENU_DOWN]); - segments[0].x1 = 1; segments[0].y1 = menu->height - 1; - segments[0].x2 = menu->width - 1; segments[0].y2 = menu->height - 1; - segments[1].x1 = 2; segments[1].y1 = menu->height - 2; - segments[1].x2 = menu->width - 1; segments[1].y2 = menu->height - 2; - segments[2].x1 = menu->width - 1; segments[2].y1 = 1; - segments[2].x2 = menu->width - 1; segments[2].y2 = menu->height - 3; - segments[3].x1 = menu->width - 2; segments[3].y1 = 2; - segments[3].x2 = menu->width - 2; segments[3].y2 = menu->height - 3; - JXDrawSegments(display, menu->window, rootGC, segments, 4); + JXCopyArea(display, menu->pixmap, menu->window, rootGC, + 0, 0, menu->width, menu->height, 0, 0); } /** Determine the action to take given an event. */ -MenuSelectionType UpdateMotion(Menu *menu, XEvent *event) { - +MenuSelectionType UpdateMotion(Menu *menu, + RunMenuCommandType runner, + XEvent *event) +{ MenuItem *ip; Menu *tp; Window subwindow; @@ -449,7 +508,8 @@ if(event->type == MotionNotify) { - SetMousePosition(event->xmotion.x_root, event->xmotion.y_root); + SetMousePosition(event->xmotion.x_root, event->xmotion.y_root, + event->xmotion.window); DiscardMotionEvents(event, menu->window); x = event->xmotion.x_root - menu->x; @@ -510,15 +570,10 @@ case KEY_ESC: return MENU_SUBSELECT; case KEY_ENTER: - if(tp->currentIndex >= 0) { - x = 0; - for(ip = tp->items; ip; ip = ip->next) { - if(x == tp->currentIndex) { - menuAction = &ip->action; - break; - } - ++x; - } + ip = GetMenuItem(tp, tp->currentIndex); + if(ip != NULL) { + ip->action.button = 0; + (runner)(&ip->action); } return MENU_SUBSELECT; default: @@ -565,20 +620,21 @@ } /* Move the menu if needed. */ - if(menu->height > rootHeight && menu->currentIndex >= 0) { + if(menu->height > menu->screen->height && menu->currentIndex >= 0) { /* If near the top, shift down. */ if(y + menu->y <= 0) { if(menu->currentIndex > 0) { - --menu->currentIndex; + menu->currentIndex -= 1; SetPosition(menu, menu->currentIndex); } } /* If near the bottom, shift up. */ - if(y + menu->y + menu->itemHeight / 2 >= rootHeight) { + if(y + menu->y + menu->itemHeight / 2 + >= menu->screen->y + menu->screen->height) { if(menu->currentIndex + 1 < menu->itemCount) { - ++menu->currentIndex; + menu->currentIndex += 1; SetPosition(menu, menu->currentIndex); } } @@ -593,8 +649,9 @@ /* If the selected item is a submenu, show it. */ ip = GetMenuItem(menu, menu->currentIndex); if(ip && IsMenuValid(ip->submenu)) { - if(ShowSubmenu(ip->submenu, menu, menu->x + menu->width, - menu->y + menu->offsets[menu->currentIndex])) { + if(ShowSubmenu(ip->submenu, menu, runner, + menu->x + menu->width + MENU_BORDER_SIZE, + menu->y + menu->offsets[menu->currentIndex])) { /* Item selected; destroy the menu tree. */ return MENU_SUBSELECT; @@ -612,10 +669,9 @@ } /** Update the menu selection. */ -void UpdateMenu(Menu *menu) { +void UpdateMenu(Menu *menu) +{ - ButtonNode button; - Pixmap pixmap; MenuItem *ip; /* Clear the old selection. */ @@ -624,57 +680,30 @@ /* Highlight the new selection. */ ip = GetMenuItem(menu, menu->currentIndex); - if(ip) { - - if(ip->type == MENU_ITEM_SEPARATOR) { - return; - } - - ResetButton(&button, menu->window, rootGC); - button.type = BUTTON_MENU_ACTIVE; - button.font = FONT_MENU; - button.width = menu->width - 5; - button.height = menu->itemHeight - 2; - button.icon = ip->icon; - button.text = ip->name; - button.x = 2; - button.y = menu->offsets[menu->currentIndex] + 1; - DrawButton(&button); - - if(ip->submenu) { - pixmap = JXCreateBitmapFromData(display, menu->window, - menu_bitmap, 4, 7); - JXSetForeground(display, rootGC, colors[COLOR_MENU_ACTIVE_FG]); - JXSetClipMask(display, rootGC, pixmap); - JXSetClipOrigin(display, rootGC, - menu->width - 9, - menu->offsets[menu->currentIndex] + menu->itemHeight / 2 - 4); - JXFillRectangle(display, menu->window, rootGC, - menu->width - 9, - menu->offsets[menu->currentIndex] + menu->itemHeight / 2 - 4, - 4, 7); - JXSetClipMask(display, rootGC, None); - JXFreePixmap(display, pixmap); - } + if(ip != NULL) { + DrawMenuItem(menu, ip, menu->currentIndex); } + JXCopyArea(display, menu->pixmap, menu->window, rootGC, + 0, 0, menu->width, menu->height, 0, 0); + } /** Draw a menu item. */ -void DrawMenuItem(Menu *menu, MenuItem *item, int index) { +void DrawMenuItem(Menu *menu, MenuItem *item, int index) +{ ButtonNode button; - Pixmap pixmap; Assert(menu); if(!item) { if(index == -1 && menu->label) { - ResetButton(&button, menu->window, rootGC); - button.x = 2; - button.y = 2; - button.width = menu->width - 5; - button.height = menu->itemHeight - 2; + ResetButton(&button, menu->pixmap, &rootVisual); + button.x = 0; + button.y = 0; + button.width = menu->width - 1; + button.height = menu->itemHeight - 1; button.font = FONT_MENU; button.type = BUTTON_LABEL; button.text = menu->label; @@ -685,46 +714,56 @@ } if(item->type != MENU_ITEM_SEPARATOR) { + ColorType fg; + + ResetButton(&button, menu->pixmap, &rootVisual); + if(menu->currentIndex == index) { + button.type = BUTTON_MENU_ACTIVE; + fg = COLOR_MENU_ACTIVE_FG; + } else { + button.type = BUTTON_LABEL; + fg = COLOR_MENU_FG; + } - ResetButton(&button, menu->window, rootGC); - button.x = 2; - button.y = 1 + menu->offsets[index]; + button.x = 0; + button.y = menu->offsets[index]; button.font = FONT_MENU; - button.type = BUTTON_LABEL; - button.width = menu->width - 5; - button.height = menu->itemHeight - 2; + button.width = menu->width; + button.height = menu->itemHeight; button.text = item->name; button.icon = item->icon; DrawButton(&button); - } else { - - JXSetForeground(display, rootGC, colors[COLOR_MENU_DOWN]); - JXDrawLine(display, menu->window, rootGC, 4, - menu->offsets[index] + 2, menu->width - 6, - menu->offsets[index] + 2); - JXSetForeground(display, rootGC, colors[COLOR_MENU_UP]); - JXDrawLine(display, menu->window, rootGC, 4, - menu->offsets[index] + 3, menu->width - 6, - menu->offsets[index] + 3); + if(item->submenu) { - } - - if(item->submenu) { + const int asize = (menu->itemHeight + 7) / 8; + const int y = menu->offsets[index] + (menu->itemHeight + 1) / 2; + int x = menu->width - 2 * asize - 1; + int i; + + JXSetForeground(display, rootGC, colors[fg]); + for(i = 0; i < asize; i++) { + const int y1 = y - asize + i; + const int y2 = y + asize - i; + JXDrawLine(display, menu->pixmap, rootGC, x, y1, x, y2); + x += 1; + } + JXDrawPoint(display, menu->pixmap, rootGC, x, y); - pixmap = JXCreatePixmapFromBitmapData(display, menu->window, - menu_bitmap, 4, 7, colors[COLOR_MENU_FG], - colors[COLOR_MENU_BG], rootDepth); - JXCopyArea(display, pixmap, menu->window, rootGC, 0, 0, 4, 7, - menu->width - 9, menu->offsets[index] + menu->itemHeight / 2 - 4); - JXFreePixmap(display, pixmap); + } + } else { + JXSetForeground(display, rootGC, colors[COLOR_MENU_ACTIVE_FG]); + JXDrawLine(display, menu->pixmap, rootGC, 4, + menu->offsets[index] + 2, menu->width - 6, + menu->offsets[index] + 2); } } /** Get the next item in the menu. */ -int GetNextMenuIndex(Menu *menu) { +int GetNextMenuIndex(Menu *menu) +{ MenuItem *item; int x; @@ -741,7 +780,8 @@ } /** Get the previous item in the menu. */ -int GetPreviousMenuIndex(Menu *menu) { +int GetPreviousMenuIndex(Menu *menu) +{ MenuItem *item; int x; @@ -758,7 +798,8 @@ } /** Get the item in the menu given a y-coordinate. */ -int GetMenuIndex(Menu *menu, int y) { +int GetMenuIndex(Menu *menu, int y) +{ int x; @@ -775,7 +816,8 @@ } /** Get the menu item associated with an index. */ -MenuItem *GetMenuItem(Menu *menu, int index) { +MenuItem *GetMenuItem(Menu *menu, int index) +{ MenuItem *ip; @@ -795,21 +837,17 @@ } /** Set the active menu item. */ -void SetPosition(Menu *tp, int index) { - - int y; - int updated; - - y = tp->offsets[index] + tp->itemHeight / 2; +void SetPosition(Menu *tp, int index) +{ + int y = tp->offsets[index] + tp->itemHeight / 2; + if(tp->height > tp->screen->height) { - if(tp->height > rootHeight) { - - updated = 0; + int updated = 0; while(y + tp->y < tp->itemHeight / 2) { tp->y += tp->itemHeight; updated = tp->itemHeight; } - while(y + tp->y >= rootHeight) { + while(y + tp->y >= tp->screen->y + tp->screen->height) { tp->y -= tp->itemHeight; updated = -tp->itemHeight; } @@ -828,35 +866,16 @@ } /** Determine if a menu is valid (and can be shown). */ -int IsMenuValid(const Menu *menu) { - - MenuItem *ip; - +char IsMenuValid(const Menu *menu) +{ if(menu) { + MenuItem *ip; for(ip = menu->items; ip; ip = ip->next) { if(ip->type != MENU_ITEM_SEPARATOR) { return 1; } } } - return 0; - -} - -/** Set the Menu transparency level. */ -void SetMenuOpacity(const char *str) { - - double temp; - - Assert(str); - - temp = atof(str); - if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { - Warning(_("invalid menu opacity: %s"), str); - temp = 1.0; - } - menuOpacity = (unsigned int)(temp * UINT_MAX); - } diff -Nru jwm-2.1.0+svn579/src/menu.h jwm-2.3.1+0~16~ubuntu14.10.1/src/menu.h --- jwm-2.1.0+svn579/src/menu.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/menu.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,32 +10,41 @@ #ifndef MENU_H #define MENU_H +struct ScreenType; + /** Enumeration of menu action types. */ -typedef enum { - MA_NONE, - MA_EXECUTE, - MA_DESKTOP, - MA_SENDTO, - MA_LAYER, - MA_STICK, - MA_MAXIMIZE, - MA_MAXIMIZE_H, - MA_MAXIMIZE_V, - MA_MINIMIZE, - MA_RESTORE, - MA_SHADE, - MA_MOVE, - MA_RESIZE, - MA_KILL, - MA_CLOSE, - MA_EXIT, - MA_RESTART -} MenuActionType; +typedef unsigned char MenuActionType; +#define MA_NONE 0 +#define MA_EXECUTE 1 +#define MA_DESKTOP 2 +#define MA_SENDTO 3 +#define MA_LAYER 4 +#define MA_STICK 5 +#define MA_MAXIMIZE 6 +#define MA_MAXIMIZE_H 7 +#define MA_MAXIMIZE_V 8 +#define MA_MINIMIZE 9 +#define MA_RESTORE 10 +#define MA_SHADE 11 +#define MA_MOVE 12 +#define MA_RESIZE 13 +#define MA_KILL 14 +#define MA_CLOSE 15 +#define MA_EXIT 16 +#define MA_RESTART 17 +#define MA_DYNAMIC 18 +#define MA_SENDTO_MENU 19 +#define MA_DESKTOP_MENU 20 +#define MA_WINDOW_MENU 21 +#define MA_ACTION_MASK 0x7F +#define MA_GROUP_MASK 0x80 /** Structure to represent a menu action for callbacks. */ typedef struct MenuAction { - MenuActionType type; /**< Type of action. */ + MenuActionType type; /**< Type of action. */ + void *context; + unsigned button; /** Extra data for the action. */ union { @@ -46,11 +55,10 @@ } MenuAction; /** Enumeration of possible menu elements. */ -typedef enum { - MENU_ITEM_NORMAL, /**< Normal menu item (button). */ - MENU_ITEM_SUBMENU, /**< Submenu. */ - MENU_ITEM_SEPARATOR /**< Item separator. */ -} MenuItemType; +typedef unsigned char MenuItemType; +#define MENU_ITEM_NORMAL 0 /**< Normal menu item (button). */ +#define MENU_ITEM_SUBMENU 1 /**< Submenu. */ +#define MENU_ITEM_SEPARATOR 2 /**< Item separator. */ /** Structure to represent a menu item. */ typedef struct MenuItem { @@ -63,7 +71,7 @@ struct MenuItem *next; /**< Next item in the menu. */ /** An icon for this menu item. - * This field is handled by menu.c */ + * This field is handled by menu.c if iconName is set. */ struct IconNode *icon; /**< Icon to display. */ } MenuItem; @@ -78,6 +86,7 @@ /* These fields are handled by menu.c */ Window window; /**< The menu window. */ + Pixmap pixmap; /**< Pixmap where the menu is rendered. */ int x; /**< The x-coordinate of the menu. */ int y; /**< The y-coordinate of the menu. */ int width; /**< The width of the menu. */ @@ -89,10 +98,14 @@ int textOffset; /**< x-offset of text in the menu. */ int *offsets; /**< y-offsets of menu items. */ struct Menu *parent; /**< The parent menu (or NULL). */ + const struct ScreenType *screen; } Menu; -typedef void (*RunMenuCommandType)(const MenuAction *action); +typedef void (*RunMenuCommandType)(MenuAction *action); + +/** Create an empty menu item. */ +MenuItem *CreateMenuItem(MenuItemType type); /** Initialize a menu structure to be shown. * @param menu The menu to initialize. @@ -115,10 +128,5 @@ /** The number of open menus. */ extern int menuShown; -/** Set the Menu opacity level. - * @param str The value (ASCII). - */ -void SetMenuOpacity(const char *str); - #endif /* MENU_H */ diff -Nru jwm-2.1.0+svn579/src/misc.c jwm-2.3.1+0~16~ubuntu14.10.1/src/misc.c --- jwm-2.1.0+svn579/src/misc.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/misc.c 2015-07-18 20:02:18.000000000 +0000 @@ -7,30 +7,35 @@ * */ -#include "jwm.h" #include "misc.h" +#include "debug.h" +#include +#include -static int IsSpace(char ch); -static int IsSymbolic(char ch); +static char IsSymbolic(char ch); static char *GetSymbolName(const char *str); -static void ReplaceSymbol(char **str, const char *name, const char *value); +static void ReplaceSymbol(char **str, unsigned int offset, + const char *name, const char *value); /** Determine if a character is a space character. */ -int IsSpace(char ch) { +char IsSpace(char ch, unsigned int *lineNumber) +{ switch(ch) { case ' ': case '\t': - case '\n': case '\r': return 1; + case '\n': + *lineNumber += 1; + return 1; default: return 0; } } /** Determine if a character is a valid for a shell variable. */ -int IsSymbolic(char ch) { - +char IsSymbolic(char ch) +{ if(ch >= 'A' && ch <= 'Z') { return 1; } else if(ch >= 'a' && ch <= 'z') { @@ -42,20 +47,20 @@ } else { return 0; } - } /** Get the name of a shell variable (returns a copy). */ -char *GetSymbolName(const char *str) { +char *GetSymbolName(const char *str) +{ char *temp; - int stop; if(*str == '$') { temp = Allocate(2); temp[0] = '$'; temp[1] = 0; } else { + int stop; for(stop = 0; IsSymbolic(str[stop]); stop++); temp = Allocate(stop + 1); memcpy(temp, str, stop); @@ -66,26 +71,29 @@ } -/** Replace "name" with "value" in str (reallocates if needed). */ -void ReplaceSymbol(char **str, const char *name, const char *value) { +/** Replace "name" with "value" at offset in str (reallocates if needed). */ +void ReplaceSymbol(char **str, unsigned int offset, + const char *name, const char *value) +{ char *temp; int strLength; int nameLength; int valueLength; - int x; Assert(str); Assert(name); + /* Determine string lengths. */ strLength = strlen(*str); - nameLength = strlen(name) + 1; + nameLength = strlen(name) + 1; /* Account for the '$'. */ if(value) { valueLength = strlen(value); } else { valueLength = 0; } + /* Allocate extra space if necessary. */ if(valueLength > nameLength) { temp = Allocate(strLength - nameLength + valueLength + 1); strcpy(temp, *str); @@ -93,28 +101,23 @@ *str = temp; } - temp = strstr(*str, name); - Assert(temp); - --temp; /* Account for the "$" */ + /* Offset to '$'. */ + temp = *str + offset; if(nameLength > valueLength) { /* Move left */ - for(x = 0; temp[x]; x++) { - temp[x] = temp[x + nameLength - valueLength]; - } - temp[x] = temp[x + nameLength - valueLength]; + memmove(temp, temp + nameLength - valueLength, + strLength - offset - nameLength + valueLength + 1); } else if(nameLength < valueLength) { /* Move right */ - for(x = strlen(temp); x >= 0; x--) { - temp[x + valueLength - nameLength] = temp[x]; - } + memmove(temp + valueLength, temp + nameLength, + strLength + - nameLength - offset + 1); } - if(value) { memcpy(temp, value, valueLength); } @@ -122,11 +125,12 @@ } /** Perform shell-like macro path expansion. */ -void ExpandPath(char **path) { +void ExpandPath(char **path) +{ char *name; char *value; - int x; + unsigned int x; Assert(path); @@ -135,7 +139,7 @@ if((*path)[x] == '$') { name = GetSymbolName(*path + x + 1); value = getenv(name); - ReplaceSymbol(path, name, value); + ReplaceSymbol(path, x, name, value); Release(name); if(value) { x += strlen(value) - 1; @@ -147,18 +151,21 @@ } /** Trim leading and trailing whitespace from a string. */ -void Trim(char *str) { +void Trim(char *str) +{ - int length; - int start; - int x; + unsigned int length; + unsigned int start; + unsigned int x; + unsigned int line; Assert(str); length = strlen(str); /* Determine how much to cut off of the left. */ - for(start = 0; IsSpace(str[start]); start++); + line = 0; + for(start = 0; IsSpace(str[start], &line); start++); /* Trim the left. */ if(start > 0) { @@ -169,18 +176,19 @@ } /* Trim the right. */ - while(length > 0 && IsSpace(str[length - 1])) { - --length; + while(length > 0 && IsSpace(str[length - 1], &line)) { + length -= 1; str[length] = 0; } } /** Copy a string. */ -char *CopyString(const char *str) { +char *CopyString(const char *str) +{ char *temp; - int len; + unsigned int len; if(!str) { return NULL; @@ -194,3 +202,49 @@ } +/** Parse a float. */ +float ParseFloat(const char *str) +{ + float result; +#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) + setlocale(LC_ALL, "C"); +#endif + result = atof(str); +#if defined(HAVE_SETLOCALE) && defined(ENABLE_NLS) + setlocale(LC_ALL, ""); +#endif + return result; +} + +/** Find a value in a string mapping. */ +int FindValue(const StringMappingType *mapping, int count, const char *key) +{ + int left = 0; + int right = count - 1; + while(right >= left) { + const int x = (left + right) / 2; + Assert(x >= 0); + Assert(x < count); + const int rc = strcmp(key, mapping[x].key); + if(rc < 0) { + right = x - 1; + } else if(rc > 0) { + left = x + 1; + } else { + return mapping[x].value; + } + } + return -1; +} + +/** Find a key in a string mapping. */ +const char *FindKey(const StringMappingType *mapping, int count, int value) +{ + int x; + for(x = 0; x < count; x++) { + if(mapping[x].value == value) { + return mapping[x].key; + } + } + return NULL; +} diff -Nru jwm-2.1.0+svn579/src/misc.h jwm-2.3.1+0~16~ubuntu14.10.1/src/misc.h --- jwm-2.1.0+svn579/src/misc.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/misc.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,12 +10,30 @@ #ifndef MISC_H #define MISC_H +/** Mapping between a string and integer. + * This is used with FindValue and FindKey. + * Note that mappings must be sorted. + */ +typedef struct { + const char *key; + int value; +} StringMappingType; + +/** Get the length of an array. */ +#define ARRAY_LENGTH( a ) (sizeof(a) / sizeof(a[0])) + /** Return the minimum of two values. */ #define Min( x, y ) ( (x) > (y) ? (y) : (x) ) /** Return the maximum of two values. */ #define Max( x, y ) ( (x) > (y) ? (x) : (y) ) +/** Determine if a character is a space character. + * @param ch The character to check. + * @param lineNumber The line number to update. + */ +char IsSpace(char ch, unsigned int *lineNumber); + /** Perform shell-like macro path expansion. * @param path The path to expand (possibly reallocated). */ @@ -33,5 +51,28 @@ */ char *CopyString(const char *str); -#endif /* MISC_H */ +/** Read a float in a locale-independent way. + * @param str The string containing the float. + * @return The float. + */ +float ParseFloat(const char *str); + +/** Find a value in a string mapping. + * This uses binary search. + * @param mapping The mapping. + * @param key The item to find. + * @param count The number of items in the mapping. + * @return The value or -1 if not found. + */ +int FindValue(const StringMappingType *mapping, int count, const char *key); +/** Find a key in a string mapping. + * This uses linear search. + * @param mapping The mapping. + * @param value The value to find. + * @param count The number of items in the mapping. + * @return The key or NULL if not found. + */ +const char *FindKey(const StringMappingType *mapping, int count, int value); + +#endif /* MISC_H */ diff -Nru jwm-2.1.0+svn579/src/move.c jwm-2.3.1+0~16~ubuntu14.10.1/src/move.c --- jwm-2.1.0+svn579/src/move.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/move.c 2015-07-18 20:02:18.000000000 +0000 @@ -14,88 +14,67 @@ #include "client.h" #include "clientlist.h" #include "cursor.h" -#include "error.h" #include "event.h" #include "key.h" -#include "main.h" #include "outline.h" #include "pager.h" #include "screen.h" #include "status.h" #include "tray.h" #include "desktop.h" +#include "settings.h" +#include "timing.h" typedef struct { - int valid; int left, right; int top, bottom; + char valid; } RectangleType; static char shouldStopMove; -static SnapModeType snapMode = SNAP_BORDER; -static int snapDistance = DEFAULT_SNAP_DISTANCE; +static char atLeft; +static char atRight; +static char atBottom; +static char atTop; +static ClientNode *currentClient; +static TimeType moveTime; -static MoveModeType moveMode = MOVE_OPAQUE; - -static void StopMove(ClientNode *np, - int doMove, int oldx, int oldy, int hmax, int vmax); +static void StopMove(ClientNode *np, int doMove, + int oldx, int oldy, MaxFlags maxFlags); static void MoveController(int wasDestroyed); static void DoSnap(ClientNode *np); static void DoSnapScreen(ClientNode *np); static void DoSnapBorder(ClientNode *np); -static int ShouldSnap(const ClientNode *np); +static char ShouldSnap(const ClientNode *np); static void GetClientRectangle(const ClientNode *np, RectangleType *r); -static int CheckOverlapTopBottom(const RectangleType *a, - const RectangleType *b); -static int CheckOverlapLeftRight(const RectangleType *a, - const RectangleType *b); - -static int CheckLeftValid(const RectangleType *client, - const RectangleType *other, const RectangleType *left); -static int CheckRightValid(const RectangleType *client, - const RectangleType *other, const RectangleType *right); -static int CheckTopValid(const RectangleType *client, - const RectangleType *other, const RectangleType *top); -static int CheckBottomValid(const RectangleType *client, - const RectangleType *other, const RectangleType *bottom); - -/** Set the snap mode to use. */ -void SetSnapMode(SnapModeType mode) { - snapMode = mode; -} - -/** Set the move mode to use. */ -void SetMoveMode(MoveModeType mode) { - moveMode = mode; -} - -/** Set the snap distance. */ -void SetSnapDistance(const char *value) { - int temp; - - Assert(value); - - temp = atoi(value); - if(JUNLIKELY(temp > MAX_SNAP_DISTANCE || temp < MIN_SNAP_DISTANCE)) { - snapDistance = DEFAULT_SNAP_DISTANCE; - Warning(_("invalid snap distance specified: %d"), temp); - } else { - snapDistance = temp; - } - -} +static char CheckOverlapTopBottom(const RectangleType *a, + const RectangleType *b); +static char CheckOverlapLeftRight(const RectangleType *a, + const RectangleType *b); + +static char CheckLeftValid(const RectangleType *client, + const RectangleType *other, + const RectangleType *left); +static char CheckRightValid(const RectangleType *client, + const RectangleType *other, + const RectangleType *right); +static char CheckTopValid(const RectangleType *client, + const RectangleType *other, + const RectangleType *top); +static char CheckBottomValid(const RectangleType *client, + const RectangleType *other, + const RectangleType *bottom); -/** Restore the default snap distance. */ -void SetDefaultSnapDistance() { - snapDistance = DEFAULT_SNAP_DISTANCE; -} +static void SignalMove(const TimeType *now, int x, int y, Window w, void *data); +static void UpdateDesktop(const TimeType *now); /** Callback for stopping moves. */ -void MoveController(int wasDestroyed) { +void MoveController(int wasDestroyed) +{ - if(moveMode == MOVE_OUTLINE) { + if(settings.moveMode == MOVE_OUTLINE) { ClearOutline(); } @@ -104,45 +83,55 @@ DestroyMoveWindow(); shouldStopMove = 1; + atTop = 0; + atBottom = 0; + atLeft = 0; + atRight = 0; } /** Move a client window. */ -int MoveClient(ClientNode *np, int startx, int starty, int snap) { +char MoveClient(ClientNode *np, int startx, int starty) +{ XEvent event; int oldx, oldy; int doMove; int north, south, east, west; int height; - int hmax, vmax; + MaxFlags maxFlags; Assert(np); if(!(np->state.border & BORDER_MOVE)) { return 0; } + if(np->state.status & STAT_FULLSCREEN) { + return 0; + } GrabMouseForMove(); + RegisterCallback(0, SignalMove, NULL); np->controller = MoveController; shouldStopMove = 0; oldx = np->x; oldy = np->y; - vmax = 0; - hmax = 0; + maxFlags = np->state.maxFlags; if(!(GetMouseMask() & (Button1Mask | Button2Mask))) { - StopMove(np, 0, oldx, oldy, 0, 0); + StopMove(np, 0, oldx, oldy, maxFlags); return 0; } - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); startx -= west; starty -= north; + currentClient = np; + atTop = atBottom = atLeft = atRight = 0; doMove = 0; for(;;) { @@ -151,6 +140,7 @@ if(shouldStopMove) { np->controller = NULL; SetDefaultCursor(np->parent); + UnregisterCallback(SignalMove, NULL); return doMove; } @@ -158,7 +148,7 @@ case ButtonRelease: if(event.xbutton.button == Button1 || event.xbutton.button == Button2) { - StopMove(np, doMove, oldx, oldy, hmax, vmax); + StopMove(np, doMove, oldx, oldy, maxFlags); return doMove; } break; @@ -169,59 +159,46 @@ np->x = event.xmotion.x_root - startx; np->y = event.xmotion.y_root - starty; - if(event.xmotion.x_root == 0) { - if(LeftDesktop()) { - SetClientDesktop(np, currentDesktop); - RestackClients(); - np->x = rootWidth - 2 - startx; - np->y = event.xmotion.y_root - starty; - MoveMouse(rootWindow, np->x + startx, np->y + starty); - DiscardMotionEvents(&event, np->window); + /* Get the move time used for desktop switching. */ + if(!(atLeft | atTop | atRight | atBottom)) { + if(event.xmotion.state & Mod1Mask) { + moveTime.seconds = 0; + moveTime.ms = 0; + } else { + GetCurrentTime(&moveTime); } + } + + /* Determine if we are at a border for desktop switching. */ + atLeft = atTop = atRight = atBottom = 0; + if(event.xmotion.x_root == 0) { + atLeft = 1; } else if(event.xmotion.x_root == rootWidth - 1) { - if(RightDesktop()) { - SetClientDesktop(np, currentDesktop); - RestackClients(); - np->x = 1 - startx; - np->y = event.xmotion.y_root - starty; - MoveMouse(rootWindow, np->x + startx, np->y + starty); - DiscardMotionEvents(&event, np->window); - } - } else if(event.xmotion.y_root == 0) { - if(AboveDesktop()) { - SetClientDesktop(np, currentDesktop); - RestackClients(); - np->x = event.xmotion.x_root - startx; - np->y = rootHeight - 2 - starty; - MoveMouse(rootWindow, np->x + startx, np->y + starty); - DiscardMotionEvents(&event, np->window); - } + atRight = 1; + } + if(event.xmotion.y_root == 0) { + atTop = 1; } else if(event.xmotion.y_root == rootHeight - 1) { - if(BelowDesktop()) { - SetClientDesktop(np, currentDesktop); - RestackClients(); - np->x = event.xmotion.x_root - startx; - np->y = 1 - starty; - MoveMouse(rootWindow, np->x + startx, np->y + starty); - DiscardMotionEvents(&event, np->window); - } + atBottom = 1; } - if(snap) { + if(event.xmotion.state & Mod1Mask) { + /* Switch desktops immediately if alt is pressed. */ + if(atLeft | atRight | atTop | atBottom) { + TimeType now; + GetCurrentTime(&now); + UpdateDesktop(&now); + } + } else { + /* If alt is not pressed, snap to borders. */ DoSnap(np); } if(!doMove && (abs(np->x - oldx) > MOVE_DELTA || abs(np->y - oldy) > MOVE_DELTA)) { - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - if(np->state.status & STAT_HMAX) { - hmax = 1; - } - if(np->state.status & STAT_VMAX) { - vmax = 1; - } - MaximizeClient(np, 0, 0); + if(np->state.maxFlags) { + MaximizeClient(np, MAX_NONE); startx = np->width / 2; starty = -north / 2; MoveMouse(np->parent, startx, starty); @@ -233,21 +210,21 @@ if(doMove) { - if(moveMode == MOVE_OUTLINE) { + if(settings.moveMode == MOVE_OUTLINE) { ClearOutline(); height = north + south; if(!(np->state.status & STAT_SHADED)) { height += np->height; } DrawOutline(np->x - west, np->y - north, - np->width + west + east, height); + np->width + west + east, height); } else { JXMoveWindow(display, np->parent, np->x - west, - np->y - north); + np->y - north); SendConfigureEvent(np); } UpdateMoveWindow(np); - UpdatePager(); + RequirePagerUpdate(); } break; @@ -258,45 +235,43 @@ } /** Move a client window (keyboard or menu initiated). */ -int MoveClientKeyboard(ClientNode *np) { +char MoveClientKeyboard(ClientNode *np) +{ XEvent event; int oldx, oldy; int moved; int height; int north, south, east, west; - int hmax, vmax; + MaxFlags maxFlags; Assert(np); if(!(np->state.border & BORDER_MOVE)) { return 0; } - - hmax = 0; - if(np->state.status & STAT_HMAX) { - hmax = 1; - } - vmax = 0; - if(np->state.status & STAT_VMAX) { - vmax = 1; + if(np->state.status & STAT_FULLSCREEN) { + return 0; } - if(vmax || hmax) { - MaximizeClient(np, 0, 0); + + maxFlags = np->state.maxFlags; + if(np->state.maxFlags != MAX_NONE) { + MaximizeClient(np, MAX_NONE); } - GrabMouseForMove(); - if(JUNLIKELY(JXGrabKeyboard(display, np->window, True, GrabModeAsync, - GrabModeAsync, CurrentTime) != GrabSuccess)) { - Debug("could not grab keyboard for client move"); + if(JUNLIKELY(JXGrabKeyboard(display, np->parent, True, GrabModeAsync, + GrabModeAsync, CurrentTime))) { + Debug("MoveClient: could not grab keyboard"); return 0; } + GrabMouseForMove(); - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); oldx = np->x; oldy = np->y; + RegisterCallback(0, SignalMove, NULL); np->controller = MoveController; shouldStopMove = 0; @@ -319,6 +294,7 @@ if(shouldStopMove) { np->controller = NULL; SetDefaultCursor(np->parent); + UnregisterCallback(SignalMove, NULL); return 1; } @@ -326,9 +302,7 @@ if(event.type == KeyPress) { - while(JXCheckTypedWindowEvent(display, np->window, KeyPress, &event)); - UpdateTime(&event); - + DiscardKeyEvents(&event, np->window); switch(GetKey(&event.xkey) & 0xFF) { case KEY_UP: if(np->y + height > 0) { @@ -351,21 +325,18 @@ } break; default: - StopMove(np, 1, oldx, oldy, hmax, vmax); + StopMove(np, 1, oldx, oldy, maxFlags); return 1; } MoveMouse(rootWindow, np->x, np->y); - JXCheckTypedWindowEvent(display, np->window, MotionNotify, &event); - UpdateTime(&event); + DiscardMotionEvents(&event, np->window); moved = 1; } else if(event.type == MotionNotify) { - while(JXCheckTypedWindowEvent(display, np->window, - MotionNotify, &event)); - UpdateTime(&event); + DiscardMotionEvents(&event, np->window); np->x = event.xmotion.x; np->y = event.xmotion.y; @@ -374,24 +345,24 @@ } else if(event.type == ButtonRelease) { - StopMove(np, 1, oldx, oldy, hmax, vmax); + StopMove(np, 1, oldx, oldy, maxFlags); return 1; } if(moved) { - if(moveMode == MOVE_OUTLINE) { + if(settings.moveMode == MOVE_OUTLINE) { ClearOutline(); DrawOutline(np->x - west, np->y - west, - np->width + west + east, height + north + west); + np->width + west + east, height + north + west); } else { JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); } UpdateMoveWindow(np); - UpdatePager(); + RequirePagerUpdate(); } @@ -401,7 +372,8 @@ /** Stop move. */ void StopMove(ClientNode *np, int doMove, - int oldx, int oldy, int hmax, int vmax) { + int oldx, int oldy, MaxFlags maxFlags) +{ int north, south, east, west; @@ -413,36 +385,37 @@ np->controller = NULL; SetDefaultCursor(np->parent); + UnregisterCallback(SignalMove, NULL); if(!doMove) { np->x = oldx; np->y = oldy; - /* Restore maximized status if only maximized in one direction. */ - if((hmax || vmax) && !(hmax && vmax)) { - MaximizeClient(np, hmax, vmax); + /* Restore maximized status. */ + if(maxFlags) { + MaximizeClient(np, maxFlags); } - return; } - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); /* Restore maximized status. */ - if((hmax || vmax) && !(hmax && vmax)) { - MaximizeClient(np, hmax, vmax); + if(maxFlags) { + MaximizeClient(np, maxFlags); } } /** Snap to the screen and/or neighboring windows. */ -void DoSnap(ClientNode *np) { - switch(snapMode) { +void DoSnap(ClientNode *np) +{ + switch(settings.snapMode) { case SNAP_BORDER: DoSnapBorder(np); DoSnapScreen(np); @@ -456,7 +429,8 @@ } /** Snap to the screen. */ -void DoSnapScreen(ClientNode *np) { +void DoSnapScreen(ClientNode *np) +{ RectangleType client; int screen; @@ -466,26 +440,26 @@ GetClientRectangle(np, &client); - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); screenCount = GetScreenCount(); for(screen = 0; screen < screenCount; screen++) { sp = GetScreen(screen); - if(abs(client.right - sp->width - sp->x) <= snapDistance) { + if(abs(client.right - sp->width - sp->x) <= settings.snapDistance) { np->x = sp->x + sp->width - west - np->width; } - if(abs(client.left - sp->x) <= snapDistance) { + if(abs(client.left - sp->x) <= settings.snapDistance) { np->x = sp->x + east; } - if(abs(client.bottom - sp->height - sp->y) <= snapDistance) { + if(abs(client.bottom - sp->height - sp->y) <= settings.snapDistance) { np->y = sp->y + sp->height - south; if(!(np->state.status & STAT_SHADED)) { np->y -= np->height; } } - if(abs(client.top - sp->y) <= snapDistance) { + if(abs(client.top - sp->y) <= settings.snapDistance) { np->y = north + sp->y; } @@ -494,7 +468,8 @@ } /** Snap to window borders. */ -void DoSnapBorder(ClientNode *np) { +void DoSnapBorder(ClientNode *np) +{ const ClientNode *tp; const TrayType *tray; @@ -508,7 +483,7 @@ GetClientRectangle(np, &client); - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); other.valid = 1; @@ -533,18 +508,18 @@ bottom.valid = CheckBottomValid(&client, &other, &bottom); if(CheckOverlapTopBottom(&client, &other)) { - if(abs(client.left - other.right) <= snapDistance) { + if(abs(client.left - other.right) <= settings.snapDistance) { left = other; } - if(abs(client.right - other.left) <= snapDistance) { + if(abs(client.right - other.left) <= settings.snapDistance) { right = other; } } if(CheckOverlapLeftRight(&client, &other)) { - if(abs(client.top - other.bottom) <= snapDistance) { + if(abs(client.top - other.bottom) <= settings.snapDistance) { top = other; } - if(abs(client.bottom - other.top) <= snapDistance) { + if(abs(client.bottom - other.top) <= settings.snapDistance) { bottom = other; } } @@ -568,18 +543,18 @@ /* Compute the new snap values. */ if(CheckOverlapTopBottom(&client, &other)) { - if(abs(client.left - other.right) <= snapDistance) { + if(abs(client.left - other.right) <= settings.snapDistance) { left = other; } - if(abs(client.right - other.left) <= snapDistance) { + if(abs(client.right - other.left) <= settings.snapDistance) { right = other; } } if(CheckOverlapLeftRight(&client, &other)) { - if(abs(client.top - other.bottom) <= snapDistance) { + if(abs(client.top - other.bottom) <= settings.snapDistance) { top = other; } - if(abs(client.bottom - other.top) <= snapDistance) { + if(abs(client.bottom - other.top) <= settings.snapDistance) { bottom = other; } } @@ -607,7 +582,8 @@ } /** Determine if we should snap to the specified client. */ -int ShouldSnap(const ClientNode *np) { +char ShouldSnap(const ClientNode *np) +{ if(np->state.status & STAT_HIDDEN) { return 0; } else if(np->state.status & STAT_MINIMIZED) { @@ -618,11 +594,12 @@ } /** Get a rectangle to represent a client window. */ -void GetClientRectangle(const ClientNode *np, RectangleType *r) { +void GetClientRectangle(const ClientNode *np, RectangleType *r) +{ int north, south, east, west; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); r->left = np->x - west; r->right = np->x + np->width + east; @@ -638,7 +615,8 @@ } /** Check for top/bottom overlap. */ -int CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b) { +char CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b) +{ if(a->top >= b->bottom) { return 0; } else if(a->bottom <= b->top) { @@ -649,7 +627,8 @@ } /** Check for left/right overlap. */ -int CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b) { +char CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b) +{ if(a->left >= b->right) { return 0; } else if(a->right <= b->left) { @@ -666,8 +645,9 @@ * @param left The top/bottom of the current left snap window. * @return 1 if the current left snap position is still valid, otherwise 0. */ -int CheckLeftValid(const RectangleType *client, - const RectangleType *other, const RectangleType *left) { +char CheckLeftValid(const RectangleType *client, + const RectangleType *other, const RectangleType *left) +{ if(!left->valid) { return 0; @@ -696,8 +676,9 @@ } /** Check if the current right snap position is valid. */ -int CheckRightValid(const RectangleType *client, - const RectangleType *other, const RectangleType *right) { +char CheckRightValid(const RectangleType *client, + const RectangleType *other, const RectangleType *right) +{ if(!right->valid) { return 0; @@ -726,8 +707,9 @@ } /** Check if the current top snap position is valid. */ -int CheckTopValid(const RectangleType *client, - const RectangleType *other, const RectangleType *top) { +char CheckTopValid(const RectangleType *client, + const RectangleType *other, const RectangleType *top) +{ if(!top->valid) { return 0; @@ -756,8 +738,9 @@ } /** Check if the current bottom snap position is valid. */ -int CheckBottomValid(const RectangleType *client, - const RectangleType *other, const RectangleType *bottom) { +char CheckBottomValid(const RectangleType *client, + const RectangleType *other, const RectangleType *bottom) +{ if(!bottom->valid) { return 0; @@ -785,3 +768,34 @@ } +/** Switch desktops if appropriate. */ +void SignalMove(const TimeType *now, int x, int y, Window w, void *data) +{ + UpdateDesktop(now); +} + +/** Switch to the specified desktop. */ +void UpdateDesktop(const TimeType *now) +{ + if(settings.desktopDelay == 0) { + return; + } + if(GetTimeDifference(now, &moveTime) < settings.desktopDelay) { + return; + } + moveTime = *now; + + if(atLeft && LeftDesktop()) { + SetClientDesktop(currentClient, currentDesktop); + RequireRestack(); + } else if(atRight && RightDesktop()) { + SetClientDesktop(currentClient, currentDesktop); + RequireRestack(); + } else if(atTop && AboveDesktop()) { + SetClientDesktop(currentClient, currentDesktop); + RequireRestack(); + } else if(atBottom && BelowDesktop()) { + SetClientDesktop(currentClient, currentDesktop); + RequireRestack(); + } +} diff -Nru jwm-2.1.0+svn579/src/move.h jwm-2.3.1+0~16~ubuntu14.10.1/src/move.h --- jwm-2.1.0+svn579/src/move.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/move.h 2015-07-18 20:02:18.000000000 +0000 @@ -12,51 +12,19 @@ struct ClientNode; -/** Window snap modes. */ -typedef enum { - SNAP_NONE = 0, /**< Don't snap. */ - SNAP_SCREEN = 1, /**< Snap to the edges of the screen. */ - SNAP_BORDER = 2 /**< Snap to all borders. */ -} SnapModeType; - -/** Window move modes. */ -typedef enum { - MOVE_OPAQUE, /**< Show window contents while moving. */ - MOVE_OUTLINE /**< Show an outline while moving. */ -} MoveModeType; - /** Move a client window. * @param np The client to move. * @param startx The starting mouse x-coordinate (window relative). * @param starty The starting mouse y-coordinate (window relative). - * @param snap 1 to do edge snapping, 0 otherwise. * @return 1 if the client moved, 0 otherwise. */ -int MoveClient(struct ClientNode *np, int startx, int starty, int snap); +char MoveClient(struct ClientNode *np, int startx, int starty); /** Move a client window using the keyboard (mouse optional). * @param np The client to move. * @return 1 if the client moved, 0 otherwise. */ -int MoveClientKeyboard(struct ClientNode *np); - -/** Set the snap mode to use. - * @param mode The snap mode to use. - */ -void SetSnapMode(SnapModeType mode); - -/** Set the snap distance to use. - * @param value A string representation of the distance to use. - */ -void SetSnapDistance(const char *value); - -/** Set the snap distance to the default. */ -void SetDefaultSnapDistance(); - -/** Set the move mode to use. - * @param mode The move mode to use. - */ -void SetMoveMode(MoveModeType mode); +char MoveClientKeyboard(struct ClientNode *np); #endif /* MOVE_H */ diff -Nru jwm-2.1.0+svn579/src/outline.c jwm-2.3.1+0~16~ubuntu14.10.1/src/outline.c --- jwm-2.1.0+svn579/src/outline.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/outline.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,61 +10,39 @@ #include "jwm.h" #include "outline.h" #include "main.h" +#include "grab.h" -static GC outlineGC; +static GC outlineGC = None; static int lastX, lastY; static int lastWidth, lastHeight; -static char outlineDrawn; - -/** Initialize outline data. */ -void InitializeOutline() { -} - -/** Startup outlines. */ -void StartupOutline() { +/** Draw an outline. */ +void DrawOutline(int x, int y, int width, int height) +{ XGCValues gcValues; - gcValues.function = GXinvert; gcValues.subwindow_mode = IncludeInferiors; gcValues.line_width = 2; outlineGC = JXCreateGC(display, rootWindow, - GCFunction | GCSubwindowMode | GCLineWidth, &gcValues); - outlineDrawn = 0; - -} - -/** Shutdown outlines. */ -void ShutdownOutline() { - JXFreeGC(display, outlineGC); -} - -/** Release outline data. */ -void DestroyOutline() { -} - -/** Draw an outline. */ -void DrawOutline(int x, int y, int width, int height) { - if(!outlineDrawn) { - JXSync(display, False); - JXGrabServer(display); - JXDrawRectangle(display, rootWindow, outlineGC, x, y, width, height); - lastX = x; - lastY = y; - lastWidth = width; - lastHeight = height; - outlineDrawn = 1; - } + GCFunction | GCSubwindowMode | GCLineWidth, + &gcValues); + GrabServer(); + JXDrawRectangle(display, rootWindow, outlineGC, x, y, width, height); + lastX = x; + lastY = y; + lastWidth = width; + lastHeight = height; } /** Clear the last outline. */ -void ClearOutline() { - if(outlineDrawn) { +void ClearOutline(void) +{ + if(outlineGC != None) { JXDrawRectangle(display, rootWindow, outlineGC, lastX, lastY, lastWidth, lastHeight); - outlineDrawn = 0; - JXUngrabServer(display); - JXSync(display, False); + UngrabServer(); + JXFreeGC(display, outlineGC); + outlineGC = None; } } diff -Nru jwm-2.1.0+svn579/src/outline.h jwm-2.3.1+0~16~ubuntu14.10.1/src/outline.h --- jwm-2.1.0+svn579/src/outline.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/outline.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,13 +10,6 @@ #ifndef OUTLINE_H #define OUTLINE_H -/*@{*/ -void InitializeOutline(); -void StartupOutline(); -void ShutdownOutline(); -void DestroyOutline(); -/*@}*/ - /** Draw an outline. * @param x The x-coordinate. * @param y The y-coordinate. @@ -26,7 +19,7 @@ void DrawOutline(int x, int y, int width, int height); /** Clear an outline. */ -void ClearOutline(); +void ClearOutline(void); #endif /* OUTLINE_H */ diff -Nru jwm-2.1.0+svn579/src/pager.c jwm-2.3.1+0~16~ubuntu14.10.1/src/pager.c --- jwm-2.1.0+svn579/src/pager.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/pager.c 2015-07-18 20:02:18.000000000 +0000 @@ -16,22 +16,22 @@ #include "cursor.h" #include "desktop.h" #include "event.h" -#include "main.h" #include "tray.h" #include "timing.h" #include "popup.h" #include "font.h" +#include "settings.h" /** Structure to represent a pager tray component. */ typedef struct PagerType { TrayComponentType *cp; /**< Common tray component data. */ - int labeled; /**< Set to label the pager. */ int deskWidth; /**< Width of a desktop. */ int deskHeight; /**< Height of a desktop. */ int scalex; /**< Horizontal scale factor (fixed point). */ int scaley; /**< Vertical scale factor (fixed point). */ + char labeled; /**< Set to label the pager. */ Pixmap buffer; /**< Buffer for rendering the pager. */ @@ -42,9 +42,9 @@ } PagerType; -static PagerType *pagers; +static PagerType *pagers = NULL; -static int shouldStopMove; +static char shouldStopMove; static void Create(TrayComponentType *cp); @@ -53,55 +53,50 @@ static int GetPagerDesktop(PagerType *pp, int x, int y); static void ProcessPagerButtonEvent(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); static void ProcessPagerMotionEvent(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); static void StartPagerMove(TrayComponentType *cp, int x, int y); static void StopPagerMove(ClientNode *np, - int x, int y, int desktop, int hmax, int vmax); + int x, int y, int desktop, MaxFlags maxFlags); static void PagerMoveController(int wasDestroyed); +static void DrawPager(const PagerType *pp); + static void DrawPagerClient(const PagerType *pp, const ClientNode *np); -/** Initialize pager data. */ -void InitializePager() { - pagers = NULL; -} +static void SignalPager(const TimeType *now, int x, int y, Window w, + void *data); -/** Startup the pager. */ -void StartupPager() { -} /** Shutdown the pager. */ -void ShutdownPager() { - +void ShutdownPager(void) +{ PagerType *pp; - for(pp = pagers; pp; pp = pp->next) { JXFreePixmap(display, pp->buffer); } - } /** Release pager data. */ -void DestroyPager() { - +void DestroyPager(void) +{ PagerType *pp; - while(pagers) { + UnregisterCallback(SignalPager, pagers); pp = pagers->next; Release(pagers); pagers = pp; } - } /** Create a new pager tray component. */ -TrayComponentType *CreatePager(int labeled) { +TrayComponentType *CreatePager(char labeled) +{ TrayComponentType *cp; PagerType *pp; @@ -110,10 +105,11 @@ pp->next = pagers; pagers = pp; pp->labeled = labeled; - pp->mousex = -POPUP_DELTA; - pp->mousey = -POPUP_DELTA; + pp->mousex = -settings.doubleClickDelta; + pp->mousey = -settings.doubleClickDelta; pp->mouseTime.seconds = 0; pp->mouseTime.ms = 0; + pp->buffer = None; cp = CreateTrayComponent(); cp->object = pp; @@ -123,11 +119,14 @@ cp->ProcessButtonPress = ProcessPagerButtonEvent; cp->ProcessMotionEvent = ProcessPagerMotionEvent; + RegisterCallback(settings.popupDelay / 2, SignalPager, pp); + return cp; } /** Initialize a pager tray component. */ -void Create(TrayComponentType *cp) { +void Create(TrayComponentType *cp) +{ PagerType *pp; @@ -141,65 +140,72 @@ Assert(cp->height > 0); cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, - cp->height, rootDepth); + cp->height, rootVisual.depth); pp->buffer = cp->pixmap; } /** Set the size of a pager tray component. */ -void SetSize(TrayComponentType *cp, int width, int height) { - - PagerType *pp; - - Assert(cp); - - pp = (PagerType*)cp->object; +void SetSize(TrayComponentType *cp, int width, int height) +{ - Assert(pp); + PagerType *pp = (PagerType*)cp->object; if(width) { /* Vertical pager. */ cp->width = width; - pp->deskWidth = width / desktopWidth; + pp->deskWidth = width / settings.desktopWidth; pp->deskHeight = (pp->deskWidth * rootHeight) / rootWidth; - cp->height = (pp->deskHeight + 1) * desktopHeight; + cp->height = pp->deskHeight * settings.desktopHeight + + settings.desktopHeight - 1; } else if(height) { /* Horizontal pager. */ cp->height = height; - pp->deskHeight = height / desktopHeight; + pp->deskHeight = height / settings.desktopHeight; pp->deskWidth = (pp->deskHeight * rootWidth) / rootHeight; - cp->width = (pp->deskWidth + 1) * desktopWidth; + cp->width = pp->deskWidth * settings.desktopWidth + + settings.desktopWidth - 1; } else { Assert(0); } + if(pp->buffer != None) { + JXFreePixmap(display, pp->buffer); + pp->buffer = JXCreatePixmap(display, rootWindow, cp->width, + cp->height, rootVisual.depth); + cp->pixmap = pp->buffer; + DrawPager(pp); + } + pp->scalex = ((pp->deskWidth - 2) << 16) / rootWidth; pp->scaley = ((pp->deskHeight - 2) << 16) / rootHeight; } /** Get the desktop for a pager given a set of coordinates. */ -int GetPagerDesktop(PagerType *pp, int x, int y) { +int GetPagerDesktop(PagerType *pp, int x, int y) +{ int pagerx, pagery; pagerx = x / (pp->deskWidth + 1); pagery = y / (pp->deskHeight + 1); - return pagery * desktopWidth + pagerx; + return pagery * settings.desktopWidth + pagerx; } /** Process a button event on a pager tray component. */ -void ProcessPagerButtonEvent(TrayComponentType *cp, int x, int y, int mask) { +void ProcessPagerButtonEvent(TrayComponentType *cp, int x, int y, int mask) +{ PagerType *pp; @@ -236,7 +242,8 @@ } /** Process a motion event on a pager tray component. */ -void ProcessPagerMotionEvent(TrayComponentType *cp, int x, int y, int mask) { +void ProcessPagerMotionEvent(TrayComponentType *cp, int x, int y, int mask) +{ PagerType *pp = (PagerType*)cp->object; @@ -246,7 +253,8 @@ } /** Start a pager move operation. */ -void StartPagerMove(TrayComponentType *cp, int x, int y) { +void StartPagerMove(TrayComponentType *cp, int x, int y) +{ XEvent event; PagerType *pp; @@ -260,23 +268,26 @@ int oldx, oldy; int oldDesk; int startx, starty; - int hmax, vmax; + MaxFlags maxFlags; pp = (PagerType*)cp->object; /* Determine the selected desktop. */ desktop = GetPagerDesktop(pp, x, y); - x -= (desktop % desktopWidth) * (pp->deskWidth + 1); - y -= (desktop / desktopWidth) * (pp->deskHeight + 1); + x -= (desktop % settings.desktopWidth) * (pp->deskWidth + 1); + y -= (desktop / settings.desktopWidth) * (pp->deskHeight + 1); /* Find the client under the specified coordinates. */ - for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { + for(layer = LAST_LAYER; layer >= FIRST_LAYER; layer--) { for(np = nodes[layer]; np; np = np->next) { /* Skip this client if it isn't mapped. */ if(!(np->state.status & STAT_MAPPED)) { continue; } + if(np->state.status & STAT_NOPAGER) { + continue; + } /* Skip this client if it isn't on the selected desktop. */ if(np->state.status & STAT_STICKY) { @@ -345,19 +356,12 @@ } /* If the client is maximized, unmaximize it. */ - hmax = 0; - if(np->state.status & STAT_HMAX) { - hmax = 1; - } - vmax = 0; - if(np->state.status & STAT_VMAX) { - vmax = 1; - } - if(hmax || vmax) { - MaximizeClient(np, 0, 0); + maxFlags = np->state.maxFlags; + if(np->state.maxFlags) { + MaximizeClient(np, MAX_NONE); } - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); /* Start the move. */ GrabMouseForMove(); @@ -373,7 +377,7 @@ starty = y; if(!(GetMouseMask() & Button3Mask)) { - StopPagerMove(np, oldx, oldy, oldDesk, hmax, vmax); + StopPagerMove(np, oldx, oldy, oldDesk, maxFlags); } for(;;) { @@ -390,14 +394,15 @@ /* Done when the 3rd mouse button is released. */ if(event.xbutton.button == Button3) { - StopPagerMove(np, oldx, oldy, oldDesk, hmax, vmax); + StopPagerMove(np, oldx, oldy, oldDesk, maxFlags); return; } break; case MotionNotify: - SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); + SetMousePosition(event.xmotion.x_root, event.xmotion.y_root, + event.xmotion.window); /* Get the mouse position on the pager. */ x = event.xmotion.x_root - cp->screenx; @@ -413,8 +418,8 @@ /* Determine the new client desktop. */ desktop = GetPagerDesktop(pp, x, y); - x -= pp->deskWidth * (desktop % desktopWidth); - y -= pp->deskHeight * (desktop / desktopWidth); + x -= pp->deskWidth * (desktop % settings.desktopWidth); + y -= pp->deskHeight * (desktop / settings.desktopWidth); /* If this client isn't sticky and now on a different desktop * change the client's desktop. */ @@ -438,7 +443,7 @@ np->y = oldy; JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); - UpdatePager(); + RequirePagerUpdate(); break; @@ -452,7 +457,8 @@ /** Stop an active pager move. */ void StopPagerMove(ClientNode *np, - int x, int y, int desktop, int hmax, int vmax) { + int x, int y, int desktop, MaxFlags maxFlags) +{ int north, south, east, west; @@ -465,22 +471,23 @@ np->x = x; np->y = y; - GetBorderSize(np, &north, &south, &east, & west); + GetBorderSize(&np->state, &north, &south, &east, & west); JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); /* Restore the maximized state of the client. */ - if(hmax || vmax) { - MaximizeClient(np, hmax, vmax); + if(maxFlags != MAX_NONE) { + MaximizeClient(np, maxFlags); } /* Redraw the pager. */ - UpdatePager(); + RequirePagerUpdate(); } /** Client-terminated pager move. */ -void PagerMoveController(int wasDestroyed) { +void PagerMoveController(int wasDestroyed) +{ JXUngrabPointer(display, CurrentTime); JXUngrabKeyboard(display, CurrentTime); @@ -488,10 +495,9 @@ } -/** Update the pager. */ -void UpdatePager() { - - PagerType *pp; +/** Draw a pager. */ +void DrawPager(const PagerType *pp) +{ ClientNode *np; Pixmap buffer; int width, height; @@ -502,68 +508,79 @@ int textWidth, textHeight; int dx, dy; - if(JUNLIKELY(shouldExit)) { - return; - } - - for(pp = pagers; pp; pp = pp->next) { - - buffer = pp->cp->pixmap; - width = pp->cp->width; - height = pp->cp->height; - deskWidth = pp->deskWidth; - deskHeight = pp->deskHeight; - - /* Draw the background. */ - JXSetForeground(display, rootGC, colors[COLOR_PAGER_BG]); - JXFillRectangle(display, buffer, rootGC, 0, 0, width, height); - - /* Highlight the current desktop. */ - JXSetForeground(display, rootGC, colors[COLOR_PAGER_ACTIVE_BG]); - dx = currentDesktop % desktopWidth; - dy = currentDesktop / desktopWidth; - JXFillRectangle(display, buffer, rootGC, - dx * (deskWidth + 1), dy * (deskHeight + 1), - deskWidth, deskHeight); - - /* Draw the labels. */ - if(pp->labeled) { - textHeight = GetStringHeight(FONT_PAGER); - if(textHeight < deskHeight) { - for(x = 0; x < desktopCount; x++) { - dx = x % desktopWidth; - dy = x / desktopWidth; - name = GetDesktopName(x); - textWidth = GetStringWidth(FONT_PAGER, name); - if(textWidth < deskWidth) { - xc = dx * (deskWidth + 1) + (deskWidth - textWidth) / 2; - yc = dy * (deskHeight + 1) + (deskHeight - textHeight) / 2; - RenderString(buffer, FONT_PAGER, COLOR_PAGER_TEXT, xc, yc, - deskWidth, None, name); - } + buffer = pp->cp->pixmap; + width = pp->cp->width; + height = pp->cp->height; + deskWidth = pp->deskWidth; + deskHeight = pp->deskHeight; + + /* Draw the background. */ + JXSetForeground(display, rootGC, colors[COLOR_PAGER_BG]); + JXFillRectangle(display, buffer, rootGC, 0, 0, width, height); + + /* Highlight the current desktop. */ + JXSetForeground(display, rootGC, colors[COLOR_PAGER_ACTIVE_BG]); + dx = currentDesktop % settings.desktopWidth; + dy = currentDesktop / settings.desktopWidth; + JXFillRectangle(display, buffer, rootGC, + dx * (deskWidth + 1), dy * (deskHeight + 1), + deskWidth, deskHeight); + + /* Draw the labels. */ + if(pp->labeled) { + textHeight = GetStringHeight(FONT_PAGER); + if(textHeight < deskHeight) { + for(x = 0; x < settings.desktopCount; x++) { + dx = x % settings.desktopWidth; + dy = x / settings.desktopWidth; + name = GetDesktopName(x); + textWidth = GetStringWidth(FONT_PAGER, name); + if(textWidth < deskWidth) { + xc = dx * (deskWidth + 1) + (deskWidth - textWidth) / 2; + yc = dy * (deskHeight + 1) + (deskHeight - textHeight) / 2; + RenderString(&rootVisual, buffer, FONT_PAGER, + COLOR_PAGER_TEXT, xc, yc, deskWidth, name); } } } + } - /* Draw the clients. */ - for(x = LAYER_BOTTOM; x <= LAYER_TOP; x++) { - for(np = nodeTail[x]; np; np = np->prev) { - DrawPagerClient(pp, np); - } + /* Draw the clients. */ + for(x = FIRST_LAYER; x <= LAST_LAYER; x++) { + for(np = nodeTail[x]; np; np = np->prev) { + DrawPagerClient(pp, np); } + } - /* Draw the desktop dividers. */ - JXSetForeground(display, rootGC, colors[COLOR_PAGER_FG]); - for(x = 1; x < desktopHeight; x++) { - JXDrawLine(display, buffer, rootGC, - 0, (deskHeight + 1) * x - 1, - width, (deskHeight + 1) * x - 1); - } - for(x = 1; x < desktopWidth; x++) { - JXDrawLine(display, buffer, rootGC, - (deskWidth + 1) * x - 1, 0, - (deskWidth + 1) * x - 1, height); - } + /* Draw the desktop dividers. */ + JXSetForeground(display, rootGC, colors[COLOR_PAGER_FG]); + for(x = 1; x < settings.desktopHeight; x++) { + JXDrawLine(display, buffer, rootGC, + 0, (deskHeight + 1) * x - 1, + width, (deskHeight + 1) * x - 1); + } + for(x = 1; x < settings.desktopWidth; x++) { + JXDrawLine(display, buffer, rootGC, + (deskWidth + 1) * x - 1, 0, + (deskWidth + 1) * x - 1, height); + } + +} + +/** Update the pager. */ +void UpdatePager(void) +{ + + PagerType *pp; + + if(JUNLIKELY(shouldExit)) { + return; + } + + for(pp = pagers; pp; pp = pp->next) { + + /* Draw the pager. */ + DrawPager(pp); /* Tell the tray to redraw. */ UpdateSpecificTray(pp->cp->tray, pp->cp); @@ -573,50 +590,49 @@ } /** Signal pagers (for popups). */ -void SignalPager(const struct TimeType *now, int x, int y) { - - PagerType *pp; - - for(pp = pagers; pp; pp = pp->next) { - if(abs(pp->mousex - x) < POPUP_DELTA - && abs(pp->mousey - y) < POPUP_DELTA) { - if(GetTimeDifference(now, &pp->mouseTime) >= popupDelay) { - int desktop; - desktop = GetPagerDesktop(pp, x - pp->cp->screenx, - y - pp->cp->screeny); - if(desktop >= 0) { - const char *desktopName; - desktopName = GetDesktopName(desktop); - if(desktopName) { - ShowPopup(x, y, desktopName); - } +void SignalPager(const TimeType *now, int x, int y, Window w, void *data) +{ + PagerType *pp = (PagerType*)data; + if(pp->cp->tray->window == w && + abs(pp->mousex - x) < settings.doubleClickDelta && + abs(pp->mousey - y) < settings.doubleClickDelta) { + if(GetTimeDifference(now, &pp->mouseTime) >= settings.popupDelay) { + const int desktop = GetPagerDesktop(pp, x - pp->cp->screenx, + y - pp->cp->screeny); + if(desktop >= 0 && desktop < settings.desktopCount) { + const char *desktopName = GetDesktopName(desktop); + if(desktopName) { + ShowPopup(x, y, desktopName); } - } + } } } /** Draw a client on the pager. */ -void DrawPagerClient(const PagerType *pp, const ClientNode *np) { +void DrawPagerClient(const PagerType *pp, const ClientNode *np) +{ int x, y; int width, height; int offx, offy; - ColorType fillColor; /* Don't draw the client if it isn't mapped. */ if(!(np->state.status & STAT_MAPPED)) { return; } + if(np->state.status & STAT_NOPAGER) { + return; + } /* Determine the desktop for the client. */ if(np->state.status & STAT_STICKY) { - offx = currentDesktop % desktopWidth; - offy = currentDesktop / desktopWidth; + offx = currentDesktop % settings.desktopWidth; + offy = currentDesktop / settings.desktopWidth; } else { - offx = np->state.desktop % desktopWidth; - offy = np->state.desktop / desktopWidth; + offx = np->state.desktop % settings.desktopWidth; + offy = np->state.desktop / settings.desktopWidth; } offx *= pp->deskWidth + 1; offy *= pp->deskHeight + 1; @@ -658,16 +674,19 @@ /* Fill the client if there's room. */ if(width > 1 && height > 1) { + ColorType fillColor; if((np->state.status & STAT_ACTIVE) && (np->state.desktop == currentDesktop || (np->state.status & STAT_STICKY))) { fillColor = COLOR_PAGER_ACTIVE_FG; + } else if(np->state.status & STAT_FLASH) { + fillColor = COLOR_PAGER_ACTIVE_FG; } else { fillColor = COLOR_PAGER_FG; } JXSetForeground(display, rootGC, colors[fillColor]); JXFillRectangle(display, pp->cp->pixmap, rootGC, x + 1, y + 1, - width - 1, height - 1); + width - 1, height - 1); } } diff -Nru jwm-2.1.0+svn579/src/pager.h jwm-2.3.1+0~16~ubuntu14.10.1/src/pager.h --- jwm-2.1.0+svn579/src/pager.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/pager.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,26 +11,22 @@ #define PAGER_H struct TrayComponentType; -struct TimeType; /*@{*/ -void InitializePager(); -void StartupPager(); -void ShutdownPager(); -void DestroyPager(); +#define InitializePager() (void)(0) +#define StartupPager() (void)(0) +void ShutdownPager(void); +void DestroyPager(void); /*@}*/ /** Create a pager tray component. * @param labeled Set to label the pager. * @return A new pager tray component. */ -struct TrayComponentType *CreatePager(int labeled); +struct TrayComponentType *CreatePager(char labeled); /** Update pagers. */ -void UpdatePager(); - -/** Signal pagers. */ -void SignalPager(const struct TimeType *now, int x, int y); +void UpdatePager(void); #endif /* PAGER_H */ diff -Nru jwm-2.1.0+svn579/src/parse.c jwm-2.3.1+0~16~ubuntu14.10.1/src/parse.c --- jwm-2.1.0+svn579/src/parse.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/parse.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,97 +10,106 @@ #include "jwm.h" #include "parse.h" #include "lex.h" +#include "settings.h" #include "menu.h" #include "root.h" -#include "client.h" #include "tray.h" #include "group.h" -#include "desktop.h" -#include "move.h" -#include "resize.h" #include "misc.h" #include "swallow.h" #include "pager.h" #include "error.h" #include "key.h" -#include "cursor.h" #include "main.h" #include "font.h" -#include "color.h" #include "icon.h" #include "command.h" -#include "button.h" -#include "event.h" #include "taskbar.h" #include "traybutton.h" #include "clock.h" #include "dock.h" -#include "popup.h" -#include "status.h" #include "background.h" #include "spacer.h" +#include "desktop.h" +#include "border.h" -/** Structure to map key names to key types. */ -typedef struct KeyMapType { - const char *name; - KeyType key; -} KeyMapType; - -/** Mapping of key names to key types. */ -static const KeyMapType KEY_MAP[] = { - { "up", KEY_UP }, - { "down", KEY_DOWN }, - { "right", KEY_RIGHT }, - { "left", KEY_LEFT }, - { "escape", KEY_ESC }, - { "select", KEY_ENTER }, - { "next", KEY_NEXT }, - { "nextstacked", KEY_NEXTSTACK }, - { "prev", KEY_PREV }, - { "prevstacked", KEY_PREVSTACK }, - { "close", KEY_CLOSE }, - { "minimize", KEY_MIN }, - { "maximize", KEY_MAX }, - { "shade", KEY_SHADE }, - { "stick", KEY_STICK }, - { "move", KEY_MOVE }, - { "resize", KEY_RESIZE }, - { "window", KEY_WIN }, - { "restart", KEY_RESTART }, - { "exit", KEY_EXIT }, - { "desktop#", KEY_DESKTOP }, - { "rdesktop", KEY_RDESKTOP }, - { "ldesktop", KEY_LDESKTOP }, - { "udesktop", KEY_UDESKTOP }, - { "ddesktop", KEY_DDESKTOP }, - { "showdesktop", KEY_SHOWDESK }, - { "showtray", KEY_SHOWTRAY }, - { "fullscreen", KEY_FULLSCREEN }, - { NULL, KEY_NONE } +/** Mapping of key names to key types. + * Note that this mapping must be sorted. + */ +static const StringMappingType KEY_MAP[] = { + { "close", KEY_CLOSE }, + { "ddesktop", KEY_DDESKTOP }, + { "desktop#", KEY_DESKTOP }, + { "down", KEY_DOWN }, + { "escape", KEY_ESC }, + { "exit", KEY_EXIT }, + { "fullscreen", KEY_FULLSCREEN }, + { "ldesktop", KEY_LDESKTOP }, + { "left", KEY_LEFT }, + { "maxbottom", KEY_MAXBOTTOM }, + { "maxh", KEY_MAXH }, + { "maximize", KEY_MAX }, + { "maxleft", KEY_MAXLEFT }, + { "maxright", KEY_MAXRIGHT }, + { "maxtop", KEY_MAXTOP }, + { "maxv", KEY_MAXV }, + { "minimize", KEY_MIN }, + { "move", KEY_MOVE }, + { "next", KEY_NEXT }, + { "nextstacked", KEY_NEXTSTACK }, + { "prev", KEY_PREV }, + { "prevstacked", KEY_PREVSTACK }, + { "rdesktop", KEY_RDESKTOP }, + { "resize", KEY_RESIZE }, + { "restart", KEY_RESTART }, + { "right", KEY_RIGHT }, + { "select", KEY_ENTER }, + { "sendd", KEY_SENDD }, + { "sendl", KEY_SENDL }, + { "sendr", KEY_SENDR }, + { "sendu", KEY_SENDU }, + { "shade", KEY_SHADE }, + { "showdesktop", KEY_SHOWDESK }, + { "showtray", KEY_SHOWTRAY }, + { "stick", KEY_STICK }, + { "udesktop", KEY_UDESKTOP }, + { "up", KEY_UP }, + { "window", KEY_WIN } }; +static const unsigned int KEY_MAP_COUNT = ARRAY_LENGTH(KEY_MAP); -/** Structure to map names to group options. */ -typedef struct OptionMapType { - const char *name; - OptionType option; -} OptionMapType; - -/** Mapping of names to group options. */ -static const OptionMapType OPTION_MAP[] = { - { "sticky", OPTION_STICKY }, - { "nolist", OPTION_NOLIST }, - { "border", OPTION_BORDER }, - { "noborder", OPTION_NOBORDER }, - { "title", OPTION_TITLE }, - { "notitle", OPTION_NOTITLE }, - { "pignore", OPTION_PIGNORE }, - { "maximized", OPTION_MAXIMIZED }, - { "minimized", OPTION_MINIMIZED }, - { "hmax", OPTION_MAX_H }, - { "vmax", OPTION_MAX_V }, - { "nofocus", OPTION_NOFOCUS }, - { NULL, OPTION_INVALID } +/** Mapping of names to group options. + * Note that this mapping must be sorted. + */ +static const StringMappingType OPTION_MAP[] = { + { "border", OPTION_BORDER }, + { "centered", OPTION_CENTERED }, + { "constrain", OPTION_CONSTRAIN }, + { "fullscreen", OPTION_FULLSCREEN }, + { "hmax", OPTION_MAX_H }, + { "iignore", OPTION_IIGNORE }, + { "maximized", OPTION_MAXIMIZED }, + { "minimized", OPTION_MINIMIZED }, + { "noborder", OPTION_NOBORDER }, + { "noclose", OPTION_NOCLOSE }, + { "nofocus", OPTION_NOFOCUS }, + { "nofullscreen", OPTION_NOFULLSCREEN }, + { "nolist", OPTION_NOLIST }, + { "nomax", OPTION_NOMAX }, + { "nomin", OPTION_NOMIN }, + { "nomove", OPTION_NOMOVE }, + { "nopager", OPTION_NOPAGER }, + { "noresize", OPTION_NORESIZE }, + { "noshade", OPTION_NOSHADE }, + { "notitle", OPTION_NOTITLE }, + { "noturgent", OPTION_NOTURGENT }, + { "pignore", OPTION_PIGNORE }, + { "sticky", OPTION_STICKY }, + { "tiled", OPTION_TILED }, + { "title", OPTION_TITLE }, + { "vmax", OPTION_MAX_V } }; +static const unsigned int OPTION_MAP_COUNT = ARRAY_LENGTH(OPTION_MAP); static const char *DEFAULT_TITLE = "JWM"; static const char *LABEL_ATTRIBUTE = "label"; @@ -108,32 +117,15 @@ static const char *CONFIRM_ATTRIBUTE = "confirm"; static const char *LABELED_ATTRIBUTE = "labeled"; static const char *ONROOT_ATTRIBUTE = "onroot"; -static const char *LAYER_ATTRIBUTE = "layer"; -static const char *LAYOUT_ATTRIBUTE = "layout"; -static const char *AUTOHIDE_ATTRIBUTE = "autohide"; static const char *X_ATTRIBUTE = "x"; static const char *Y_ATTRIBUTE = "y"; static const char *WIDTH_ATTRIBUTE = "width"; static const char *HEIGHT_ATTRIBUTE = "height"; -static const char *NAME_ATTRIBUTE = "name"; -static const char *BORDER_ATTRIBUTE = "border"; -static const char *DISTANCE_ATTRIBUTE = "distance"; -static const char *INSERT_ATTRIBUTE = "insert"; -static const char *MAX_WIDTH_ATTRIBUTE = "maxwidth"; -static const char *FORMAT_ATTRIBUTE = "format"; -static const char *ZONE_ATTRIBUTE = "zone"; -static const char *VALIGN_ATTRIBUTE = "valign"; -static const char *HALIGN_ATTRIBUTE = "halign"; -static const char *POPUP_ATTRIBUTE = "popup"; -static const char *DELAY_ATTRIBUTE = "delay"; -static const char *ENABLED_ATTRIBUTE = "enabled"; -static const char *COORDINATES_ATTRIBUTE = "coordinates"; -static const char *TYPE_ATTRIBUTE = "type"; static const char *FALSE_VALUE = "false"; static const char *TRUE_VALUE = "true"; -static int ParseFile(const char *fileName, int depth); +static char ParseFile(const char *fileName, int depth); static char *ReadFile(FILE *fd); /* Misc. */ @@ -144,39 +136,51 @@ static void ParseDesktopBackground(int desktop, const TokenNode *tp); /* Menus. */ +static Menu *ParseMenu(const TokenNode *start); static void ParseRootMenu(const TokenNode *start); static MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu, - MenuItem *last); -static MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, - MenuItem *last); + MenuItem *last); static MenuItem *InsertMenuItem(MenuItem *last); +static MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, + MenuItem *last); +static TokenNode *ParseMenuIncludeHelper(const TokenNode *tp, + const char *command); /* Tray. */ +typedef void (*AddTrayActionFunc)(TrayComponentType*, const char*, int); static void ParseTray(const TokenNode *tp); static void ParsePager(const TokenNode *tp, TrayType *tray); static void ParseTaskList(const TokenNode *tp, TrayType *tray); static void ParseSwallow(const TokenNode *tp, TrayType *tray); static void ParseTrayButton(const TokenNode *tp, TrayType *tray); static void ParseClock(const TokenNode *tp, TrayType *tray); +static void ParseTrayComponentActions(const TokenNode *tp, + TrayComponentType *cp, + AddTrayActionFunc func); static void ParseDock(const TokenNode *tp, TrayType *tray); static void ParseSpacer(const TokenNode *tp, TrayType *tray); /* Groups. */ static void ParseGroup(const TokenNode *tp); static void ParseGroupOption(const TokenNode *tp, - struct GroupType *group, const char *option); + struct GroupType *group, + const char *option); /* Style. */ -static void ParseWindowStyle(const TokenNode *start); +static void ParseWindowStyle(const TokenNode *tp); static void ParseActiveWindowStyle(const TokenNode *tp); -static void ParseInactiveWindowStyle(const TokenNode *tp); -static void ParseTaskListStyle(const TokenNode *start); -static void ParseTrayStyle(const TokenNode *start); -static void ParsePagerStyle(const TokenNode *start); -static void ParseMenuStyle(const TokenNode *start); -static void ParsePopupStyle(const TokenNode *start); -static void ParseClockStyle(const TokenNode *start); -static void ParseTrayButtonStyle(const TokenNode *start); +static void ParseTaskListStyle(const TokenNode *tp); +static void ParseActiveTaskListStyle(const TokenNode *tp); +static void ParseTrayStyle(const TokenNode *tp); +static void ParseActiveTrayStyle(const TokenNode *tp); +static void ParsePagerStyle(const TokenNode *tp); +static void ParseActivePagerStyle(const TokenNode *tp); +static void ParseMenuStyle(const TokenNode *tp); +static void ParseActiveMenuStyle(const TokenNode *tp); +static void ParsePopupStyle(const TokenNode *tp); +static void ParseClockStyle(const TokenNode *tp); +static void ParseTrayButtonStyle(const TokenNode *tp); +static void ParseActiveTrayButtonStyle(const TokenNode *tp); /* Feel. */ static void ParseKey(const TokenNode *tp); @@ -187,12 +191,21 @@ static void ParseGradient(const char *value, ColorType a, ColorType b); static char *FindAttribute(AttributeNode *ap, const char *name); -static void ReleaseTokens(TokenNode *np); +static int ParseTokenValue(const StringMappingType *mapping, int count, + const TokenNode *tp, int def); +static int ParseAttribute(const StringMappingType *mapping, int count, + const TokenNode *tp, const char *attr, + int def); +static unsigned int ParseUnsigned(const TokenNode *tp, const char *str); +static unsigned int ParseOpacity(const TokenNode *tp, const char *str); +static WinLayerType ParseLayer(const TokenNode *tp, const char *str); +static StatusWindowType ParseStatusWindowType(const TokenNode *tp); static void InvalidTag(const TokenNode *tp, TokenType parent); static void ParseError(const TokenNode *tp, const char *str, ...); /** Parse the JWM configuration. */ -void ParseConfig(const char *fileName) { +void ParseConfig(const char *fileName) +{ if(!ParseFile(fileName, 0)) { if(JUNLIKELY(!ParseFile(SYSTEM_CONFIG, 0))) { ParseError(NULL, "could not open %s or %s", fileName, SYSTEM_CONFIG); @@ -206,13 +219,14 @@ * Parse a specific file. * @return 1 on success and 0 on failure. */ -int ParseFile(const char *fileName, int depth) { +char ParseFile(const char *fileName, int depth) +{ TokenNode *tokens; FILE *fd; char *buffer; - ++depth; + depth += 1; if(JUNLIKELY(depth > MAX_INCLUDE_DEPTH)) { ParseError(NULL, "include depth (%d) exceeded", MAX_INCLUDE_DEPTH); return 0; @@ -235,51 +249,9 @@ } -/** Release a token list. */ -void ReleaseTokens(TokenNode *np) { - - AttributeNode *ap; - TokenNode *tp; - - while(np) { - tp = np->next; - - while(np->attributes) { - ap = np->attributes->next; - if(np->attributes->name) { - Release(np->attributes->name); - } - if(np->attributes->value) { - Release(np->attributes->value); - } - Release(np->attributes); - np->attributes = ap; - } - - if(np->subnodeHead) { - ReleaseTokens(np->subnodeHead); - } - - if(np->value) { - Release(np->value); - } - - if(np->invalidName) { - Release(np->invalidName); - } - - if(np->fileName) { - Release(np->fileName); - } - - Release(np); - np = tp; - } - -} - /** Parse a token list. */ -void Parse(const TokenNode *start, int depth) { +void Parse(const TokenNode *start, int depth) +{ TokenNode *tp; @@ -306,10 +278,10 @@ ParseDesktops(tp); break; case TOK_DOUBLECLICKSPEED: - SetDoubleClickSpeed(tp->value); + settings.doubleClickSpeed = ParseUnsigned(tp, tp->value); break; case TOK_DOUBLECLICKDELTA: - SetDoubleClickDelta(tp->value); + settings.doubleClickDelta = ParseUnsigned(tp, tp->value); break; case TOK_FOCUSMODEL: ParseFocusModel(tp); @@ -375,16 +347,16 @@ ParseWindowStyle(tp); break; case TOK_BUTTONCLOSE: - SetButtonMask(BP_CLOSE, tp->value); - break; - case TOK_BUTTONMIN: - SetButtonMask(BP_MINIMIZE, tp->value); + SetBorderIcon(BI_CLOSE, tp->value); break; case TOK_BUTTONMAX: - SetButtonMask(BP_MAXIMIZE, tp->value); + SetBorderIcon(BI_MAX, tp->value); break; case TOK_BUTTONMAXACTIVE: - SetButtonMask(BP_MAXIMIZE_ACTIVE, tp->value); + SetBorderIcon(BI_MAX_ACTIVE, tp->value); + break; + case TOK_BUTTONMIN: + SetBorderIcon(BI_MIN, tp->value); break; default: InvalidTag(tp, TOK_JWM); @@ -400,93 +372,66 @@ /** Parse focus model. */ void ParseFocusModel(const TokenNode *tp) { - if(JLIKELY(tp->value)) { - if(!strcmp(tp->value, "sloppy")) { - focusModel = FOCUS_SLOPPY; - } else if(!strcmp(tp->value, "click")) { - focusModel = FOCUS_CLICK; - } else { - ParseError(tp, "invalid focus model: \"%s\"", tp->value); - } - } else { - ParseError(tp, "focus model not specified"); - } + static const StringMappingType mapping[] = { + { "click", FOCUS_CLICK }, + { "sloppy", FOCUS_SLOPPY } + }; + settings.focusModel = ParseTokenValue(mapping, ARRAY_LENGTH(mapping), tp, + settings.focusModel); } /** Parse snap mode for moving windows. */ -void ParseSnapMode(const TokenNode *tp) { - +void ParseSnapMode(const TokenNode *tp) +{ const char *distance; + static const StringMappingType mapping[] = { + { "border", SNAP_BORDER }, + { "none", SNAP_NONE }, + { "screen", SNAP_SCREEN } + }; - distance = FindAttribute(tp->attributes, DISTANCE_ATTRIBUTE); + distance = FindAttribute(tp->attributes, "distance"); if(distance) { - SetSnapDistance(distance); - } else { - SetDefaultSnapDistance(); - } - - if(JLIKELY(tp->value)) { - if(!strcmp(tp->value, "none")) { - SetSnapMode(SNAP_NONE); - } else if(!strcmp(tp->value, "screen")) { - SetSnapMode(SNAP_SCREEN); - } else if(!strcmp(tp->value, "border")) { - SetSnapMode(SNAP_BORDER); - } else { - ParseError(tp, "invalid snap mode: %s", tp->value); - } - } else { - ParseError(tp, "snap mode not specified"); + settings.snapDistance = ParseUnsigned(tp, distance); } + settings.snapMode = ParseTokenValue(mapping, ARRAY_LENGTH(mapping), tp, + settings.snapMode); } /** Parse move mode. */ -void ParseMoveMode(const TokenNode *tp) { - +void ParseMoveMode(const TokenNode *tp) +{ const char *str; + static const StringMappingType mapping[] = { + { "opaque", MOVE_OPAQUE }, + { "outline", MOVE_OUTLINE } + }; - str = FindAttribute(tp->attributes, COORDINATES_ATTRIBUTE); - SetMoveStatusType(str); - - if(JLIKELY(tp->value)) { - if(!strcmp(tp->value, "outline")) { - SetMoveMode(MOVE_OUTLINE); - } else if(!strcmp(tp->value, "opaque")) { - SetMoveMode(MOVE_OPAQUE); - } else { - ParseError(tp, "invalid move mode: %s", tp->value); - } - } else { - ParseError(tp, "move mode not specified"); + str = FindAttribute(tp->attributes, "delay"); + if(str) { + settings.desktopDelay = ParseUnsigned(tp, str); } + settings.moveStatusType = ParseStatusWindowType(tp); + settings.moveMode = ParseTokenValue(mapping, ARRAY_LENGTH(mapping), tp, + settings.moveMode); } /** Parse resize mode. */ -void ParseResizeMode(const TokenNode *tp) { - - const char *str; - - str = FindAttribute(tp->attributes, COORDINATES_ATTRIBUTE); - SetResizeStatusType(str); - - if(JLIKELY(tp->value)) { - if(!strcmp(tp->value, "outline")) { - SetResizeMode(RESIZE_OUTLINE); - } else if(!strcmp(tp->value, "opaque")) { - SetResizeMode(RESIZE_OPAQUE); - } else { - ParseError(tp, "invalid resize mode: %s", tp->value); - } - } else { - ParseError(tp, "resize mode not specified"); - } - +void ParseResizeMode(const TokenNode *tp) +{ + static const StringMappingType mapping[] = { + { "opaque", RESIZE_OPAQUE }, + { "outline", RESIZE_OUTLINE } + }; + settings.resizeStatusType = ParseStatusWindowType(tp); + settings.resizeMode = ParseTokenValue(mapping, ARRAY_LENGTH(mapping), tp, + settings.resizeMode); } -/** Parse a root menu. */ -void ParseRootMenu(const TokenNode *start) { - +/** Parse a menu. */ +Menu *ParseMenu(const TokenNode *start) +{ const char *value; Menu *menu; @@ -494,7 +439,7 @@ value = FindAttribute(start->attributes, HEIGHT_ATTRIBUTE); if(value) { - menu->itemHeight = atoi(value); + menu->itemHeight = ParseUnsigned(start, value); } else { menu->itemHeight = 0; } @@ -513,40 +458,40 @@ menu->items = NULL; ParseMenuItem(start->subnodeHead, menu, NULL); - value = FindAttribute(start->attributes, ONROOT_ATTRIBUTE); - if(!value) { - value = "123"; - } - - SetRootMenu(value, menu); + return menu; } -/** Insert a new menu item into a menu. */ -MenuItem *InsertMenuItem(MenuItem *last) { +/** Parse a root menu. */ +void ParseRootMenu(const TokenNode *start) +{ + Menu *menu; + char *onroot; + + menu = ParseMenu(start); - MenuItem *item; + onroot = FindAttribute(start->attributes, ONROOT_ATTRIBUTE); + if(!onroot) { + onroot = "123"; + } + + SetRootMenu(onroot, menu); - item = Allocate(sizeof(MenuItem)); - item->name = NULL; - item->type = MENU_ITEM_NORMAL; - item->iconName = NULL; - item->action.type = MA_NONE; - item->action.data.str = NULL; - item->submenu = NULL; +} - item->next = NULL; +/** Insert a new menu item into a menu. */ +MenuItem *InsertMenuItem(MenuItem *last) +{ + MenuItem *item = CreateMenuItem(MENU_ITEM_NORMAL); if(last) { last->next = item; } - return item; - } /** Parse a menu item. */ -MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu, - MenuItem *last) { +MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu, MenuItem *last) +{ Menu *child; const char *value; @@ -556,11 +501,6 @@ menu->offsets = NULL; while(start) { switch(start->type) { - case TOK_INCLUDE: - - last = ParseMenuInclude(start, menu, last); - - break; case TOK_MENU: last = InsertMenuItem(last); @@ -580,7 +520,7 @@ value = FindAttribute(start->attributes, HEIGHT_ATTRIBUTE); if(value) { - child->itemHeight = atoi(value); + child->itemHeight = ParseUnsigned(start, value); } else { child->itemHeight = menu->itemHeight; } @@ -630,6 +570,9 @@ } break; + case TOK_INCLUDE: + last = ParseMenuInclude(start, menu, last); + break; case TOK_DESKTOPS: case TOK_STICK: case TOK_MAXIMIZE: @@ -639,6 +582,8 @@ case TOK_RESIZE: case TOK_KILL: case TOK_CLOSE: + case TOK_SENDTO: + case TOK_DYNAMIC: last = InsertMenuItem(last); if(!menu->items) { @@ -656,7 +601,7 @@ switch(start->type) { case TOK_DESKTOPS: - last->action.type = MA_DESKTOP; + last->action.type = MA_DESKTOP_MENU; break; case TOK_STICK: last->action.type = MA_STICK; @@ -682,6 +627,13 @@ case TOK_CLOSE: last->action.type = MA_CLOSE; break; + case TOK_SENDTO: + last->action.type = MA_SENDTO_MENU; + break; + case TOK_DYNAMIC: + last->action.type = MA_DYNAMIC; + last->action.data.str = CopyString(start->value); + break; default: break; } @@ -696,9 +648,9 @@ value = FindAttribute(start->attributes, CONFIRM_ATTRIBUTE); if(value && !strcmp(value, FALSE_VALUE)) { - SetShowExitConfirmation(0); + settings.exitConfirmation = 0; } else { - SetShowExitConfirmation(1); + settings.exitConfirmation = 1; } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); @@ -744,21 +696,19 @@ } -/** Parse a menu include. */ -MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, - MenuItem *last) { - +/** Get tokens from a menu include (either dynamic or static). */ +TokenNode *ParseMenuIncludeHelper(const TokenNode *tp, const char *command) +{ FILE *fd; char *path; - char *buffer = NULL; + char *buffer; TokenNode *start; - Assert(tp); + buffer = NULL; + if(!strncmp(command, "exec:", 5)) { - if(!strncmp(tp->value, "exec:", 5)) { - - path = Allocate(strlen(tp->value) - 5 + 1); - strcpy(path, tp->value + 5); + path = Allocate(strlen(command) - 5 + 1); + strcpy(path, command + 5); ExpandPath(&path); fd = popen(path, "r"); @@ -771,7 +721,7 @@ } else { - path = CopyString(tp->value); + path = CopyString(command); ExpandPath(&path); fd = fopen(path, "r"); @@ -779,32 +729,52 @@ buffer = ReadFile(fd); fclose(fd); } else { - ParseError(tp, "could not open include: %s", path); + ParseError(NULL, "could not open include: %s", path); } } - if(!buffer) { + if(JUNLIKELY(!buffer)) { Release(path); - return last; + return NULL; } start = Tokenize(buffer, path); Release(buffer); Release(path); - if(JUNLIKELY(!start || start->type != TOK_JWM)) { - ParseError(tp, "invalid included menu: %s", tp->value); - } else { - last = ParseMenuItem(start->subnodeHead, menu, last); + if(JUNLIKELY(!start || start->type != TOK_JWM)) + { + ParseError(tp, "invalid include: %s", command); + ReleaseTokens(start); + return NULL; } - if(start) { + return start; +} + +/** Parse a menu include. */ +MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, + MenuItem *last) +{ + TokenNode *start = ParseMenuIncludeHelper(tp, tp->value); + if(JLIKELY(start)) { + last = ParseMenuItem(start->subnodeHead, menu, last); ReleaseTokens(start); } - return last; +} +/** Parse a dynamic menu (called from menu code). */ +Menu *ParseDynamicMenu(const char *command) +{ + Menu *menu = NULL; + TokenNode *start = ParseMenuIncludeHelper(NULL, command); + if(JLIKELY(start)) { + menu = ParseMenu(start); + ReleaseTokens(start); + } + return menu; } /** Parse a key binding. */ @@ -816,7 +786,6 @@ const char *action; const char *command; KeyType k; - int x; Assert(tp); @@ -839,11 +808,10 @@ k = KEY_ROOT; command = action + 5; } else { - for(x = 0; KEY_MAP[x].name; x++) { - if(!strcmp(action, KEY_MAP[x].name)) { - k = KEY_MAP[x].key; - break; - } + /* Look up the option in the key map using binary search. */ + const int x = FindValue(KEY_MAP, KEY_MAP_COUNT, action); + if(x >= 0) { + k = (KeyType)x; } } @@ -861,11 +829,23 @@ } /** Parse window style. */ -void ParseWindowStyle(const TokenNode *tp) { - +void ParseWindowStyle(const TokenNode *tp) +{ const TokenNode *np; + const char *decorations; - Assert(tp); + decorations = FindAttribute(tp->attributes, "decorations"); + if(decorations) { + if(!strcmp(decorations, "motif")) { + settings.handles = 1; + } else if(!strcmp(decorations, "flat")) { + settings.handles = 0; + } else { + ParseError(tp, "invalid WindowStyle decorations: %s\n", decorations); + } + } else { + settings.handles = 0; + } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { @@ -873,27 +853,39 @@ SetFont(FONT_BORDER, np->value); break; case TOK_WIDTH: - SetBorderWidth(np->value); + settings.borderWidth = ParseUnsigned(np, np->value); break; case TOK_HEIGHT: - SetTitleHeight(np->value); + settings.titleHeight = ParseUnsigned(np, np->value); + break; + case TOK_CORNER: + settings.cornerRadius = ParseUnsigned(np, np->value); break; case TOK_ACTIVE: ParseActiveWindowStyle(np); break; - case TOK_INACTIVE: - ParseInactiveWindowStyle(np); + case TOK_FOREGROUND: + SetColor(COLOR_TITLE_FG, np->value); + break; + case TOK_BACKGROUND: + ParseGradient(np->value, COLOR_TITLE_BG1, COLOR_TITLE_BG2); + break; + case TOK_OUTLINE: + SetColor(COLOR_BORDER_LINE, np->value); + break; + case TOK_OPACITY: + settings.inactiveClientOpacity = ParseOpacity(tp, np->value); break; default: InvalidTag(np, TOK_WINDOWSTYLE); break; } } - } /** Parse active window style information. */ -void ParseActiveWindowStyle(const TokenNode *tp) { +void ParseActiveWindowStyle(const TokenNode *tp) +{ const TokenNode *np; @@ -901,10 +893,10 @@ for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { - case TOK_TEXT: + case TOK_FOREGROUND: SetColor(COLOR_TITLE_ACTIVE_FG, np->value); break; - case TOK_TITLE: + case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_BG2); break; @@ -912,38 +904,11 @@ SetColor(COLOR_BORDER_ACTIVE_LINE, np->value); break; case TOK_OPACITY: - SetActiveClientOpacity(np->value); + settings.activeClientOpacity = ParseOpacity(np, np->value); break; default: InvalidTag(np, TOK_ACTIVE); - } - } - -} - -/** Parse inactive window style information. */ -void ParseInactiveWindowStyle(const TokenNode *tp) { - - const TokenNode *np; - - Assert(tp); - - for(np = tp->subnodeHead; np; np = np->next) { - switch(np->type) { - case TOK_TEXT: - SetColor(COLOR_TITLE_FG, np->value); - break; - case TOK_TITLE: - ParseGradient(np->value, COLOR_TITLE_BG1, COLOR_TITLE_BG2); - break; - case TOK_OUTLINE: - SetColor(COLOR_BORDER_LINE, np->value); break; - case TOK_OPACITY: - SetInactiveClientOpacity(np->value); - break; - default: - InvalidTag(np, TOK_INACTIVE); } } @@ -982,18 +947,23 @@ TokenNode *np; const char *width; const char *height; - int x; int desktop; Assert(tp); width = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); + if(width != NULL) { + settings.desktopWidth = ParseUnsigned(tp, width); + } height = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); - SetDesktopCount(width, height); + if(height != NULL) { + settings.desktopHeight = ParseUnsigned(tp, height); + } + settings.desktopCount = settings.desktopWidth * settings.desktopHeight; desktop = 0; - for(x = 0, np = tp->subnodeHead; np; np = np->next, x++) { - if(desktop >= desktopCount) { + for(np = tp->subnodeHead; np; np = np->next) { + if(desktop >= settings.desktopCount) { break; } switch(np->type) { @@ -1002,7 +972,7 @@ break; case TOK_DESKTOP: ParseDesktop(desktop, np); - ++desktop; + desktop += 1; break; default: InvalidTag(np, TOK_DESKTOPS); @@ -1018,7 +988,7 @@ TokenNode *np; const char *attr; - attr = FindAttribute(tp->attributes, NAME_ATTRIBUTE); + attr = FindAttribute(tp->attributes, "name"); if(attr) { SetDesktopName(desktop, attr); } @@ -1037,69 +1007,95 @@ } /** Parse a background for a desktop. */ -void ParseDesktopBackground(int desktop, const TokenNode *tp) { - - const char *type; - - type = FindAttribute(tp->attributes, TYPE_ATTRIBUTE); +void ParseDesktopBackground(int desktop, const TokenNode *tp) +{ + const char *type = FindAttribute(tp->attributes, "type"); SetBackground(desktop, type, tp->value); - } /** Parse task list style. */ -void ParseTaskListStyle(const TokenNode *tp) { - - const char *temp; +void ParseTaskListStyle(const TokenNode *tp) +{ + static const StringMappingType mapping[] = { + { "left", INSERT_LEFT }, + { "right", INSERT_RIGHT } + }; TokenNode *np; - temp = FindAttribute(tp->attributes, INSERT_ATTRIBUTE); - if(temp) { - SetTaskBarInsertMode(temp); - } + settings.taskInsertMode = ParseAttribute(mapping, ARRAY_LENGTH(mapping), + tp, "insert", settings.taskInsertMode); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_TASK, np->value); break; + case TOK_ACTIVE: + ParseActiveTaskListStyle(np); + break; case TOK_FOREGROUND: SetColor(COLOR_TASK_FG, np->value); break; case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TASK_BG1, COLOR_TASK_BG2); break; - case TOK_ACTIVEFOREGROUND: + default: + InvalidTag(np, TOK_TASKLISTSTYLE); + break; + } + } + +} + +/** Parse active task list style. */ +void ParseActiveTaskListStyle(const TokenNode *tp) +{ + TokenNode *np; + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_FOREGROUND: SetColor(COLOR_TASK_ACTIVE_FG, np->value); break; - case TOK_ACTIVEBACKGROUND: + case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_BG2); break; default: - InvalidTag(np, TOK_TASKLISTSTYLE); + InvalidTag(np, TOK_ACTIVE); break; } } - } /** Parse tray style. */ -void ParseTrayStyle(const TokenNode *tp) { - +void ParseTrayStyle(const TokenNode *tp) +{ const TokenNode *np; + const char *temp; + + temp = FindAttribute(tp->attributes, "group"); + if(temp) { + settings.groupTasks = !strcmp(temp, TRUE_VALUE); + } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_TRAY, np->value); break; + case TOK_ACTIVE: + ParseActiveTrayStyle(np); + break; case TOK_BACKGROUND: - SetColor(COLOR_TRAY_BG, np->value); + ParseGradient(np->value, COLOR_TRAY_BG1, COLOR_TRAY_BG2); break; case TOK_FOREGROUND: SetColor(COLOR_TRAY_FG, np->value); break; case TOK_OPACITY: - SetTrayOpacity(np->value); + settings.trayOpacity = ParseOpacity(np, np->value); + break; + case TOK_OUTLINE: + SetColor(COLOR_TRAY_OUTLINE, np->value); break; default: InvalidTag(np, TOK_TRAYSTYLE); @@ -1109,23 +1105,48 @@ } -/** Parse tray. */ -void ParseTray(const TokenNode *tp) { +/** Parse active tray style. */ +void ParseActiveTrayStyle(const TokenNode *tp) +{ + const TokenNode *np; + + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_BACKGROUND: + ParseGradient(np->value, COLOR_TRAY_ACTIVE_BG1, COLOR_TRAY_ACTIVE_BG2); + break; + case TOK_FOREGROUND: + SetColor(COLOR_TRAY_ACTIVE_FG, np->value); + break; + default: + InvalidTag(np, TOK_ACTIVE); + break; + } + } +} +/** Parse tray. */ +void ParseTray(const TokenNode *tp) +{ + static const StringMappingType mapping[] = { + { "bottom", THIDE_BOTTOM }, + { "left", THIDE_LEFT }, + { "off", THIDE_OFF }, + { "right", THIDE_RIGHT }, + { "top", THIDE_TOP } + }; const TokenNode *np; const char *attr; TrayType *tray; + TrayAutoHideType autohide; Assert(tp); tray = CreateTray(); - attr = FindAttribute(tp->attributes, AUTOHIDE_ATTRIBUTE); - if(attr && !strcmp(attr, TRUE_VALUE)) { - SetAutoHideTray(tray, 1); - } else { - SetAutoHideTray(tray, 0); - } + autohide = ParseAttribute(mapping, ARRAY_LENGTH(mapping), tp, + "autohide", THIDE_OFF); + SetAutoHideTray(tray, autohide); attr = FindAttribute(tp->attributes, X_ATTRIBUTE); if(attr) { @@ -1147,23 +1168,18 @@ SetTrayHeight(tray, attr); } - attr = FindAttribute(tp->attributes, VALIGN_ATTRIBUTE); + attr = FindAttribute(tp->attributes, "valign"); SetTrayVerticalAlignment(tray, attr); - attr = FindAttribute(tp->attributes, HALIGN_ATTRIBUTE); + attr = FindAttribute(tp->attributes, "halign"); SetTrayHorizontalAlignment(tray, attr); - attr = FindAttribute(tp->attributes, LAYOUT_ATTRIBUTE); + attr = FindAttribute(tp->attributes, "layout"); SetTrayLayout(tray, attr); - attr = FindAttribute(tp->attributes, LAYER_ATTRIBUTE); - if(attr) { - SetTrayLayer(tray, attr); - } - - attr = FindAttribute(tp->attributes, BORDER_ATTRIBUTE); + attr = FindAttribute(tp->attributes, "layer"); if(attr) { - SetTrayBorder(tray, attr); + SetTrayLayer(tray, ParseLayer(tp, attr)); } for(np = tp->subnodeHead; np; np = np->next) { @@ -1198,7 +1214,8 @@ } /** Parse a pager tray component. */ -void ParsePager(const TokenNode *tp, TrayType *tray) { +void ParsePager(const TokenNode *tp, TrayType *tray) +{ TrayComponentType *cp; const char *temp; @@ -1218,8 +1235,8 @@ } /** Parse a task list tray component. */ -void ParseTaskList(const TokenNode *tp, TrayType *tray) { - +void ParseTaskList(const TokenNode *tp, TrayType *tray) +{ TrayComponentType *cp; const char *temp; @@ -1229,7 +1246,7 @@ cp = CreateTaskBar(); AddTrayComponent(tray, cp); - temp = FindAttribute(tp->attributes, MAX_WIDTH_ATTRIBUTE); + temp = FindAttribute(tp->attributes, "maxwidth"); if(temp) { SetMaxTaskBarItemWidth(cp, temp); } @@ -1237,7 +1254,8 @@ } /** Parse a swallow tray component. */ -void ParseSwallow(const TokenNode *tp, TrayType *tray) { +void ParseSwallow(const TokenNode *tp, TrayType *tray) +{ TrayComponentType *cp; const char *name; @@ -1247,21 +1265,21 @@ Assert(tp); Assert(tray); - name = FindAttribute(tp->attributes, NAME_ATTRIBUTE); + name = FindAttribute(tp->attributes, "name"); if(name == NULL) { name = tp->value; } temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { - width = atoi(temp); + width = ParseUnsigned(tp, temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { - height = atoi(temp); + height = ParseUnsigned(tp, temp); } else { height = 0; } @@ -1274,87 +1292,118 @@ } /** Parse a button tray component. */ -void ParseTrayButton(const TokenNode *tp, TrayType *tray) { +void ParseTrayButton(const TokenNode *tp, TrayType *tray) +{ TrayComponentType *cp; const char *icon; const char *label; const char *popup; const char *temp; - int width, height; + unsigned int width, height; Assert(tp); Assert(tray); icon = FindAttribute(tp->attributes, ICON_ATTRIBUTE); label = FindAttribute(tp->attributes, LABEL_ATTRIBUTE); - popup = FindAttribute(tp->attributes, POPUP_ATTRIBUTE); + popup = FindAttribute(tp->attributes, "popup"); temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { - width = atoi(temp); + width = ParseUnsigned(tp, temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { - height = atoi(temp); + height = ParseUnsigned(tp, temp); } else { height = 0; } - cp = CreateTrayButton(icon, label, tp->value, popup, width, height); - if(cp) { + cp = CreateTrayButton(icon, label, popup, width, height); + if(JLIKELY(cp)) { AddTrayComponent(tray, cp); + ParseTrayComponentActions(tp, cp, AddTrayButtonAction); } } /** Parse a clock tray component. */ -void ParseClock(const TokenNode *tp, TrayType *tray) { - +void ParseClock(const TokenNode *tp, TrayType *tray) +{ TrayComponentType *cp; const char *format; const char *zone; - const char *command; const char *temp; int width, height; Assert(tp); Assert(tray); - format = FindAttribute(tp->attributes, FORMAT_ATTRIBUTE); - - zone = FindAttribute(tp->attributes, ZONE_ATTRIBUTE); - - if(tp->value && strlen(tp->value) > 0) { - command = tp->value; - } else { - command = NULL; - } + format = FindAttribute(tp->attributes, "format"); + zone = FindAttribute(tp->attributes, "zone"); temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { - width = atoi(temp); + width = ParseUnsigned(tp, temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { - height = atoi(temp); + height = ParseUnsigned(tp, temp); } else { height = 0; } - cp = CreateClock(format, zone, command, width, height); + cp = CreateClock(format, zone, width, height); if(JLIKELY(cp)) { + ParseTrayComponentActions(tp, cp, AddClockAction); AddTrayComponent(tray, cp); } } +/** Parse tray component actions. */ +void ParseTrayComponentActions(const TokenNode *tp, TrayComponentType *cp, + AddTrayActionFunc func) +{ + const TokenNode *np; + const char *mask_str; + const int default_mask = (1 << 1) | (1 << 2) | (1 << 3); + int mask; + + if(tp->value) { + (func)(cp, tp->value, default_mask); + } + + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_BUTTON: + mask_str = FindAttribute(np->attributes, "mask"); + if(mask_str) { + int i; + mask = 0; + for(i = 0; mask_str[i]; i++) { + mask |= 1 << (mask_str[i] - '0'); + } + } else { + mask = default_mask; + } + (func)(cp, np->value, mask); + break; + default: + InvalidTag(np, tp->type); + break; + } + } +} + + /** Parse a dock tray component. */ void ParseDock(const TokenNode *tp, TrayType *tray) { @@ -1367,7 +1416,7 @@ str = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(str) { - width = atoi(str); + width = ParseUnsigned(tp, str); } else { width = 0; } @@ -1393,7 +1442,7 @@ /* Get the width. */ str = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(str) { - width = atoi(str); + width = ParseUnsigned(tp, str); } else { width = 0; } @@ -1401,7 +1450,7 @@ /* Get the height. */ str = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(str) { - height = atoi(str); + height = ParseUnsigned(tp, str); } else { height = 0; } @@ -1415,7 +1464,8 @@ } /** Parse pager style. */ -void ParsePagerStyle(const TokenNode *tp) { +void ParsePagerStyle(const TokenNode *tp) +{ const TokenNode *np; @@ -1432,11 +1482,8 @@ case TOK_BACKGROUND: SetColor(COLOR_PAGER_BG, np->value); break; - case TOK_ACTIVEFOREGROUND: - SetColor(COLOR_PAGER_ACTIVE_FG, np->value); - break; - case TOK_ACTIVEBACKGROUND: - SetColor(COLOR_PAGER_ACTIVE_BG, np->value); + case TOK_ACTIVE: + ParseActivePagerStyle(np); break; case TOK_FONT: SetFont(FONT_PAGER, np->value); @@ -1452,28 +1499,44 @@ } +/** Parse active pager style. */ +void ParseActivePagerStyle(const TokenNode *tp) +{ + const TokenNode *np; + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_FOREGROUND: + SetColor(COLOR_PAGER_ACTIVE_FG, np->value); + break; + case TOK_BACKGROUND: + SetColor(COLOR_PAGER_ACTIVE_BG, np->value); + break; + default: + InvalidTag(np, TOK_ACTIVE); + break; + } + } +} + /** Parse popup style. */ -void ParsePopupStyle(const TokenNode *tp) { +void ParsePopupStyle(const TokenNode *tp) +{ const TokenNode *np; const char *str; Assert(tp); - str = FindAttribute(tp->attributes, ENABLED_ATTRIBUTE); - if(str) { - if(!strcmp(str, TRUE_VALUE)) { - SetPopupEnabled(1); - } else if(!strcmp(str, FALSE_VALUE)) { - SetPopupEnabled(0); - } else { - ParseError(tp, "invalid enabled value: \"%s\"", str); - } + str = FindAttribute(tp->attributes, "enabled"); + if(str && !strcmp(str, FALSE_VALUE)) { + settings.popupEnabled = 0; + } else { + settings.popupEnabled = 1; } - str = FindAttribute(tp->attributes, DELAY_ATTRIBUTE); + str = FindAttribute(tp->attributes, "delay"); if(str) { - SetPopupDelay(str); + settings.popupDelay = ParseUnsigned(tp, str); } for(np = tp->subnodeHead; np; np = np->next) { @@ -1499,7 +1562,8 @@ } /** Parse menu style. */ -void ParseMenuStyle(const TokenNode *tp) { +void ParseMenuStyle(const TokenNode *tp) +{ const TokenNode *np; @@ -1516,17 +1580,14 @@ case TOK_BACKGROUND: SetColor(COLOR_MENU_BG, np->value); break; - case TOK_ACTIVEFOREGROUND: - SetColor(COLOR_MENU_ACTIVE_FG, np->value); + case TOK_ACTIVE: + ParseActiveMenuStyle(np); break; - case TOK_ACTIVEBACKGROUND: - ParseGradient(np->value, COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2); + case TOK_OPACITY: + settings.menuOpacity = ParseOpacity(np, np->value); break; case TOK_OUTLINE: - SetColor(COLOR_MENU_ACTIVE_OL, np->value); - break; - case TOK_OPACITY: - SetMenuOpacity(np->value); + SetColor(COLOR_MENU_OUTLINE, np->value); break; default: InvalidTag(np, TOK_MENUSTYLE); @@ -1536,8 +1597,28 @@ } +/** Parse active menu style. */ +void ParseActiveMenuStyle(const TokenNode *tp) +{ + const TokenNode *np; + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_FOREGROUND: + SetColor(COLOR_MENU_ACTIVE_FG, np->value); + break; + case TOK_BACKGROUND: + ParseGradient(np->value, COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2); + break; + default: + InvalidTag(np, TOK_ACTIVE); + break; + } + } +} + /** Parse clock style. */ -void ParseClockStyle(const TokenNode *tp) { +void ParseClockStyle(const TokenNode *tp) +{ const TokenNode *np; @@ -1552,7 +1633,7 @@ SetColor(COLOR_CLOCK_FG, np->value); break; case TOK_BACKGROUND: - SetColor(COLOR_CLOCK_BG, np->value); + ParseGradient(np->value, COLOR_CLOCK_BG1, COLOR_CLOCK_BG2); break; default: InvalidTag(np, TOK_CLOCKSTYLE); @@ -1563,7 +1644,8 @@ } /** Parse tray button style. */ -void ParseTrayButtonStyle(const TokenNode *tp) { +void ParseTrayButtonStyle(const TokenNode *tp) +{ const TokenNode *np; @@ -1578,7 +1660,10 @@ SetColor(COLOR_TRAYBUTTON_FG, np->value); break; case TOK_BACKGROUND: - SetColor(COLOR_TRAYBUTTON_BG, np->value); + ParseGradient(np->value, COLOR_TRAYBUTTON_BG1, COLOR_TRAYBUTTON_BG2); + break; + case TOK_ACTIVE: + ParseActiveTrayButtonStyle(np); break; default: InvalidTag(np, TOK_TRAYBUTTONSTYLE); @@ -1588,8 +1673,29 @@ } +/** Parse active tray button style. */ +void ParseActiveTrayButtonStyle(const TokenNode *tp) +{ + const TokenNode *np; + for(np = tp->subnodeHead; np; np = np->next) { + switch(np->type) { + case TOK_FOREGROUND: + SetColor(COLOR_TRAYBUTTON_ACTIVE_FG, np->value); + break; + case TOK_BACKGROUND: + ParseGradient(np->value, COLOR_TRAYBUTTON_ACTIVE_BG1, + COLOR_TRAYBUTTON_ACTIVE_BG2); + break; + default: + InvalidTag(np, TOK_INVALID); + break; + } + } +} + /** Parse an option group. */ -void ParseGroup(const TokenNode *tp) { +void ParseGroup(const TokenNode *tp) +{ const TokenNode *np; struct GroupType *group; @@ -1619,30 +1725,33 @@ /** Parse a option group option. */ void ParseGroupOption(const TokenNode *tp, struct GroupType *group, - const char *option) { - + const char *option) +{ int x; if(!option) { return; } - for(x = 0; OPTION_MAP[x].name; x++) { - if(!strcmp(option, OPTION_MAP[x].name)) { - AddGroupOption(group, OPTION_MAP[x].option); - return; - } + /* Look up the option in the option map using binary search. */ + x = FindValue(OPTION_MAP, OPTION_MAP_COUNT, option); + if(x >= 0) { + AddGroupOption(group, (OptionType)x); + return; } /* These options have arguments and so we handled them separately. */ if(!strncmp(option, "layer:", 6)) { - AddGroupOptionValue(group, OPTION_LAYER, option + 6); + const WinLayerType layer = ParseLayer(tp, option + 6); + AddGroupOptionUnsigned(group, OPTION_LAYER, layer); } else if(!strncmp(option, "desktop:", 8)) { - AddGroupOptionValue(group, OPTION_DESKTOP, option + 8); + const unsigned int desktop = (unsigned int)atoi(option + 8); + AddGroupOptionUnsigned(group, OPTION_DESKTOP, desktop); } else if(!strncmp(option, "icon:", 5)) { - AddGroupOptionValue(group, OPTION_ICON, option + 5); + AddGroupOptionString(group, OPTION_ICON, option + 5); } else if(!strncmp(option, "opacity:", 8)) { - AddGroupOptionValue(group, OPTION_OPACITY, option + 8); + const unsigned int opacity = ParseOpacity(tp, option + 8); + AddGroupOptionUnsigned(group, OPTION_OPACITY, opacity); } else { ParseError(tp, "invalid Group Option: %s", option); } @@ -1650,11 +1759,11 @@ } /** Parse a color which may be a gradient. */ -void ParseGradient(const char *value, ColorType a, ColorType b) { +void ParseGradient(const char *value, ColorType a, ColorType b) +{ const char *sep; char *temp; - int len; /* Find the separator. */ sep = strchr(value, ':'); @@ -1670,7 +1779,7 @@ /* Two colors. */ /* Get the first color. */ - len = (int)(sep - value); + int len = (int)(sep - value); temp = AllocateStack(len + 1); memcpy(temp, value, len); temp[len] = 0; @@ -1690,40 +1799,80 @@ } /** Find an attribute in a list of attributes. */ -char *FindAttribute(AttributeNode *ap, const char *name) { - +char *FindAttribute(AttributeNode *ap, const char *name) +{ while(ap) { if(!strcmp(name, ap->name)) { return ap->value; } ap = ap->next; } - return NULL; } +/** Parse a token value using a string mapping. */ +int ParseTokenValue(const StringMappingType *mapping, int count, + const TokenNode *tp, int def) +{ + if(JUNLIKELY(tp->value == NULL)) { + ParseError(tp, "%s is empty", GetTokenName(tp)); + return def; + } else { + const int x = FindValue(mapping, count, tp->value); + if(JLIKELY(x >= 0)) { + return x; + } else { + ParseError(tp, "invalid %s: \"%s\"", GetTokenName(tp), tp->value); + return def; + } + } +} + +/** Parse a string using a string mapping. */ +int ParseAttribute(const StringMappingType *mapping, int count, + const TokenNode *tp, const char *attr, int def) +{ + const char *str = FindAttribute(tp->attributes, attr); + if(str == NULL) { + return def; + } else { + const int x = FindValue(mapping, count, str); + if(JLIKELY(x >= 0)) { + return x; + } else { + ParseError(tp, "invalid value for %s: \"%s\"", attr, str); + return def; + } + } +} + /** Read a file. */ -char *ReadFile(FILE *fd) { +char *ReadFile(FILE *fd) +{ - const int BLOCK_SIZE = 8192; + const int BLOCK_SIZE = 1024; // Start at 1k. char *buffer; int len, max; - int ch; len = 0; max = BLOCK_SIZE; buffer = Allocate(max + 1); for(;;) { - ch = fgetc(fd); - if(ch == EOF) { + const size_t count = fread(&buffer[len], 1, max - len, fd); + len += count; + if(len < max) { break; } - buffer[len++] = ch; - if(len >= max) { - max += BLOCK_SIZE; - buffer = Reallocate(buffer, max + 1); + max *= 2; + if(JUNLIKELY(max < 0)) { + /* File is too big. */ + break; + } + buffer = Reallocate(buffer, max + 1); + if(JUNLIKELY(buffer == NULL)) { + FatalError(_("out of memory")); } } buffer[len] = 0; @@ -1732,20 +1881,76 @@ } -/** Display an invalid tag error message. */ -void InvalidTag(const TokenNode *tp, TokenType parent) { +/** Parse an unsigned integer. */ +unsigned int ParseUnsigned(const TokenNode *tp, const char *str) +{ + const long value = strtol(str, NULL, 0); + if(JUNLIKELY(value < 0 || value > UINT_MAX)) { + ParseError(tp, _("invalid setting: %s"), str); + return 0; + } else { + return (unsigned int)value; + } +} + +/** Parse opacity (a float between 0.0 and 1.0). */ +unsigned int ParseOpacity(const TokenNode *tp, const char *str) +{ + const float value = ParseFloat(str); + if(JUNLIKELY(value <= 0.0 || value > 1.0)) { + ParseError(tp, _("invalid opacity: %s"), str); + return UINT_MAX; + } else if(value == 1.0) { + return UINT_MAX; + } else { + return (unsigned int)(value * UINT_MAX); + } +} + +/** Parse layer. */ +WinLayerType ParseLayer(const TokenNode *tp, const char *str) +{ + static const StringMappingType mapping[] = { + { "above", LAYER_ABOVE }, + { "below", LAYER_BELOW }, + { "normal", LAYER_NORMAL } + }; + const int x = FindValue(mapping, ARRAY_LENGTH(mapping), str); + if(JLIKELY(x >= 0)) { + return x; + } else { + ParseError(tp, "invalid layer: %s", str); + return LAYER_NORMAL; + } +} +/** Parse status window type. */ +StatusWindowType ParseStatusWindowType(const TokenNode *tp) +{ + static const StringMappingType mapping[] = { + { "corner", SW_CORNER }, + { "off", SW_OFF }, + { "screen", SW_SCREEN }, + { "window", SW_WINDOW } + }; + return ParseAttribute(mapping, ARRAY_LENGTH(mapping), tp, + "coordinates", SW_SCREEN); +} + +/** Display an invalid tag error message. */ +void InvalidTag(const TokenNode *tp, TokenType parent) +{ ParseError(tp, _("invalid tag in %s: %s"), GetTokenTypeName(parent), GetTokenName(tp)); - } /** Display a parser error. */ -void ParseError(const TokenNode *tp, const char *str, ...) { +void ParseError(const TokenNode *tp, const char *str, ...) +{ va_list ap; - static const char *FILE_MESSAGE = "%s[%d]"; + static const char *FILE_MESSAGE = "%s[%u]"; char *msg; @@ -1765,4 +1970,3 @@ va_end(ap); } - diff -Nru jwm-2.1.0+svn579/src/parse.h jwm-2.3.1+0~16~ubuntu14.10.1/src/parse.h --- jwm-2.1.0+svn579/src/parse.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/parse.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,10 +10,18 @@ #ifndef PARSE_H #define PARSE_H +struct Menu; + /** Parse a configuration file. * @param fileName The file to parse. */ void ParseConfig(const char *fileName); +/** Parse a dynamic menu. + * @param command The command to generate the menu. + * @return The menu. + */ +struct Menu *ParseDynamicMenu(const char *command); + #endif /* PARSE_H */ diff -Nru jwm-2.1.0+svn579/src/place.c jwm-2.3.1+0~16~ubuntu14.10.1/src/place.c --- jwm-2.1.0+svn579/src/place.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/place.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,48 +11,57 @@ #include "place.h" #include "client.h" #include "screen.h" -#include "border.h" #include "tray.h" -#include "main.h" +#include "settings.h" +#include "clientlist.h" +#include "misc.h" typedef struct Strut { ClientNode *client; BoundingBox box; - struct Strut *prev; struct Strut *next; } Strut; static Strut *struts = NULL; -static Strut *strutsTail = NULL; /* desktopCount x screenCount */ /* Note that we assume x and y are 0 based for all screens here. */ static int *cascadeOffsets = NULL; -static void SubtractStrutBounds(BoundingBox *box); -static void SubtractBounds(const BoundingBox *src, BoundingBox *dest); +static char DoRemoveClientStrut(ClientNode *np); +static void InsertStrut(const BoundingBox *box, ClientNode *np); +static void CenterClient(const BoundingBox *box, ClientNode *np); +static int IntComparator(const void *a, const void *b); +static char TryTileClient(const BoundingBox *box, ClientNode *np, + int x, int y); +static char TileClient(const BoundingBox *box, ClientNode *np); +static void CascadeClient(const BoundingBox *box, ClientNode *np); -/** Initialize placement data. */ -void InitializePlacement() { -} +static void SubtractStrutBounds(BoundingBox *box, const ClientNode *np); +static void SubtractBounds(const BoundingBox *src, BoundingBox *dest); +static void SetWorkarea(void); /** Startup placement. */ -void StartupPlacement() { +void StartupPlacement(void) +{ int count; int x; - count = desktopCount * GetScreenCount(); + count = settings.desktopCount * GetScreenCount(); cascadeOffsets = Allocate(count * sizeof(int)); for(x = 0; x < count; x++) { - cascadeOffsets[x] = borderWidth + titleHeight; + cascadeOffsets[x] = settings.borderWidth + settings.titleHeight; } + SetWorkarea(); + } /** Shutdown placement. */ -void ShutdownPlacement() { +void ShutdownPlacement(void) +{ Strut *sp; @@ -63,46 +72,53 @@ Release(struts); struts = sp; } - strutsTail = NULL; } -/** Destroy placement data. */ -void DestroyPlacement() { +/** Remove struts associated with a client. */ +void RemoveClientStrut(ClientNode *np) +{ + if(DoRemoveClientStrut(np)) { + SetWorkarea(); + } } /** Remove struts associated with a client. */ -void RemoveClientStrut(ClientNode *np) { - - Strut *sp; - - sp = struts; - while(sp) { +char DoRemoveClientStrut(ClientNode *np) +{ + char updated = 0; + Strut **spp = &struts; + while(*spp) { + Strut *sp = *spp; if(sp->client == np) { - if(sp->prev) { - sp->prev->next = sp->next; - } else { - struts = sp->next; - } - if(sp->next) { - sp->next->prev = sp->prev; - } else { - strutsTail = sp->prev; - } + *spp = sp->next; Release(sp); - sp = struts; + updated = 1; } else { - sp = sp->next; + spp = &sp->next; } } + return updated; +} + +/** Insert a bounding box to the list of struts. */ +void InsertStrut(const BoundingBox *box, ClientNode *np) +{ + if(JLIKELY(box->width > 0 && box->height > 0)) { + Strut *sp = Allocate(sizeof(Strut)); + sp->client = np; + sp->box = *box; + sp->next = struts; + struts = sp; + } } /** Add client specified struts to our list. */ -void ReadClientStrut(ClientNode *np) { +void ReadClientStrut(ClientNode *np) +{ BoundingBox box; - Strut *sp; int status; Atom actualType; int actualFormat; @@ -111,10 +127,9 @@ unsigned char *value; long *lvalue; long leftWidth, rightWidth, topHeight, bottomHeight; - long leftStart, rightStart; - long topStart, bottomStart; + char updated; - RemoveClientStrut(np); + updated = DoRemoveClientStrut(np); box.x = 0; box.y = 0; @@ -128,70 +143,75 @@ * top_start_x, top_end_x, bottom_start_x, bottom_end_x */ status = JXGetWindowProperty(display, np->window, - atoms[ATOM_NET_WM_STRUT_PARTIAL], 0, 12, False, XA_CARDINAL, - &actualType, &actualFormat, &count, &bytesLeft, &value); - if(status == Success) { + atoms[ATOM_NET_WM_STRUT_PARTIAL], + 0, 12, False, XA_CARDINAL, &actualType, + &actualFormat, &count, &bytesLeft, &value); + if(status == Success && actualFormat != 0) { if(count == 12) { + + long leftStart, leftStop; + long rightStart, rightStop; + long topStart, topStop; + long bottomStart, bottomStop; + lvalue = (long*)value; - leftWidth = lvalue[0]; - rightWidth = lvalue[1]; - topHeight = lvalue[2]; - bottomHeight = lvalue[3]; - leftStart = lvalue[4]; - rightStart = lvalue[6]; - topStart = lvalue[8]; - bottomStart = lvalue[10]; + leftWidth = lvalue[0]; + rightWidth = lvalue[1]; + topHeight = lvalue[2]; + bottomHeight = lvalue[3]; + leftStart = lvalue[4]; + leftStop = lvalue[5]; + rightStart = lvalue[6]; + rightStop = lvalue[7]; + topStart = lvalue[8]; + topStop = lvalue[9]; + bottomStart = lvalue[10]; + bottomStop = lvalue[11]; if(leftWidth > 0) { + box.x = 0; + box.y = leftStart; + box.height = leftStop - leftStart; box.width = leftWidth; - box.x = leftStart; + InsertStrut(&box, np); } if(rightWidth > 0) { + box.x = rootWidth - rightWidth; + box.y = rightStart; + box.height = rightStop - rightStart; box.width = rightWidth; - box.x = rightStart; + InsertStrut(&box, np); } if(topHeight > 0) { + box.x = topStart; + box.y = 0; box.height = topHeight; - box.y = topStart; + box.width = topStop - topStart; + InsertStrut(&box, np); } if(bottomHeight > 0) { + box.x = bottomStart; + box.y = rootHeight - bottomHeight; + box.width = bottomStop - bottomStart; box.height = bottomHeight; - box.y = bottomStart; + InsertStrut(&box, np); } - if(box.width == 0 && box.height > 0) { - box.width = rootWidth; - } - if(box.height == 0 && box.width > 0) { - box.height = rootHeight; - } - - sp = Allocate(sizeof(Strut)); - sp->client = np; - sp->box = box; - sp->prev = NULL; - sp->next = struts; - if(struts) { - struts->prev = sp; - } else { - strutsTail = sp; - } - struts = sp; - } JXFree(value); + SetWorkarea(); return; } /* Next try to read _NET_WM_STRUT */ /* Format is: left_width, right_width, top_width, bottom_width */ - status = JXGetWindowProperty(display, np->window, - atoms[ATOM_NET_WM_STRUT], 0, 4, False, XA_CARDINAL, - &actualType, &actualFormat, &count, &bytesLeft, &value); - if(status == Success) { + status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_STRUT], + 0, 4, False, XA_CARDINAL, &actualType, + &actualFormat, &count, &bytesLeft, &value); + if(status == Success && actualFormat != 0) { if(count == 4) { lvalue = (long*)value; leftWidth = lvalue[0]; @@ -201,55 +221,61 @@ if(leftWidth > 0) { box.x = 0; + box.y = 0; box.width = leftWidth; + box.height = rootHeight; + InsertStrut(&box, np); } if(rightWidth > 0) { box.x = rootWidth - rightWidth; + box.y = 0; box.width = rightWidth; + box.height = rootHeight; + InsertStrut(&box, np); } if(topHeight > 0) { + box.x = 0; box.y = 0; + box.width = rootWidth; box.height = topHeight; + InsertStrut(&box, np); } if(bottomHeight > 0) { + box.x = 0; box.y = rootHeight - bottomHeight; + box.width = rootWidth; box.height = bottomHeight; + InsertStrut(&box, np); } - sp = Allocate(sizeof(Strut)); - sp->client = np; - sp->box = box; - sp->prev = NULL; - sp->next = struts; - if(struts) { - struts->prev = sp; - } else { - strutsTail = sp; - } - struts = sp; - } JXFree(value); + SetWorkarea(); return; } + /* Struts were removed. */ + if(updated) { + SetWorkarea(); + } + } /** Get the screen bounds. */ -void GetScreenBounds(const ScreenType *sp, BoundingBox *box) { - +void GetScreenBounds(const ScreenType *sp, BoundingBox *box) +{ box->x = sp->x; box->y = sp->y; box->width = sp->width; box->height = sp->height; - } /** Shrink dest such that it does not intersect with src. */ -void SubtractBounds(const BoundingBox *src, BoundingBox *dest) { +void SubtractBounds(const BoundingBox *src, BoundingBox *dest) +{ BoundingBox boxes[4]; @@ -314,25 +340,26 @@ /** Subtract tray area from the bounding box. */ void SubtractTrayBounds(const TrayType *tp, BoundingBox *box, - unsigned int layer) { - + unsigned int layer) +{ BoundingBox src; BoundingBox last; - for(; tp; tp = tp->next) { - if(tp->layer > layer && !tp->autoHide) { + if(tp->layer > layer && tp->autoHide == THIDE_OFF) { src.x = tp->x; + src.y = tp->y; + src.width = tp->width + 2 * TRAY_BORDER_SIZE; + src.height = tp->height + 2 * TRAY_BORDER_SIZE; if(src.x < 0) { - src.x = rootWidth - src.x; + src.width += src.x; + src.x = 0; } - src.y = tp->y; if(src.y < 0) { - src.y = rootHeight - src.y; + src.height += src.y; + src.y = 0; } - src.width = tp->width; - src.height = tp->height; last = *box; SubtractBounds(&src, box); @@ -344,16 +371,19 @@ } } - } /** Remove struts from the bounding box. */ -void SubtractStrutBounds(BoundingBox *box) { +void SubtractStrutBounds(BoundingBox *box, const ClientNode *np) +{ Strut *sp; BoundingBox last; for(sp = struts; sp; sp = sp->next) { + if(np != NULL && sp->client == np) { + continue; + } if(sp->client->state.desktop == currentDesktop || (sp->client->state.status & STAT_STICKY)) { last = *box; @@ -367,173 +397,395 @@ } -/** Place a client on the screen. */ -void PlaceClient(ClientNode *np, int alreadyMapped) { - - BoundingBox box; +/** Centered placement. */ +void CenterClient(const BoundingBox *box, ClientNode *np) +{ + np->x = box->x + (box->width / 2) - (np->width / 2); + np->y = box->y + (box->height / 2) - (np->height / 2); + ConstrainSize(np); + ConstrainPosition(np); +} + +/** Compare two integers. */ +int IntComparator(const void *a, const void *b) +{ + const int ia = *(const long*)a; + const int ib = *(const long*)b; + return ia - ib; +} + +/** Attempt to place the client at the specified coordinates. */ +char TryTileClient(const BoundingBox *box, ClientNode *np, int x, int y) +{ + const ClientNode *tp; + int layer; int north, south, east, west; - const ScreenType *sp; - int cascadeIndex; - int overflow; + int x1, x2, y1, y2; + int ox1, ox2, oy1, oy2; - Assert(np); + /* Set the client position. */ + GetBorderSize(&np->state, &north, &south, &east, &west); + np->x = x + west; + np->y = y + north; + ConstrainSize(np); + ConstrainPosition(np); - GetBorderSize(np, &north, &south, &east, &west); + /* Get the client boundaries. */ + x1 = np->x - west; + x2 = np->x + np->width + east; + y1 = np->y - north; + y2 = np->y + np->height + south; - if(np->x + np->width > rootWidth || np->y + np->height > rootHeight) { - overflow = 1; - } else { - overflow = 0; - } + /* Loop over each client. */ + for(layer = np->state.layer; layer < LAYER_COUNT; layer++) { + for(tp = nodes[layer]; tp; tp = tp->next) { - sp = GetMouseScreen(); - GetScreenBounds(sp, &box); + /* Skip clients that aren't visible. */ + if(tp->state.desktop != currentDesktop) { + if(!(tp->state.status & STAT_STICKY)) { + continue; + } + } + if(!(tp->state.status & STAT_MAPPED)) { + continue; + } + if(tp == np) { + continue; + } - if(!overflow && (alreadyMapped - || (!(np->state.status & STAT_PIGNORE) - && (np->sizeFlags & (PPosition | USPosition))))) { + /* Get the boundaries of the other client. */ + GetBorderSize(&tp->state, &north, &south, &east, &west); + ox1 = tp->x - west; + ox2 = tp->x + tp->width + east; + oy1 = tp->y - north; + oy2 = tp->y + tp->height + south; - GravitateClient(np, 0); + /* Check for an overlap. */ + if(x2 <= ox1 || x1 >= ox2) { + continue; + } + if(y2 <= oy1 || y1 >= oy2) { + continue; + } + return 0; - } else { + } + } - SubtractTrayBounds(GetTrays(), &box, np->state.layer); - SubtractStrutBounds(&box); + /* No client overlaps this position. */ + return 1; + +} - cascadeIndex = sp->index * desktopCount + currentDesktop; +/** Tiled placement. */ +char TileClient(const BoundingBox *box, ClientNode *np) +{ - /* Set the cascaded location. */ - np->x = box.x + west + cascadeOffsets[cascadeIndex]; - np->y = box.y + north + cascadeOffsets[cascadeIndex]; - cascadeOffsets[cascadeIndex] += borderWidth + titleHeight; + const ClientNode *tp; + int layer; + int north, south, east, west; + int i, j; + int count; + int *xs; + int *ys; - /* Check for cascade overflow. */ - overflow = 0; - if(np->x + np->width - box.x > box.width) { - overflow = 1; - } else if(np->y + np->height - box.y > box.height) { - overflow = 1; + /* Determine how much space to allocate. */ + count = 1; + for(layer = np->state.layer; layer < LAYER_COUNT; layer++) { + for(tp = nodes[layer]; tp; tp = tp->next) { + if(tp->state.desktop != currentDesktop) { + if(!(tp->state.status & STAT_STICKY)) { + continue; + } + } + if(!(tp->state.status & STAT_MAPPED)) { + continue; + } + if(tp == np) { + continue; + } + count += 2; } + } - if(overflow) { - - cascadeOffsets[cascadeIndex] = borderWidth + titleHeight; - np->x = box.x + west + cascadeOffsets[cascadeIndex]; - np->y = box.y + north + cascadeOffsets[cascadeIndex]; + /* Allocate space for the points. */ + xs = AllocateStack(sizeof(int) * count); + ys = AllocateStack(sizeof(int) * count); - /* Check for client overflow. */ - overflow = 0; - if(np->x + np->width - box.x > box.width) { - overflow = 1; - } else if(np->y + np->height - box.y > box.height) { - overflow = 1; + /* Insert points. */ + xs[0] = box->x; + ys[0] = box->y; + count = 1; + for(layer = np->state.layer; layer < LAYER_COUNT; layer++) { + for(tp = nodes[layer]; tp; tp = tp->next) { + if(tp->state.desktop != currentDesktop) { + if(!(tp->state.status & STAT_STICKY)) { + continue; + } } - - /* Update cascade position or position client. */ - if(overflow) { - np->x = box.x + west; - np->y = box.y + north; - } else { - cascadeOffsets[cascadeIndex] += borderWidth + titleHeight; + if(!(tp->state.status & STAT_MAPPED)) { + continue; + } + if(tp == np) { + continue; } + GetBorderSize(&tp->state, &north, &south, &east, &west); + xs[count + 0] = tp->x - west; + xs[count + 1] = tp->x + tp->width + east; + ys[count + 0] = tp->y - north; + ys[count + 1] = tp->y + tp->height + south; + count += 2; + } + } + + /* Sort the points. */ + qsort(xs, count, sizeof(int), IntComparator); + qsort(ys, count, sizeof(int), IntComparator); + /* Try all possible positions. */ + for(i = 0; i < count; i++) { + for(j = 0; j < count; j++) { + if(TryTileClient(box, np, xs[i], ys[j])) { + ReleaseStack(xs); + ReleaseStack(ys); + return 1; + } } + } + + ReleaseStack(xs); + ReleaseStack(ys); + + /* Tiled placement failed. */ + return 0; + +} +/** Cascade placement. */ +void CascadeClient(const BoundingBox *box, ClientNode *np) +{ + + const ScreenType *sp; + int north, south, east, west; + int cascadeIndex; + char overflow; + + GetBorderSize(&np->state, &north, &south, &east, &west); + sp = GetMouseScreen(); + cascadeIndex = sp->index * settings.desktopCount + currentDesktop; + + /* Set the cascaded location. */ + np->x = box->x + west + cascadeOffsets[cascadeIndex]; + np->y = box->y + north + cascadeOffsets[cascadeIndex]; + cascadeOffsets[cascadeIndex] += settings.borderWidth + + settings.titleHeight; + + /* Check for cascade overflow. */ + overflow = 0; + if(np->x + np->width - box->x > box->width) { + overflow = 1; + } else if(np->y + np->height - box->y > box->height) { + overflow = 1; } - if(np->state.status & STAT_FULLSCREEN) { - JXMoveWindow(display, np->parent, sp->x, sp->y); - } else { - JXMoveWindow(display, np->parent, np->x - west, np->y - north); + if(overflow) { + cascadeOffsets[cascadeIndex] = settings.borderWidth + + settings.titleHeight; + np->x = box->x + west + cascadeOffsets[cascadeIndex]; + np->y = box->y + north + cascadeOffsets[cascadeIndex]; + + /* Check for client overflow and update cascade position. */ + if(np->x + np->width - box->x > box->width) { + np->x = box->x + west; + } else if(np->y + np->height - box->y > box->height) { + np->y = box->y + north; + } else { + cascadeOffsets[cascadeIndex] += settings.borderWidth + + settings.titleHeight; + } } + ConstrainSize(np); + ConstrainPosition(np); + } -/** Constrain the size of the client so it fits. */ -void ConstrainSize(ClientNode *np) { +/** Place a client on the screen. */ +void PlaceClient(ClientNode *np, char alreadyMapped) +{ BoundingBox box; const ScreenType *sp; - int north, south, east, west; - int ratio, minr, maxr; Assert(np); - /* Determine if the size needs to be constrained. */ - sp = GetCurrentScreen(np->x, np->y); - if(np->width < sp->width && np->height < sp->height) { - return; + if(alreadyMapped || (!(np->state.status & STAT_PIGNORE) + && (np->sizeFlags & (PPosition | USPosition)))) { + + GravitateClient(np, 0); + if(!alreadyMapped) { + ConstrainSize(np); + ConstrainPosition(np); + } + + } else { + + sp = GetMouseScreen(); + GetScreenBounds(sp, &box); + SubtractTrayBounds(GetTrays(), &box, np->state.layer); + SubtractStrutBounds(&box, np); + + /* If tiled is specified, first attempt to use tiled placement. */ + if(np->state.status & STAT_TILED) { + if(TileClient(&box, np)) { + return; + } + } + + /* Either tiled placement failed or was not specified. */ + if(np->state.status & STAT_CENTERED) { + CenterClient(&box, np); + } else { + CascadeClient(&box, np); + } + } - /* Constrain the size. */ - GetBorderSize(np, &north, &south, &east, &west); +} + +/** Constrain the size of the client. */ +char ConstrainSize(ClientNode *np) +{ + BoundingBox box; + const ScreenType *sp; + int north, south, east, west; + const int oldWidth = np->width; + const int oldHeight = np->height; + + /* First we make sure the window isn't larger than the program allows. + * We do this here to avoid moving the window below. + */ + np->width = Min(np->width, np->maxWidth); + np->height = Min(np->height, np->maxHeight); + + /* Constrain the width if necessary. */ + sp = GetCurrentScreen(np->x, np->y); GetScreenBounds(sp, &box); SubtractTrayBounds(GetTrays(), &box, np->state.layer); - SubtractStrutBounds(&box); + SubtractStrutBounds(&box, np); + GetBorderSize(&np->state, &north, &south, &east, &west); + if(np->width + east + west > sp->width) { + box.x += west; + box.width -= east + west; + if(box.width > np->maxWidth) { + box.width = np->maxWidth; + } + if(box.width > np->width) { + box.width = np->width; + } + np->x = box.x; + np->width = box.width - (box.width % np->xinc); + } - box.x += west; - box.y += north; - box.width -= east + west; - box.height -= north + south; + /* Constrain the height if necessary. */ + if(np->height + north + south > sp->height) { + box.y += north; + box.height -= north + south; + if(box.height > np->maxHeight) { + box.height = np->maxHeight; + } + if(box.height > np->height) { + box.height = np->height; + } + np->y = box.y; + np->height = box.height - (box.height % np->yinc); + } - if(box.width > np->maxWidth) { - box.width = np->maxWidth; + /* If the program has a minimum constraint, we apply that here. + * Note that this could cause the window to overlap something. */ + np->width = Max(np->width, np->minWidth); + np->height = Max(np->height, np->minHeight); + + /* Fix the aspect ratio. */ + if(np->sizeFlags & PAspect) { + if(np->width * np->aspect.miny < np->height * np->aspect.minx) { + np->height = (np->width * np->aspect.miny) / np->aspect.minx; + } + if(np->width * np->aspect.maxy > np->height * np->aspect.maxx) { + np->width = (np->height * np->aspect.maxx) / np->aspect.maxy; + } } - if(box.height > np->maxHeight) { - box.height = np->maxHeight; + + if(np->width != oldWidth || np->height != oldHeight) { + return 1; + } else { + return 0; } - if(np->sizeFlags & PAspect) { +} - /* Fixed point with a 16-bit fraction. */ - ratio = (box.width << 16) / box.height; +/** Constrain the position of a client. */ +void ConstrainPosition(ClientNode *np) +{ - minr = (np->aspect.minx << 16) / np->aspect.miny; - if(ratio < minr) { - box.height = (box.width << 16) / minr; - } + BoundingBox box; + int north, south, east, west; - maxr = (np->aspect.maxx << 16) / np->aspect.maxy; - if(ratio > maxr) { - box.width = (box.height * maxr) >> 16; - } + /* Get the bounds for placement. */ + box.x = 0; + box.y = 0; + box.width = rootWidth; + box.height = rootHeight; + SubtractTrayBounds(GetTrays(), &box, np->state.layer); + SubtractStrutBounds(&box, np); + /* Fix the position. */ + GetBorderSize(&np->state, &north, &south, &east, &west); + if(np->x + np->width + east + west > box.x + box.width) { + np->x = box.x + box.width - np->width - east; + } + if(np->y + np->height + north + south > box.y + box.height) { + np->y = box.y + box.height - np->height - south; + } + if(np->x < box.x + west) { + np->x = box.x + west; + } + if(np->y < box.y + north) { + np->y = box.y + north; } - - np->x = box.x; - np->y = box.y; - np->width = box.width - (box.width % np->xinc); - np->height = box.height - (box.height % np->yinc); } /** Place a maximized client on the screen. */ -void PlaceMaximizedClient(ClientNode *np, int horiz, int vert) { +void PlaceMaximizedClient(ClientNode *np, MaxFlags flags) +{ BoundingBox box; const ScreenType *sp; int north, south, east, west; - int ratio, minr, maxr; np->oldx = np->x; np->oldy = np->y; np->oldWidth = np->width; np->oldHeight = np->height; + np->state.maxFlags = flags; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); - sp = GetCurrentScreen( - np->x + (east + west + np->width) / 2, - np->y + (north + south + np->height) / 2); + sp = GetCurrentScreen(np->x + (east + west + np->width) / 2, + np->y + (north + south + np->height) / 2); GetScreenBounds(sp, &box); + if(!(flags & (MAX_HORIZ | MAX_LEFT | MAX_RIGHT))) { + box.x = np->x - west; + box.width = np->width + east + west; + } + if(!(flags & (MAX_VERT | MAX_TOP | MAX_BOTTOM))) { + box.y = np->y - north; + box.height = np->height + north + south; + } SubtractTrayBounds(GetTrays(), &box, np->state.layer); - SubtractStrutBounds(&box); - - box.x += west; - box.y += north; - box.width -= east + west; - box.height -= north + south; + SubtractStrutBounds(&box, np); if(box.width > np->maxWidth) { box.width = np->maxWidth; @@ -543,56 +795,86 @@ } if(np->sizeFlags & PAspect) { - - /* Fixed point with a 16-bit fraction. */ - ratio = (box.width << 16) / box.height; - - minr = (np->aspect.minx << 16) / np->aspect.miny; - if(ratio < minr) { - box.height = (box.width << 16) / minr; + if(box.width * np->aspect.miny < box.height * np->aspect.minx) { + box.height = (box.width * np->aspect.miny) / np->aspect.minx; } - - maxr = (np->aspect.maxx << 16) / np->aspect.maxy; - if(ratio > maxr) { - box.width = (box.height * maxr) >> 16; + if(box.width * np->aspect.maxy > box.height * np->aspect.maxx) { + box.width = (box.height * np->aspect.maxx) / np->aspect.maxy; } + } + /* Remove window outlines. */ + if(flags & (MAX_VERT | MAX_TOP)) { + north = Max(0, north - 1); + } + if(flags & (MAX_VERT | MAX_BOTTOM)) { + south = Max(0, south - 1); + } + if(flags & (MAX_HORIZ | MAX_LEFT)) { + west = Max(0, west - 1); + } + if(flags & (MAX_HORIZ | MAX_RIGHT)) { + east = Max(0, east - 1); } /* If maximizing horizontally, update width. */ - if(horiz) { + if(flags & MAX_HORIZ) { np->x = box.x; - np->width = box.width - ((box.width - np->baseWidth) % np->xinc); - np->state.status |= STAT_HMAX; + np->width = box.width; + if(!(np->state.status & STAT_IIGNORE)) { + np->width -= ((box.width - np->baseWidth) % np->xinc); + } + } else if(flags & MAX_LEFT) { + np->x = box.x; + np->width = box.width / 2 - west; + if(!(np->state.status & STAT_IIGNORE)) { + np->width -= ((box.width - np->baseWidth) % np->xinc); + } + } else if(flags & MAX_RIGHT) { + np->x = box.x + box.width / 2 + west; + np->width = box.width / 2 - east; + if(!(np->state.status & STAT_IIGNORE)) { + np->width -= ((box.width - np->baseWidth) % np->xinc); + } } /* If maximizing vertically, update height. */ - if(vert) { - np->y = box.y; - np->height = box.height - ((box.height - np->baseHeight) % np->yinc); - np->state.status |= STAT_VMAX; + if(flags & MAX_VERT) { + np->y = box.y + north; + np->height = box.height - north; + if(!(np->state.status & STAT_IIGNORE)) { + np->height -= ((box.height - np->baseHeight) % np->yinc); + } + } else if(flags & MAX_TOP) { + np->y = box.y + north; + np->height = box.height / 2 - north - south; + if(!(np->state.status & STAT_IIGNORE)) { + np->height -= ((box.height - np->baseHeight) % np->yinc); + } + } else if(flags & MAX_BOTTOM) { + np->y = box.y + box.height / 2 + north; + np->height = box.height / 2 - north - south; + if(!(np->state.status & STAT_IIGNORE)) { + np->height -= ((box.height - np->baseHeight) % np->yinc); + } } } /** Determine which way to move the client for the border. */ -void GetGravityDelta(const ClientNode *np, int *x, int *y) { +void GetGravityDelta(const ClientNode *np, int gravity, int *x, int *y) +{ int north, south, east, west; - - Assert(np); - Assert(x); - Assert(y); - - GetBorderSize(np, &north, &south, &east, &west); - - switch(np->gravity) { + GetBorderSize(&np->state, &north, &south, &east, &west); + switch(gravity) { case NorthWestGravity: *y = -north; *x = -west; break; case NorthGravity: *y = -north; + *x = (west - east) / 2; break; case NorthEastGravity: *y = -north; @@ -600,19 +882,22 @@ break; case WestGravity: *x = -west; + *y = (north - south) / 2; break; case CenterGravity: - *y = (north + south) / 2; - *x = (east + west) / 2; + *y = (north - south) / 2; + *x = (west - east) / 2; break; case EastGravity: *x = west; + *y = (north - south) / 2; break; case SouthWestGravity: *y = south; *x = -west; break; case SouthGravity: + *x = (west - east) / 2; *y = south; break; case SouthEastGravity: @@ -628,14 +913,11 @@ } /** Move the window in the specified direction for reparenting. */ -void GravitateClient(ClientNode *np, int negate) { +void GravitateClient(ClientNode *np, char negate) +{ int deltax, deltay; - - Assert(np); - - GetGravityDelta(np, &deltax, &deltay); - + GetGravityDelta(np, np->gravity, &deltax, &deltay); if(negate) { np->x += deltax; np->y += deltay; @@ -646,3 +928,36 @@ } +/** Set _NET_WORKAREA. */ +void SetWorkarea(void) +{ + BoundingBox box; + unsigned long *array; + unsigned int count; + int x; + + count = 4 * settings.desktopCount * sizeof(unsigned long); + array = (unsigned long*)AllocateStack(count); + + box.x = 0; + box.y = 0; + box.width = rootWidth; + box.height = rootHeight; + + SubtractTrayBounds(GetTrays(), &box, LAYER_NORMAL); + SubtractStrutBounds(&box, NULL); + + for(x = 0; x < settings.desktopCount; x++) { + array[x * 4 + 0] = box.x; + array[x * 4 + 1] = box.y; + array[x * 4 + 2] = box.width; + array[x * 4 + 3] = box.height; + } + JXChangeProperty(display, rootWindow, atoms[ATOM_NET_WORKAREA], + XA_CARDINAL, 32, PropModeReplace, + (unsigned char*)array, settings.desktopCount * 4); + + ReleaseStack(array); + +} + diff -Nru jwm-2.1.0+svn579/src/place.h jwm-2.3.1+0~16~ubuntu14.10.1/src/place.h --- jwm-2.1.0+svn579/src/place.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/place.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,7 +10,8 @@ #ifndef PLACE_H #define PLACE_H -struct ClientNode; +#include "client.h" + struct ScreenType; struct TrayType; @@ -23,52 +24,58 @@ } BoundingBox; /*@{*/ -void InitializePlacement(); -void StartupPlacement(); -void ShutdownPlacement(); -void DestroyPlacement(); +#define InitializePlacement() (void)(0) +void StartupPlacement(void); +void ShutdownPlacement(void); +#define DestroyPlacement() (void)(0) /*@}*/ /** Remove struts associated with a client. * @param np The client. */ -void RemoveClientStrut(struct ClientNode *np); +void RemoveClientStrut(ClientNode *np); /** Read struts associated with a client. * @param np The client. */ -void ReadClientStrut(struct ClientNode *np); +void ReadClientStrut(ClientNode *np); /** Place a client on the screen. * @param np The client to place. * @param alreadyMapped 1 if already mapped, 0 if unmapped. */ -void PlaceClient(struct ClientNode *np, int alreadyMapped); +void PlaceClient(ClientNode *np, char alreadyMapped); /** Place a maximized client on the screen. * @param np The client to place. - * @param horiz Set if maximizing horizontally. - * @param vert Set if maximizing vertically. + * @param flags The type of maximization to perform. */ -void PlaceMaximizedClient(struct ClientNode *np, int horiz, int vert); +void PlaceMaximizedClient(ClientNode *np, MaxFlags flags); /** Move a client window for a border. * @param np The client. * @param negate 0 to gravitate for a border, 1 to gravitate for no border. */ -void GravitateClient(struct ClientNode *np, int negate); +void GravitateClient(ClientNode *np, char negate); /** Get the x and y deltas for gravitating a client. * @param np The client. + * @param gravity The gravity to use. * @param x Location to store the x delta. * @param y Location to store the y delta. */ -void GetGravityDelta(const struct ClientNode *np, int *x, int *y); +void GetGravityDelta(const ClientNode *np, int gravity, int *x, int *y); -/** Constrain the size of a client to available screen space. +/** Constrain the size of a client. * @param np The client. + * @return 1 if the size changed, 0 otherwise. + */ +char ConstrainSize(ClientNode *np); + +/** Constrain the position of a client. + * @param np The client. */ -void ConstrainSize(struct ClientNode *np); +void ConstrainPosition(ClientNode *np); /** Get the bounding box for the screen. * @param sp A pointer to the screen whose bounds to get. @@ -82,7 +89,7 @@ * @param layer The maximum layer of the tray bounds. */ void SubtractTrayBounds(const struct TrayType *tp, BoundingBox *box, - unsigned int layer); + unsigned int layer); #endif /* PLACE_H */ diff -Nru jwm-2.1.0+svn579/src/popup.c jwm-2.3.1+0~16~ubuntu14.10.1/src/popup.c --- jwm-2.1.0+svn579/src/popup.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/popup.c 2015-07-18 20:02:18.000000000 +0000 @@ -14,71 +14,66 @@ #include "font.h" #include "screen.h" #include "cursor.h" -#include "error.h" #include "timing.h" #include "misc.h" -#include "border.h" - -#define DEFAULT_POPUP_DELAY 600 +#include "settings.h" +#include "event.h" typedef struct PopupType { - int isActive; int x, y; /* The coordinates of the upper-left corner of the popup. */ int mx, my; /* The mouse position when the popup was created. */ + Window mw; int width, height; char *text; Window window; + Pixmap pmap; } PopupType; static PopupType popup; -static int popupEnabled; -int popupDelay; - -static void DrawPopup(); -/** Initialize popup data. */ -void InitializePopup() { - popupDelay = DEFAULT_POPUP_DELAY; - popupEnabled = 1; -} +static void SignalPopup(const TimeType *now, int x, int y, Window w, + void *data); /** Startup popups. */ -void StartupPopup() { - popup.isActive = 0; +void StartupPopup(void) +{ popup.text = NULL; popup.window = None; + RegisterCallback(100, SignalPopup, NULL); } /** Shutdown popups. */ -void ShutdownPopup() { +void ShutdownPopup(void) +{ + UnregisterCallback(SignalPopup, NULL); if(popup.text) { Release(popup.text); popup.text = NULL; } if(popup.window != None) { JXDestroyWindow(display, popup.window); + JXFreePixmap(display, popup.pmap); popup.window = None; } } -/** Destroy popup data. */ -void DestroyPopup() { -} - /** Show a popup window. */ -void ShowPopup(int x, int y, const char *text) { +void ShowPopup(int x, int y, const char *text) +{ - unsigned long attrMask; - XSetWindowAttributes attr; const ScreenType *sp; Assert(text); - if(!popupEnabled) { + if(!settings.popupEnabled) { return; } if(popup.text) { + if(x == popup.x && y == popup.y && !strcmp(popup.text, text)) { + // This popup is already shown. + return; + } Release(popup.text); popup.text = NULL; } @@ -87,6 +82,7 @@ return; } + GetMousePosition(&popup.mx, &popup.my, &popup.mw); popup.text = CopyString(text); popup.height = GetStringHeight(FONT_POPUP) + 2; popup.width = GetStringWidth(FONT_POPUP, popup.text) + 9; @@ -98,141 +94,101 @@ } popup.x = x; - popup.y = y - popup.height - 2; + if(y + 2 * popup.height + 2 >= sp->height) { + popup.y = y - popup.height - 2; + } else { + popup.y = y + popup.height + 2; + } - if(popup.width + popup.x >= sp->width) { - popup.x = sp->width - popup.width - 2; + if(popup.width + popup.x > sp->x + sp->width) { + popup.x = sp->x + sp->width - popup.width - 2; } - if(popup.height + popup.y >= sp->height) { - popup.y = sp->height - popup.height - 2; + if(popup.height + popup.y > sp->y + sp->height) { + popup.y = sp->y + sp->height - popup.height - 2; } - if (popup.x < 2) { + if(popup.x < 2) { popup.x = 2; } - if (popup.y < 2) { + if(popup.y < 2) { popup.y = 2; } if(popup.window == None) { - attrMask = 0; + XSetWindowAttributes attr; + unsigned long attrMask = 0; attrMask |= CWEventMask; - attr.event_mask - = ExposureMask - | PointerMotionMask | PointerMotionHintMask; + attr.event_mask = ExposureMask + | PointerMotionMask + | PointerMotionHintMask; attrMask |= CWSaveUnder; attr.save_under = True; - attrMask |= CWBackPixel; - attr.background_pixel = colors[COLOR_POPUP_BG]; - - attrMask |= CWBorderPixel; - attr.border_pixel = colors[COLOR_POPUP_OUTLINE]; - attrMask |= CWDontPropagate; - attr.do_not_propagate_mask - = PointerMotionMask - | ButtonPressMask - | ButtonReleaseMask; + attr.do_not_propagate_mask = PointerMotionMask + | ButtonPressMask + | ButtonReleaseMask; popup.window = JXCreateWindow(display, rootWindow, popup.x, popup.y, - popup.width, popup.height, 1, + popup.width, popup.height, 0, CopyFromParent, InputOutput, CopyFromParent, attrMask, &attr); + JXMapRaised(display, popup.window); } else { JXMoveResizeWindow(display, popup.window, popup.x, popup.y, popup.width, popup.height); + JXFreePixmap(display, popup.pmap); } - ResetRoundedRectWindow(popup.window); - ShapeRoundedRectWindow(popup.window, popup.width, popup.height); - - popup.mx = x; - popup.my = y; - - if(!popup.isActive) { - JXMapRaised(display, popup.window); - popup.isActive = 1; - } else { - DrawPopup(); - } - -} - -/** Set whether popups show be shown. */ -void SetPopupEnabled(int e) { - popupEnabled = e; -} - -/** Set the popup delay. */ -void SetPopupDelay(const char *str) { + popup.pmap = JXCreatePixmap(display, popup.window, + popup.width, popup.height, + rootVisual.depth); - int temp; - - if(JUNLIKELY(str == NULL)) { - return; - } - - temp = atoi(str); - if(JUNLIKELY(temp < 0)) { - Warning(_("invalid popup delay specified: %s"), str); - } else { - popupDelay = temp; - } + JXSetForeground(display, rootGC, colors[COLOR_POPUP_BG]); + JXFillRectangle(display, popup.pmap, rootGC, 0, 0, + popup.width - 1, popup.height - 1); + JXSetForeground(display, rootGC, colors[COLOR_POPUP_OUTLINE]); + JXDrawRectangle(display, popup.pmap, rootGC, 0, 0, + popup.width - 1, popup.height - 1); + RenderString(&rootVisual, popup.pmap, FONT_POPUP, COLOR_POPUP_FG, 4, 1, + popup.width, popup.text); + JXCopyArea(display, popup.pmap, popup.window, rootGC, + 0, 0, popup.width, popup.height, 0, 0); } /** Signal popup (this is used to hide popups after awhile). */ -void SignalPopup(const TimeType *now, int x, int y) { - - if(popup.isActive) { - if(abs(popup.mx - x) > 2 || abs(popup.my - y) > 2) { - JXUnmapWindow(display, popup.window); - popup.isActive = 0; +void SignalPopup(const TimeType *now, int x, int y, Window w, void *data) +{ + if(popup.window != None) { + if(popup.mw != w || + abs(popup.mx - x) > 0 || abs(popup.my - y) > 0) { + JXDestroyWindow(display, popup.window); + JXFreePixmap(display, popup.pmap); + popup.window = None; } } - } /** Process an event on a popup window. */ -int ProcessPopupEvent(const XEvent *event) { - - if(popup.isActive && event->xany.window == popup.window) { - if(event->type == Expose) { - DrawPopup(); - return 1; +char ProcessPopupEvent(const XEvent *event) +{ + if(popup.window != None && event->xany.window == popup.window) { + if(event->type == Expose && event->xexpose.count == 0) { + JXCopyArea(display, popup.pmap, popup.window, rootGC, + 0, 0, popup.width, popup.height, 0, 0); } else if(event->type == MotionNotify) { - JXUnmapWindow(display, popup.window); - popup.isActive = 0; - return 1; + JXDestroyWindow(display, popup.window); + JXFreePixmap(display, popup.pmap); + popup.window = None; } + return 1; } - return 0; - -} - -/** Draw the popup window. */ -void DrawPopup() { - - Assert(popup.isActive); - - JXClearWindow(display, popup.window); - -#ifdef USE_SHAPE - JXSetForeground(display, rootGC, colors[COLOR_POPUP_OUTLINE]); - DrawRoundedRectangle(popup.window, rootGC, 0, 0, - popup.width - 1, popup.height - 1, - CORNER_RADIUS); -#endif - - RenderString(popup.window, FONT_POPUP, COLOR_POPUP_FG, 4, 1, - popup.width, NULL, popup.text); - } diff -Nru jwm-2.1.0+svn579/src/popup.h jwm-2.3.1+0~16~ubuntu14.10.1/src/popup.h --- jwm-2.1.0+svn579/src/popup.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/popup.h 2015-07-18 20:02:18.000000000 +0000 @@ -10,57 +10,26 @@ #ifndef POPUP_H #define POPUP_H -/** Number of pixels the mouse can move before the popup disappears. */ -#define POPUP_DELTA 2 - -struct TimeType; - /*@{*/ -void InitializePopup(); -void StartupPopup(); -void ShutdownPopup(); -void DestroyPopup(); +#define InitializePopup() (void)(0) +void StartupPopup(void); +void ShutdownPopup(void); +#define DestroyPopup() (void)(0) /*@}*/ -/** Calculate dimensions of a popup window given the popup text. - * @param text The text to measure. - * @param width The width output. - * @param height The height output. - */ -void MeasurePopupText(const char *text, int *width, int *height); - /** Show a popup window. + * @param w The window under the mouse. * @param x The x coordinate of the left edge of the popup window. * @param y The y coordinate of the bottom edge of the popup window. * @param text The text to display in the popup. */ void ShowPopup(int x, int y, const char *text); -/** Set whether or not popups are enabled. - * @param e 1 to enable popups, 0 to disable popups. - */ -void SetPopupEnabled(int e); - -/** Set the delay before showing popups. - * @param str The delay (ASCII, milliseconds). - */ -void SetPopupDelay(const char *str); - -/** Signal the popup window. - * @param now The effective time of the signal. - * @param x The x-coordinate of the mouse. - * @param y The y-coordinate of the mouse. - */ -void SignalPopup(const struct TimeType *now, int x, int y); - /** Process a popup event. * @param event The event to process. * @return 1 if handled, 0 otherwise. */ -int ProcessPopupEvent(const XEvent *event); - -/** The popup delay in milliseconds. */ -extern int popupDelay; +char ProcessPopupEvent(const XEvent *event); #endif /* POPUP_H */ diff -Nru jwm-2.1.0+svn579/src/render.c jwm-2.3.1+0~16~ubuntu14.10.1/src/render.c --- jwm-2.1.0+svn579/src/render.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/render.c 2015-07-18 20:02:18.000000000 +0000 @@ -13,53 +13,49 @@ #include "image.h" #include "main.h" #include "color.h" -#include "error.h" /** Draw a scaled icon. */ -int PutScaledRenderIcon(IconNode *icon, ScaledIconNode *node, Drawable d, - int x, int y) +void PutScaledRenderIcon(const VisualData *visual, const ImageNode *image, + Drawable d, int x, int y) { #ifdef USE_XRENDER - Picture dest; Picture source; - Picture alpha; - XRenderPictFormat *fp; - XRenderPictureAttributes pa; - XTransform xf; - int width, height; - int xscale, yscale; - - Assert(icon); + const ScaledIconNode *node = image->nodes; - if(!haveRender || !icon->useRender) { - return 0; - } + Assert(image); + Assert(haveRender); source = node->imagePicture; - alpha = node->alphaPicture; if(source != None) { - fp = JXRenderFindVisualFormat(display, rootVisual); + XRenderPictureAttributes pa; + XTransform xf; + int width, height; + int xscale, yscale; + Picture dest; + Picture alpha = node->alphaPicture; + XRenderPictFormat *fp = JXRenderFindVisualFormat(display, + visual->visual); Assert(fp); pa.subwindow_mode = IncludeInferiors; dest = JXRenderCreatePicture(display, d, fp, CPSubwindowMode, &pa); if(node->width == 0) { - width = icon->image->width; + width = image->width; xscale = 65536; } else { width = node->width; - xscale = (icon->image->width << 16) / width; + xscale = (image->width << 16) / width; } if(node->height == 0) { - height = icon->image->height; + height = image->height; yscale = 65536; } else { height = node->height; - yscale = (icon->image->height << 16) / height; + yscale = (image->height << 16) / height; } memset(&xf, 0, sizeof(xf)); @@ -78,19 +74,13 @@ } - return 1; - -#else - - return 0; - #endif } /** Create a scaled icon. */ -ScaledIconNode *CreateScaledRenderIcon(IconNode *icon, - int width, int height) { +ScaledIconNode *CreateScaledRenderIcon(ImageNode *image, long fg) +{ ScaledIconNode *result = NULL; @@ -101,71 +91,73 @@ GC maskGC; XImage *destImage; XImage *destMask; - unsigned long alpha; - int index, yindex; + const unsigned int width = image->width; + const unsigned int height = image->height; int x, y; - int imageLine; int maskLine; - Assert(icon); - - if(!haveRender || !icon->useRender) { - return NULL; - } + Assert(haveRender); result = Allocate(sizeof(ScaledIconNode)); - result->next = icon->nodes; - icon->nodes = result; - - result->width = width; - result->height = height; - width = icon->image->width; - height = icon->image->height; + result->fg = fg; + result->next = image->nodes; + image->nodes = result; result->mask = JXCreatePixmap(display, rootWindow, width, height, 8); maskGC = JXCreateGC(display, result->mask, 0, NULL); result->image = JXCreatePixmap(display, rootWindow, width, height, - rootDepth); + rootVisual.depth); - destImage = JXCreateImage(display, rootVisual, rootDepth, ZPixmap, 0, - NULL, width, height, 8, 0); + destImage = JXCreateImage(display, rootVisual.visual, rootVisual.depth, + ZPixmap, 0, NULL, width, height, 8, 0); destImage->data = Allocate(sizeof(unsigned long) * width * height); - destMask = JXCreateImage(display, rootVisual, 8, ZPixmap, 0, - NULL, width, height, 8, 0); + destMask = JXCreateImage(display, rootVisual.visual, 8, ZPixmap, + 0, NULL, width, height, 8, 0); destMask->data = Allocate(width * height); - imageLine = 0; maskLine = 0; for(y = 0; y < height; y++) { - yindex = y * icon->image->width; + const int yindex = y * image->width; for(x = 0; x < width; x++) { + if(image->bitmap) { - index = 4 * (yindex + x); - alpha = icon->image->data[index]; - color.red = icon->image->data[index + 1]; - color.red |= color.red << 8; - color.green = icon->image->data[index + 2]; - color.green |= color.green << 8; - color.blue = icon->image->data[index + 3]; - color.blue |= color.blue << 8; - - color.red = (color.red * alpha) >> 8; - color.green = (color.green * alpha) >> 8; - color.blue = (color.blue * alpha) >> 8; - - GetColor(&color); - XPutPixel(destImage, x, y, color.pixel); - destMask->data[maskLine + x] = alpha; - + const int index = yindex + x; + const int offset = index >> 3; + const int mask = 1 << (index & 7); + unsigned long alpha = 0; + if(image->data[offset] & mask) { + alpha = 255; + XPutPixel(destImage, x, y, fg); + } + destMask->data[maskLine + x] = alpha; + + } else { + + const int index = 4 * (yindex + x); + const unsigned long alpha = image->data[index]; + color.red = image->data[index + 1]; + color.red |= color.red << 8; + color.green = image->data[index + 2]; + color.green |= color.green << 8; + color.blue = image->data[index + 3]; + color.blue |= color.blue << 8; + + color.red = (color.red * alpha) >> 8; + color.green = (color.green * alpha) >> 8; + color.blue = (color.blue * alpha) >> 8; + + GetColor(&color); + XPutPixel(destImage, x, y, color.pixel); + destMask->data[maskLine + x] = alpha; + } } - imageLine += destImage->bytes_per_line; maskLine += destMask->bytes_per_line; } /* Render the image data to the image pixmap. */ - JXPutImage(display, result->image, rootGC, destImage, 0, 0, 0, 0, - width, height); + JXPutImage(display, result->image, rootGC, destImage, + 0, 0, 0, 0, width, height); Release(destImage->data); destImage->data = NULL; JXDestroyImage(destImage); @@ -185,7 +177,7 @@ 0, NULL); /* Create the render picture. */ - fp = JXRenderFindVisualFormat(display, rootVisual); + fp = JXRenderFindVisualFormat(display, rootVisual.visual); Assert(fp); result->imagePicture = JXRenderCreatePicture(display, result->image, fp, 0, NULL); @@ -201,4 +193,3 @@ return result; } - diff -Nru jwm-2.1.0+svn579/src/render.h jwm-2.3.1+0~16~ubuntu14.10.1/src/render.h --- jwm-2.1.0+svn579/src/render.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/render.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,27 +11,26 @@ #define RENDER_H struct IconNode; +struct ImageNode; struct ScaledIconNode; +struct VisualData; /** Put a scaled icon. - * @param icon The icon. - * @param node The scaled icon data. + * @param image The image to display. * @param d The drawable on which to render the icon. * @param x The x-coordinate to place the icon. * @param y The y-coordinate to place the icon. * @return 1 if the icon was successfully rendered, 0 otherwise. */ -int PutScaledRenderIcon(struct IconNode *icon, struct ScaledIconNode *node, - Drawable d, int x, int y); +void PutScaledRenderIcon(const struct VisualData *visual, + const struct ImageNode *image, + Drawable d, int x, int y); /** Create a scaled icon. * @param icon The icon. - * @param width The width of the icon to create. - * @param height The height of the icon to create. + * @param fg The foreground color (for bitmaps). * @return The scaled icon. */ -struct ScaledIconNode *CreateScaledRenderIcon(struct IconNode *icon, - int width, int height); +struct ScaledIconNode *CreateScaledRenderIcon(struct ImageNode *image, long fg); #endif /* RENDER_H */ - diff -Nru jwm-2.1.0+svn579/src/resize.c jwm-2.3.1+0~16~ubuntu14.10.1/src/resize.c --- jwm-2.1.0+svn579/src/resize.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/resize.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,16 +11,13 @@ #include "resize.h" #include "client.h" #include "outline.h" -#include "main.h" #include "cursor.h" #include "misc.h" #include "pager.h" #include "status.h" #include "key.h" #include "event.h" -#include "border.h" - -static ResizeModeType resizeMode = RESIZE_OPAQUE; +#include "settings.h" static char shouldStopResize; @@ -29,14 +26,10 @@ static void FixWidth(ClientNode *np); static void FixHeight(ClientNode *np); -/** Set the resize mode to use. */ -void SetResizeMode(ResizeModeType mode) { - resizeMode = mode; -} - /** Callback to stop a resize. */ -void ResizeController(int wasDestroyed) { - if(resizeMode == RESIZE_OUTLINE) { +void ResizeController(int wasDestroyed) +{ + if(settings.resizeMode == RESIZE_OUTLINE) { ClearOutline(); } JXUngrabPointer(display, CurrentTime); @@ -47,7 +40,8 @@ /** Resize a client window (mouse initiated). */ void ResizeClient(ClientNode *np, BorderActionType action, - int startx, int starty) { + int startx, int starty) +{ XEvent event; int oldx, oldy; @@ -56,23 +50,21 @@ int lastgwidth, lastgheight; int delta; int north, south, east, west; - int ratio, minr, maxr; Assert(np); if(!(np->state.border & BORDER_RESIZE)) { return; } + if((np->state.status & STAT_FULLSCREEN) || np->state.maxFlags) { + return; + } if(JUNLIKELY(!GrabMouseForResize(action))) { Debug("ResizeClient: could not grab mouse"); return; } - if(np->state.status & STAT_SHADED) { - action &= ~(BA_RESIZE_N | BA_RESIZE_S); - } - np->controller = ResizeController; shouldStopResize = 0; @@ -84,7 +76,7 @@ gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); startx += np->x - west; starty += np->y - north; @@ -116,7 +108,8 @@ break; case MotionNotify: - SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); + SetMousePosition(event.xmotion.x_root, event.xmotion.y_root, + event.xmotion.window); DiscardMotionEvents(&event, np->window); if(action & BA_RESIZE_N) { @@ -168,27 +161,20 @@ if((action & (BA_RESIZE_N | BA_RESIZE_S)) && (action & (BA_RESIZE_E | BA_RESIZE_W))) { - /* Fixed point with a 16-bit fraction. */ - ratio = (np->width << 16) / np->height; - - minr = (np->aspect.minx << 16) / np->aspect.miny; - if(ratio < minr) { + if(np->width * np->aspect.miny < np->height * np->aspect.minx) { delta = np->width; - np->width = (np->height * minr) >> 16; + np->width = (np->height * np->aspect.minx) / np->aspect.miny; if(action & BA_RESIZE_W) { np->x -= np->width - delta; } } - - maxr = (np->aspect.maxx << 16) / np->aspect.maxy; - if(ratio > maxr) { + if(np->width * np->aspect.maxy > np->height * np->aspect.maxx) { delta = np->height; - np->height = (np->width << 16) / maxr; + np->height = (np->width * np->aspect.maxy) / np->aspect.maxx; if(action & BA_RESIZE_N) { np->y -= np->height - delta; } } - } } @@ -200,15 +186,9 @@ if(lastgheight != gheight || lastgwidth != gwidth) { - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - np->state.status &= ~(STAT_HMAX | STAT_VMAX); - WriteState(np); - SendConfigureEvent(np); - } - UpdateResizeWindow(np, gwidth, gheight); - if(resizeMode == RESIZE_OUTLINE) { + if(settings.resizeMode == RESIZE_OUTLINE) { ClearOutline(); if(np->state.status & STAT_SHADED) { DrawOutline(np->x - west, np->y - north, @@ -219,29 +199,11 @@ np->height + north + south); } } else { - ResetRoundedRectWindow(np->parent); - if(np->state.status & STAT_SHADED) { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + west + east, north + south); - } else { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + west + east, - np->height + north + south); - } - JXMoveResizeWindow(display, np->window, west, - north, np->width, np->height); + ResetBorder(np); SendConfigureEvent(np); } - UpdatePager(); + RequirePagerUpdate(); } @@ -254,7 +216,8 @@ } /** Resize a client window (keyboard or menu initiated). */ -void ResizeClientKeyboard(ClientNode *np) { +void ResizeClientKeyboard(ClientNode *np) +{ XEvent event; int gwidth, gheight; @@ -268,10 +231,13 @@ if(!(np->state.border & BORDER_RESIZE)) { return; } + if((np->state.status & STAT_FULLSCREEN) || np->state.maxFlags) { + return; + } - if(JUNLIKELY(JXGrabKeyboard(display, np->window, True, GrabModeAsync, - GrabModeAsync, CurrentTime) != GrabSuccess)) { - Debug("ResizeClientKeyboard: could not grab keyboard"); + if(JUNLIKELY(JXGrabKeyboard(display, np->parent, True, GrabModeAsync, + GrabModeAsync, CurrentTime) != GrabSuccess)) { + Debug("ResizeClient: could not grab keyboard"); return; } GrabMouseForResize(BA_RESIZE_S | BA_RESIZE_E | BA_RESIZE); @@ -282,12 +248,16 @@ gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; - GetBorderSize(np, &north, &south, &east, &west); + GetBorderSize(&np->state, &north, &south, &east, &west); CreateResizeWindow(np); UpdateResizeWindow(np, gwidth, gheight); - MoveMouse(rootWindow, np->x + np->width, np->y + np->height); + if(np->state.status & STAT_SHADED) { + MoveMouse(rootWindow, np->x + np->width, np->y); + } else { + MoveMouse(rootWindow, np->x + np->width, np->y + np->height); + } DiscardMotionEvents(&event, np->window); for(;;) { @@ -304,9 +274,7 @@ if(event.type == KeyPress) { - while(JXCheckTypedWindowEvent(display, np->window, KeyPress, &event)); - UpdateTime(&event); - + DiscardKeyEvents(&event, np->window); switch(GetKey(&event.xkey) & 0xFF) { case KEY_UP: deltay = Min(-np->yinc, -10); @@ -327,11 +295,16 @@ } else if(event.type == MotionNotify) { - SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); + SetMousePosition(event.xmotion.x_root, event.xmotion.y_root, + event.xmotion.window); DiscardMotionEvents(&event, np->window); deltax = event.xmotion.x - (np->x + np->width); - deltay = event.xmotion.y - (np->y + np->height); + if(np->state.status & STAT_SHADED) { + deltay = 0; + } else { + deltay = event.xmotion.y - (np->y + np->height); + } } else if(event.type == ButtonRelease) { @@ -376,15 +349,9 @@ if(lastgwidth != gwidth || lastgheight != gheight) { - if(np->state.status & (STAT_HMAX | STAT_VMAX)) { - np->state.status &= ~(STAT_HMAX | STAT_VMAX); - WriteState(np); - SendConfigureEvent(np); - } - UpdateResizeWindow(np, gwidth, gheight); - if(resizeMode == RESIZE_OUTLINE) { + if(settings.resizeMode == RESIZE_OUTLINE) { ClearOutline(); if(np->state.status & STAT_SHADED) { DrawOutline(np->x - west, np->y - north, @@ -396,25 +363,11 @@ np->height + north + south); } } else { - ResetRoundedRectWindow(np->parent); - if(np->state.status & STAT_SHADED) { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - north + south); - JXResizeWindow(display, np->parent, - np->width + west + east, north + south); - } else { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - JXResizeWindow(display, np->parent, - np->width + west + east, np->height + north + south); - } - JXResizeWindow(display, np->window, np->width, np->height); + ResetBorder(np); SendConfigureEvent(np); } - UpdatePager(); + RequirePagerUpdate(); } @@ -423,13 +376,23 @@ } /** Stop a resize action. */ -void StopResize(ClientNode *np) { - - int north, south, east, west; +void StopResize(ClientNode *np) +{ np->controller = NULL; - if(resizeMode == RESIZE_OUTLINE) { + /* Set the old width/height if maximized so the window + * is restored to the new size. */ + if(np->state.maxFlags & MAX_VERT) { + np->oldWidth = np->width; + np->oldx = np->x; + } + if(np->state.maxFlags & MAX_HORIZ) { + np->oldHeight = np->height; + np->oldy = np->y; + } + + if(settings.resizeMode == RESIZE_OUTLINE) { ClearOutline(); } @@ -438,79 +401,41 @@ DestroyResizeWindow(); - GetBorderSize(np, &north, &south, &east, &west); - - /* Reset shaped bound */ - ResetRoundedRectWindow(np->parent); - - if(np->state.status & STAT_SHADED) { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + east + west, north + south); - } else { - ShapeRoundedRectWindow(np->parent, - np->width + east + west, - np->height + north + south); - JXMoveResizeWindow(display, np->parent, - np->x - west, np->y - north, - np->width + east + west, - np->height + north + south); - } - JXMoveResizeWindow(display, np->window, west, - north, np->width, np->height); + ResetBorder(np); SendConfigureEvent(np); } /** Fix the width to match the aspect ratio. */ -void FixWidth(ClientNode *np) { - - int ratio, minr, maxr; +void FixWidth(ClientNode *np) +{ Assert(np); if((np->sizeFlags & PAspect) && np->height > 0) { - - /* Fixed point with a 16-bit fraction. */ - ratio = (np->width << 16) / np->height; - - minr = (np->aspect.minx << 16) / np->aspect.miny; - if(ratio < minr) { - np->width = (np->height * minr) >> 16; + if(np->width * np->aspect.miny < np->height * np->aspect.minx) { + np->width = (np->height * np->aspect.minx) / np->aspect.miny; } - - maxr = (np->aspect.maxx << 16) / np->aspect.maxy; - if(ratio > maxr) { - np->width = (np->height * maxr) >> 16; + if(np->width * np->aspect.maxy > np->height * np->aspect.maxx) { + np->width = (np->height * np->aspect.maxx) / np->aspect.maxy; } - } } /** Fix the height to match the aspect ratio. */ -void FixHeight(ClientNode *np) { - - int ratio, minr, maxr; +void FixHeight(ClientNode *np) +{ Assert(np); if((np->sizeFlags & PAspect) && np->height > 0) { - - ratio = (np->width << 16) / np->height; - - minr = (np->aspect.minx << 16) / np->aspect.miny; - if(ratio < minr) { - np->height = (np->width << 16) / minr; + if(np->width * np->aspect.miny < np->height * np->aspect.minx) { + np->height = (np->width * np->aspect.miny) / np->aspect.minx; } - - maxr = (np->aspect.maxx << 16) / np->aspect.maxy; - if(ratio > maxr) { - np->height = (np->width << 16) / maxr; + if(np->width * np->aspect.maxy > np->height * np->aspect.maxx) { + np->height = (np->width * np->aspect.maxy) / np->aspect.maxy; } - } } diff -Nru jwm-2.1.0+svn579/src/resize.h jwm-2.3.1+0~16~ubuntu14.10.1/src/resize.h --- jwm-2.1.0+svn579/src/resize.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/resize.h 2015-07-18 20:02:18.000000000 +0000 @@ -14,12 +14,6 @@ struct ClientNode; -/** Enumeration of possible resize modes. */ -typedef enum { - RESIZE_OPAQUE, /**< Show window contents while resizing. */ - RESIZE_OUTLINE /**< Show an outline while resizing. */ -} ResizeModeType; - /** Resize a client window. * @param np The client to resize. * @param action The location on the border where the move should take place. @@ -27,17 +21,12 @@ * @param starty The starting mouse y-coordinate (window relative). */ void ResizeClient(struct ClientNode *np, BorderActionType action, - int startx, int starty); + int startx, int starty); /** Resize a client window using the keyboard (mouse optional). * @param np The client to resize. */ void ResizeClientKeyboard(struct ClientNode *np); -/** Set the resize mode to use. - * @param mode The resize mode to use. - */ -void SetResizeMode(ResizeModeType mode); - #endif /* RESIZE_H */ diff -Nru jwm-2.1.0+svn579/src/root.c jwm-2.3.1+0~16~ubuntu14.10.1/src/root.c --- jwm-2.1.0+svn579/src/root.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/root.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,42 +11,39 @@ #include "root.h" #include "menu.h" #include "client.h" -#include "main.h" #include "error.h" #include "confirm.h" -#include "desktop.h" #include "misc.h" #include "winmenu.h" #include "command.h" #include "parse.h" +#include "settings.h" +#include "desktop.h" /** Number of root menus to support. */ -#define ROOT_MENU_COUNT 10 +#define ROOT_MENU_COUNT 36 static Menu *rootMenu[ROOT_MENU_COUNT]; -static char showExitConfirmation = 1; static void ExitHandler(ClientNode *np); -static void PatchRootMenu(Menu *menu); -static void UnpatchRootMenu(Menu *menu); -static void RunRootCommand(const MenuAction *action); +static void RunRootCommand(MenuAction *action); /** Initialize root menu data. */ -void InitializeRootMenu() { - - int x; +void InitializeRootMenu(void) +{ + unsigned int x; for(x = 0; x < ROOT_MENU_COUNT; x++) { rootMenu[x] = NULL; } - } /** Startup root menus. */ -void StartupRootMenu() { +void StartupRootMenu(void) +{ - int x, y; - int found; + unsigned int x, y; + char found; for(x = 0; x < ROOT_MENU_COUNT; x++) { if(rootMenu[x]) { @@ -65,14 +62,11 @@ } -/** Shutdown root menus. */ -void ShutdownRootMenu() { -} - /** Destroy root menu data. */ -void DestroyRootMenu() { +void DestroyRootMenu(void) +{ - int x, y; + unsigned int x, y; for(x = 0; x < ROOT_MENU_COUNT; x++) { if(rootMenu[x]) { @@ -88,19 +82,52 @@ } +/** Get the index for a root menu character. */ +int GetRootMenuIndex(char ch) +{ + if(ch >= '0' && ch <= '9') { + return ch - '0'; + } else if(ch >= 'A' && ch <= 'Z') { + return ch - 'A' + 10; + } else if(ch >= 'a' && ch <= 'z') { + return ch - 'a' + 10; + } else { + return -1; + } +} + +/** Get the index for a root menu string. */ +int GetRootMenuIndexFromString(const char *str) +{ + unsigned int temp = 0; + while(*str && IsSpace(*str, &temp)) { + str += 1; + } + if(JUNLIKELY(!*str)) { + return -1; + } + const int result = GetRootMenuIndex(*str); + str += 1; + while(*str && IsSpace(*str, &temp)) { + str += 1; + } + return *str ? -1 : result; +} + /** Set a root menu. */ -void SetRootMenu(const char *indexes, Menu *m) { +void SetRootMenu(const char *indexes, Menu *m) +{ - int x, y; + unsigned int x, y; int index; - int found; + char found; /* Loop over each index to consider. */ for(x = 0; indexes[x]; x++) { /* Get the index and make sure it's in range. */ - index = indexes[x] - '0'; - if(JUNLIKELY(index < 0 || index >= ROOT_MENU_COUNT)) { + index = GetRootMenuIndex(indexes[x]); + if(JUNLIKELY(index < 0)) { Warning(_("invalid root menu specified: \"%c\""), indexes[x]); continue; } @@ -129,13 +156,9 @@ } -/** Set whether a dialog should be shown before exiting. */ -void SetShowExitConfirmation(char v) { - showExitConfirmation = v; -} - /** Determine if the specified root menu is defined. */ -int IsRootMenuDefined(int index) { +char IsRootMenuDefined(int index) +{ if(index >= 0 && index < ROOT_MENU_COUNT && rootMenu[index]) { return 1; } else { @@ -144,83 +167,48 @@ } /** Determine the size of a root menu. */ -void GetRootMenuSize(int index, int *width, int *height) { +void GetRootMenuSize(int index, int *width, int *height) +{ if(!rootMenu[index]) { *width = 0; *height = 0; return; } - - PatchRootMenu(rootMenu[index]); *width = rootMenu[index]->width; *height = rootMenu[index]->height; - UnpatchRootMenu(rootMenu[index]); } /** Show a root menu. */ -int ShowRootMenu(int index, int x, int y) { +char ShowRootMenu(int index, int x, int y) +{ if(!rootMenu[index]) { return 0; } - - PatchRootMenu(rootMenu[index]); ShowMenu(rootMenu[index], RunRootCommand, x, y); - UnpatchRootMenu(rootMenu[index]); - return 1; } -/** Prepare a root menu to be shown. */ -void PatchRootMenu(Menu *menu) { - - MenuItem *item; - - for(item = menu->items; item; item = item->next) { - if(item->submenu) { - PatchRootMenu(item->submenu); - } - if(item->action.type == MA_DESKTOP) { - item->submenu = CreateDesktopMenu(1 << currentDesktop); - InitializeMenu(item->submenu); - } - } - -} - -/** Remove temporary items from a root menu. */ -void UnpatchRootMenu(Menu *menu) { - - MenuItem *item; - - for(item = menu->items; item; item = item->next) { - if(item->action.type == MA_DESKTOP) { - DestroyMenu(item->submenu); - item->submenu = NULL; - } else if(item->submenu) { - UnpatchRootMenu(item->submenu); - } - } - -} - /** Exit callback for the exit menu item. */ -void ExitHandler(ClientNode *np) { +void ExitHandler(ClientNode *np) +{ shouldExit = 1; } /** Restart callback for the restart menu item. */ -void Restart() { +void Restart(void) +{ shouldRestart = 1; shouldExit = 1; } /** Exit with optional confirmation. */ -void Exit() { - if(showExitConfirmation) { +void Exit(void) +{ + if(settings.exitConfirmation) { ShowConfirmDialog(NULL, ExitHandler, _("Exit JWM"), _("Are you sure?"), @@ -231,23 +219,24 @@ } /** Reload the menu. */ -void ReloadMenu() { - shouldReload = 1; +void ReloadMenu(void) +{ + shouldReload = 1; if(!menuShown) { ShutdownRootMenu(); DestroyRootMenu(); InitializeRootMenu(); ParseConfig(configPath); StartupRootMenu(); - shouldReload = 0; + shouldReload = 0; } } /** Root menu callback. */ -void RunRootCommand(const MenuAction *action) { +void RunRootCommand(MenuAction *action) +{ switch(action->type) { - case MA_EXECUTE: RunCommand(action->data.str); break; @@ -279,7 +268,6 @@ break; default: - Debug("invalid RunRootCommand action: %d", action->type); break; } diff -Nru jwm-2.1.0+svn579/src/root.h jwm-2.3.1+0~16~ubuntu14.10.1/src/root.h --- jwm-2.1.0+svn579/src/root.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/root.h 2015-07-18 20:02:18.000000000 +0000 @@ -13,10 +13,10 @@ struct Menu; /*@{*/ -void InitializeRootMenu(); -void StartupRootMenu(); -void ShutdownRootMenu(); -void DestroyRootMenu(); +void InitializeRootMenu(void); +void StartupRootMenu(void); +#define ShutdownRootMenu() (void)(0) +void DestroyRootMenu(void); /*@}*/ /** Set the root menu to be used for the specified indexes. @@ -25,15 +25,20 @@ */ void SetRootMenu(const char *indexes, struct Menu *m); -/** Set whether a confirmation dialog is displayed on exit. - * @param v 1 to display confirmation, 0 to just exit. +/** Get the index for a root menu character. + * @return The menu index, -1 if not found. */ -void SetShowExitConfirmation(char v); +int GetRootMenuIndex(char ch); + +/** Get the index for a root menu string. + * @return The menu index, -1 if not found. + */ +int GetRootMenuIndexFromString(const char *str); /** Determine if a root menu is defined for the specified index. * @return 1 if it is defined, 0 if not. */ -int IsRootMenuDefined(int index); +char IsRootMenuDefined(int index); /** Get the size of a root menu. * @param index The root menu index. @@ -48,16 +53,16 @@ * @param y The y-coordinate. * @return 1 if a menu was displayed, 0 if not. */ -int ShowRootMenu(int index, int x, int y); +char ShowRootMenu(int index, int x, int y); /** Restart the window manager. */ -void Restart(); +void Restart(void); /** Exit the window manager. */ -void Exit(); +void Exit(void); /** Reload the menu. */ -void ReloadMenu(); +void ReloadMenu(void); #endif /* ROOT_H */ diff -Nru jwm-2.1.0+svn579/src/screen.c jwm-2.3.1+0~16~ubuntu14.10.1/src/screen.c --- jwm-2.1.0+svn579/src/screen.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/screen.c 2015-07-18 20:02:18.000000000 +0000 @@ -15,17 +15,14 @@ #include "screen.h" #include "main.h" #include "cursor.h" +#include "misc.h" -static ScreenType *screens; +static ScreenType *screens = NULL; static int screenCount; -/** Initialize screen data. */ -void InitializeScreens() { - screens = NULL; -} - /** Startup screens. */ -void StartupScreens() { +void StartupScreens(void) +{ #ifdef USE_XINERAMA XineramaScreenInfo *info; @@ -72,27 +69,29 @@ } /** Shutdown screens. */ -void ShutdownScreens() { +void ShutdownScreens(void) +{ if(screens) { Release(screens); screens = NULL; } } -/** Destroy screen data. */ -void DestroyScreens() { -} - /** Get the screen given global screen coordinates. */ -const ScreenType *GetCurrentScreen(int x, int y) { +const ScreenType *GetCurrentScreen(int x, int y) +{ ScreenType *sp; int index; + x = Max(0, x); + x = Min(x, rootWidth - 1); + y = Max(0, y); + y = Min(y, rootHeight - 1); for(index = 1; index < screenCount; index++) { sp = &screens[index]; if(x >= sp->x && x < sp->x + sp->width) { - if(y >= sp->y && y <= sp->y + sp->height) { + if(y >= sp->y && y < sp->y + sp->height) { return sp; } } @@ -103,12 +102,14 @@ } /** Get the screen the mouse is currently on. */ -const ScreenType *GetMouseScreen() { +const ScreenType *GetMouseScreen(void) +{ #ifdef USE_XINERAMA + Window w; int x, y; - GetMousePosition(&x, &y); + GetMousePosition(&x, &y, &w); return GetCurrentScreen(x, y); #else @@ -119,7 +120,8 @@ } /** Get data for a screen. */ -const ScreenType *GetScreen(int index) { +const ScreenType *GetScreen(int index) +{ Assert(index >= 0); Assert(index < screenCount); @@ -129,10 +131,9 @@ } /** Get the number of screens. */ -int GetScreenCount() { - +int GetScreenCount(void) +{ return screenCount; - } diff -Nru jwm-2.1.0+svn579/src/screen.h jwm-2.3.1+0~16~ubuntu14.10.1/src/screen.h --- jwm-2.1.0+svn579/src/screen.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/screen.h 2015-07-18 20:02:18.000000000 +0000 @@ -21,10 +21,12 @@ int width, height; /**< The size of this screen. */ } ScreenType; -void InitializeScreens(); -void StartupScreens(); -void ShutdownScreens(); -void DestroyScreens(); +/*@{*/ +#define InitializeScreens() (void)(0) +void StartupScreens(void); +void ShutdownScreens(void); +#define DestroyScreens() (void)(0) +/*@}*/ /** Get the screen of the specified coordinates. * @param x The x-coordinate. @@ -36,7 +38,7 @@ /** Get the screen containing the mouse. * @return The screen containing the mouse. */ -const ScreenType *GetMouseScreen(); +const ScreenType *GetMouseScreen(void); /** Get the screen of the specified index. * @param index The screen index (0 based). @@ -47,7 +49,7 @@ /** Get the number of screens. * @return The number of screens. */ -int GetScreenCount(); +int GetScreenCount(void); #endif /* SCREEN_H */ diff -Nru jwm-2.1.0+svn579/src/settings.c jwm-2.3.1+0~16~ubuntu14.10.1/src/settings.c --- jwm-2.1.0+svn579/src/settings.c 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/settings.c 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,87 @@ +/** + * @file settings.c + * @author Joe Wingbermuehle + * @date 2012 + */ + +#include "jwm.h" +#include "settings.h" +#include "misc.h" + +Settings settings; + +static void FixRange(unsigned int *value, + unsigned int min_value, + unsigned int max_value, + unsigned int def_value); + +/** Initialize settings. */ +void InitializeSettings(void) +{ + settings.doubleClickSpeed = 400; + settings.doubleClickDelta = 2; + settings.snapMode = SNAP_BORDER; + settings.snapDistance = 5; + settings.moveMode = MOVE_OPAQUE; + settings.moveStatusType = SW_SCREEN; + settings.resizeStatusType = SW_SCREEN; + settings.focusModel = FOCUS_SLOPPY; + settings.resizeMode = RESIZE_OPAQUE; + settings.popupDelay = 600; + settings.desktopDelay = 1000; + settings.trayOpacity = UINT_MAX; + settings.popupEnabled = 1; + settings.activeClientOpacity = UINT_MAX; + settings.inactiveClientOpacity = (unsigned int)(0.75 * UINT_MAX); + settings.borderWidth = 5; + settings.titleHeight = 22; + settings.desktopWidth = 4; + settings.desktopHeight = 1; + settings.menuOpacity = UINT_MAX; + settings.taskInsertMode = INSERT_RIGHT; + settings.exitConfirmation = 1; + settings.cornerRadius = 4; + settings.handles = 0; + settings.groupTasks = 0; +} + +/** Make sure settings are reasonable. */ +void StartupSettings(void) +{ + + FixRange(&settings.cornerRadius, 0, 5, 4); + + FixRange(&settings.borderWidth, 1, 128, 4); + FixRange(&settings.titleHeight, 2, 256, 20); + + FixRange(&settings.doubleClickDelta, 0, 64, 2); + FixRange(&settings.doubleClickSpeed, 1, 2000, 400); + + FixRange(&settings.desktopWidth, 1, 64, 4); + FixRange(&settings.desktopHeight, 1, 64, 1); + settings.desktopCount = settings.desktopWidth * settings.desktopHeight; + +} + +/** Update a string setting. */ +void SetPathString(char **dest, const char *src) +{ + if(*dest) { + Release(*dest); + } + *dest = CopyString(src); + if(JLIKELY(*dest)) { + ExpandPath(dest); + } +} + +/** Make sure a value is in range. */ +void FixRange(unsigned int *value, + unsigned int min_value, + unsigned int max_value, + unsigned int def_value) +{ + if(JUNLIKELY(*value < min_value || *value > max_value)) { + *value = def_value; + } +} diff -Nru jwm-2.1.0+svn579/src/settings.h jwm-2.3.1+0~16~ubuntu14.10.1/src/settings.h --- jwm-2.1.0+svn579/src/settings.h 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/settings.h 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,89 @@ +/** + * @file settings.h + * @author Joe Wingbermuehle + * @date 2012 + * + * @brief JWM settings. + * + */ + +#ifndef SETTINGS_H +#define SETTINGS_H + +/** Window snap modes. */ +typedef unsigned char SnapModeType; +#define SNAP_NONE 0 /**< Don't snap. */ +#define SNAP_SCREEN 1 /**< Snap to the edges of the screen. */ +#define SNAP_BORDER 2 /**< Snap to all borders. */ + +/** Window move modes. */ +typedef unsigned char MoveModeType; +#define MOVE_OPAQUE 0 /**< Show window contents while moving. */ +#define MOVE_OUTLINE 1 /**< Show an outline while moving. */ + +/** Window resize modes. */ +typedef unsigned char ResizeModeType; +#define RESIZE_OPAQUE 0 /**< Show window contents while resizing. */ +#define RESIZE_OUTLINE 1 /**< Show an outline while resizing. */ + +/** Status window types. */ +typedef unsigned char StatusWindowType; +#define SW_OFF 0 /**< No status window. */ +#define SW_SCREEN 1 /**< Centered on screen. */ +#define SW_WINDOW 2 /**< Centered on window. */ +#define SW_CORNER 3 /**< Upper-left corner. */ + +/** Focus models. */ +typedef unsigned char FocusModelType; +#define FOCUS_SLOPPY 0 +#define FOCUS_CLICK 1 + +/** Taskbar insert modes. */ +typedef unsigned char InsertModeType; +#define INSERT_LEFT 0 +#define INSERT_RIGHT 1 + +/** Settings. */ +typedef struct { + unsigned int doubleClickSpeed; + unsigned int doubleClickDelta; + unsigned int snapDistance; + unsigned int popupDelay; + unsigned int trayOpacity; + unsigned int activeClientOpacity; + unsigned int inactiveClientOpacity; + unsigned int borderWidth; + unsigned int titleHeight; + unsigned int desktopWidth; + unsigned int desktopHeight; + unsigned int desktopCount; + unsigned int menuOpacity; + unsigned int desktopDelay; + unsigned int cornerRadius; + SnapModeType snapMode; + MoveModeType moveMode; + StatusWindowType moveStatusType; + StatusWindowType resizeStatusType; + FocusModelType focusModel; + ResizeModeType resizeMode; + InsertModeType taskInsertMode; + char popupEnabled; + char exitConfirmation; + char handles; + char groupTasks; +} Settings; + +extern Settings settings; + +/*@{*/ +void InitializeSettings(void); +void StartupSettings(void); +#define ShutdownSettings() (void)(0) +#define DestroySettings() (void)(0) +/*@}*/ + +/** Update a string setting. */ +void SetPathString(char **dest, const char *src); + +#endif + diff -Nru jwm-2.1.0+svn579/src/spacer.c jwm-2.3.1+0~16~ubuntu14.10.1/src/spacer.c --- jwm-2.1.0+svn579/src/spacer.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/spacer.c 2015-07-18 20:02:18.000000000 +0000 @@ -8,6 +8,7 @@ */ #include "jwm.h" +#include "main.h" #include "spacer.h" #include "tray.h" @@ -17,7 +18,8 @@ static void Resize(TrayComponentType *cp); /** Create a spacer tray component. */ -TrayComponentType *CreateSpacer(int width, int height) { +TrayComponentType *CreateSpacer(int width, int height) +{ TrayComponentType *cp; @@ -42,7 +44,8 @@ } /** Set the size. */ -void SetSize(TrayComponentType *cp, int width, int height) { +void SetSize(TrayComponentType *cp, int width, int height) +{ if(width == 0) { cp->width = cp->requestedWidth; cp->height = height; @@ -53,14 +56,29 @@ } /** Initialize. */ -void Create(TrayComponentType *cp) { +void Create(TrayComponentType *cp) +{ + cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, + rootVisual.depth); + ClearTrayDrawable(cp); } /** Resize. */ -void Resize(TrayComponentType *cp) { +void Resize(TrayComponentType *cp) +{ + if(cp->pixmap != None) { + JXFreePixmap(display, cp->pixmap); + } + cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, + rootVisual.depth); + ClearTrayDrawable(cp); } /** Destroy. */ -void Destroy(TrayComponentType *cp) { +void Destroy(TrayComponentType *cp) +{ + if(cp->pixmap != None) { + JXFreePixmap(display, cp->pixmap); + } } diff -Nru jwm-2.1.0+svn579/src/status.c jwm-2.3.1+0~16~ubuntu14.10.1/src/status.c --- jwm-2.1.0+svn579/src/status.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/status.c 2015-07-18 20:02:18.000000000 +0000 @@ -11,37 +11,26 @@ #include "status.h" #include "font.h" #include "screen.h" -#include "color.h" #include "main.h" #include "client.h" -#include "error.h" - -typedef enum { - SW_INVALID, - SW_OFF, - SW_SCREEN, - SW_WINDOW, - SW_CORNER -} StatusWindowType; +#include "settings.h" static Window statusWindow; static unsigned int statusWindowHeight; static unsigned int statusWindowWidth; static int statusWindowX, statusWindowY; -static StatusWindowType moveStatusType; -static StatusWindowType resizeStatusType; static void CreateMoveResizeWindow(const ClientNode *np, StatusWindowType type); static void DrawMoveResizeWindow(const ClientNode *np, StatusWindowType type); -static void DestroyMoveResizeWindow(); +static void DestroyMoveResizeWindow(void); static void GetMoveResizeCoordinates(const ClientNode *np, StatusWindowType type, int *x, int *y); -static StatusWindowType ParseType(const char *str); /** Get the location to place the status window. */ void GetMoveResizeCoordinates(const ClientNode *np, StatusWindowType type, - int *x, int *y) { + int *x, int *y) +{ const ScreenType *sp; @@ -66,9 +55,11 @@ } /** Create the status window. */ -void CreateMoveResizeWindow(const ClientNode *np, StatusWindowType type) { +void CreateMoveResizeWindow(const ClientNode *np, StatusWindowType type) +{ XSetWindowAttributes attrs; + long attrMask; if(type == SW_OFF) { return; @@ -79,23 +70,33 @@ GetMoveResizeCoordinates(np, type, &statusWindowX, &statusWindowY); + attrMask = 0; + + attrMask |= CWBackPixel; attrs.background_pixel = colors[COLOR_MENU_BG]; + + attrMask |= CWSaveUnder; attrs.save_under = True; + + attrMask |= CWOverrideRedirect; attrs.override_redirect = True; + attrMask |= CWBorderPixel; + attrs.border_pixel = colors[COLOR_MENU_OUTLINE]; + statusWindow = JXCreateWindow(display, rootWindow, statusWindowX, statusWindowY, - statusWindowWidth, statusWindowHeight, 0, + statusWindowWidth, statusWindowHeight, 1, CopyFromParent, InputOutput, CopyFromParent, - CWBackPixel | CWOverrideRedirect | CWSaveUnder, - &attrs); + attrMask, &attrs); JXMapRaised(display, statusWindow); } /** Draw the status window. */ -void DrawMoveResizeWindow(const ClientNode *np, StatusWindowType type) { +void DrawMoveResizeWindow(const ClientNode *np, StatusWindowType type) +{ int x, y; @@ -104,150 +105,81 @@ statusWindowX = x; statusWindowY = y; JXMoveResizeWindow(display, statusWindow, x, y, - statusWindowWidth, statusWindowHeight); + statusWindowWidth, statusWindowHeight); } - /* Shape window corners. */ - ShapeRoundedRectWindow(statusWindow, statusWindowWidth, statusWindowHeight); - /* Clear the background. */ JXClearWindow(display, statusWindow); - /* Draw a border. */ - JXSetForeground(display, rootGC, colors[COLOR_MENU_FG]); -#ifdef USE_SHAPE - DrawRoundedRectangle(statusWindow, rootGC, 0, 0, - statusWindowWidth - 1, statusWindowHeight - 1, - CORNER_RADIUS); -#else - JXDrawRectangle(display, statusWindow, rootGC, 0, 0, - statusWindowWidth - 1, statusWindowHeight - 1); -#endif - } /** Destroy the status window. */ -void DestroyMoveResizeWindow() { - +void DestroyMoveResizeWindow(void) +{ if(statusWindow != None) { JXDestroyWindow(display, statusWindow); statusWindow = None; } - } /** Create a move status window. */ -void CreateMoveWindow(ClientNode *np) { - - CreateMoveResizeWindow(np, moveStatusType); - +void CreateMoveWindow(ClientNode *np) +{ + CreateMoveResizeWindow(np, settings.moveStatusType); } /** Update the move status window. */ -void UpdateMoveWindow(ClientNode *np) { - +void UpdateMoveWindow(ClientNode *np) +{ char str[80]; unsigned int width; - if(moveStatusType == SW_OFF) { + if(settings.moveStatusType == SW_OFF) { return; } - DrawMoveResizeWindow(np, moveStatusType); + DrawMoveResizeWindow(np, settings.moveStatusType); snprintf(str, sizeof(str), "(%d, %d)", np->x, np->y); width = GetStringWidth(FONT_MENU, str); - RenderString(statusWindow, FONT_MENU, COLOR_MENU_FG, - (statusWindowWidth - width) / 2, 4, rootWidth, NULL, str); - + RenderString(&rootVisual, statusWindow, FONT_MENU, COLOR_MENU_FG, + (statusWindowWidth - width) / 2, 4, rootWidth, str); } /** Destroy the move status window. */ -void DestroyMoveWindow() { - +void DestroyMoveWindow(void) +{ DestroyMoveResizeWindow(); - } /** Create a resize status window. */ -void CreateResizeWindow(ClientNode *np) { - - CreateMoveResizeWindow(np, resizeStatusType); - +void CreateResizeWindow(ClientNode *np) +{ + CreateMoveResizeWindow(np, settings.resizeStatusType); } /** Update the resize status window. */ -void UpdateResizeWindow(ClientNode *np, int gwidth, int gheight) { +void UpdateResizeWindow(ClientNode *np, int gwidth, int gheight) +{ char str[80]; unsigned int fontWidth; - if(resizeStatusType == SW_OFF) { + if(settings.resizeStatusType == SW_OFF) { return; } - DrawMoveResizeWindow(np, resizeStatusType); + DrawMoveResizeWindow(np, settings.resizeStatusType); snprintf(str, sizeof(str), "%d x %d", gwidth, gheight); fontWidth = GetStringWidth(FONT_MENU, str); - RenderString(statusWindow, FONT_MENU, COLOR_MENU_FG, - (statusWindowWidth - fontWidth) / 2, 4, rootWidth, NULL, str); + RenderString(&rootVisual, statusWindow, FONT_MENU, COLOR_MENU_FG, + (statusWindowWidth - fontWidth) / 2, 4, rootWidth, str); } /** Destroy the resize status window. */ -void DestroyResizeWindow() { - +void DestroyResizeWindow(void) +{ DestroyMoveResizeWindow(); - } - -/** Parse a status window type string. */ -StatusWindowType ParseType(const char *str) { - - if(!str) { - return SW_SCREEN; - } else if(!strcmp(str, "off")) { - return SW_OFF; - } else if(!strcmp(str, "screen")) { - return SW_SCREEN; - } else if(!strcmp(str, "window")) { - return SW_WINDOW; - } else if(!strcmp(str, "corner")) { - return SW_CORNER; - } else { - return SW_INVALID; - } - -} - -/** Set the move status window type. */ -void SetMoveStatusType(const char *str) { - - StatusWindowType type; - - type = ParseType(str); - if(JUNLIKELY(type == SW_INVALID)) { - moveStatusType = SW_SCREEN; - Warning(_("invalid MoveMode coordinates: \"%s\""), str); - } else { - moveStatusType = type; - } - -} - -/** Set the resize status window type. */ -void SetResizeStatusType(const char *str) { - - StatusWindowType type; - - type = ParseType(str); - if(JUNLIKELY(type == SW_INVALID)) { - resizeStatusType = SW_SCREEN; - Warning(_("invalid ResizeMode coordinates: \"%s\""), str); - } else { - resizeStatusType = type; - } - -} - diff -Nru jwm-2.1.0+svn579/src/status.h jwm-2.3.1+0~16~ubuntu14.10.1/src/status.h --- jwm-2.1.0+svn579/src/status.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/status.h 2015-07-18 20:02:18.000000000 +0000 @@ -23,7 +23,7 @@ void UpdateMoveWindow(struct ClientNode *np); /** Destroy a move status window. */ -void DestroyMoveWindow(); +void DestroyMoveWindow(void); /** Create a resize status window. * @param np The client being resized. @@ -38,17 +38,7 @@ void UpdateResizeWindow(struct ClientNode *np, int gwidth, int gheight); /** Destroy a resize status window. */ -void DestroyResizeWindow(); - -/** Set the location of move status windows. - * @param str The location (off, screen, window, or corner). - */ -void SetMoveStatusType(const char *str); - -/** Set the location of resize status windows. - * @param str The location (off, screen, window, or corner). - */ -void SetResizeStatusType(const char *str); +void DestroyResizeWindow(void); #endif /* STATUS_H */ diff -Nru jwm-2.1.0+svn579/src/swallow.c jwm-2.3.1+0~16~ubuntu14.10.1/src/swallow.c --- jwm-2.1.0+svn579/src/swallow.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/swallow.c 2015-07-18 20:02:18.000000000 +0000 @@ -15,7 +15,6 @@ #include "command.h" #include "color.h" #include "client.h" -#include "event.h" #include "misc.h" typedef struct SwallowNode { @@ -32,59 +31,52 @@ } SwallowNode; -static SwallowNode *swallowNodes; +static SwallowNode *pendingNodes = NULL; +static SwallowNode *swallowNodes = NULL; +static void ReleaseNodes(SwallowNode *nodes); static void Destroy(TrayComponentType *cp); static void Resize(TrayComponentType *cp); -/** Initialize swallow data. */ -void InitializeSwallow() { - swallowNodes = NULL; -} - /** Start swallow processing. */ -void StartupSwallow() { - +void StartupSwallow(void) +{ SwallowNode *np; - - for(np = swallowNodes; np; np = np->next) { + for(np = pendingNodes; np; np = np->next) { if(np->command) { RunCommand(np->command); } } - -} - -/** Stop swallow processing. */ -void ShutdownSwallow() { } /** Destroy swallow data. */ -void DestroySwallow() { - - SwallowNode *np; - - while(swallowNodes) { - - np = swallowNodes->next; - - Assert(swallowNodes->name); - Release(swallowNodes->name); +void DestroySwallow(void) +{ + ReleaseNodes(pendingNodes); + ReleaseNodes(swallowNodes); + pendingNodes = NULL; + swallowNodes = NULL; +} - if(swallowNodes->command) { - Release(swallowNodes->command); +/** Release a linked list of swallow nodes. */ +void ReleaseNodes(SwallowNode *nodes) +{ + while(nodes) { + SwallowNode *np = nodes->next; + Assert(nodes->name); + Release(nodes->name); + if(nodes->command) { + Release(nodes->command); } - - Release(swallowNodes); - swallowNodes = np; - + Release(nodes); + nodes = np; } - } /** Create a swallowed application tray component. */ TrayComponentType *CreateSwallow(const char *name, const char *command, - int width, int height) { + int width, int height) +{ TrayComponentType *cp; SwallowNode *np; @@ -94,20 +86,12 @@ return NULL; } - /* Make sure this name isn't already used. */ - for(np = swallowNodes; np; np = np->next) { - if(JUNLIKELY(!strcmp(np->name, name))) { - Warning(_("cannot swallow the same client multiple times")); - return NULL; - } - } - np = Allocate(sizeof(SwallowNode)); np->name = CopyString(name); np->command = CopyString(command); - np->next = swallowNodes; - swallowNodes = np; + np->next = pendingNodes; + pendingNodes = np; cp = CreateTrayComponent(); np->cp = cp; @@ -135,7 +119,8 @@ } /** Process an event on a swallowed window. */ -int ProcessSwallowEvent(const XEvent *event) { +char ProcessSwallowEvent(const XEvent *event) +{ SwallowNode *np; int width, height; @@ -180,27 +165,23 @@ } /** Handle a tray resize. */ -void Resize(TrayComponentType *cp) { +void Resize(TrayComponentType *cp) +{ - int width, height; SwallowNode *np = (SwallowNode*)cp->object; if(cp->window != None) { - - width = cp->width - np->border * 2; - height = cp->height - np->border * 2; - + const unsigned int width = cp->width - np->border * 2; + const unsigned int height = cp->height - np->border * 2; JXResizeWindow(display, cp->window, width, height); - } } /** Destroy a swallow tray component. */ -void Destroy(TrayComponentType *cp) { - - ClientProtocolType protocols; +void Destroy(TrayComponentType *cp) +{ /* Destroy the window if there is one. */ if(cp->window) { @@ -208,10 +189,12 @@ JXReparentWindow(display, cp->window, rootWindow, 0, 0); JXRemoveFromSaveSet(display, cp->window); - protocols = ReadWMProtocols(cp->window); - if(protocols & PROT_DELETE) { + ClientState state; + memset(&state, 0, sizeof(state)); + ReadWMProtocols(cp->window, &state); + if(state.status & STAT_DELETE) { SendClientMessage(cp->window, ATOM_WM_PROTOCOLS, - ATOM_WM_DELETE_WINDOW); + ATOM_WM_DELETE_WINDOW); } else { JXKillClient(display, cp->window); } @@ -221,60 +204,79 @@ } /** Determine if this is a window to be swallowed, if it is, swallow it. */ -int CheckSwallowMap(const XMapEvent *event) { +char CheckSwallowMap(Window win) +{ - SwallowNode *np; + SwallowNode **npp; XClassHint hint; XWindowAttributes attr; + char result; - for(np = swallowNodes; np; np = np->next) { - - if(np->cp->window != None) { - continue; - } + /* Return if there are no programs left to swallow. */ + if(!pendingNodes) { + return 0; + } - Assert(np->cp->tray->window != None); + /* Get the name of the window. */ + if(JXGetClassHint(display, win, &hint) == 0) { + return 0; + } - if(JXGetClassHint(display, event->window, &hint)) { - if(!strcmp(hint.res_name, np->name)) { + /* Check if we should swallow this window. */ + result = 0; + npp = &pendingNodes; + while(*npp) { - /* Swallow the window. */ - JXSelectInput(display, event->window, - StructureNotifyMask | ResizeRedirectMask); - JXAddToSaveSet(display, event->window); - JXSetWindowBorder(display, event->window, colors[COLOR_TRAY_BG]); - JXReparentWindow(display, event->window, - np->cp->tray->window, 0, 0); - JXMapRaised(display, event->window); - JXFree(hint.res_name); - JXFree(hint.res_class); - np->cp->window = event->window; - - /* Update the size. */ - JXGetWindowAttributes(display, event->window, &attr); - np->border = attr.border_width; - if(!np->userWidth) { - np->cp->requestedWidth = attr.width + 2 * np->border; - } - if(!np->userHeight) { - np->cp->requestedHeight = attr.height + 2 * np->border; - } - - ResizeTray(np->cp->tray); + SwallowNode *np = *npp; + Assert(np->cp->tray->window != None); - return 1; + if(!strcmp(hint.res_name, np->name)) { - } else { + /* Swallow the window. */ + JXSelectInput(display, win, + StructureNotifyMask | ResizeRedirectMask); + JXAddToSaveSet(display, win); + JXSetWindowBorder(display, win, colors[COLOR_TRAY_BG2]); + JXReparentWindow(display, win, + np->cp->tray->window, 0, 0); + JXMapRaised(display, win); + np->cp->window = win; + + /* Remove this node from the pendingNodes list and place it + * on the swallowNodes list. */ + *npp = np->next; + np->next = swallowNodes; + swallowNodes = np; + + /* Update the size. */ + JXGetWindowAttributes(display, win, &attr); + np->border = attr.border_width; + if(!np->userWidth) { + np->cp->requestedWidth = attr.width + 2 * np->border; + } + if(!np->userHeight) { + np->cp->requestedHeight = attr.height + 2 * np->border; + } - JXFree(hint.res_name); - JXFree(hint.res_class); + ResizeTray(np->cp->tray); + result = 1; - } + break; } + npp = &np->next; + } + JXFree(hint.res_name); + JXFree(hint.res_class); - return 0; + return result; + +} +/** Determine if there are swallow processes pending. */ +char IsSwallowPending(void) +{ + return pendingNodes ? 1 : 0; } diff -Nru jwm-2.1.0+svn579/src/swallow.h jwm-2.3.1+0~16~ubuntu14.10.1/src/swallow.h --- jwm-2.1.0+svn579/src/swallow.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/swallow.h 2015-07-18 20:02:18.000000000 +0000 @@ -11,10 +11,10 @@ #define SWALLOW_H /*@{*/ -void InitializeSwallow(); -void StartupSwallow(); -void ShutdownSwallow(); -void DestroySwallow(); +#define InitializeSwallow() (void)(0) +void StartupSwallow(void); +#define ShutdownSwallow() (void)(0) +void DestroySwallow(void); /*@}*/ /** Create a swallowed application tray component. @@ -23,21 +23,26 @@ * @param width The width to use (0 for default). * @param height the height to use (0 for default). */ -struct TrayComponentType *CreateSwallow( - const char *name, const char *command, - int width, int height); +struct TrayComponentType *CreateSwallow(const char *name, + const char *command, + int width, int height); -/** Determine if a map event was for a window that should be swallowed. - * @param event The map event. +/** Determine if a window should be swallowed. + * @param win The window. * @return 1 if this window should be swallowed, 0 if not. */ -int CheckSwallowMap(const XMapEvent *event); +char CheckSwallowMap(Window win); /** Process an event on a swallowed window. * @param event The event to process. * @return 1 if the event was for a swallowed window, 0 if not. */ -int ProcessSwallowEvent(const XEvent *event); +char ProcessSwallowEvent(const XEvent *event); + +/** Determine if there are swallow processes pending. + * @return 1 if there are still pending swallow processes, 0 otherwise. + */ +char IsSwallowPending(void); #endif /* SWALLOW_H */ diff -Nru jwm-2.1.0+svn579/src/taskbar.c jwm-2.3.1+0~16~ubuntu14.10.1/src/taskbar.c --- jwm-2.1.0+svn579/src/taskbar.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/taskbar.c 2015-07-18 20:02:18.000000000 +0000 @@ -20,20 +20,19 @@ #include "cursor.h" #include "icon.h" #include "error.h" -#include "font.h" #include "winmenu.h" #include "screen.h" - -typedef enum { - INSERT_LEFT, - INSERT_RIGHT -} InsertModeType; +#include "settings.h" +#include "event.h" +#include "misc.h" typedef struct TaskBarType { TrayComponentType *cp; + int maxItemWidth; int itemHeight; + int itemWidth; LayoutType layout; Pixmap buffer; @@ -41,89 +40,78 @@ TimeType mouseTime; int mousex, mousey; - unsigned int maxItemWidth; - struct TaskBarType *next; } TaskBarType; -typedef struct Node { +typedef struct ClientEntry { ClientNode *client; - int y; - struct Node *next; - struct Node *prev; -} Node; - -static char minimized_bitmap[] = { - 0x01, 0x03, - 0x07, 0x0F -}; - -static const int TASK_SPACER = 2; - -static Pixmap minimizedPixmap; -static InsertModeType insertMode; + struct ClientEntry *next; + struct ClientEntry *prev; +} ClientEntry; + +typedef struct TaskEntry { + ClientEntry *clients; + struct TaskEntry *next; + struct TaskEntry *prev; +} TaskEntry; static TaskBarType *bars; -static Node *taskBarNodes; -static Node *taskBarNodesTail; +static TaskEntry *taskEntries; +static TaskEntry *taskEntriesTail; -static Node *GetNode(TaskBarType *bar, int x); -static unsigned int GetItemCount(); -static unsigned int GetItemWidth(const TaskBarType *bp, - unsigned int itemCount); +static void ComputeItemSize(TaskBarType *tp); +static char ShouldShowEntry(const TaskEntry *tp); +static char ShouldFocusEntry(const TaskEntry *tp); +static TaskEntry *GetEntry(TaskBarType *bar, int x, int y); static void Render(const TaskBarType *bp); -static void ShowTaskWindowMenu(TaskBarType *bar, Node *np); +static void ShowClientList(TaskBarType *bar, TaskEntry *tp); +static void RunTaskBarCommand(MenuAction *action); static void SetSize(TrayComponentType *cp, int width, int height); static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void ProcessTaskButtonEvent(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); +static void MinimizeGroup(const TaskEntry *tp); +static void FocusGroup(const TaskEntry *tp); static void ProcessTaskMotionEvent(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); +static void SignalTaskbar(const TimeType *now, int x, int y, Window w, + void *data); /** Initialize task bar data. */ -void InitializeTaskBar() { +void InitializeTaskBar(void) +{ bars = NULL; - taskBarNodes = NULL; - taskBarNodesTail = NULL; - insertMode = INSERT_RIGHT; -} - -/** Startup the task bar. */ -void StartupTaskBar() { - minimizedPixmap = JXCreateBitmapFromData(display, rootWindow, - minimized_bitmap, 4, 4); + taskEntries = NULL; + taskEntriesTail = NULL; } /** Shutdown the task bar. */ -void ShutdownTaskBar() { - +void ShutdownTaskBar(void) +{ TaskBarType *bp; - for(bp = bars; bp; bp = bp->next) { JXFreePixmap(display, bp->buffer); } - - JXFreePixmap(display, minimizedPixmap); } /** Destroy task bar data. */ -void DestroyTaskBar() { - +void DestroyTaskBar(void) +{ TaskBarType *bp; - while(bars) { bp = bars->next; + UnregisterCallback(SignalTaskbar, bars); Release(bars); bars = bp; } - } /** Create a new task bar tray component. */ -TrayComponentType *CreateTaskBar() { +TrayComponentType *CreateTaskBar() +{ TrayComponentType *cp; TaskBarType *tp; @@ -133,11 +121,10 @@ bars = tp; tp->itemHeight = 0; tp->layout = LAYOUT_HORIZONTAL; - tp->mousex = -POPUP_DELTA; - tp->mousey = -POPUP_DELTA; + tp->mousex = -settings.doubleClickDelta; + tp->mousey = -settings.doubleClickDelta; tp->mouseTime.seconds = 0; tp->mouseTime.ms = 0; - tp->maxItemWidth = 0; cp = CreateTrayComponent(); cp->object = tp; @@ -149,12 +136,15 @@ cp->ProcessButtonPress = ProcessTaskButtonEvent; cp->ProcessMotionEvent = ProcessTaskMotionEvent; + RegisterCallback(settings.popupDelay / 2, SignalTaskbar, tp); + return cp; } /** Set the size of a task bar tray component. */ -void SetSize(TrayComponentType *cp, int width, int height) { +void SetSize(TrayComponentType *cp, int width, int height) +{ TaskBarType *tp; @@ -177,100 +167,98 @@ } /** Initialize a task bar tray component. */ -void Create(TrayComponentType *cp) { - - TaskBarType *tp; - - Assert(cp); - - tp = (TaskBarType*)cp->object; - - Assert(tp); - - if(tp->layout == LAYOUT_HORIZONTAL) { - tp->itemHeight = cp->height - TASK_SPACER; - } else { - tp->itemHeight = GetStringHeight(FONT_TASK) + 12; - } - - Assert(cp->width > 0); - Assert(cp->height > 0); - +void Create(TrayComponentType *cp) +{ + TaskBarType *tp = (TaskBarType*)cp->object; cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, - rootDepth); + rootVisual.depth); tp->buffer = cp->pixmap; - - JXSetForeground(display, rootGC, colors[COLOR_TRAY_BG]); - JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); - + ClearTrayDrawable(cp); } /** Resize a task bar tray component. */ -void Resize(TrayComponentType *cp) { - - TaskBarType *tp; - - Assert(cp); - - tp = (TaskBarType*)cp->object; - - Assert(tp); - +void Resize(TrayComponentType *cp) +{ + TaskBarType *tp = (TaskBarType*)cp->object; if(tp->buffer != None) { JXFreePixmap(display, tp->buffer); } + cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, + rootVisual.depth); + tp->buffer = cp->pixmap; + ClearTrayDrawable(cp); +} + +/** Determine the size of items in the task bar. */ +void ComputeItemSize(TaskBarType *tp) +{ + TrayComponentType *cp = tp->cp; + if(tp->layout == LAYOUT_VERTICAL) { - if(tp->layout == LAYOUT_HORIZONTAL) { - tp->itemHeight = cp->height - TASK_SPACER; - } else { tp->itemHeight = GetStringHeight(FONT_TASK) + 12; - } + tp->itemWidth = cp->width; - Assert(cp->width > 0); - Assert(cp->height > 0); + } else { - cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, - rootDepth); - tp->buffer = cp->pixmap; + TaskEntry *ep; + unsigned itemCount = 0; - JXSetForeground(display, rootGC, colors[COLOR_TRAY_BG]); - JXFillRectangle(display, cp->pixmap, rootGC, - 0, 0, cp->width, cp->height); + tp->itemHeight = cp->height; + for(ep = taskEntries; ep; ep = ep->next) { + if(ShouldShowEntry(ep)) { + itemCount += 1; + } + } + if(itemCount == 0) { + return; + } + + tp->itemWidth = Max(1, cp->width / itemCount); + if(tp->maxItemWidth > 0) { + tp->itemWidth = Min(tp->maxItemWidth, tp->itemWidth); + } + } } /** Process a task list button event. */ -void ProcessTaskButtonEvent(TrayComponentType *cp, int x, int y, int mask) { +void ProcessTaskButtonEvent(TrayComponentType *cp, int x, int y, int mask) +{ TaskBarType *bar = (TaskBarType*)cp->object; - Node *np; - - Assert(bar); + TaskEntry *entry = GetEntry(bar, x, y); - if(bar->layout == LAYOUT_HORIZONTAL) { - np = GetNode(bar, x); - } else { - np = GetNode(bar, y); - } + if(entry) { + char hasActive = 0; + int layer; - if(np) { switch(mask) { - case Button1: - if(np->client->state.status & STAT_ACTIVE - && np->client == nodes[np->client->state.layer]) { - MinimizeClient(np->client); + case Button1: /* Raise or minimize items in this group. */ + for(layer = LAST_LAYER; layer >= FIRST_LAYER; layer--) { + ClientNode *np; + for(np = nodes[layer]; np; np = np->next) { + ClientEntry *cp; + if(np->state.status & STAT_MINIMIZED) { + continue; + } else if(!ShouldFocus(np)) { + continue; + } + for(cp = entry->clients; cp; cp = cp->next) { + if(cp->client == np) { + hasActive = 1; + break; + } + } + break; + } + } + if(hasActive) { + MinimizeGroup(entry); } else { - RestoreClient(np->client, 1); - FocusClient(np->client); + FocusGroup(entry); } break; case Button3: - ShowTaskWindowMenu(bar, np); - break; - case Button4: - FocusPrevious(); - break; - case Button5: - FocusNext(); + ShowClientList(bar, entry); break; default: break; @@ -279,162 +267,365 @@ } -/** Process a task list motion event. */ -void ProcessTaskMotionEvent(TrayComponentType *cp, int x, int y, int mask) { +/** Minimize all clients in a group. */ +void MinimizeGroup(const TaskEntry *tp) +{ + ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(ShouldFocus(cp->client)) { + MinimizeClient(cp->client, 0); + } + } +} - TaskBarType *bp = (TaskBarType*)cp->object; +/** Raise all clients in a group and focus the top-most. */ +void FocusGroup(const TaskEntry *tp) +{ + const char *className = tp->clients->client->className; + ClientNode **toRestore; + unsigned restoreCount; + int i; + + /* If there is no class name, then there will only be one client. */ + if(!className || !settings.groupTasks) { + RestoreClient(tp->clients->client, 1); + FocusClient(tp->clients->client); + return; + } + /* Build up the list of clients to restore in correct order. */ + toRestore = AllocateStack(sizeof(ClientNode*) * clientCount); + restoreCount = 0; + for(i = 0; i < LAYER_COUNT; i++) { + ClientNode *np; + for(np = nodes[i]; np; np = np->next) { + if(!ShouldFocus(np)) { + continue; + } + if(np->className && !strcmp(np->className, className)) { + toRestore[restoreCount] = np; + restoreCount += 1; + } + } + } + Assert(restoreCount <= clientCount); + for(i = restoreCount - 1; i >= 0; i--) { + RestoreClient(toRestore[i], 1); + } + for(i = 0; i < restoreCount; i++) { + if(toRestore[i]->state.status & STAT_CANFOCUS) { + FocusClient(toRestore[i]); + break; + } + } + ReleaseStack(toRestore); +} + +/** Process a task list motion event. */ +void ProcessTaskMotionEvent(TrayComponentType *cp, int x, int y, int mask) +{ + TaskBarType *bp = (TaskBarType*)cp->object; bp->mousex = cp->screenx + x; bp->mousey = cp->screeny + y; GetCurrentTime(&bp->mouseTime); - } /** Show the menu associated with a task list item. */ -void ShowTaskWindowMenu(TaskBarType *bar, Node *np) { +void ShowClientList(TaskBarType *bar, TaskEntry *tp) +{ + Menu *menu; + MenuItem *item; + ClientEntry *cp; - int x, y; - int mwidth, mheight; const ScreenType *sp; + int x, y; + Window w; - GetWindowMenuSize(np->client, &mwidth, &mheight); + if(settings.groupTasks) { - sp = GetCurrentScreen(bar->cp->screenx, bar->cp->screeny); + menu = Allocate(sizeof(Menu)); + menu->itemHeight = 0; + menu->items = NULL; + menu->label = NULL; + + item = CreateMenuItem(MENU_ITEM_SUBMENU); + item->name = CopyString(_("Close")); + item->action.type = MA_CLOSE | MA_GROUP_MASK; + item->action.context = tp; + item->next = menu->items; + menu->items = item; + + item = CreateMenuItem(MENU_ITEM_SUBMENU); + item->name = CopyString(_("Minimize")); + item->action.type = MA_MINIMIZE | MA_GROUP_MASK; + item->action.context = tp; + item->next = menu->items; + menu->items = item; + + item = CreateMenuItem(MENU_ITEM_SUBMENU); + item->name = CopyString(_("Restore")); + item->action.type = MA_RESTORE | MA_GROUP_MASK; + item->action.context = tp; + item->next = menu->items; + menu->items = item; + + item = CreateMenuItem(MENU_ITEM_SUBMENU); + item->name = CopyString(_("Send To")); + item->action.type = MA_SENDTO_MENU | MA_GROUP_MASK; + item->action.context = tp; + item->next = menu->items; + menu->items = item; + + /* Load the separator and group actions. */ + item = CreateMenuItem(MENU_ITEM_SEPARATOR); + item->next = menu->items; + menu->items = item; + + /* Load the clients into the menu. */ + for(cp = tp->clients; cp; cp = cp->next) { + if(!ShouldFocus(cp->client)) { + continue; + } + item = CreateMenuItem(MENU_ITEM_NORMAL); + if(cp->client->state.status & STAT_MINIMIZED) { + size_t len = 0; + if(cp->client->name) { + len = strlen(cp->client->name); + } + item->name = Allocate(len + 3); + item->name[0] = '['; + memcpy(&item->name[1], cp->client->name, len); + item->name[len + 1] = ']'; + item->name[len + 2] = 0; + } else { + item->name = CopyString(cp->client->name); + } + item->icon = cp->client->icon; + item->action.type = MA_EXECUTE; + item->action.context = cp->client; + item->next = menu->items; + menu->items = item; + } + } else { + /* Not grouping clients. */ + menu = CreateWindowMenu(tp->clients->client); + } + /* Initialize and position the menu. */ + InitializeMenu(menu); + sp = GetCurrentScreen(bar->cp->screenx, bar->cp->screeny); + GetMousePosition(&x, &y, &w); if(bar->layout == LAYOUT_HORIZONTAL) { - GetMousePosition(&x, &y); if(bar->cp->screeny + bar->cp->height / 2 < sp->y + sp->height / 2) { + /* Bottom of the screen: menus go up. */ y = bar->cp->screeny + bar->cp->height; } else { - y = bar->cp->screeny - mheight; + /* Top of the screen: menus go down. */ + y = bar->cp->screeny - menu->height; } - x -= mwidth / 2; + x -= menu->width / 2; + x = Max(x, sp->x); } else { if(bar->cp->screenx + bar->cp->width / 2 < sp->x + sp->width / 2) { + /* Left side: menus go right. */ x = bar->cp->screenx + bar->cp->width; } else { - x = bar->cp->screenx - mwidth; + /* Right side: menus go left. */ + x = bar->cp->screenx - menu->width; } - y = bar->cp->screeny + np->y; + y -= menu->height / 2; + y = Max(y, sp->y); } - ShowWindowMenu(np->client, x, y); + ShowMenu(menu, RunTaskBarCommand, x, y); -} - -/** Add a client to the task bar. */ -void AddClientToTaskBar(ClientNode *np) { - - Node *tp; + DestroyMenu(menu); - Assert(np); +} - tp = Allocate(sizeof(Node)); - tp->client = np; +/** Run a menu action. */ +void RunTaskBarCommand(MenuAction *action) +{ + ClientEntry *cp; - if(insertMode == INSERT_RIGHT) { - tp->next = NULL; - tp->prev = taskBarNodesTail; - if(taskBarNodesTail) { - taskBarNodesTail->next = tp; + if(action->type & MA_GROUP_MASK) { + TaskEntry *tp = action->context; + for(cp = tp->clients; cp; cp = cp->next) { + if(!ShouldFocus(cp->client)) { + continue; + } + switch(action->type & ~MA_GROUP_MASK) { + case MA_SENDTO: + SetClientDesktop(cp->client, action->data.i); + break; + case MA_CLOSE: + DeleteClient(cp->client); + break; + case MA_RESTORE: + RestoreClient(cp->client, 0); + break; + case MA_MINIMIZE: + MinimizeClient(cp->client, 0); + break; + default: + break; + } + } + } else if(action->type == MA_EXECUTE) { + if(action->button == Button3) { + Window w; + int x, y; + GetMousePosition(&x, &y, &w); + ShowWindowMenu(action->context, x, y); } else { - taskBarNodes = tp; + ClientNode *np = action->context; + RestoreClient(np, 1); + FocusClient(np); + MoveMouse(np->window, np->width / 2, np->height / 2); } - taskBarNodesTail = tp; } else { - tp->prev = NULL; - tp->next = taskBarNodes; - if(taskBarNodes) { - taskBarNodes->prev = tp; - } - taskBarNodes = tp; - if(!taskBarNodesTail) { - taskBarNodesTail = tp; - } + RunWindowCommand(action); } - - UpdateTaskBar(); - - UpdateNetClientList(); - } -/** Remove a client from the task bar. */ -void RemoveClientFromTaskBar(ClientNode *np) { - - Node *tp; - - Assert(np); - - for(tp = taskBarNodes; tp; tp = tp->next) { - if(tp->client == np) { - if(tp->prev) { - tp->prev->next = tp->next; +/** Add a client to the task bar. */ +void AddClientToTaskBar(ClientNode *np) +{ + TaskEntry *tp = NULL; + ClientEntry *cp = Allocate(sizeof(ClientEntry)); + cp->client = np; + + if(np->className && settings.groupTasks) { + for(tp = taskEntries; tp; tp = tp->next) { + const char *className = tp->clients->client->className; + if(className && !strcmp(np->className, className)) { + break; + } + } + } + if(tp == NULL) { + tp = Allocate(sizeof(TaskEntry)); + tp->clients = NULL; + if(settings.taskInsertMode == INSERT_LEFT) { + tp->prev = NULL; + tp->next = taskEntries; + if(taskEntries) { + taskEntries->prev = tp; } else { - taskBarNodes = tp->next; + taskEntriesTail = tp; } - if(tp->next) { - tp->next->prev = tp->prev; + taskEntries = tp; + } else { + tp->next = NULL; + tp->prev = taskEntriesTail; + if(taskEntriesTail) { + taskEntriesTail->next = tp; } else { - taskBarNodesTail = tp->prev; + taskEntries = tp; } - Release(tp); - break; + taskEntriesTail = tp; } } - UpdateTaskBar(); + cp->next = tp->clients; + if(tp->clients) { + tp->clients->prev = cp; + } + cp->prev = NULL; + tp->clients = cp; + RequireTaskUpdate(); UpdateNetClientList(); } -/** Update all task bars. */ -void UpdateTaskBar() { +/** Remove a client from the task bar. */ +void RemoveClientFromTaskBar(ClientNode *np) +{ + TaskEntry *tp; + for(tp = taskEntries; tp; tp = tp->next) { + ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(cp->client == np) { + if(cp->prev) { + cp->prev->next = cp->next; + } else { + tp->clients = cp->next; + } + if(cp->next) { + cp->next->prev = cp->prev; + } + Release(cp); + if(!tp->clients) { + if(tp->prev) { + tp->prev->next = tp->next; + } else { + taskEntries = tp->next; + } + if(tp->next) { + tp->next->prev = tp->prev; + } else { + taskEntriesTail = tp->prev; + } + Release(tp); + } + UpdateTaskBar(); + UpdateNetClientList(); + return; + } + } + } +} +/** Update all task bars. */ +void UpdateTaskBar(void) +{ TaskBarType *bp; - unsigned int count; - int lastHeight; + int lastHeight = -1; - if(shouldExit) { + if(JUNLIKELY(shouldExit)) { return; } for(bp = bars; bp; bp = bp->next) { - if(bp->layout == LAYOUT_VERTICAL) { + TaskEntry *tp; lastHeight = bp->cp->requestedHeight; - count = GetItemCount(); - bp->cp->requestedHeight = GetStringHeight(FONT_TASK) + 12; - bp->cp->requestedHeight *= count; - bp->cp->requestedHeight += 2; + bp->itemHeight = GetStringHeight(FONT_TASK) + 12; + bp->cp->requestedHeight = 2; + for(tp = taskEntries; tp; tp = tp->next) { + if(ShouldShowEntry(tp)) { + bp->cp->requestedHeight += bp->itemHeight; + } + } if(lastHeight != bp->cp->requestedHeight) { ResizeTray(bp->cp->tray); } } - + ComputeItemSize(bp); Render(bp); } - } /** Signal task bar (for popups). */ -void SignalTaskbar(const TimeType *now, int x, int y) { +void SignalTaskbar(const TimeType *now, int x, int y, Window w, void *data) +{ - TaskBarType *bp; - Node *np; + TaskBarType *bp = (TaskBarType*)data; + TaskEntry *ep; - for(bp = bars; bp; bp = bp->next) { - if(abs(bp->mousex - x) < POPUP_DELTA - && abs(bp->mousey - y) < POPUP_DELTA) { - if(GetTimeDifference(now, &bp->mouseTime) >= popupDelay) { - if(bp->layout == LAYOUT_HORIZONTAL) { - np = GetNode(bp, x - bp->cp->screenx); - } else { - np = GetNode(bp, y - bp->cp->screeny); + if(w == bp->cp->tray->window && + abs(bp->mousex - x) < settings.doubleClickDelta && + abs(bp->mousey - y) < settings.doubleClickDelta) { + if(GetTimeDifference(now, &bp->mouseTime) >= settings.popupDelay) { + ep = GetEntry(bp, x - bp->cp->screenx, y - bp->cp->screeny); + if(settings.groupTasks) { + if(ep && ep->clients->client->className) { + ShowPopup(x, y, ep->clients->client->className); } - if(np && np->client->name) { - ShowPopup(x, y, np->client->name); + } else { + if(ep && ep->clients->client->name) { + ShowPopup(x, y, ep->clients->client->name); } } } @@ -443,113 +634,59 @@ } /** Draw a specific task bar. */ -void Render(const TaskBarType *bp) { - - Node *tp; +void Render(const TaskBarType *bp) +{ + TaskEntry *tp; ButtonNode button; int x, y; - int remainder; - int itemWidth, itemCount; - int width, height; - Pixmap buffer; - GC gc; - char *minimizedName; - if(shouldExit) { + if(JUNLIKELY(shouldExit)) { return; } - Assert(bp); - Assert(bp->cp); - - width = bp->cp->width; - height = bp->cp->height; - buffer = bp->cp->pixmap; - gc = rootGC; - - x = TASK_SPACER; - width -= x; - y = 1; - - JXSetForeground(display, gc, colors[COLOR_TRAY_BG]); - JXFillRectangle(display, buffer, gc, 0, 0, width, height); - - itemCount = GetItemCount(); - if(!itemCount) { + ClearTrayDrawable(bp->cp); + if(!taskEntries) { UpdateSpecificTray(bp->cp->tray, bp->cp); return; } - if(bp->layout == LAYOUT_HORIZONTAL) { - itemWidth = GetItemWidth(bp, itemCount); - remainder = width - itemWidth * itemCount; - } else { - itemWidth = width; - remainder = 0; - } - ResetButton(&button, buffer, gc); + ResetButton(&button, bp->cp->pixmap, &rootVisual); button.font = FONT_TASK; - - for(tp = taskBarNodes; tp; tp = tp->next) { - if(ShouldFocus(tp->client)) { - - tp->y = y; - - if(tp->client->state.status & STAT_ACTIVE) { + button.height = bp->itemHeight; + button.width = bp->itemWidth; + button.text = NULL; + + x = 0; + y = 0; + for(tp = taskEntries; tp; tp = tp->next) { + + if(!ShouldShowEntry(tp)) { + continue; + } + + /* Check for an active or urgent window. */ + ClientEntry *cp; + button.type = BUTTON_TASK; + for(cp = tp->clients; cp; cp = cp->next) { + if(cp->client->state.status & (STAT_ACTIVE | STAT_FLASH)) { button.type = BUTTON_TASK_ACTIVE; - } else { - button.type = BUTTON_TASK; - } - - if(remainder) { - button.width = itemWidth - TASK_SPACER; - } else { - button.width = itemWidth - TASK_SPACER - 1; - } - button.height = bp->itemHeight - 1; - button.x = x; - button.y = y; - button.icon = tp->client->icon; - - if(tp->client->state.status & STAT_MINIMIZED) { - if(tp->client->name) { - minimizedName = AllocateStack(strlen(tp->client->name) + 3); - sprintf(minimizedName, "[%s]", tp->client->name); - button.text = minimizedName; - DrawButton(&button); - ReleaseStack(minimizedName); - } else { - button.text = "[]"; - DrawButton(&button); - } - } else { - button.text = tp->client->name; - DrawButton(&button); - } - - if(tp->client->state.status & STAT_MINIMIZED) { - JXSetForeground(display, gc, colors[COLOR_TASK_FG]); - JXSetClipMask(display, gc, minimizedPixmap); - JXSetClipOrigin(display, gc, x + 3, y + bp->itemHeight - 7); - JXFillRectangle(display, buffer, gc, - x + 3, y + bp->itemHeight - 7, 4, 4); - JXSetClipMask(display, gc, None); - } - - if(bp->layout == LAYOUT_HORIZONTAL) { - x += itemWidth; - if(remainder) { - ++x; - --remainder; - } - } else { - y += bp->itemHeight; - if(remainder) { - ++y; - --remainder; - } + break; } + } + button.x = x; + button.y = y; + button.icon = tp->clients->client->icon; + if(tp->clients->client->className && settings.groupTasks) { + button.text = tp->clients->client->className; + } else { + button.text = tp->clients->client->name; + } + DrawButton(&button); + if(bp->layout == LAYOUT_HORIZONTAL) { + x += bp->itemWidth; + } else { + y += bp->itemHeight; } } @@ -558,257 +695,200 @@ } /** Focus the next client in the task bar. */ -void FocusNext() { - - Node *tp; - - for(tp = taskBarNodes; tp; tp = tp->next) { - if(ShouldFocus(tp->client)) { - if(tp->client->state.status & STAT_ACTIVE) { - tp = tp->next; - break; +void FocusNext(void) +{ + TaskEntry *tp; + + /* Find the current entry. */ + for(tp = taskEntries; tp; tp = tp->next) { + ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(cp->client->state.status & STAT_CANFOCUS) { + if(ShouldFocus(cp->client)) { + if(cp->client->state.status & STAT_ACTIVE) { + cp = cp->next; + goto ClientFound; + } + } } } } +ClientFound: - if(!tp) { - tp = taskBarNodes; - } - - while(tp && !ShouldFocus(tp->client)) { - tp = tp->next; + /* Move to the next group. */ + if(tp) { + do { + tp = tp->next; + } while(tp && !ShouldFocusEntry(tp)); } - if(!tp) { - tp = taskBarNodes; - while(tp && !ShouldFocus(tp->client)) { - tp = tp->next; + /* Wrap around; start at the beginning. */ + for(tp = taskEntries; tp; tp = tp->next) { + if(ShouldFocusEntry(tp)) { + break; + } } } + /* Focus the group if one exists. */ if(tp) { - RestoreClient(tp->client, 1); - FocusClient(tp->client); + FocusGroup(tp); } - } /** Focus the previous client in the task bar. */ -void FocusPrevious() { - - Node *tp; - - for(tp = taskBarNodesTail; tp; tp = tp->prev) { - if(ShouldFocus(tp->client)) { - if(tp->client->state.status & STAT_ACTIVE) { - tp = tp->prev; - break; +void FocusPrevious(void) +{ + TaskEntry *tp; + + /* Find the current entry. */ + for(tp = taskEntries; tp; tp = tp->next) { + ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(cp->client->state.status & STAT_CANFOCUS) { + if(ShouldFocus(cp->client)) { + if(cp->client->state.status & STAT_ACTIVE) { + cp = cp->next; + goto ClientFound; + } + } } } } +ClientFound: - if(!tp) { - tp = taskBarNodesTail; - } - - while(tp && !ShouldFocus(tp->client)) { - tp = tp->prev; + /* Move to the previous group. */ + if(tp) { + do { + tp = tp->prev; + } while(tp && !ShouldFocusEntry(tp)); } - if(!tp) { - tp = taskBarNodesTail; - while(tp && !ShouldFocus(tp->client)) { - tp = tp->prev; + /* Wrap around; start at the end. */ + for(tp = taskEntriesTail; tp; tp = tp->prev) { + if(ShouldFocusEntry(tp)) { + break; + } } } + /* Focus the group if one exists. */ if(tp) { - RestoreClient(tp->client, 1); - FocusClient(tp->client); + FocusGroup(tp); } - } -/** Get the item associated with an x-coordinate on the task bar. */ -Node *GetNode(TaskBarType *bar, int x) { - - Node *tp; - int remainder; - int itemCount; - int itemWidth; - int index, stop; - int width; - - index = TASK_SPACER; - - itemCount = GetItemCount(); - - if(bar->layout == LAYOUT_HORIZONTAL) { - - width = bar->cp->width - index; - itemWidth = GetItemWidth(bar, itemCount); - remainder = width - itemWidth * itemCount; - - for(tp = taskBarNodes; tp; tp = tp->next) { - if(ShouldFocus(tp->client)) { - if(remainder) { - stop = index + itemWidth + 1; - --remainder; - } else { - stop = index + itemWidth; - } - if(x >= index && x < stop) { - return tp; - } - index = stop; - } +/** Determine if there is anything to show for the specified entry. */ +char ShouldShowEntry(const TaskEntry *tp) +{ + const ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(ShouldFocus(cp->client)) { + return 1; } - - } else { - - for(tp = taskBarNodes; tp; tp = tp->next) { - if(ShouldFocus(tp->client)) { - stop = index + bar->itemHeight; - if(x >= index && x < stop) { - return tp; - } - index = stop; - } - } - } - - return NULL; - + return 0; } -/** Get the number of items on the task bar. */ -unsigned int GetItemCount() { - - Node *tp; - unsigned int count; - - count = 0; - for(tp = taskBarNodes; tp; tp = tp->next) { - if(ShouldFocus(tp->client)) { - ++count; +/** Determine if we should attempt to focus an entry. */ +char ShouldFocusEntry(const TaskEntry *tp) +{ + const ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + if(cp->client->state.status & STAT_CANFOCUS) { + if(ShouldFocus(cp->client)) { + return 1; + } } } - - return count; - + return 0; } -/** Get the width of an item in the task bar. */ -unsigned int GetItemWidth(const TaskBarType *bp, unsigned int itemCount) { - - unsigned int itemWidth; - - itemWidth = bp->cp->width - TASK_SPACER; - - if(!itemCount) { - return itemWidth; - } - - itemWidth /= itemCount; - if(!itemWidth) { - itemWidth = 1; - } +/** Get the item associated with a coordinate on the task bar. */ +TaskEntry *GetEntry(TaskBarType *bar, int x, int y) +{ + TaskEntry *tp; + int offset; - if(bp->maxItemWidth > 0 && itemWidth > bp->maxItemWidth) { - itemWidth = bp->maxItemWidth; + offset = 0; + for(tp = taskEntries; tp; tp = tp->next) { + if(!ShouldShowEntry(tp)) { + continue; + } + if(bar->layout == LAYOUT_HORIZONTAL) { + offset += bar->itemWidth; + if(x < offset) { + return tp; + } + } else { + offset += bar->itemHeight; + if(y < offset) { + return tp; + } + } } - return itemWidth; - + return NULL; } /** Set the maximum width of an item in the task bar. */ -void SetMaxTaskBarItemWidth(TrayComponentType *cp, const char *value) { - +void SetMaxTaskBarItemWidth(TrayComponentType *cp, const char *value) +{ + TaskBarType *bp = (TaskBarType*)cp->object; int temp; - TaskBarType *bp; Assert(cp); + Assert(value); - if(value) { - temp = atoi(value); - if(JUNLIKELY(temp < 0)) { - Warning(_("invalid maxwidth for TaskList: %s"), value); - return; - } - bp = (TaskBarType*)cp->object; - bp->maxItemWidth = temp; - } - -} - -/** Set the way items are inserted into the task bar. */ -void SetTaskBarInsertMode(const char *mode) { - - if(!mode) { - insertMode = INSERT_RIGHT; + temp = atoi(value); + if(JUNLIKELY(temp < 0)) { + Warning(_("invalid maxwidth for TaskList: %s"), value); return; } - - if(!strcmp(mode, "right")) { - insertMode = INSERT_RIGHT; - } else if(!strcmp(mode, "left")) { - insertMode = INSERT_LEFT; - } else { - Warning(_("invalid insert mode: \"%s\""), mode); - insertMode = INSERT_RIGHT; - } - + bp->maxItemWidth = temp; } /** Maintain the _NET_CLIENT_LIST[_STACKING] properties on the root. */ -void UpdateNetClientList() { - - Node *np; +void UpdateNetClientList(void) +{ + TaskEntry *tp; ClientNode *client; Window *windows; - int count, temp; + unsigned int count; int layer; /* Determine how much we need to allocate. */ - count = 0; - for(np = taskBarNodes; np; np = np->next) { - ++count; - } - temp = 0; - for(layer = LAYER_BOTTOM; layer <= LAYER_TOP; layer++) { - for(client = nodes[layer]; client; client = client->next) { - ++temp; - } - } - if(temp > count) { - count = temp; - } - - if(count == 0) { + if(clientCount == 0) { windows = NULL; } else { - windows = AllocateStack(count * sizeof(Window)); + windows = AllocateStack(clientCount * sizeof(Window)); } /* Set _NET_CLIENT_LIST */ count = 0; - for(np = taskBarNodes; np; np = np->next) { - windows[count++] = np->client->window; + for(tp = taskEntries; tp; tp = tp->next) { + ClientEntry *cp; + for(cp = tp->clients; cp; cp = cp->next) { + windows[count] = cp->client->window; + count += 1; + } } + Assert(count <= clientCount); JXChangeProperty(display, rootWindow, atoms[ATOM_NET_CLIENT_LIST], - XA_WINDOW, 32, PropModeReplace, (unsigned char*)windows, count); + XA_WINDOW, 32, PropModeReplace, + (unsigned char*)windows, count); /* Set _NET_CLIENT_LIST_STACKING */ count = 0; - for(layer = LAYER_BOTTOM; layer <= LAYER_TOP; layer++) { + for(layer = FIRST_LAYER; layer <= LAST_LAYER; layer++) { for(client = nodes[layer]; client; client = client->next) { - windows[count++] = client->window; + windows[count] = client->window; + count += 1; } } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_CLIENT_LIST_STACKING], - XA_WINDOW, 32, PropModeReplace, (unsigned char*)windows, count); + XA_WINDOW, 32, PropModeReplace, + (unsigned char*)windows, count); if(windows != NULL) { ReleaseStack(windows); diff -Nru jwm-2.1.0+svn579/src/taskbar.h jwm-2.3.1+0~16~ubuntu14.10.1/src/taskbar.h --- jwm-2.1.0+svn579/src/taskbar.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/taskbar.h 2015-07-18 20:02:18.000000000 +0000 @@ -14,10 +14,10 @@ struct TimeType; /*@{*/ -void InitializeTaskBar(); -void StartupTaskBar(); -void ShutdownTaskBar(); -void DestroyTaskBar(); +void InitializeTaskBar(void); +#define StartupTaskBar() (void)(0) +void ShutdownTaskBar(void); +void DestroyTaskBar(void); /*@}*/ /** Create a new task bar tray component. */ @@ -33,15 +33,14 @@ */ void RemoveClientFromTaskBar(struct ClientNode *np); -void UpdateTaskBar(); - -void SignalTaskbar(const struct TimeType *now, int x, int y); +/** Update all task bars. */ +void UpdateTaskBar(void); /** Focus the next client in the task bar. */ -void FocusNext(); +void FocusNext(void); /** Focus the previous client in the task bar. */ -void FocusPrevious(); +void FocusPrevious(void); /** Set the maximum width of task bar items. * @param cp The task bar component. @@ -49,13 +48,8 @@ */ void SetMaxTaskBarItemWidth(struct TrayComponentType *cp, const char *value); -/** Set the insertion mode for task bars. - * @param mode The insertion mode (either right or left). - */ -void SetTaskBarInsertMode(const char *mode); - /** Update the _NET_CLIENT_LIST property. */ -void UpdateNetClientList(); +void UpdateNetClientList(void); #endif /* TASKBAR_H */ diff -Nru jwm-2.1.0+svn579/src/timing.c jwm-2.3.1+0~16~ubuntu14.10.1/src/timing.c --- jwm-2.1.0+svn579/src/timing.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/timing.c 2015-07-18 20:02:18.000000000 +0000 @@ -13,7 +13,8 @@ static const unsigned long MAX_TIME_SECONDS = 60; /** Get the current time in milliseconds since midnight 1970-01-01 UTC. */ -void GetCurrentTime(TimeType *t) { +void GetCurrentTime(TimeType *t) +{ struct timeval val; gettimeofday(&val, NULL); t->seconds = val.tv_sec; @@ -25,7 +26,8 @@ * MAX_TIME_SECONDS will be returned. * Note that the times must be normalized. */ -unsigned long GetTimeDifference(const TimeType *t1, const TimeType *t2) { +unsigned long GetTimeDifference(const TimeType *t1, const TimeType *t2) +{ unsigned long deltaSeconds; int deltaMs; @@ -52,7 +54,8 @@ } /** Get the current time. */ -const char *GetTimeString(const char *format, const char *zone) { +const char *GetTimeString(const char *format, const char *zone) +{ static char saveTZ[256]; static char newTZ[256]; @@ -92,5 +95,3 @@ return str; } - - diff -Nru jwm-2.1.0+svn579/src/traybutton.c jwm-2.3.1+0~16~ubuntu14.10.1/src/traybutton.c --- jwm-2.1.0+svn579/src/traybutton.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/traybutton.c 2015-07-18 20:02:18.000000000 +0000 @@ -1,5 +1,5 @@ /** - * @file traybutton.h + * @file traybutton.c * @author Joe Wingbermuehle * @date 2004-2006 * @@ -15,7 +15,6 @@ #include "error.h" #include "root.h" #include "main.h" -#include "color.h" #include "font.h" #include "button.h" #include "misc.h" @@ -25,8 +24,9 @@ #include "timing.h" #include "command.h" #include "cursor.h" - -#define BUTTON_SIZE 4 +#include "settings.h" +#include "event.h" +#include "action.h" typedef struct TrayButtonType { @@ -37,100 +37,90 @@ char *iconName; IconNode *icon; - char *action; - int mousex; int mousey; TimeType mouseTime; + struct ActionType *actions; struct TrayButtonType *next; } TrayButtonType; -static TrayButtonType *buttons; +static TrayButtonType *buttons = NULL; static void Create(TrayComponentType *cp); static void Destroy(TrayComponentType *cp); static void SetSize(TrayComponentType *cp, int width, int height); static void Resize(TrayComponentType *cp); -static void Draw(TrayComponentType *cp, int active); +static void Draw(TrayComponentType *cp); static void ProcessButtonPress(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int button); static void ProcessButtonRelease(TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int button); static void ProcessMotionEvent(TrayComponentType *cp, int x, int y, int mask); - -/** Initialize tray button data. */ -void InitializeTrayButtons() { - buttons = NULL; -} +static void SignalTrayButton(const TimeType *now, + int x, int y, Window w, void *data); /** Startup tray buttons. */ -void StartupTrayButtons() { - +void StartupTrayButtons(void) +{ TrayButtonType *bp; - for(bp = buttons; bp; bp = bp->next) { if(bp->label) { bp->cp->requestedWidth = GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; - bp->cp->requestedHeight - = GetStringHeight(FONT_TRAYBUTTON); + bp->cp->requestedHeight = GetStringHeight(FONT_TRAYBUTTON); } else { bp->cp->requestedWidth = 0; bp->cp->requestedHeight = 0; } if(bp->iconName) { - bp->icon = LoadNamedIcon(bp->iconName); + bp->icon = LoadNamedIcon(bp->iconName, 1, 1); if(JLIKELY(bp->icon)) { - bp->cp->requestedWidth += bp->icon->image->width; - bp->cp->requestedHeight += bp->icon->image->height; + bp->cp->requestedWidth += bp->icon->images->width + 4; + if(bp->label) { + bp->cp->requestedWidth -= 2; + } + bp->cp->requestedHeight + = Max(bp->icon->images->height + 4, bp->cp->requestedHeight); } else { Warning(_("could not load tray icon: \"%s\""), bp->iconName); } } - bp->cp->requestedWidth += 2 * BUTTON_SIZE; - bp->cp->requestedHeight += 2 * BUTTON_SIZE; } - -} - -/** Shutdown tray buttons. */ -void ShutdownTrayButtons() { - } /** Release tray button data. */ -void DestroyTrayButtons() { - +void DestroyTrayButtons(void) +{ TrayButtonType *bp; - while(buttons) { bp = buttons->next; + UnregisterCallback(SignalTrayButton, buttons); if(buttons->label) { Release(buttons->label); } if(buttons->iconName) { Release(buttons->iconName); } - if(buttons->action) { - Release(buttons->action); - } + DestroyActions(buttons->actions); if(buttons->popup) { Release(buttons->popup); } Release(buttons); buttons = bp; } - } /** Create a button tray component. */ TrayComponentType *CreateTrayButton(const char *iconName, - const char *label, const char *action, - const char *popup, int width, int height) { + const char *label, + const char *popup, + unsigned int width, + unsigned int height) +{ TrayButtonType *bp; TrayComponentType *cp; @@ -141,15 +131,6 @@ return NULL; } - if(JUNLIKELY(width < 0)) { - Warning(_("invalid TrayButton width: %d"), width); - width = 0; - } - if(JUNLIKELY(height < 0)) { - Warning(_("invalid TrayButton height: %d"), height); - height = 0; - } - bp = Allocate(sizeof(TrayButtonType)); bp->next = buttons; buttons = bp; @@ -157,7 +138,7 @@ bp->icon = NULL; bp->iconName = CopyString(iconName); bp->label = CopyString(label); - bp->action = CopyString(action); + bp->actions = NULL; bp->popup = CopyString(popup); cp = CreateTrayComponent(); @@ -166,13 +147,14 @@ cp->requestedWidth = width; cp->requestedHeight = height; - bp->mousex = -POPUP_DELTA; - bp->mousey = -POPUP_DELTA; + bp->mousex = -settings.doubleClickDelta; + bp->mousey = -settings.doubleClickDelta; cp->Create = Create; cp->Destroy = Destroy; cp->SetSize = SetSize; cp->Resize = Resize; + cp->Redraw = Draw; cp->ProcessButtonPress = ProcessButtonPress; cp->ProcessButtonRelease = ProcessButtonRelease; @@ -180,32 +162,45 @@ cp->ProcessMotionEvent = ProcessMotionEvent; } + RegisterCallback(settings.popupDelay / 2, SignalTrayButton, bp); + return cp; } +/** Add a action to a tray button. */ +void AddTrayButtonAction(TrayComponentType *cp, + const char *action, + int mask) +{ + TrayButtonType *bp = (TrayButtonType*)cp->object; + AddAction(&bp->actions, action, mask); +} + /** Set the size of a button tray component. */ -void SetSize(TrayComponentType *cp, int width, int height) { +void SetSize(TrayComponentType *cp, int width, int height) +{ TrayButtonType *bp; - int labelWidth, labelHeight; - int iconWidth, iconHeight; - int ratio; bp = (TrayButtonType*)cp->object; if(bp->icon) { + int labelWidth, labelHeight; + int iconWidth, iconHeight; + int ratio; + if(bp->label) { - labelWidth = GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; - labelHeight = GetStringHeight(FONT_TRAYBUTTON); + labelWidth = GetStringWidth(FONT_TRAYBUTTON, bp->label) + 6; + labelHeight = GetStringHeight(FONT_TRAYBUTTON) + 6; } else { - labelWidth = 0; - labelHeight = 0; + labelWidth = 4; + labelHeight = 4; } - iconWidth = bp->icon->image->width; - iconHeight = bp->icon->image->height; + iconWidth = bp->icon->images->width; + iconHeight = bp->icon->images->height; /* Fixed point with 16 bit fraction. */ ratio = (iconWidth << 16) / iconHeight; @@ -213,16 +208,16 @@ if(width > 0) { /* Compute height from width. */ - iconWidth = width - labelWidth - 2 * BUTTON_SIZE; + iconWidth = width - labelWidth; iconHeight = (iconWidth << 16) / ratio; - height = Max(iconHeight, labelHeight) + 2 * BUTTON_SIZE; + height = Max(labelHeight, iconHeight + 4); } else if(height > 0) { /* Compute width from height. */ - iconHeight = height - 2 * BUTTON_SIZE; + iconHeight = height - 4; iconWidth = (iconHeight * ratio) >> 16; - width = iconWidth + labelWidth + 2 * BUTTON_SIZE; + width = iconWidth + labelWidth; } @@ -234,238 +229,106 @@ } /** Initialize a button tray component. */ -void Create(TrayComponentType *cp) { - - TrayButtonType *bp; - - bp = (TrayButtonType*)cp->object; - - /* Validate the action for this tray button. */ - if(bp->action && strlen(bp->action) > 0) { - if(!strncmp(bp->action, "exec:", 5)) { - /* Valid. */ - } else if(!strncmp(bp->action, "root:", 5)) { - /* Valid. However, the specified root menu may not exist. - * This case is handled in ValidateTrayButtons. - */ - } else if(!strcmp(bp->action, "showdesktop")) { - /* Valid. */ - } else { - Warning(_("invalid TrayButton action: \"%s\""), bp->action); - } - } else { - /* Valid. However, root menu 1 may not exist. - * This case is handled in ValidateTrayButtons. - */ - } - +void Create(TrayComponentType *cp) +{ cp->pixmap = JXCreatePixmap(display, rootWindow, - cp->width, cp->height, rootDepth); - - Draw(cp, 0); - + cp->width, cp->height, rootVisual.depth); + Draw(cp); } /** Resize a button tray component. */ -void Resize(TrayComponentType *cp) { - +void Resize(TrayComponentType *cp) +{ Destroy(cp); Create(cp); - } /** Destroy a button tray component. */ -void Destroy(TrayComponentType *cp) { +void Destroy(TrayComponentType *cp) +{ if(cp->pixmap != None) { JXFreePixmap(display, cp->pixmap); } } /** Draw a tray button. */ -void Draw(TrayComponentType *cp, int active) { +void Draw(TrayComponentType *cp) +{ ButtonNode button; TrayButtonType *bp; - int labelx; bp = (TrayButtonType*)cp->object; - JXSetForeground(display, rootGC, colors[COLOR_TRAYBUTTON_BG]); - JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); - - ResetButton(&button, cp->pixmap, rootGC); - if(active) { - button.type = BUTTON_TASK_ACTIVE; + ClearTrayDrawable(cp); + ResetButton(&button, cp->pixmap, &rootVisual); + if(cp->grabbed) { + button.type = BUTTON_TRAY_ACTIVE; } else { - button.type = BUTTON_TASK; + button.type = BUTTON_TRAY; } - button.width = cp->width - 3; - button.height = cp->height - 3; - button.x = 1; - button.y = 1; + button.width = cp->width; + button.height = cp->height; + button.x = 0; + button.y = 0; + button.font = FONT_TRAYBUTTON; + button.text = bp->label; + button.icon = bp->icon; DrawButton(&button); - /* Compute the offset of the text. */ - if(bp->label) { - if(!bp->icon) { - labelx = 2 + cp->width / 2; - labelx -= GetStringWidth(FONT_TRAYBUTTON, bp->label) / 2; - } else { - labelx = cp->width; - labelx -= GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; - } - } else { - labelx = cp->width; - } - labelx -= BUTTON_SIZE; - - if(bp->icon) { - PutIcon(bp->icon, cp->pixmap, BUTTON_SIZE, BUTTON_SIZE, - labelx - BUTTON_SIZE, cp->height - BUTTON_SIZE * 2); - } - - if(bp->label) { - RenderString(cp->pixmap, FONT_TRAYBUTTON, COLOR_TRAYBUTTON_FG, - labelx + 2, cp->height / 2 - GetStringHeight(FONT_TRAYBUTTON) / 2, - cp->width - labelx, NULL, bp->label); - } - } /** Process a button press. */ -void ProcessButtonPress(TrayComponentType *cp, int x, int y, int mask) { - - const ScreenType *sp; - int mwidth, mheight; - int button; - - TrayButtonType *bp = (TrayButtonType*)cp->object; - - Assert(bp); - - if(bp->action && strlen(bp->action) > 0) { - if(strncmp(bp->action, "root:", 5)) { - GrabMouse(cp->tray->window); - cp->grabbed = 1; - Draw(cp, 1); - UpdateSpecificTray(cp->tray, cp); - return; - } else { - button = atoi(bp->action + 5); - } - } else { - button = 1; - } - - GetRootMenuSize(button, &mwidth, &mheight); - - sp = GetCurrentScreen(cp->screenx, cp->screeny); - - if(cp->tray->layout == LAYOUT_HORIZONTAL) { - x = cp->screenx; - if(cp->screeny + cp->height / 2 < sp->y + sp->height / 2) { - y = cp->screeny + cp->height; - } else { - y = cp->screeny - mheight; - } - } else { - y = cp->screeny; - if(cp->screenx + cp->width / 2 < sp->x + sp->width / 2) { - x = cp->screenx + cp->width; - } else { - x = cp->screenx - mwidth; - } - } - - Draw(cp, 1); - UpdateSpecificTray(cp->tray, cp); - ShowRootMenu(button, x, y); - Draw(cp, 0); - UpdateSpecificTray(cp->tray, cp); - +void ProcessButtonPress(TrayComponentType *cp, int x, int y, int button) +{ + const TrayButtonType *bp = (TrayButtonType*)cp->object; + ProcessActionPress(bp->actions, cp, x, y, button); } /** Process a button release. */ -void ProcessButtonRelease(TrayComponentType *cp, int x, int y, int mask) { - - TrayButtonType *bp = (TrayButtonType*)cp->object; - - Assert(bp); - - Draw(cp, 0); - UpdateSpecificTray(cp->tray, cp); - - // Since we grab the mouse, make sure the mouse is actually - // over the button. - if(x < 0 || x >= cp->width) { - return; - } - if(y < 0 || y >= cp->height) { - return; - } - - // Run the tray button action (if any). - if(bp->action && strlen(bp->action) > 0) { - if(!strncmp(bp->action, "exec:", 5)) { - RunCommand(bp->action + 5); - return; - } else if(!strcmp(bp->action, "showdesktop")) { - ShowDesktop(); - return; - } - } - +void ProcessButtonRelease(TrayComponentType *cp, int x, int y, int button) +{ + const TrayButtonType *bp = (TrayButtonType*)cp->object; + ProcessActionRelease(bp->actions, cp, x, y, button); } /** Process a motion event. */ -void ProcessMotionEvent(TrayComponentType *cp, int x, int y, int mask) { - +void ProcessMotionEvent(TrayComponentType *cp, int x, int y, int mask) +{ TrayButtonType *bp = (TrayButtonType*)cp->object; - bp->mousex = cp->screenx + x; bp->mousey = cp->screeny + y; GetCurrentTime(&bp->mouseTime); - } /** Signal (needed for popups). */ -void SignalTrayButton(const TimeType *now, int x, int y) { - - TrayButtonType *bp; +void SignalTrayButton(const TimeType *now, int x, int y, Window w, void *data) +{ + TrayButtonType *bp = (TrayButtonType*)data; const char *popup; - for(bp = buttons; bp; bp = bp->next) { - if(bp->popup) { - popup = bp->popup; - } else if(bp->label) { - popup = bp->label; - } else { - continue; - } - if(abs(bp->mousex - x) < POPUP_DELTA - && abs(bp->mousey - y) < POPUP_DELTA) { - if(GetTimeDifference(now, &bp->mouseTime) >= popupDelay) { - ShowPopup(x, y, popup); - } + if(bp->popup) { + popup = bp->popup; + } else if(bp->label) { + popup = bp->label; + } else { + return; + } + if(bp->cp->tray->window == w && + abs(bp->mousex - x) < settings.doubleClickDelta && + abs(bp->mousey - y) < settings.doubleClickDelta) { + if(GetTimeDifference(now, &bp->mouseTime) >= settings.popupDelay) { + ShowPopup(x, y, popup); } } - } /** Validate tray buttons. */ -void ValidateTrayButtons() { - - TrayButtonType *bp; - int bindex; - +void ValidateTrayButtons(void) +{ + const TrayButtonType *bp; for(bp = buttons; bp; bp = bp->next) { - if(bp->action && !strncmp(bp->action, "root:", 5)) { - bindex = atoi(bp->action + 5); - if(JUNLIKELY(!IsRootMenuDefined(bindex))) { - Warning(_("tray button: root menu %d not defined"), bindex); - } - } + ValidateActions(bp->actions); } - } diff -Nru jwm-2.1.0+svn579/src/traybutton.h jwm-2.3.1+0~16~ubuntu14.10.1/src/traybutton.h --- jwm-2.1.0+svn579/src/traybutton.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/traybutton.h 2015-07-18 20:02:18.000000000 +0000 @@ -14,38 +14,41 @@ struct TimeType; /*@{*/ -void InitializeTrayButtons(); -void StartupTrayButtons(); -void ShutdownTrayButtons(); -void DestroyTrayButtons(); +#define InitializeTrayButtons() (void)(0) +void StartupTrayButtons(void); +#define ShutdownTrayButtons() (void)(0) +void DestroyTrayButtons(void); /*@}*/ /** Create a tray button component. * @param iconName The name of the icon to use for the button. * @param label The label to use for the button. - * @param action The action to take when the button is clicked. * @param popup Text to display in a popup window. * @param width The width to use for the button (0 for default). * @param height The height to use for the button (0 for default). * @return A new tray button component. */ -struct TrayComponentType *CreateTrayButton( - const char *iconName, const char *label, const char *action, - const char *popup, int width, int height); - -/** Signal a tray button. - * @param now The current time. - * @param x The x-coordinate of the mouse (root relative). - * @param y The y-coordinate of the mouse (root relative). +struct TrayComponentType *CreateTrayButton(const char *iconName, + const char *label, + const char *popup, + unsigned int width, + unsigned int height); + +/** Add an action to a tray button. + * @param cp The tray button. + * @param action The action to take. + * @param mask The mouse button mask. */ -void SignalTrayButton(const struct TimeType *now, int x, int y); +void AddTrayButtonAction(struct TrayComponentType *cp, + const char *action, + int mask); /** Validate the tray buttons and print a warning if something is wrong. * This is called after parsing the configuration file(s) to determine * if a root menu is defined for each each tray button that specifies * a root menu. */ -void ValidateTrayButtons(); +void ValidateTrayButtons(void); #endif /* TRAY_BUTTON_H */ diff -Nru jwm-2.1.0+svn579/src/tray.c jwm-2.3.1+0~16~ubuntu14.10.1/src/tray.c --- jwm-2.1.0+svn579/src/tray.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/tray.c 2015-07-18 20:02:18.000000000 +0000 @@ -18,14 +18,16 @@ #include "menu.h" #include "timing.h" #include "screen.h" +#include "settings.h" +#include "event.h" +#include "client.h" +#include "misc.h" #define DEFAULT_TRAY_WIDTH 32 #define DEFAULT_TRAY_HEIGHT 32 static TrayType *trays; -static Window supportingWindow; -static int trayCount; -static unsigned int trayOpacity; +static unsigned int trayCount; static void HandleTrayExpose(TrayType *tp, const XExposeEvent *event); static void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event); @@ -40,24 +42,28 @@ static int ComputeTotalWidth(TrayType *tp); static int ComputeMaxHeight(TrayType *tp); static int ComputeTotalHeight(TrayType *tp); -static int CheckHorizontalFill(TrayType *tp); -static int CheckVerticalFill(TrayType *tp); +static char CheckHorizontalFill(TrayType *tp); +static char CheckVerticalFill(TrayType *tp); static void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder); +static void SignalTray(const TimeType *now, int x, int y, Window w, + void *data); + + /** Initialize tray data. */ -void InitializeTray() { +void InitializeTray(void) +{ trays = NULL; trayCount = 0; - supportingWindow = None; - trayOpacity = UINT_MAX; } /** Startup trays. */ -void StartupTray() { +void StartupTray(void) +{ XSetWindowAttributes attr; - Atom opacityAtom; + Atom atom; unsigned long attrMask; TrayType *tp; TrayComponentType *cp; @@ -89,51 +95,58 @@ | PointerMotionMask; attrMask |= CWBackPixel; - attr.background_pixel = colors[COLOR_TRAY_BG]; + attr.background_pixel = colors[COLOR_TRAY_BG2]; + + attrMask |= CWBorderPixel; + attr.border_pixel = colors[COLOR_TRAY_OUTLINE]; + Assert(tp->width > 0); + Assert(tp->height > 0); tp->window = JXCreateWindow(display, rootWindow, - tp->x, tp->y, tp->width, tp->height, - 0, rootDepth, InputOutput, rootVisual, attrMask, &attr); + tp->x, tp->y, tp->width, tp->height, + TRAY_BORDER_SIZE, + rootVisual.depth, InputOutput, + rootVisual.visual, attrMask, &attr); - if(trayOpacity < UINT_MAX) { + if(settings.trayOpacity < UINT_MAX) { /* Can't use atoms yet as it hasn't been initialized. */ - opacityAtom = JXInternAtom(display, "_NET_WM_WINDOW_OPACITY", False); - JXChangeProperty(display, tp->window, opacityAtom, XA_CARDINAL, 32, - PropModeReplace, (unsigned char*)&trayOpacity, 1); - JXSync(display, False); + atom = JXInternAtom(display, opacityAtom, False); + JXChangeProperty(display, tp->window, atom, XA_CARDINAL, 32, + PropModeReplace, + (unsigned char*)&settings.trayOpacity, 1); } SetDefaultCursor(tp->window); /* Create and layout items on the tray. */ - xoffset = tp->border; - yoffset = tp->border; + xoffset = 0; + yoffset = 0; for(cp = tp->components; cp; cp = cp->next) { if(cp->Create) { if(tp->layout == LAYOUT_HORIZONTAL) { - height = tp->height - 2 * tp->border; + height = tp->height; width = cp->width; if(width == 0) { width = variableSize; if(variableRemainder) { - ++width; - --variableRemainder; + width += 1; + variableRemainder -= 1; } } } else { - width = tp->width - 2 * tp->border; + width = tp->width; height = cp->height; if(height == 0) { height = variableSize; if(variableRemainder) { - ++height; - --variableRemainder; + height += 1; + variableRemainder -= 1; } } } - cp->width = width; - cp->height = height; + cp->width = Max(1, width); + cp->height = Max(1, height); (cp->Create)(cp); } @@ -144,7 +157,7 @@ if(cp->window != None) { JXReparentWindow(display, cp->window, tp->window, - xoffset, yoffset); + xoffset, yoffset); } if(tp->layout == LAYOUT_HORIZONTAL) { @@ -157,17 +170,18 @@ /* Show the tray. */ JXMapWindow(display, tp->window); - ++trayCount; + trayCount += 1; } - UpdatePager(); - UpdateTaskBar(); + RequirePagerUpdate(); + RequireTaskUpdate(); } /** Shutdown trays. */ -void ShutdownTray() { +void ShutdownTray(void) +{ TrayType *tp; TrayComponentType *cp; @@ -181,22 +195,18 @@ JXDestroyWindow(display, tp->window); } - if(supportingWindow != None) { - XDestroyWindow(display, supportingWindow); - supportingWindow = None; - } - } /** Destroy tray data. */ -void DestroyTray() { +void DestroyTray(void) +{ TrayType *tp; TrayComponentType *cp; while(trays) { tp = trays->next; - + UnregisterCallback(SignalTray, trays); while(trays->components) { cp = trays->components->next; Release(trays->components); @@ -210,25 +220,27 @@ } /** Create an empty tray. */ -TrayType *CreateTray() { +TrayType *CreateTray(void) +{ TrayType *tp; tp = Allocate(sizeof(TrayType)); + tp->requestedX = 0; + tp->requestedY = -1; tp->x = 0; tp->y = -1; tp->requestedWidth = 0; tp->requestedHeight = 0; tp->width = 0; tp->height = 0; - tp->border = 1; tp->layer = DEFAULT_TRAY_LAYER; tp->layout = LAYOUT_HORIZONTAL; tp->valign = TALIGN_FIXED; tp->halign = TALIGN_FIXED; - tp->autoHide = 0; + tp->autoHide = THIDE_OFF; tp->hidden = 0; tp->window = None; @@ -239,12 +251,15 @@ tp->next = trays; trays = tp; + RegisterCallback(100, SignalTray, tp); + return tp; } /** Create an empty tray component. */ -TrayComponentType *CreateTrayComponent() { +TrayComponentType *CreateTrayComponent(void) +{ TrayComponentType *cp; @@ -273,6 +288,7 @@ cp->ProcessButtonPress = NULL; cp->ProcessButtonRelease = NULL; cp->ProcessMotionEvent = NULL; + cp->Redraw = NULL; cp->next = NULL; @@ -281,7 +297,8 @@ } /** Add a tray component to a tray. */ -void AddTrayComponent(TrayType *tp, TrayComponentType *cp) { +void AddTrayComponent(TrayType *tp, TrayComponentType *cp) +{ Assert(tp); Assert(cp); @@ -299,7 +316,8 @@ } /** Compute the max component width. */ -int ComputeMaxWidth(TrayType *tp) { +int ComputeMaxWidth(TrayType *tp) +{ TrayComponentType *cp; int result; @@ -309,7 +327,6 @@ for(cp = tp->components; cp; cp = cp->next) { temp = cp->width; if(temp > 0) { - temp += 2 * tp->border; if(temp > result) { result = temp; } @@ -321,12 +338,13 @@ } /** Compute the total width of a tray. */ -int ComputeTotalWidth(TrayType *tp) { +int ComputeTotalWidth(TrayType *tp) +{ TrayComponentType *cp; int result; - result = 2 * tp->border; + result = 0; for(cp = tp->components; cp; cp = cp->next) { result += cp->width; } @@ -336,7 +354,8 @@ } /** Compute the max component height. */ -int ComputeMaxHeight(TrayType *tp) { +int ComputeMaxHeight(TrayType *tp) +{ TrayComponentType *cp; int result; @@ -346,7 +365,6 @@ for(cp = tp->components; cp; cp = cp->next) { temp = cp->height; if(temp > 0) { - temp += 2 * tp->border; if(temp > result) { result = temp; } @@ -358,12 +376,13 @@ } /** Compute the total height of a tray. */ -int ComputeTotalHeight(TrayType *tp) { +int ComputeTotalHeight(TrayType *tp) +{ TrayComponentType *cp; int result; - result = 2 * tp->border; + result = 0; for(cp = tp->components; cp; cp = cp->next) { result += cp->height; } @@ -373,7 +392,8 @@ } /** Check if the tray fills the screen horizontally. */ -int CheckHorizontalFill(TrayType *tp) { +char CheckHorizontalFill(TrayType *tp) +{ TrayComponentType *cp; @@ -388,7 +408,8 @@ } /** Check if the tray fills the screen vertically. */ -int CheckVerticalFill(TrayType *tp) { +char CheckVerticalFill(TrayType *tp) +{ TrayComponentType *cp; @@ -403,7 +424,8 @@ } /** Compute the size of a tray. */ -void ComputeTraySize(TrayType *tp) { +void ComputeTraySize(TrayType *tp) +{ TrayComponentType *cp; const ScreenType *sp; @@ -415,7 +437,6 @@ if(tp->height == 0) { tp->height = ComputeMaxHeight(tp); } - if(tp->height == 0) { tp->height = DEFAULT_TRAY_HEIGHT; } @@ -425,7 +446,6 @@ if(tp->width == 0) { tp->width = ComputeMaxWidth(tp); } - if(tp->width == 0) { tp->width = DEFAULT_TRAY_WIDTH; } @@ -436,13 +456,17 @@ for(cp = tp->components; cp; cp = cp->next) { if(cp->SetSize) { if(tp->layout == LAYOUT_HORIZONTAL) { - (cp->SetSize)(cp, 0, tp->height - 2 * tp->border); + (cp->SetSize)(cp, 0, tp->height); } else { - (cp->SetSize)(cp, tp->width - 2 * tp->border, 0); + (cp->SetSize)(cp, tp->width, 0); } } } + /* Initialize the coordinates. */ + tp->x = tp->requestedX; + tp->y = tp->requestedY; + /* Determine on which screen the tray will reside. */ switch(tp->valign) { case TALIGN_TOP: @@ -510,34 +534,38 @@ /* Compute the tray location. */ switch(tp->valign) { case TALIGN_TOP: - tp->y = 0; + tp->y = sp->y - TRAY_BORDER_SIZE; break; case TALIGN_BOTTOM: - tp->y = sp->height - tp->height + 1; + tp->y = sp->y + sp->height - tp->height + TRAY_BORDER_SIZE; break; case TALIGN_CENTER: - tp->y = (sp->height - tp->height) / 2; + tp->y = sp->y + (sp->height - tp->height) / 2; break; default: if(tp->y < 0) { - tp->y = sp->height + tp->y - tp->height + 1; + tp->y = sp->y + sp->height - tp->height + TRAY_BORDER_SIZE; + } else { + tp->y -= TRAY_BORDER_SIZE; } break; } switch(tp->halign) { case TALIGN_LEFT: - tp->x = 0; + tp->x = sp->x - TRAY_BORDER_SIZE; break; case TALIGN_RIGHT: - tp->x = sp->width - tp->width + 1; + tp->x = sp->x + sp->width - tp->width + TRAY_BORDER_SIZE; break; case TALIGN_CENTER: - tp->x = (sp->width - tp->width) / 2; + tp->x = sp->x + (sp->width - tp->width) / 2; break; default: if(tp->x < 0) { - tp->x = sp->width + tp->x - tp->width + 1; + tp->x = sp->x + sp->width - tp->width + TRAY_BORDER_SIZE; + } else { + tp->x -= TRAY_BORDER_SIZE; } break; } @@ -545,7 +573,8 @@ } /** Display a tray (for autohide). */ -void ShowTray(TrayType *tp) { +void ShowTray(TrayType *tp) +{ Window win1, win2; int winx, winy; @@ -558,15 +587,16 @@ JXMoveWindow(display, tp->window, tp->x, tp->y); JXQueryPointer(display, rootWindow, &win1, &win2, - &mousex, &mousey, &winx, &winy, &mask); - SetMousePosition(mousex, mousey); + &mousex, &mousey, &winx, &winy, &mask); + SetMousePosition(mousex, mousey, win2); } } /** Show all trays. */ -void ShowAllTrays() { +void ShowAllTrays(void) +{ TrayType *tp; @@ -581,42 +611,52 @@ } /** Hide a tray (for autohide). */ -void HideTray(TrayType *tp) { +void HideTray(TrayType *tp) +{ + const ScreenType *sp; int x, y; + /* Don't hide if the tray is raised. */ + if(tp->autoHide & THIDE_RAISED) { + return; + } + tp->hidden = 1; /* Determine where to move the tray. */ - if(tp->layout == LAYOUT_HORIZONTAL) { - - x = tp->x; - - if(tp->y >= rootHeight / 2) { - y = rootHeight - 1; - } else { - y = 1 - tp->height; - } - - } else { - + sp = GetCurrentScreen(tp->x, tp->y); + switch(tp->autoHide) { + case THIDE_LEFT: + x = sp->y - tp->width - TRAY_BORDER_SIZE; y = tp->y; - - if(tp->x >= rootWidth / 2) { - x = rootWidth - 1; - } else { - x = 1 - tp->width; - } - + break; + case THIDE_RIGHT: + x = sp->y + sp->width - TRAY_BORDER_SIZE; + y = tp->y; + break; + case THIDE_TOP: + x = tp->x; + y = sp->y - tp->height - TRAY_BORDER_SIZE; + break; + case THIDE_BOTTOM: + x = tp->x; + y = sp->y + sp->height - TRAY_BORDER_SIZE; + break; + default: + Assert(0); + break; } - /* Move it. */ + /* Move and redraw. */ JXMoveWindow(display, tp->window, x, y); + DrawSpecificTray(tp); } /** Process a tray event. */ -int ProcessTrayEvent(const XEvent *event) { +char ProcessTrayEvent(const XEvent *event) +{ TrayType *tp; @@ -649,56 +689,52 @@ } /** Signal the tray (needed for autohide). */ -void SignalTray(const TimeType *now, int x, int y) { - - TrayType *tp; - - for(tp = trays; tp; tp = tp->next) { - if(tp->autoHide && !tp->hidden && !menuShown) { - if(x < tp->x || x >= tp->x + tp->width - || y < tp->y || y >= tp->y + tp->height) { - HideTray(tp); - } +void SignalTray(const TimeType *now, int x, int y, Window w, void *data) +{ + TrayType *tp = (TrayType*)data; + if(tp->autoHide != THIDE_OFF && !tp->hidden && !menuShown) { + if(x < tp->x || x >= tp->x + tp->width + || y < tp->y || y >= tp->y + tp->height) { + HideTray(tp); } } - } /** Handle a tray expose event. */ -void HandleTrayExpose(TrayType *tp, const XExposeEvent *event) { - +void HandleTrayExpose(TrayType *tp, const XExposeEvent *event) +{ DrawSpecificTray(tp); - } /** Handle a tray enter notify (for autohide). */ -void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event) { - +void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event) +{ ShowTray(tp); - } /** Get the tray component under the given coordinates. */ -TrayComponentType *GetTrayComponent(TrayType *tp, int x, int y) { +TrayComponentType *GetTrayComponent(TrayType *tp, int x, int y) +{ TrayComponentType *cp; int xoffset, yoffset; - int width, height; - xoffset = tp->border; - yoffset = tp->border; + xoffset = 0; + yoffset = 0; for(cp = tp->components; cp; cp = cp->next) { - width = cp->width; - height = cp->height; - if(x >= xoffset && x < xoffset + width) { - if(y >= yoffset && y < yoffset + height) { + int startx = xoffset; + int starty = yoffset; + int width = cp->width; + int height = cp->height; + if(x >= startx && x < startx + width) { + if(y >= starty && y < starty + height) { return cp; } } if(tp->layout == LAYOUT_HORIZONTAL) { - xoffset += width; + xoffset += cp->width; } else { - yoffset += height; + yoffset += cp->height; } } @@ -707,35 +743,29 @@ } /** Handle a button press on a tray. */ -void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event) { - - TrayComponentType *cp; - int x, y; - int mask; - - cp = GetTrayComponent(tp, event->x, event->y); +void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event) +{ + TrayComponentType *cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessButtonPress) { - x = event->x - cp->x; - y = event->y - cp->y; - mask = event->button; + const int x = event->x - cp->x; + const int y = event->y - cp->y; + const int mask = event->button; (cp->ProcessButtonPress)(cp, x, y, mask); } - } /** Handle a button release on a tray. */ -void HandleTrayButtonRelease(TrayType *tp, const XButtonEvent *event) { +void HandleTrayButtonRelease(TrayType *tp, const XButtonEvent *event) +{ TrayComponentType *cp; - int x, y; - int mask; // First inform any components that have a grab. for(cp = tp->components; cp; cp = cp->next) { if(cp->grabbed) { - x = event->x - cp->x; - y = event->y - cp->y; - mask = event->button; + const int x = event->x - cp->x; + const int y = event->y - cp->y; + const int mask = event->button; (cp->ProcessButtonRelease)(cp, x, y, mask); JXUngrabPointer(display, CurrentTime); cp->grabbed = 0; @@ -745,33 +775,31 @@ cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessButtonRelease) { - x = event->x - cp->x; - y = event->y - cp->y; - mask = event->button; + const int x = event->x - cp->x; + const int y = event->y - cp->y; + const int mask = event->button; (cp->ProcessButtonRelease)(cp, x, y, mask); } } /** Handle a motion notify event. */ -void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event) { - - TrayComponentType *cp; - int x, y; - int mask; +void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event) +{ - cp = GetTrayComponent(tp, event->x, event->y); + TrayComponentType *cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessMotionEvent) { - x = event->x - cp->x; - y = event->y - cp->y; - mask = event->state; + const int x = event->x - cp->x; + const int y = event->y - cp->y; + const int mask = event->state; (cp->ProcessMotionEvent)(cp, x, y, mask); } } /** Draw all trays. */ -void DrawTray() { +void DrawTray(void) +{ TrayType *tp; @@ -786,49 +814,48 @@ } /** Draw a specific tray. */ -void DrawSpecificTray(const TrayType *tp) { +void DrawSpecificTray(const TrayType *tp) +{ TrayComponentType *cp; - int x; - - Assert(tp); - /* Draw components. */ for(cp = tp->components; cp; cp = cp->next) { UpdateSpecificTray(tp, cp); } - /* Draw the border. */ - for(x = 0; x < tp->border; x++) { - - /* Top */ - JXSetForeground(display, rootGC, colors[COLOR_TRAY_UP]); - JXDrawLine(display, tp->window, rootGC, 0, x, - tp->width - x - 1, x); - - /* Bottom */ - JXSetForeground(display, rootGC, colors[COLOR_TRAY_DOWN]); - JXDrawLine(display, tp->window, rootGC, x + 1, tp->height - x - 1, - tp->width - x - 2, tp->height - x - 1); - - /* Left */ - JXSetForeground(display, rootGC, colors[COLOR_TRAY_UP]); - JXDrawLine(display, tp->window, rootGC, x, x, - x, tp->height - x - 1); - - /* Right */ - JXSetForeground(display, rootGC, colors[COLOR_TRAY_DOWN]); - JXDrawLine(display, tp->window, rootGC, tp->width - x - 1, x + 1, - tp->width - x - 1, tp->height - x - 1); +} +/** Raise tray windows. */ +void RaiseTrays(void) +{ + TrayType *tp; + for(tp = trays; tp; tp = tp->next) { + tp->autoHide |= THIDE_RAISED; + ShowTray(tp); + JXRaiseWindow(display, tp->window); } +} +/** Lower tray windows. */ +void LowerTrays(void) +{ + TrayType *tp; + for(tp = trays; tp; tp = tp->next) { + tp->autoHide &= ~THIDE_RAISED; + } + RequireRestack(); } /** Update a specific component on a tray. */ -void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp) { +void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp) +{ - if(cp->pixmap != None && !shouldExit) { + if(JUNLIKELY(shouldExit)) { + return; + } + + /* If the tray is hidden, draw only the background. */ + if(!tp->hidden && cp->pixmap != None) { JXCopyArea(display, cp->pixmap, tp->window, rootGC, 0, 0, cp->width, cp->height, cp->x, cp->y); } @@ -836,10 +863,11 @@ } /** Layout tray components on a tray. */ -void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder) { +void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder) +{ TrayComponentType *cp; - int variableCount; + unsigned int variableCount; int width, height; int temp; @@ -855,8 +883,8 @@ /* Get the remaining size after setting fixed size components. */ /* Also, keep track of the number of variable size components. */ - width = tp->width - 2 * tp->border; - height = tp->height - 2 * tp->border; + width = tp->width; + height = tp->height; variableCount = 0; for(cp = tp->components; cp; cp = cp->next) { if(tp->layout == LAYOUT_HORIZONTAL) { @@ -864,14 +892,14 @@ if(temp > 0) { width -= temp; } else { - ++variableCount; + variableCount += 1; } } else { temp = cp->height; if(temp > 0) { height -= temp; } else { - ++variableCount; + variableCount += 1; } } } @@ -902,10 +930,14 @@ } } + tp->width = Max(1, tp->width); + tp->height = Max(1, tp->height); + } /** Resize a tray. */ -void ResizeTray(TrayType *tp) { +void ResizeTray(TrayType *tp) +{ TrayComponentType *cp; int variableSize; @@ -918,8 +950,8 @@ LayoutTray(tp, &variableSize, &variableRemainder); /* Reposition items on the tray. */ - xoffset = tp->border; - yoffset = tp->border; + xoffset = 0; + yoffset = 0; for(cp = tp->components; cp; cp = cp->next) { cp->x = xoffset; @@ -929,23 +961,23 @@ if(cp->Resize) { if(tp->layout == LAYOUT_HORIZONTAL) { - height = tp->height - 2 * tp->border; + height = tp->height; width = cp->width; if(width == 0) { width = variableSize; if(variableRemainder) { - ++width; - --variableRemainder; + width += 1; + variableRemainder -= 1; } } } else { - width = tp->width - 2 * tp->border; + width = tp->width; height = cp->height; if(height == 0) { height = variableSize; if(variableRemainder) { - ++height; - --variableRemainder; + height += 1; + variableRemainder -= 1; } } } @@ -966,9 +998,9 @@ } JXMoveResizeWindow(display, tp->window, tp->x, tp->y, - tp->width, tp->height); + tp->width, tp->height); - UpdateTaskBar(); + RequireTaskUpdate(); DrawSpecificTray(tp); if(tp->hidden) { @@ -977,53 +1009,58 @@ } +/** Draw the tray background on a drawable. */ +void ClearTrayDrawable(const TrayComponentType *cp) +{ + const Drawable d = cp->pixmap != None ? cp->pixmap : cp->window; + if(colors[COLOR_TRAY_BG1] == colors[COLOR_TRAY_BG2]) { + JXSetForeground(display, rootGC, colors[COLOR_TRAY_BG1]); + JXFillRectangle(display, d, rootGC, 0, 0, cp->width, cp->height); + } else { + DrawHorizontalGradient(d, rootGC, colors[COLOR_TRAY_BG1], + colors[COLOR_TRAY_BG2], 0, 0, + cp->width, cp->height); + } +} + /** Get a linked list of trays. */ -TrayType *GetTrays() { +TrayType *GetTrays(void) +{ return trays; } /** Get the number of trays. */ -int GetTrayCount() { +unsigned int GetTrayCount(void) +{ return trayCount; } -/** Get a supporting window to use. */ -Window GetSupportingWindow() { - - if(trays) { - return trays->window; - } else if(supportingWindow != None) { - return supportingWindow; - } else { - supportingWindow = JXCreateSimpleWindow(display, rootWindow, - 0, 0, 1, 1, 0, 0, 0); - return supportingWindow; - } - -} - /** Determine if a tray should autohide. */ -void SetAutoHideTray(TrayType *tp, int v) { +void SetAutoHideTray(TrayType *tp, TrayAutoHideType autohide) +{ Assert(tp); - tp->autoHide = v; + tp->autoHide = autohide; } /** Set the x-coordinate of a tray. */ -void SetTrayX(TrayType *tp, const char *str) { +void SetTrayX(TrayType *tp, const char *str) +{ Assert(tp); Assert(str); - tp->x = atoi(str); + tp->requestedX = atoi(str); } /** Set the y-coordinate of a tray. */ -void SetTrayY(TrayType *tp, const char *str) { +void SetTrayY(TrayType *tp, const char *str) +{ Assert(tp); Assert(str); - tp->y = atoi(str); + tp->requestedY = atoi(str); } /** Set the width of a tray. */ -void SetTrayWidth(TrayType *tp, const char *str) { +void SetTrayWidth(TrayType *tp, const char *str) +{ int width; @@ -1041,7 +1078,8 @@ } /** Set the height of a tray. */ -void SetTrayHeight(TrayType *tp, const char *str) { +void SetTrayHeight(TrayType *tp, const char *str) +{ int height; @@ -1060,7 +1098,8 @@ /** Set the tray orientation. */ -void SetTrayLayout(TrayType *tp, const char *str) { +void SetTrayLayout(TrayType *tp, const char *str) +{ Assert(tp); @@ -1096,94 +1135,53 @@ } /** Set the layer for a tray. */ -void SetTrayLayer(TrayType *tp, const char *str) { - - int temp; - - Assert(tp); - Assert(str); - - temp = atoi(str); - if(JUNLIKELY(temp < LAYER_BOTTOM || temp > LAYER_TOP)) { - Warning(_("invalid tray layer: %d"), temp); - tp->layer = DEFAULT_TRAY_LAYER; - } else { - tp->layer = temp; - } - -} - -/** Set the border width for a tray. */ -void SetTrayBorder(TrayType *tp, const char *str) { - - int temp; - - Assert(tp); - Assert(str); - - temp = atoi(str); - if(JUNLIKELY(temp < MIN_TRAY_BORDER || temp > MAX_TRAY_BORDER)) { - Warning(_("invalid tray border: %d"), temp); - tp->border = DEFAULT_TRAY_BORDER; - } else { - tp->border = temp; - } - +void SetTrayLayer(TrayType *tp, WinLayerType layer) +{ + tp->layer = layer; } /** Set the horizontal tray alignment. */ -void SetTrayHorizontalAlignment(TrayType *tp, const char *str) { - - Assert(tp); +void SetTrayHorizontalAlignment(TrayType *tp, const char *str) +{ + static const StringMappingType mapping[] = { + { "center", TALIGN_CENTER }, + { "fixed", TALIGN_FIXED }, + { "left", TALIGN_LEFT }, + { "right", TALIGN_RIGHT } + }; - if(!str || !strcmp(str, "fixed")) { + if(!str) { tp->halign = TALIGN_FIXED; - } else if(!strcmp(str, "left")) { - tp->halign = TALIGN_LEFT; - } else if(!strcmp(str, "right")) { - tp->halign = TALIGN_RIGHT; - } else if(!strcmp(str, "center")) { - tp->halign = TALIGN_CENTER; } else { - Warning(_("invalid tray horizontal alignment: \"%s\""), str); - tp->halign = TALIGN_FIXED; + const int x = FindValue(mapping, ARRAY_LENGTH(mapping), str); + if(JLIKELY(x >= 0)) { + tp->halign = x; + } else { + Warning(_("invalid tray horizontal alignment: \"%s\""), str); + tp->halign = TALIGN_FIXED; + } } - } /** Set the vertical tray alignment. */ -void SetTrayVerticalAlignment(TrayType *tp, const char *str) { +void SetTrayVerticalAlignment(TrayType *tp, const char *str) +{ + static const StringMappingType mapping[] = { + { "bottom", TALIGN_BOTTOM }, + { "center", TALIGN_CENTER }, + { "fixed", TALIGN_FIXED }, + { "top", TALIGN_TOP } + }; - Assert(tp); - - if(!str || !strcmp(str, "fixed")) { + if(!str) { tp->valign = TALIGN_FIXED; - } else if(!strcmp(str, "top")) { - tp->valign = TALIGN_TOP; - } else if(!strcmp(str, "bottom")) { - tp->valign = TALIGN_BOTTOM; - } else if(!strcmp(str, "center")) { - tp->valign = TALIGN_CENTER; } else { - Warning(_("invalid tray vertical alignment: \"%s\""), str); - tp->valign = TALIGN_FIXED; - } - -} - -/** Set the tray transparency level. */ -void SetTrayOpacity(const char *str) { - - double temp; - - Assert(str); - - temp = atof(str); - if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { - Warning(_("invalid tray opacity: %s"), str); - temp = 1.0; + const int x = FindValue(mapping, ARRAY_LENGTH(mapping), str); + if(JLIKELY(x >= 0)) { + tp->valign = x; + } else { + Warning(_("invalid tray vertical alignment: \"%s\""), str); + tp->valign = TALIGN_FIXED; + } } - trayOpacity = (unsigned int)(temp * UINT_MAX); - } - diff -Nru jwm-2.1.0+svn579/src/tray.h jwm-2.3.1+0~16~ubuntu14.10.1/src/tray.h --- jwm-2.1.0+svn579/src/tray.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/tray.h 2015-07-18 20:02:18.000000000 +0000 @@ -12,23 +12,31 @@ #include "hint.h" -struct TimeType; +/* Size of the tray border. */ +#define TRAY_BORDER_SIZE 1 /** Enumeration of tray layouts. */ -typedef enum { - LAYOUT_HORIZONTAL, /**< Left-to-right. */ - LAYOUT_VERTICAL /**< Top-to-bottom. */ -} LayoutType; +typedef unsigned char LayoutType; +#define LAYOUT_HORIZONTAL 0 /**< Left-to-right. */ +#define LAYOUT_VERTICAL 1 /**< Top-to-bottom. */ /** Enumeration of tray alignments. */ -typedef enum { - TALIGN_FIXED, /**< Fixed at user specified x and y coordinates. */ - TALIGN_LEFT, /**< Left aligned. */ - TALIGN_TOP, /**< Top aligned. */ - TALIGN_CENTER, /**< Center aligned. */ - TALIGN_RIGHT, /**< Right aligned. */ - TALIGN_BOTTOM /**< Bottom aligned. */ -} TrayAlignmentType; +typedef unsigned char TrayAlignmentType; +#define TALIGN_FIXED 0 /**< Fixed at user specified x and y coordinates. */ +#define TALIGN_LEFT 1 /**< Left aligned. */ +#define TALIGN_TOP 2 /**< Top aligned. */ +#define TALIGN_CENTER 3 /**< Center aligned. */ +#define TALIGN_RIGHT 4 /**< Right aligned. */ +#define TALIGN_BOTTOM 5 /**< Bottom aligned. */ + +/** Enumeration of tray autohide values. */ +typedef unsigned char TrayAutoHideType; +#define THIDE_OFF 0 /**< No autohide. */ +#define THIDE_LEFT 1 /**< Hide on the left. */ +#define THIDE_RIGHT 2 /**< Hide on the right. */ +#define THIDE_TOP 3 /**< Hide on the top. */ +#define THIDE_BOTTOM 4 /**< Hide on the bottom. */ +#define THIDE_RAISED 8 /**< Mask to indicate the tray is raised. */ /** Structure to hold common tray component data. * Sizing is handled as follows: @@ -71,7 +79,7 @@ int width; /**< Actual width. */ int height; /**< Actual height. */ - int grabbed; /**< 1 if the mouse was grabbed by this component. */ + char grabbed; /**< 1 if the mouse was grabbed by this component. */ Window window; /**< Content (if a window, otherwise None). */ Pixmap pixmap; /**< Content (if a pixmap, otherwise None). */ @@ -94,15 +102,20 @@ /** Callback for mouse presses. */ void (*ProcessButtonPress)(struct TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); /** Callback for mouse releases. */ void (*ProcessButtonRelease)(struct TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); /** Callback for mouse motion. */ void (*ProcessMotionEvent)(struct TrayComponentType *cp, - int x, int y, int mask); + int x, int y, int mask); + + /** Callback to redraw the component contents. + * This is only needed for components that use actions. + */ + void (*Redraw)(struct TrayComponentType *cp); /** The next component in the tray. */ struct TrayComponentType *next; @@ -112,6 +125,9 @@ /** Structure to represent a tray. */ typedef struct TrayType { + int requestedX; /**< The user-requested x-coordinate of the tray. */ + int requestedY; /**< The user-requested y-coordinate of the tray. */ + int x; /**< The x-coordinate of the tray. */ int y; /**< The y-coordinate of the tray. */ @@ -121,14 +137,13 @@ int width; /**< Actual width of the tray. */ int height; /**< Actual height of the tray. */ - int border; /**< Border size in pixels. */ WinLayerType layer; /**< Layer. */ LayoutType layout; /**< Layout. */ TrayAlignmentType valign; /**< Vertical alignment. */ TrayAlignmentType halign; /**< Horizontal alignment. */ - int autoHide; /**< 1 for autohide, 0 otherwise. */ - int hidden; /**< 1 if hidden (due to autohide), 0 otherwise. */ + TrayAutoHideType autoHide; + char hidden; /**< 1 if hidden (due to autohide), 0 otherwise. */ Window window; /**< The tray window. */ @@ -142,20 +157,20 @@ } TrayType; -void InitializeTray(); -void StartupTray(); -void ShutdownTray(); -void DestroyTray(); +void InitializeTray(void); +void StartupTray(void); +void ShutdownTray(void); +void DestroyTray(void); /** Create a new tray. * @return A new, empty tray. */ -TrayType *CreateTray(); +TrayType *CreateTray(void); /** Create a tray component. * @return A new tray component structure. */ -TrayComponentType *CreateTrayComponent(); +TrayComponentType *CreateTrayComponent(void); /** Add a tray component to a tray. * @param tp The tray to update. @@ -169,7 +184,7 @@ void ShowTray(TrayType *tp); /** Show all trays. */ -void ShowAllTrays(); +void ShowAllTrays(void); /** Hide a tray. * @param tp The tray to hide. @@ -177,13 +192,19 @@ void HideTray(TrayType *tp); /** Draw all trays. */ -void DrawTray(); +void DrawTray(void); /** Draw a specific tray. * @param tp The tray to draw. */ void DrawSpecificTray(const TrayType *tp); +/** Raise tray windows. */ +void RaiseTrays(void); + +/** Lower tray windows. */ +void LowerTrays(void); + /** Update a component on a tray. * @param tp The tray containing the component. * @param cp The component that needs updating. @@ -195,42 +216,30 @@ */ void ResizeTray(TrayType *tp); +/** Draw the tray background on a drawable. */ +void ClearTrayDrawable(const TrayComponentType *cp); + /** Get a linked list of trays. * @return The trays. */ -TrayType *GetTrays(); +TrayType *GetTrays(void); /** Get the number of trays. * @return The number of trays. */ -int GetTrayCount(); - -/** Get a window to use as the supporting window. - * This is used by clients to validate that compliant window manager is - * running. - * @return The supporting window. - */ -Window GetSupportingWindow(); +unsigned int GetTrayCount(void); /** Process an event that may be for a tray. * @param event The event to process. * @return 1 if this event was for a tray, 0 otherwise. */ -int ProcessTrayEvent(const XEvent *event); - -/** Signal the trays. - * This function is called regularly so that autohide, etc. can take place. - * @param now The current time. - * @param x The mouse x-coordinate (root relative). - * @param y The mouse y-coordinate (root relative). - */ -void SignalTray(const struct TimeType *now, int x, int y); +char ProcessTrayEvent(const XEvent *event); /** Set whether auto hide is enabled for a tray. * @param tp The tray. - * @param v 1 to enable, 0 to disable. + * @param autohide The auto hide setting. */ -void SetAutoHideTray(TrayType *tp, int v); +void SetAutoHideTray(TrayType *tp, TrayAutoHideType autohide); /** Set the tray x-coordinate. * @param tp The tray. @@ -264,32 +273,21 @@ /** Set the tray layer. * @param tp The tray. - * @param str The layer (ASCII). + * @param layer The layer. */ -void SetTrayLayer(TrayType *tp, const char *str); - -/** Set the tray border size. - * @param tp The tray. - * @param str The border size (ASCII, pixels). - */ -void SetTrayBorder(TrayType *tp, const char *str); +void SetTrayLayer(TrayType *tp, WinLayerType layer); /** Set the tray horizontal alignment. * @param tp The tray. - * @param str The alignment(ASCII). + * @param str The alignment (ASCII). */ void SetTrayHorizontalAlignment(TrayType *tp, const char *str); /** Set the tray vertical alignment. * @param tp The tray. - * @param str The alignment(ASCII). + * @param str The alignment (ASCII). */ void SetTrayVerticalAlignment(TrayType *tp, const char *str); -/** Set the tray transparency level. - * @param str The value (ASCII). - */ -void SetTrayOpacity(const char *str); - #endif /* TRAY_H */ diff -Nru jwm-2.1.0+svn579/src/winmenu.c jwm-2.3.1+0~16~ubuntu14.10.1/src/winmenu.c --- jwm-2.1.0+svn579/src/winmenu.c 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/winmenu.c 2015-07-18 20:02:18.000000000 +0000 @@ -10,8 +10,6 @@ #include "jwm.h" #include "winmenu.h" #include "client.h" -#include "menu.h" -#include "main.h" #include "desktop.h" #include "move.h" #include "resize.h" @@ -19,49 +17,26 @@ #include "cursor.h" #include "misc.h" #include "root.h" +#include "settings.h" -static Menu *CreateWindowMenu(); -static void RunWindowCommand(const MenuAction *action); - -static void CreateWindowLayerMenu(Menu *menu); -static void CreateWindowSendToMenu(Menu *menu); +static void CreateWindowLayerMenu(Menu *menu, ClientNode *np); +static void CreateWindowSendToMenu(Menu *menu, ClientNode *np); static void AddWindowMenuItem(Menu *menu, const char *name, - MenuActionType type, int value); - -static ClientNode *client = NULL; - -/** Get the size of a window menu. */ -void GetWindowMenuSize(ClientNode *np, int *width, int *height) { - - Menu *menu; - - client = np; - menu = CreateWindowMenu(); - InitializeMenu(menu); - *width = menu->width; - *height = menu->height; - DestroyMenu(menu); - -} + MenuActionType type, + ClientNode *np, int value); /** Show a window menu. */ -void ShowWindowMenu(ClientNode *np, int x, int y) { - - Menu *menu; - - client = np; - menu = CreateWindowMenu(); - +void ShowWindowMenu(ClientNode *np, int x, int y) +{ + Menu *menu = CreateWindowMenu(np); InitializeMenu(menu); - ShowMenu(menu, RunWindowCommand, x, y); - DestroyMenu(menu); - } /** Create a new window menu. */ -Menu *CreateWindowMenu() { +Menu *CreateWindowMenu(ClientNode *np) +{ Menu *menu; @@ -72,67 +47,68 @@ /* Note that items are added in reverse order of display. */ - if(!(client->state.status & STAT_WMDIALOG)) { - AddWindowMenuItem(menu, _("Close"), MA_CLOSE, 0); - AddWindowMenuItem(menu, _("Kill"), MA_KILL, 0); - AddWindowMenuItem(menu, NULL, MA_NONE, 0); + if(!(np->state.status & STAT_WMDIALOG)) { + AddWindowMenuItem(menu, _("Close"), MA_CLOSE, np, 0); + AddWindowMenuItem(menu, _("Kill"), MA_KILL, np, 0); + AddWindowMenuItem(menu, NULL, MA_NONE, np, 0); } - if(client->state.status & (STAT_MAPPED | STAT_SHADED)) { - if(client->state.border & BORDER_RESIZE) { - AddWindowMenuItem(menu, _("Resize"), MA_RESIZE, 0); - } - if(client->state.border & BORDER_MOVE) { - AddWindowMenuItem(menu, _("Move"), MA_MOVE, 0); + if(!(np->state.status & (STAT_FULLSCREEN | STAT_MINIMIZED) + || np->state.maxFlags)) { + if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { + if(np->state.border & BORDER_RESIZE) { + AddWindowMenuItem(menu, _("Resize"), MA_RESIZE, np, 0); + } + if(np->state.border & BORDER_MOVE) { + AddWindowMenuItem(menu, _("Move"), MA_MOVE, np, 0); + } } } - if(client->state.border & BORDER_MIN) { - - if(client->state.status & STAT_MINIMIZED) { - AddWindowMenuItem(menu, _("Restore"), MA_RESTORE, 0); - } else { - if(client->state.status & STAT_SHADED) { - AddWindowMenuItem(menu, _("Unshade"), MA_SHADE, 0); + if(np->state.status & STAT_MINIMIZED) { + AddWindowMenuItem(menu, _("Restore"), MA_RESTORE, np, 0); + } else if(np->state.border & BORDER_MIN) { + AddWindowMenuItem(menu, _("Minimize"), MA_MINIMIZE, np, 0); + } + + if(!(np->state.status & STAT_FULLSCREEN)) { + if(np->state.status & STAT_SHADED) { + AddWindowMenuItem(menu, _("Unshade"), MA_SHADE, np, 0); + } else if(np->state.border & BORDER_SHADE) { + AddWindowMenuItem(menu, _("Shade"), MA_SHADE, np, 0); + } + if((np->state.border & BORDER_MAX) && + (np->state.status & (STAT_MAPPED | STAT_SHADED))) { + if(!(np->state.maxFlags & MAX_VERT)) { + AddWindowMenuItem(menu, _("Maximize-y"), MA_MAXIMIZE_V, np, 0); + } + if(!(np->state.maxFlags & MAX_HORIZ)) { + AddWindowMenuItem(menu, _("Maximize-x"), MA_MAXIMIZE_H, np, 0); + } + if(np->state.maxFlags) { + AddWindowMenuItem(menu, _("Restore"), MA_MAXIMIZE, np, 0); } else { - AddWindowMenuItem(menu, _("Shade"), MA_SHADE, 0); + AddWindowMenuItem(menu, _("Maximize"), MA_MAXIMIZE, np, 0); } - AddWindowMenuItem(menu, _("Minimize"), MA_MINIMIZE, 0); - } - - } - - if((client->state.border & BORDER_MAX) - && (client->state.status & STAT_MAPPED)) { - - if(!(client->state.status & (STAT_HMAX | STAT_VMAX))) { - AddWindowMenuItem(menu, _("Maximize-y"), MA_MAXIMIZE_V, 0); - } - - if(!(client->state.status & (STAT_HMAX | STAT_VMAX))) { - AddWindowMenuItem(menu, _("Maximize-x"), MA_MAXIMIZE_H, 0); - } - - if((client->state.status & (STAT_HMAX | STAT_VMAX))) { - AddWindowMenuItem(menu, _("Restore"), MA_MAXIMIZE, 0); - } else { - AddWindowMenuItem(menu, _("Maximize"), MA_MAXIMIZE, 0); } - } - if(!(client->state.status & STAT_WMDIALOG)) { + if(!(np->state.status & STAT_WMDIALOG)) { - if(client->state.status & STAT_STICKY) { - AddWindowMenuItem(menu, _("Unstick"), MA_STICK, 0); - } else { - AddWindowMenuItem(menu, _("Stick"), MA_STICK, 0); + if(settings.desktopCount > 1) { + if(np->state.status & STAT_STICKY) { + AddWindowMenuItem(menu, _("Unstick"), MA_STICK, np, 0); + } else { + AddWindowMenuItem(menu, _("Stick"), MA_STICK, np, 0); + } } - CreateWindowLayerMenu(menu); + CreateWindowLayerMenu(menu, np); - if(!(client->state.status & STAT_STICKY)) { - CreateWindowSendToMenu(menu); + if(settings.desktopCount > 1) { + if(!(np->state.status & STAT_STICKY)) { + CreateWindowSendToMenu(menu, np); + } } } @@ -141,20 +117,15 @@ } /** Create a window layer submenu. */ -void CreateWindowLayerMenu(Menu *menu) { +void CreateWindowLayerMenu(Menu *menu, ClientNode *np) +{ Menu *submenu; MenuItem *item; - char str[10]; - unsigned int x; - item = Allocate(sizeof(MenuItem)); - item->type = MENU_ITEM_SUBMENU; + item = CreateMenuItem(MENU_ITEM_SUBMENU); item->name = CopyString(_("Layer")); item->action.type = MA_NONE; - item->action.data.str = NULL; - item->iconName = NULL; - item->next = menu->items; menu->items = item; @@ -164,92 +135,65 @@ submenu->items = NULL; submenu->label = NULL; - if(client->state.layer == LAYER_TOP) { - AddWindowMenuItem(submenu, _("[Top]"), MA_LAYER, LAYER_TOP); + if(np->state.layer == LAYER_ABOVE) { + AddWindowMenuItem(submenu, _("[Above]"), MA_LAYER, np, LAYER_ABOVE); } else { - AddWindowMenuItem(submenu, _("Top"), MA_LAYER, LAYER_TOP); + AddWindowMenuItem(submenu, _("Above"), MA_LAYER, np, LAYER_ABOVE); } - - str[4] = 0; - for(x = LAYER_TOP - 1; x > LAYER_BOTTOM; x--) { - if(x == LAYER_NORMAL) { - if(client->state.layer == x) { - AddWindowMenuItem(submenu, _("[Normal]"), MA_LAYER, x); - } else { - AddWindowMenuItem(submenu, _("Normal"), MA_LAYER, x); - } - } else { - if(client->state.layer == x) { - str[0] = '['; - str[3] = ']'; - } else { - str[0] = ' '; - str[3] = ' '; - } - if(x < 10) { - str[1] = ' '; - } else { - str[1] = (x / 10) + '0'; - } - str[2] = (x % 10) + '0'; - AddWindowMenuItem(submenu, str, MA_LAYER, x); - } + if(np->state.layer == LAYER_NORMAL) { + AddWindowMenuItem(submenu, _("[Normal]"), MA_LAYER, np, LAYER_NORMAL); + } else { + AddWindowMenuItem(submenu, _("Normal"), MA_LAYER, np, LAYER_NORMAL); } - - if(client->state.layer == LAYER_BOTTOM) { - AddWindowMenuItem(submenu, _("[Bottom]"), MA_LAYER, LAYER_BOTTOM); + if(np->state.layer == LAYER_BELOW) { + AddWindowMenuItem(submenu, _("[Below]"), MA_LAYER, np, LAYER_BELOW); } else { - AddWindowMenuItem(submenu, _("Bottom"), MA_LAYER, LAYER_BOTTOM); + AddWindowMenuItem(submenu, _("Below"), MA_LAYER, np, LAYER_BELOW); } } /** Create a send to submenu. */ -void CreateWindowSendToMenu(Menu *menu) { +void CreateWindowSendToMenu(Menu *menu, ClientNode *np) +{ unsigned int mask; unsigned int x; mask = 0; - for(x = 0; x < desktopCount; x++) { - if(client->state.desktop == x - || (client->state.status & STAT_STICKY)) { + for(x = 0; x < settings.desktopCount; x++) { + if(np->state.desktop == x || (np->state.status & STAT_STICKY)) { mask |= 1 << x; } } - AddWindowMenuItem(menu, _("Send To"), MA_NONE, 0); + AddWindowMenuItem(menu, _("Send To"), MA_NONE, np, 0); /* Now the first item in the menu is for the desktop list. */ - menu->items->submenu = CreateDesktopMenu(mask); + menu->items->submenu = CreateDesktopMenu(mask, np); } /** Add an item to the current window menu. */ -void AddWindowMenuItem(Menu *menu, const char *name, - MenuActionType type, int value) { +void AddWindowMenuItem(Menu *menu, const char *name, MenuActionType type, + ClientNode *np, int value) +{ MenuItem *item; - item = Allocate(sizeof(MenuItem)); - if(name) { - item->type = MENU_ITEM_NORMAL; - } else { - item->type = MENU_ITEM_SEPARATOR; - } + item = CreateMenuItem(name ? MENU_ITEM_NORMAL : MENU_ITEM_SEPARATOR); item->name = CopyString(name); item->action.type = type; + item->action.context = np; item->action.data.i = value; - item->iconName = NULL; - item->submenu = NULL; - item->next = menu->items; menu->items = item; } /** Select a window for performing an action. */ -void ChooseWindow(const MenuAction *action) { +void ChooseWindow(MenuAction *action) +{ XEvent event; ClientNode *np; @@ -262,9 +206,9 @@ if(event.type == ButtonPress) { if(event.xbutton.button == Button1) { - np = FindClientByWindow(event.xbutton.subwindow); + np = FindClient(event.xbutton.subwindow); if(np) { - client = np; + action->context = np; RunWindowCommand(action); } } @@ -280,8 +224,9 @@ } /** Window menu action callback. */ -void RunWindowCommand(const MenuAction *action) { - +void RunWindowCommand(MenuAction *action) +{ + ClientNode *client = action->context; switch(action->type) { case MA_STICK: if(client->state.status & STAT_STICKY) { @@ -291,16 +236,20 @@ } break; case MA_MAXIMIZE: - MaximizeClient(client, 1, 1); + if(client->state.maxFlags) { + MaximizeClient(client, MAX_NONE); + } else { + MaximizeClient(client, MAX_VERT | MAX_HORIZ); + } break; case MA_MAXIMIZE_H: - MaximizeClient(client, 1, 0); + MaximizeClient(client, MAX_HORIZ); break; case MA_MAXIMIZE_V: - MaximizeClient(client, 0, 1); + MaximizeClient(client, MAX_VERT); break; case MA_MINIMIZE: - MinimizeClient(client); + MinimizeClient(client, 1); break; case MA_RESTORE: RestoreClient(client, 1); @@ -332,9 +281,7 @@ SetClientLayer(client, action->data.i); break; default: - Debug("unknown window command: %d", action->type); break; } } - diff -Nru jwm-2.1.0+svn579/src/winmenu.h jwm-2.3.1+0~16~ubuntu14.10.1/src/winmenu.h --- jwm-2.1.0+svn579/src/winmenu.h 2012-01-27 01:04:17.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/src/winmenu.h 2015-07-18 20:02:18.000000000 +0000 @@ -14,12 +14,8 @@ struct ClientNode; -/** Get the size of a window menu. - * @param np The client for the window menu. - * @param width The width return. - * @param height The height return. - */ -void GetWindowMenuSize(struct ClientNode *np, int *width, int *height); +/** Create a window menu. */ +Menu *CreateWindowMenu(struct ClientNode *np); /** Show a window menu. * @param np The client for the window menu. @@ -31,7 +27,9 @@ /** Grab the mouse to select a window. * @param action The action to perform when a window is selected. */ -void ChooseWindow(const MenuAction *action); +void ChooseWindow(MenuAction *action); -#endif /* WINMENU_H */ +/** Run a menu action for selected client. */ +void RunWindowCommand(MenuAction *action); +#endif /* WINMENU_H */ diff -Nru jwm-2.1.0+svn579/xslt/jwm-2.3.xslt jwm-2.3.1+0~16~ubuntu14.10.1/xslt/jwm-2.3.xslt --- jwm-2.1.0+svn579/xslt/jwm-2.3.xslt 1970-01-01 00:00:00.000000000 +0000 +++ jwm-2.3.1+0~16~ubuntu14.10.1/xslt/jwm-2.3.xslt 2015-07-18 20:02:18.000000000 +0000 @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + bottom + + off + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +