debian/0000755000000000000000000000000012313576635007201 5ustar debian/python3-newt-dbg.preinst0000644000000000000000000000024212144637210013703 0ustar #!/bin/sh set -e # handle symlink to directory conversion (#700781) DOCDIR=/usr/share/doc/python3-newt-dbg if [ -L $DOCDIR ] ; then rm $DOCDIR fi #DEBHELPER# debian/newt-tcl.install0000644000000000000000000000003311766635560012326 0ustar whiptcl.so usr/lib/whiptcl debian/libnewt0.52.install0000644000000000000000000000016212164376144012536 0ustar usr/share/locale lib/*/libnewt.so.* ../../debian/palette.original etc/newt/ ../../debian/palette.ubuntu etc/newt/ debian/README.whiptail0000644000000000000000000000101211766635560011677 0ustar whiptail(1) is a lightweight replacement for dialog(1), to provide dialog boxes for shell scripts. It is built on the newt windowing library rather than the ncurses library, allowing it to be smaller in embedded enviroments such as installers, rescue disks, etc. whiptail is designed to be drop-in compatible with dialog, but has less features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc. Please see the whiptail(1) man page for details. Regards, Alastair McKinstry, 2003-06-08. debian/libnewt0.52.prerm0000644000000000000000000000022312154107074012204 0ustar #!/bin/sh set -e #DEBHELPER# if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then update-alternatives --remove-all newt-palette fi exit 0 debian/copyright0000644000000000000000000000144311766635560011142 0ustar This is the Debian version of the newt library. newt was written by Erik Troan . The original package was put together by Enrique Zanardi , from sources obtained from: ftp://ftp.redhat.com/pub/redhat/redhat-7.0-en/os/i386/SRPMS/newt-0.50.17-1.src.rpm Recent upstream versions can be found at: http://fedora.redhat.com/ Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. newt is available under the terms of the GNU Library General Public License, version 2. On Debian GNU/Linux systems, the complete text of this license can be found in `/usr/share/common-licenses/LGPL-2'. debian/test-newt.sh0000644000000000000000000000032311766635560011471 0ustar #!/bin/bash # the following should work set -x whiptail --msgbox 'hoge a You are a normal test' 10 20 whiptail --msgbox 'hoge a You are a normal test' 10 20 whiptail --msgbox ha 1 4 whiptail --msgbox ha 1 5 debian/libnewt-dev.doc-base0000644000000000000000000000020011766635560013014 0ustar build-tree/*/tutorial/t1.html build-tree/*/tutorial/x100.html build-tree/*/tutorial/x197.html build-tree/*/tutorial/x223.html debian/libnewt-dev.docs0000644000000000000000000000001211766635560012270 0ustar newt.spec debian/changelog0000644000000000000000000016001412313576635011055 0ustar newt (0.52.15-2ubuntu5) trusty; urgency=medium * No-change rebuild to drop Python 3.3 support. -- Matthias Klose Sun, 23 Mar 2014 15:28:29 +0000 newt (0.52.15-2ubuntu4) trusty; urgency=medium * Rebuild for python3.4 as a supported python version. -- Matthias Klose Sat, 04 Jan 2014 18:31:26 +0000 newt (0.52.15-2ubuntu3) trusty; urgency=medium * Build for Tcl 8.6. * Rename the python extension to the multiarch name. -- Matthias Klose Thu, 02 Jan 2014 17:24:22 +0100 newt (0.52.15-2ubuntu2) trusty; urgency=medium * Allow the package to cross build. -- Matthias Klose Sun, 08 Dec 2013 21:34:41 +0100 newt (0.52.15-2ubuntu1) saucy; urgency=low * Merge with Debian; remaining changes: - Fix python-* package descriptions. - Install/remove alternatives for the ubuntu palette. - Don't install python-newt example files. - Install whiptail in /bin instead of /usr/bin. * Still build with tcl8.5 (8.6 is in universe). -- Matthias Klose Mon, 01 Jul 2013 23:06:29 +0200 newt (0.52.15-2) unstable; urgency=low * Ensure unowned files get removed on purge.( /etc/newt/palette). Closes: #709194. * Fix FTBFS with new automake-1.13. * Add symbols file for libnewt0.52.15 -- Alastair McKinstry Thu, 06 Jun 2013 14:28:50 +0100 newt (0.52.15-1) unstable; urgency=low * New upstream release. * Standards-Version: 3.9.4 * Build against tcl8.6-dev * Build python3 modules. Closes: #691240 * Update patches; latvian patch now merged upstream. * M-A, round two: patch to run msgfmt --endianness little to force .mo files to be identical. Now lib* package can be Multi-Arch: same * The python-newt-dbg and python3-newt-dbg packages conflict as they ship the same debug symbols file (hashed) * Use dh --with autoreconf rather than call 'by hand'. Cleaner. * Include more changes for hardening support. Closes: #658430. * Improved watch file from Bart Martens. -- Alastair McKinstry Thu, 16 May 2013 20:56:57 +0100 newt (0.52.14-11ubuntu7) raring; urgency=low * debian/palette.ubuntu, debian/palette.debian: LP: #1155441 - update the palette configuration file for the Ubuntu palette - the previous palette configuration file was read by a patch that upstream did not accept; upstream did enable the configurable palette feature, but the file format is completely different - update palette.ubuntu to set the necessary values to magenta - update palette.original, zeroing it out to empty (which will default to the upstream default colors -- Dustin Kirkland Thu, 14 Mar 2013 23:52:24 -0500 newt (0.52.14-11ubuntu6) raring; urgency=low * debian/patches/python3.patch: Fix the $$variant tests in Makefile.in. -z means to check for zero length (-n is for non-zero length). This got the order of the _snack{,_d}.so files reversed. (LP: #1097922) -- Barry Warsaw Wed, 13 Feb 2013 15:16:35 -0500 newt (0.52.14-11ubuntu5) raring; urgency=low * Modified python3.patch (LP: #1092117). - New snack.py depends on string modules. -- Mitsuya Shibata Sun, 23 Dec 2012 17:52:33 +0900 newt (0.52.14-11ubuntu4) raring; urgency=low * Fix link target of libnewt.so to cope with move to /lib. -- Colin Watson Wed, 28 Nov 2012 14:14:01 +0000 newt (0.52.14-11ubuntu3) raring; urgency=low * Build-depend on python3-all-dev. -- Matthias Klose Thu, 08 Nov 2012 18:04:44 +0100 newt (0.52.14-11ubuntu1) raring; urgency=low * Merge with Debian; remaining changes: - Port python module to python3. - Fix installation for multiple python3 versions. - Move libnewt to /lib and whiptail to /bin so they can be used by friendly-recovery on systems that have a separate /usr. - debian/libnewt0.52.install, debian/libnewt0.52.postinst, debian/palette => debian/palette.original: - move palette from /usr to /etc such that they can be edited by an admin. * Configure --with-colorsfile=/etc/newt/palette. -- Matthias Klose Thu, 08 Nov 2012 14:50:00 +0100 newt (0.52.14-11.1) unstable; urgency=low * Non-maintainer upload. * python-newt-dbg.preinst: Handle symlink to directory conversion. (Closes: #700781) -- Sebastian Ramacher Mon, 25 Feb 2013 19:58:40 +0100 newt (0.52.14-11) unstable; urgency=low * Add Latvian translation. Closes: #674705. * Close bugs fixed in -9: Closes: #670039. Closes: #670012. Closes: #658319. * Don't override hardened CFLAGS. Closes: #658430. * Updated welsh translation. Closes: #677458. * Updated Lithuanian translation. Closes: #675678. -- Alastair McKinstry Fri, 15 Jun 2012 12:52:00 +0100 newt (0.52.14-10) unstable; urgency=low * Fix: whiptail gave incorrect result for ESC pressed when NO selected. Closes: #665784. -- Alastair McKinstry Wed, 16 May 2012 12:30:04 +0100 newt (0.52.14-9) unstable; urgency=low * Add debian/watch file. * Standard-Version: 3.9.3. No changes required. * Correct packages marked: Multiarch: same. translation .mo files are not multiarch safe Closes: #670012, #670039. -- Alastair McKinstry Fri, 20 Apr 2012 00:22:52 +0100 newt (0.52.14-8) unstable; urgency=low * Fix thanks to Kris Henriksson for snackmodule build. Closes: #655151. -- Alastair McKinstry Sun, 29 Jan 2012 14:59:30 +0000 newt (0.52.14-7) unstable; urgency=low * Snackmodule.* must be compiled -fPIC on AMD64, etc. Closes: #655151. -- Alastair McKinstry Fri, 13 Jan 2012 14:20:33 +0000 newt (0.52.14-6) unstable; urgency=low * Edit pkg-config --libs, --ldflags lines to ensure python shared objects are not linkead against libpython. Closes: #655244. -- Alastair McKinstry Mon, 09 Jan 2012 17:49:24 +0000 newt (0.52.14-5) unstable; urgency=low * Typo in patch: extra "+" leads to failure to install snackmodule in some cases. Closes: #655151. * Remove unnecessary dependencies on libpython* in python-newt that were blocking python2.6 upgade. -- Alastair McKinstry Mon, 09 Jan 2012 16:08:28 +0000 newt (0.52.14-4) unstable; urgency=low * Fix crash due to blankline() in textbox being initialised in the wrong place in refactored bid patch. Closes: #654408, #654351. -- Alastair McKinstry Tue, 03 Jan 2012 16:56:33 +0000 newt (0.52.14-3) unstable; urgency=low * Push to unstable. -- Alastair McKinstry Sun, 01 Jan 2012 15:54:01 +0000 newt (0.52.14-2) experimental; urgency=low * bidi.patch: Add -ldl direct linkage for libnewt.so. Closes: #600289. * One call newtInit() once in python newt initScreen(). Closes: #557960. * Fix crash due to blankline being empty in textboxDraw. Closes: #650845. -- Alastair McKinstry Sun, 04 Dec 2011 02:34:47 +0000 newt (0.52.14-1) experimental; urgency=low * New upstream release. Closes: #601516. * Move to dh and source format 3 (quilt), from dbs. Closes: #576044. * Move to python2 from python_central. Closes: #616915. * Make Multi-Arch. * Standards-Version: 3.9.2. * Remove obsolete conflicts / replaces/ provides from control file. * Uighir translation by Sahran . Closes: #627014. * Sinhala translation by Danishka Navin. Closes: #640766. * Old Patches: - Added DEP-3 headers. - removed Farsi lang patch now in upstream. -- Alastair McKinstry Sat, 03 Dec 2011 10:56:05 +0000 newt (0.52.11-2ubuntu12) raring; urgency=low * Fix build failure with python3.3. -- Matthias Klose Mon, 22 Oct 2012 18:07:37 +0200 newt (0.52.11-2ubuntu11) quantal; urgency=low [ James Hunt ] * Port python module to python3: - Introduces python3-newt and python3-newt-dbg. - Update build-depend to require python3-all-dev. [ Stéphane Graber ] * Port python module to python3: - Make a debian/patches patch out of James' changes. - Add missing python3-all-dbg build-dependency. - Fix debian/rules generated symlinks to work with the python3 packages. - Fix the Provides and Depends of the python3 packages. -- Stéphane Graber Wed, 13 Jun 2012 18:31:46 -0400 newt (0.52.11-2ubuntu10) precise; urgency=low * Move libnewt to /lib and whiptail to /bin so they can be used by friendly-recovery on systems that have a separate /usr. -- Stéphane Graber Wed, 08 Feb 2012 23:23:34 -0500 newt (0.52.11-2ubuntu9) precise; urgency=low * Insert missing space in debian/patches/030_tcl8.5.patch -- Adam Conrad Sun, 20 Nov 2011 23:28:49 -0700 newt (0.52.11-2ubuntu8) oneiric; urgency=low * Convert to dh_python2 (Debian #616915, LP: #788514). -- Colin Watson Mon, 27 Jun 2011 11:59:01 +0100 newt (0.52.11-2ubuntu7) natty; urgency=low * debian/libnewt0.52.postinst: revert part of last change, do install the original newt alternative, such that it's discoverable, other packages will use --set to select -- Dustin Kirkland Tue, 22 Mar 2011 08:25:07 -0500 newt (0.52.11-2ubuntu6) natty; urgency=low * debian/libnewt0.52.postinst: don't add the newt-palette original alternate to update-alternatives; let other packages or humans do this; otherwise, every time this package upgrades, it would overwrite others' choices -- Dustin Kirkland Sun, 20 Mar 2011 17:48:26 -0500 newt (0.52.11-2ubuntu5) natty; urgency=low * debian/libnewt0.52.install, debian/libnewt0.52.postinst, debian/palette => debian/palette.original: - move palette from /usr to /etc such that they can be edited by an admin, LP: #738992 -- Dustin Kirkland Sun, 20 Mar 2011 17:24:08 -0500 newt (0.52.11-2ubuntu4) natty; urgency=low Fixes for LP: #737948 * debian/patches/800_ubuntu_skin.patch, debian/patches/801_configurable-palette.patch: - drop the hardcoded color changes - instead, read color values from /etc/newt/palette, if readable * debian/libnewt0.52.install, debian/libnewt0.52.postinst, debian/palette, debian/palette.ubuntu, debian/libnewt0.52.dirs: - install the default palette, and an ubuntu palette, use the update-alternatives system to set -- Dustin Kirkland Fri, 18 Mar 2011 21:56:08 -0500 newt (0.52.11-2ubuntu3) natty; urgency=low * debian/patches/800_ubuntu_skin.patch: LP: #730672 - add an Ubuntu skin to newt colors, changing blue to magenta - note that 'magenta' is actually be aubergine, when coupled with the console-setup and kbd fixes for LP: #730672 -- Dustin Kirkland Thu, 17 Mar 2011 19:00:51 -0500 newt (0.52.11-2ubuntu2) natty; urgency=low * Rebuild to add support for python 2.7. -- Matthias Klose Fri, 03 Dec 2010 00:05:11 +0000 newt (0.52.11-2ubuntu1) natty; urgency=low * Resynchronise with Debian. Remaining changes: - 020_bidi.patch: Link with -ldl for dlopen, so that we work properly with GCC versions that default to --no-add-needed. -- Colin Watson Sun, 17 Oct 2010 02:22:58 +0100 newt (0.52.11-2) unstable; urgency=low * Icelandic translation thanks to Sveinn í Felli. Closes: #3600258, #592828. * Farsi patch translation thanks to Behrad Eslamifar. Closes: #590698. * Belarussian translation thanks to Viktar Siarheichyk. Closes: #595938. * Kazakh translation thanks to Baurzhan Muftakhidinov. Closes: #589007. * Irish translation thanks to Kevin Scannell. Closes: #579198. * Standards-Version: 3.9.1. No changes required. -- Alastair McKinstry Sat, 16 Oct 2010 15:10:47 +0100 newt (0.52.11-1ubuntu1) natty; urgency=low * 020_bidi.patch: Link with -ldl for dlopen, so that we work properly with GCC versions that default to --no-add-needed. -- Colin Watson Fri, 15 Oct 2010 16:25:00 +0100 newt (0.52.11-1) unstable; urgency=low * New upstream. Closes: #575561. Merged upstream: 029_crash_fix.patch 040_pkgconfig.patch 310_libfixes.patch 320_valgrind_fixes.patch (partial) 040_pkgconfig.patch 410_marathi.patch 420_checkbox_width.patch 600_CVE-2009-2905.patch 720_newt_combiwrap.patch 730_gujarati.patch * Fix to allow ESC key to work in whiptail. Closes: #584098. -- Alastair McKinstry Sat, 19 Jun 2010 20:54:29 +0100 newt (0.52.10-8) unstable; urgency=low * Remove unnecessary libgpm-dev, as it breaks kfreebsd. Closes: #572230. -- Alastair McKinstry Wed, 03 Mar 2010 10:14:59 +0000 newt (0.52.10-7) unstable; urgency=low * Enable GPM support on Linux, kFreeBSD. Closes: #572274, #569172 . * Build-depend on libgpm-dev. * Standards-Version: 3.8.4. No changes required. -- Alastair McKinstry Wed, 03 Mar 2010 08:34:30 +0000 newt (0.52.10-6) unstable; urgency=low * Fix for 020_bidi.patch that now requires TRUE/FALSE to be defined. Thanks to Theppitak Karoonboonyanan. Closes: #570663. * Initialize space for fribidi to zero. Fix thanks to Colin Watson. Closes: #570581. * Fix for text incorrectly wrapping at combining characters. Thanks to Theppitak Karoonboonyanan. Closes: #570630. * Translations: Gujarati, thanks to Kartik Mistry. Closes: #571682. -- Alastair McKinstry Tue, 02 Mar 2010 13:33:00 +0000 newt (0.52.10-5) unstable; urgency=low * Acknowledge NMU with thanks. * Remove double spaces in control that breaks dpkg-dev. Closes: #557543. * Move to Standards-Version 3.8.3. No changes required. * Add -ldl to Libs line. Closes: #560542, #555771. * Translations: Updated Bengali patch that documens plural forms. Closes: #524974 Updated Italian patch (in UTF-8). Closes: #559499. Updated Asturian patch (in UTF-8). Closes: #538951. -- Alastair McKinstry Fri, 18 Dec 2009 02:07:51 +0000 newt (0.52.10-4.1) unstable; urgency=high * Non-maintainer upload by the testing Security Team. * Include patch to fix buffer overflow in content processing code Fixes: CVE-2009-2905 Closes: #548198 -- Giuseppe Iuculano Tue, 06 Oct 2009 17:29:33 +0200 newt (0.52.10-4) unstable; urgency=low * Add Ubuntu patch for python-newt-dbg package from Michael Vogt. Closes: #531725. * Add Ubuntu patch from Michael Vogt for crash when re-using text box multiple times. Thanks. Closes: #531724. * Set the CHARSET specification in Marathi translation to UTF-8. Thanks to Christian Perrier. Closes: #531394. -- Alastair McKinstry Wed, 03 Jun 2009 23:20:22 +0100 newt (0.52.10-3) unstable; urgency=low * Marathi translation, thanks to Priti Patil. Closes: #416811. * Patch from Neil Williams for cross-build support. Closes: #465105. * Add patch from Baruch Evan to allow checkboxes be aligned; wanted for LTR languages. Experimental API addition. Closes: #429351. -- Alastair McKinstry Tue, 05 May 2009 20:51:49 +0100 newt (0.52.10-2) unstable; urgency=low * Change Priority: for python-newt to optional. * Remove old message about experimental SONAME for README.Debian. Closes: #430104. * Add asturian po file from Marcos Alverez Costales. Closes: #518982. * Add Homepage: and Vcs-Git: fields to debian/control. Closes: #489612. * Cross-build support for kfreebsd from Guillem Jover. Closes: #465196. -- Alastair McKinstry Fri, 01 May 2009 11:09:34 +0100 newt (0.52.10-1) unstable; urgency=low * New upstream release. The following patches were merged, and have been removed: 015_slang2_utf8.patch 035_topleft_a11y.patch 040_bengali.patch 045_snack_entrywindow.patch 050_updated_greek.patch 060_pgupdown_crash.patch 065_scrollbars.patch 070_cursor_a11y.patch 080_pa_rename.patch 090_khmer.patch 100_dzongkha.patch 110_a11y.patch 130_colors.patch 140_screensize.patch 150_thai.patch 160_esperanto.patch 170_nepali.patch 180_cursor.patch 190_focus.patch 200_cbtpos.patch 222_fix_gauge_crash.patch 330_tamil.patch 340_sl_fix.patch 500_cope_with_backward_system_time_jumps.patch * Build-Conflicts: autoconf2.13 no longer necessary. * Move DH_COMPAT=5 to file debian/COMPAT. * Move to Standards-Version: 3.8.1: replace dependencies on Source-Version to binary:Version. * newt-tcl now built with tcl8.5-dev and works with tcl8.{3,4,5}. * Add libnewt.pc file to libnewt-dev. -- Alastair McKinstry Mon, 20 Apr 2009 22:57:48 +0100 newt (0.52.2-11.3) unstable; urgency=low * NMU * Cherry-pick upstream patch to avoid breaking timers when the system clock jumps backwards. Closes: #436497 -- Joey Hess Fri, 11 Jul 2008 14:48:49 -0400 newt (0.52.2-11.2) unstable; urgency=low * Non-maintainer upload. * Apply ubuntu patch to use actually use pycentral. Thanks to Steve Langasek for forwarding. Closes: #445392. * Fix python memory handling. Closes: #445392. -- Thomas Viehmann Tue, 04 Mar 2008 23:33:17 +0100 newt (0.52.2-11.1) unstable; urgency=medium * NMU * Fix bidi patch to link libnewt with -ldl. * Include map file in the pic package. * Closes: #443248 -- Joey Hess Wed, 19 Sep 2007 17:06:40 -0400 newt (0.52.2-11) unstable; urgency=low * Patch from Matthias Klose to deal with changed dpkg-architecure output. Closes: #435376. -- Alastair McKinstry Thu, 09 Aug 2007 19:44:20 +0100 newt (0.52.2-10) unstable; urgency=low * Correction to Slovenian translation: thanks to Matej Kovacic. Closes: #405582. * Fix whiptail --help response: --defaultno not -defaultno. Closes: #400972. -- Alastair McKinstry Mon, 22 Jan 2007 16:54:48 +0000 newt (0.52.2-9) unstable; urgency=low * Add Tamil translation from Senthil Kumar B. Closes: #404670. * Add entry to LINGUAS file so that Kurdish translation is included. -- Alastair McKinstry Sun, 31 Dec 2006 10:29:31 +0000 newt (0.52.2-8) unstable; urgency=low * Change libnewt0.52 priority to important, as it is required by whiptail, which is important. * Fix by Eugeniy Meshcheryakov for inputbox breakage under non-ASCII locales. Closes: #384391, #384787. * Moved debhelper dependency to >= 5.0.37.2, to ensure latest python policy support. * libcheck: Remove unnecessary dependencies on -lm, -lslang, -lpopt from libnewt and executables. * When fribidi lookup fails, record the fact so we don't try to dlopen() libfribidi on every text string printed. * newt-tcl: rename /usr/lib/libtwhiptcl.so/ to /usr/lib/whiptcl for clarity. -- Alastair McKinstry Fri, 29 Sep 2006 13:25:33 +0100 newt (0.52.2-7) unstable; urgency=low * debian/patches/222_fix_gauge_crash.patch - prevent a negative number input to the gauge dialog from crashing whiptail by smashing the stack. Thanks to Ryan Lortie. -- Alastair McKinstry Thu, 10 Aug 2006 10:18:08 +0100 newt (0.52.2-6) experimental; urgency=low * Acknowledge NMU with thanks. Closes: #379566. * Updated python change patch to only build on python2.3, python2.4; makes no assumptions about python2.5, etc. Thanks to Matthias Klose. Closes: #372811. * Clear dlerror() state before trying dlopen(), to try fixing failures in loading. -- Alastair McKinstry Fri, 28 Jul 2006 09:41:39 +0100 newt (0.52.2-5.1) unstable; urgency=low * NMU * Apply patch from Eugeniy Meshcheryako to regenerate configure during build so that bidi support is enabled again. Closes: #379566 -- Joey Hess Mon, 24 Jul 2006 12:24:38 -0400 newt (0.52.2-5) unstable; urgency=low * Acknowledge NMU with thanks. Closes: #372811. * Move to new Python policy. This package should now work on python2.3 and python2.4. * Move to Standards-Version: 3.7.2 : No changes required. * Patches from Fedora 0.52.2-7 : - Make the default colours more friendly to 8-color terminals - handle listbox and checkboxtree focus better. Closes: #189038. - turn off cursor when entry terminated form - fix handling windows larger than screen size - fix checkboxtree positioning. * Translations: - Thai, thanks to Theppitak Karoonboonyanan. Closes: #367230. - Esperanto, thanks to Serge Leblanc. Closes: #366077, #369240. - Nepali, thanks to Paras pradhan. Closes: #369357. * Fixed bug that meant Bengali was not properly included. * libnewt0.52: Move priority from required to standard, to match overrides. -- Alastair McKinstry Tue, 20 Jun 2006 21:15:43 +0100 newt (0.52.2-4.1) experimental; urgency=low * Build for python2.4. * Hardcode the python dependencies for this upload, so that we can build without 2.4 as the default version. -- Matthias Klose Sun, 11 Jun 2006 15:07:35 +0000 newt (0.52.2-4) unstable; urgency=low * Translations: - Dzongkha, thanks to Pema Geyleg. Closes: #361793. * Further accessability improvements by Samuel Thibault. Closes: #337171. -- Alastair McKinstry Tue, 11 Apr 2006 17:52:56 +0100 newt (0.52.2-3) unstable; urgency=low * Translations: - Khmer, thanks to Khoem Sokhem. Closes: #359671. -- Alastair McKinstry Tue, 28 Mar 2006 21:52:06 +0100 newt (0.52.2-2) unstable; urgency=low * Change Punjabi from pa_IN to pa, following debian-i18n discussion. Closes: #357611. * Release as unstable, causing a transition to new libnewt0.52. -- Alastair McKinstry Sun, 19 Mar 2006 14:25:06 +0000 newt (0.52.2-1) experimental; urgency=low * New upstream release. * Change whiptail section: from base to utils to match override. * Updated Greek translation from Kostas Papadimas. Closes: #344583. * Patches from RedHat: - pgupdown-crash: fixes crash in checkboxtree using pgup/down - scrollbar: more pleasing scrollbars. * Include cursor-a11y.patch for better accessability. Closes: #337171. -- Alastair McKinstry Thu, 19 Jan 2006 21:44:03 +0000 newt (0.52.1-3) experimental; urgency=low * New Bengali translation by Progga. Closes: #340650. * snack.py: function EntryWindow now works with preset values for entries. Closes: #340366. -- Alastair McKinstry Fri, 25 Nov 2005 20:50:49 +0000 newt (0.52.1-2) experimental; urgency=low * Include a11y patches by Samuel Thibault for accessability. Closes: #337171. * move to DH_COMPAT=5; include ${misc:Depends} to Dependencies. -- Alastair McKinstry Sat, 19 Nov 2005 12:05:48 +0000 newt (0.52.1-1) experimental; urgency=low * New upstream release. * New Kurdish translation by Erdal Ronahi. Closes: #335077. -- Alastair McKinstry Sat, 22 Oct 2005 20:20:38 +0100 newt (0.51.6-31) unstable; urgency=low * don't free() a pointer that will be NULL if fribidi is not installed. Closes: #317451, #326068. * Build-Depend on libfribid-dev, libnewt0.51 recommends libfribidi0. -- Alastair McKinstry Thu, 8 Sep 2005 22:30:22 +0100 newt (0.51.6-30) unstable; urgency=low * Improved BIDI patch from Eugeniy Meshcheryakov. Closes: #323832. -- Alastair McKinstry Mon, 22 Aug 2005 19:03:02 +0100 newt (0.51.6-29) unstable; urgency=low * Translations: - Xhosa thanks to Xhosa team and Canonical. Closes: #319480. * Fixed syntax errors in changelog that lintian now complains of. * Better dependency generation for whiptail; no doubled dependencies -- Alastair McKinstry Thu, 4 Aug 2005 18:56:34 +0100 newt (0.51.6-28) unstable; urgency=low * Patch from Eugeniy Meshcheryakov to do fribidi in newt. Closes: #318239. -- Alastair McKinstry Thu, 14 Jul 2005 21:54:38 +0100 newt (0.51.6-27) unstable; urgency=low * Translations: - Wolof (wo) thanks to Mouhamadou Mamoune Mbacke. Closes: #317535. * Add explanation to whiptail man page as to how to start text with a dash '-'. Closes: #284708. * Move to Standards-Version: 3.6.2 -- Alastair McKinstry Sun, 10 Jul 2005 08:32:24 +0100 newt (0.51.6-26) unstable; urgency=low * Build against libslang2-dev (>= 2.0.4-2) for fribidi patch. * Upload to unstable. -- Alastair McKinstry Sun, 26 Jun 2005 10:20:18 +0100 newt (0.51.6-25) experimental; urgency=low * libslang2: use SLutf8_enable(-1) to enable UTF8 handling. * Patch from Eugeniy Meshcheryakov to handle incorrect input in non-ASCII modes. Closes: #304657. * libnewt0.51: set priority to required, to match override. * whiptail: set priority to important, to match override. * Generate newt.pot during package build. Closes: #313523. -- Alastair McKinstry Sat, 25 Jun 2005 13:12:54 +0100 newt (0.51.6-24) experimental; urgency=low * Build against libslang2 * Translations: - Punjabi (pa_IN) thanks to Amanpreet Singh Alam. Closes: #309793. - Estonian thanks to Siim Põder. Closes: #312465. -- Alastair McKinstry Mon, 13 Jun 2005 21:23:47 +0100 newt (0.51.6-23) unstable; urgency=low * Build against libc6 from unstable, not experimental. Closes: #308550. -- Alastair McKinstry Fri, 13 May 2005 07:43:48 +0100 newt (0.51.6-22) unstable; urgency=low * Translations: - Vietnamese, thanks to Clytie Siddall. Closes: #306612. -- Alastair McKinstry Mon, 9 May 2005 20:53:22 +0100 newt (0.51.6-21) unstable; urgency=low * Translations: - Tagalog, thanks to Eric Pareja. Closes: #288908. * Corrections for typos in whiptail man page. Thanks to A. Costa. Closes: #287349. * whiptail: textbox help should say not . Closes: #287352. * Interpret C-u as discard. Thanks to Matt Kraai for patch; Closes: #275588. -- Alastair McKinstry Sun, 20 Feb 2005 15:33:50 +0000 newt (0.51.6-20) unstable; urgency=low * Upgrade bug; lbnewt0.51 was supplying /usr/lib/libnewt.so in conflict with libnewt-dev. Closes: #283185. -- Alastair McKinstry Sat, 27 Nov 2004 09:49:00 +0000 newt (0.51.6-19) unstable; urgency=low * Translations: - Welsh, thanks to Dafydd Harries. Closes: #282178. - Galician, thanks to Jacobo Tarrio. Closes: #282231. - Albanian, thanks to Elian Myftiu. Closes: #282158. - Malagasy, thanks to Jaonary Rabarisoa. Closes: #282444. - Hindi, thanks to Ravishankar Shrivastava. Closes: #282445. * Fix regression: Tradition Chinese translations that were over-written by Simplified Chinese by mistake. Closes: #282948. -- Alastair McKinstry Thu, 25 Nov 2004 20:44:04 +0000 newt (0.51.6-18) unstable; urgency=low * Macedonian translation thanks to Georgi Stanojevski. Closes: #275778. -- Alastair McKinstry Sun, 17 Oct 2004 20:18:57 +0100 newt (0.51.6-17) unstable; urgency=low * Romanian translation thanks to Eddy Petrisor. Closes: #275121. * Traditional Chinese translation thanks to Tetralet. Closes: #272618. -- Alastair McKinstry Wed, 6 Oct 2004 20:52:22 +0100 newt (0.51.6-16) unstable; urgency=low * Include Bulgarian translation by Ognyan Kulev. Closes: #271425, #272378. * Remove reference to hot-key numbers (a dialog-only feature) from whiptail man-page. Closes: #267965. -- Alastair McKinstry Mon, 20 Sep 2004 21:45:32 +0100 newt (0.51.6-15) unstable; urgency=low * Ensure whiptail depends on ${Source-Version} of libnewt0.51. Closes: #269835. -- Alastair McKinstry Sun, 5 Sep 2004 20:41:08 +0100 newt (0.51.6-12) unstable; urgency=low * Build for sid. -- Alastair McKinstry Fri, 27 Aug 2004 22:20:01 +0100 newt (0.51.6-6sarge) testing-proposed-updates; urgency=low * Set reset charset properly when doing line-drawing; Closes: #263780 * FTBFS on AMD64,alpha. Closes: #265214. * Build whiptail against shared libnewt.so; Closes: #265721 -- Alastair McKinstry Sat, 14 Aug 2004 23:08:41 +0100 newt (0.51.6-11) unstable; urgency=low * Acknowledging NMU: Closes: #262107. # Ensure wstrlen is visible to newt binaries. Closes: #264723. -- Alastair McKinstry Fri, 13 Aug 2004 20:29:31 +0100 newt (0.51.6-10.1) unstable; urgency=high * NMU * libnewt-dev should depend on 0.51, not itself. -- Joey Hess Thu, 29 Jul 2004 15:01:19 -0400 newt (0.51.6-10) unstable; urgency=low * Tighten dependencies to latest versions of newt, slang. Closes: #261314, #260992. * Translations: - ar.po thanks to Arabeyes project. Closes: #260646. - hr.po thanks to Krunoslav Gernhard. Closes: #261421. * Add debian/watch file. -- Alastair McKinstry Mon, 26 Jul 2004 22:32:54 +0100 newt (0.51.6-9) unstable; urgency=low * Build against the correct slang libraries. Closes: #259283. -- Alastair McKinstry Tue, 13 Jul 2004 22:44:40 +0100 newt (0.51.6-8) unstable; urgency=low * FIx garbled display in top line of boxes. Closes: #257488. -- Alastair McKinstry Mon, 12 Jul 2004 19:22:55 +0100 newt (0.51.6-7) unstable; urgency=low * Fix display problem with 'hidden' checkbox entries in whiptail being shown. Closes: #257807. * Used versioned symbols in libnewt. -- Alastair McKinstry Thu, 8 Jul 2004 20:49:22 +0100 newt (0.51.6-6) unstable; urgency=low * Echo '*' in password field in whiptail. Closes: #254411. * Fix segfaults on bad parameters (box sizes). Closes: #253512. * Update copyright file to point to better source. Closes: #254975. * ENTER in multiselect (check and radio lists) now selects; tabbing to OK not required. Closes: #252751. * Removed XSI:'isms from python-newt.prerm.in ; Closes: #256508. -- Alastair McKinstry Mon, 28 Jun 2004 20:45:09 +0100 newt (0.51.6-5) unstable; urgency=low * Correction to Catalan translation. Closes: #251790. -- Alastair McKinstry Tue, 8 Jun 2004 22:29:40 +0100 newt (0.51.6-4) unstable; urgency=low * Change Catalan po file to reflect UTF-8 encoding. Closes: #251790, #251811. * Bosnian translationi by Safir Šećerović. Closes: #251138. -- Alastair McKinstry Mon, 31 May 2004 21:30:06 +0100 newt (0.51.6-3) unstable; urgency=low * Don't free ptr in entry.c twice. Closes: #246378. -- Alastair McKinstry Tue, 4 May 2004 20:24:09 +0100 newt (0.51.6-2) unstable; urgency=low * Translations: - Portuguese by Miguel Figueiredo. Closes: #241311. - Slovak by Peter Mann. Closes: #246099. * Fix python indentation in snack.py. Closes: #236837. * Don't truncate strings in UTF-8 mode in whiptail. Closes: #232426. -- Alastair McKinstry Mon, 26 Apr 2004 20:27:23 +0100 newt (0.51.6-1) unstable; urgency=low * New Upstream release. * Switched to dbs: - Cleanup of debian/rules - broke 0.51.4 changes into debian/patches * newt.c: Don't spin on the terminal window dying. Closes: #203988. * Use terminfo bindings: patch from Henning Makholm. Closes: #219043. * Trim long titles rather than failing. Closes: #236114. * Add GNU options --help, --version to whiptail. * Translations: - Turkish by Recai Oktas. Closes: #239149. - Korean by Changwoo Ryu. Closes: #241988. - Indonesian by I Gede Wijaya S. Closes: #243454. - Basque by Piarres Beobide Egaña. Closes: #243587. - Hebrew by Lior Kaplan. * Patch for non-ASCII input, thanks to Eugeniy Meshcheryakov. Closes: #238873. Special thanks to Eugeniy Meshcheryakov for fixes and testing. -- Alastair McKinstry Sun, 25 Apr 2004 19:12:19 +0000 newt (0.51.4-21) unstable; urgency=low * zh_CN.po: Simplified Chinese translation from Carlos Z.F. Liu. Closes: #232134. * whiptail.c: guessSize: fix wrapping/truncation of text when autosizing dialogs. Closes: #224333, #231634. * whiptail.c: Translate "\n" in text to newlines. Closes: #218991, #212255. -- Alastair McKinstry Wed, 11 Feb 2004 15:37:07 +0000 newt (0.51.4-20) unstable; urgency=low The "Further adventures in translation" release. * cs.po: Czech translation from Miroslav Kure. Closes: #227116. * nl.po: Dutch translation from Bart Cornelis. Closes: #227102. * sl.po: Slovenian translation from Jure Cuhalev. Closes: #227519. * lt.po: Lithuanian translation from Kęstutis Biliūnas. Closes: #227566. * es.po: Improved Spanish translation from Carlos Valdivia Yagüe. * da.po: Danish translation from Claus Hindsgaul. -- Alastair McKinstry Fri, 6 Feb 2004 18:04:25 +0000 newt (0.51.4-19) unstable; urgency=medium The "Do translators travel in packs?" release. * fi.po: Finnish translation from Tommi Vainikainen. Closes: #226993. * fr.po, ja.po: Fix comments; these are not German translations. Closes: #226964. * ga.po: Convert to UTF-8. * it.po: Italian translation from Giuseppe Sacco, and build fix for ja.po. Closes: #226942, #226943. * sl.po: Slovenian translation from Jure Cuhalev. Closes: #226901. * hu.po: New Hungarian translation from VEROK Istvan. Closes: #226982. * ru.po: New Russian translation from Nikolai Prokoschenko. Closes: #226945. * sv.po: Fix spelling mistake. Thanks to André Dahlqvist. * el.po: New Greek translation from Konstantinos Margaritis. Closes: #226922. * pl.po: New Polish translation from Bartosz Fenski aka fEnIo. Closes: #226921. -- Alastair McKinstry Sat, 10 Jan 2004 07:28:36 +0000 newt (0.51.4-18) unstable; urgency=low * whiptail / whiptcl: Resize listboxes to fit on screen. Closes: #201619, #206616. * ESC key now works. Closes: #52477, #110268. * Add examples to libnewt-dev. * Update version, authors in whiptail(1). -- Alastair McKinstry Fri, 19 Sep 2003 20:52:48 +0000 newt (0.51.4-17) unstable; urgency=low * whiptail: Return -1 on error, to distinguish Ok, Cancel, Error. Closes: #86400. Closes: #209029. * Add documentation for python-newt. Closes: #151783. * Fix build error for po/Makefile.in.in. Closes: #207047. * newt should Build-Depend on gettext. Closes: #207477. * Build-Depend on debhelper >= 4.1.1. Closes: #207037. -- Alastair McKinstry Mon, 15 Sep 2003 20:35:56 +0100 newt (0.51.4-16) unstable; urgency=low * Ship files for python2.3, not python2.2. Closes: #205481, #205505. * Change es.po to UTF-8, to correct charset error * Correct spelling in sv.po. Closes: #206218, #206219, #206220, #206221. -- Alastair McKinstry Mon, 18 Aug 2003 22:02:11 +0100 newt (0.51.4-15) unstable; urgency=low * Removed unnecessary dependencies on python << 2.3; Closes: #204876. * Changed maintainer email to mckinstry@debian.org * Moved to Standards-Version: 3.6.0; no changes required. -- Alastair McKinstry Tue, 12 Aug 2003 22:09:43 +0100 newt (0.51.4-14) unstable; urgency=low * Added Brazilian Portugese translation from Andre Luis Lopes. Closes: #202101. * chmod +x ./mkinstalldirs. Closes: #202078. -- Alastair McKinstry Sun, 20 Jul 2003 09:28:44 +0100 newt (0.51.4-13) unstable; urgency=low * Fix installation of .mo files. Closes: #202003. * Added french translation for whiptail from Christian Perrier. Closes: #201864. * Added Japanese translation for whipatil from Tomohiro KUBOTA. Closes: #202005. -- Alastair McKinstry Sat, 19 Jul 2003 08:31:49 +0100 newt (0.51.4-12) unstable; urgency=low * Re-enabled Ctrl-U key. Closes: #184486, #191487. * Enable i18n, with whiptail button translations to Catalan, Spanish, Irish, German, Swedish and Norwegian. Closes: #54536. -- Alastair McKinstry Sun, 13 Jul 2003 12:33:58 +0100 newt (0.51.4-11) unstable; urgency=low * Fixed misleading colors in compact buttons. Closes: #195775,#198800. * Updated to policy 3.6.0; no changes needed. -- Alastair McKinstry Mon, 14 Jul 2003 10:16:11 +0100 newt (0.51.4-10) unstable; urgency=low * libnewt0.51 replaces libnewt0, libnewt-utf8; whiptail can also use tcl8.4. Closes: #196570. * Add README.whiptail to document the purpose of whiptail. Closes: #67356. * Added --default-item option added to whiptail, whiptcl. Closes: #49352, #49796. * Added shlibs fix from Daniel Schepler for whiptail dependency on alpha. Closes: #196290. * malloc, realloc failures in whiptail, whiptcl now generate a DLG_ERROR return, not a segfault. -- Alastair McKinstry Mon, 16 Jun 2003 20:54:30 +0100 newt (0.51.4-9) unstable; urgency=low * libnewt0 replaces libnewt-utf8 -- Alastair McKinstry Sun, 8 Jun 2003 08:28:55 +0100 newt (0.51.4-8) unstable; urgency=low * Fix problem with cursor position when no border drawn. Closes: #195545. * Add --notags option to whiptail. Closes: #45957. * Change newt-tcl whiptcl.so to libwhiptcl.so. Closes: #21697. * Fix shlib dependency calculation to ensure dependency for whiptail on libnewt0.51 on sparc. Closes: #196290. -- Alastair McKinstry Fri, 6 Jun 2003 14:00:05 +0100 newt (0.51.4-7) unstable; urgency=low * Added --output-fd option. Closes: #153628. * Use libc6.1 on Alpha rather than libc. Closes: #194877. -- Alastair McKinstry Fri, 30 May 2003 19:00:46 +0100 newt (0.51.4-6) unstable; urgency=low * Hardcode whiptail dependencies for the moment to ensure that libnewt0.51 is included on !i386. Closes: #192767. * Re-included --textbox, --passwordbox functionality that upstream had dropped without mentioning it in documentation. Closes: #191579, #191580, #192494, #192922, #192944, #193040. -- Alastair McKinstry Mon, 12 May 2003 22:31:37 +0100 newt (0.51.4-5) unstable; urgency=low * Re-insert code to ensure dialogboxes.o is -fPIC, this time to Makefile.in, not Makefile. Closes: #192393. -- Alastair McKinstry Sun, 11 May 2003 13:51:18 +0100 newt (0.51.4-4) unstable; urgency=low * Reset screen before leaving on exit. Closes: #55638. * Removed incorrect 'and is maintained by' line from debian/copyright. * Ensure dialogboxes.o is built -fPIC: its included in shared objects. Closes: #192393. * Ensure whiptail dependency on libnewt0.51. Closes: #192767. * Added libnewt.so->libnewt.so.0.51 symlink to libnewt-dev. Closes: #192884. -- Alastair McKinstry Mon, 5 May 2003 14:29:15 +0100 newt (0.51.4-3) unstable; urgency=low * Also remore dh_testroot from configure target. Closes: #191123. * Change Sections to match overrides (devel->libdevel, interpreters->python) * Fixed dependencies. Build-Depend, slang>>1.4.5-2; whiptail. Closes: #162429. * Re-inserted the guessSize() code for autosizing from 0.50.17, with a bugfix to allow it to work with UTF8. Closes: #191627. * newt.c: Window placement calc: Don't assume 80x24! instead, read from slang. Closes: #191578 * include newt.spec in /usr/share/doc as it includes important changelog info. * Documented the removal of whiptail features --passwordbox, --textbox; added explanation on how to select items in checklists, radiolists in whiptail.1. Closes: #184471. * Removed debian-test testsuite, as the debian-test package has been removed. -- Alastair McKinstry Thu, 1 May 2003 12:33:01 +0100 newt (0.51.4-2) unstable; urgency=low * build target no longer needs root. Closes: #191123. * Include snack.py in python-newt. Closes: #191445, #191446. -- Alastair McKinstry Wed, 30 Apr 2003 23:38:55 +0100 newt (0.51.4-1) unstable; urgency=low * New maintainer. * Upgraded to new release 0.51.4, from RedHat, bumping SONAME to 0.51 * Merged newt, newt-utf8 now that SONAME has changed. -- Alastair McKinstry Mon, 14 Apr 2003 10:20:02 +0100 newt (0.50.17-13) unstable; urgency=low * textbox.c(addLine,doReflow,newtTextbox) add checks to try and fix (closes: 169788) * add debian-test script and install it, but I haven't actually figured out how really to use it. * debian/control{,.utf8}: Build-Depend on sgmltools-lite rather than sgmltools-2, and libnewt-utf8-pic and libnewt-pic conflicts explicitly with each other * Install libnewt-utf8_pic.a as libnewt_pic.a, I hope I don't break anybody's back with this change. (closes: #182041) * slightly update create-utf8.sh script. * update README.Debian for a change. -- Junichi Uekawa Fri, 28 Feb 2003 17:32:33 +0900 newt (0.50.17-12) unstable; urgency=low * no stripping if nostrip is specified in DEB_BUILD_OPTS. - change configure.in to accept --with-nostrip - change Makefile.in to use @INSTALL_S@ instead of install -s. * No buffer overflow in pushhelpline (partially fixes #66349, that it doesn't segv anymore, but something is surely wrong.) * Possible buffer overflow in newt.c for keyinput fixed (closes: #140404) -- Junichi Uekawa Wed, 27 Nov 2002 16:40:41 +0900 newt (0.50.17-11) unstable; urgency=low * Apply patch from Robert Milan (mostly) for hurd compatbility. (closes: #149318) -- Junichi Uekawa Wed, 30 Oct 2002 17:22:23 +0900 newt (0.50.17-10) unstable; urgency=low * New maintainer * Build newt-utf8 also. versions -9.7 and -9.8 were not uploaded to Debian archive as utf-8 versions. * Fix newt-utf8 portions that doko didn't touch. * Fixed descriptions to clarify that newt-utf8 is not binary compatible, and note that it's not wide-character support, but support for locales. (closes: #135455, #152223) * rename debian/README to debian/README.Debian * update debian/copyright to include me. -- Junichi Uekawa Mon, 28 Oct 2002 22:46:25 +0900 newt (0.50.17-9.8) unstable; urgency=low * Makefile.in (PYVER): Set to 2.2 (closes: #158689). -- Matthias Klose Fri, 30 Aug 2002 08:15:43 +0200 newt (0.50.17-9.7) unstable; urgency=low * NMU. * Build using python2.2. -- Matthias Klose Sat, 24 Aug 2002 14:07:14 +0200 newt (0.50.17-9.6) unstable; urgency=high * Fix possible buffer overflow. (closes: #138363, #140493) At least, this no longer segfaults for me: whiptail --menu "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 30 120 0 aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -- Junichi Uekawa Sun, 31 Mar 2002 09:38:18 +0900 newt (0.50.17-9.5) unstable; urgency=high * NMU * An urgency high upload to fix mistakes introduced in -9.3, and to let the fix trickle into testing. * whiptail and whiptail-utf8 conflicts with each other (closes: #135752, #136404) * update build-depends to depend on slang 1.4.4-7.2 or greater -- Junichi Uekawa Sun, 3 Mar 2002 11:45:10 +0900 newt (0.50.17-9.4) unstable; urgency=low * NMU * add setlocale(LC_ALL, ""); to whiptail, in utf8 mode. mbrtowc most probably wants this. Otherwise, we are getting question marks from whiptail-utf8. -- Junichi Uekawa Mon, 25 Feb 2002 02:51:17 +0900 newt (0.50.17-9.3) unstable; urgency=low * NMU * "Creating the necessary binaries for building boot-floppies, and fixing the non-arch porability" * Makefile.in: fix some compilation warnings with -D_GNU_SOURCE for UTF8 mode, so that the program will run on other arches. (closes: #135386) * newt_pr.h: added declaration for strwidth definition. * debian/control: - libnewt-dev conflicts with libnewt-dev, libnewt-utf8-dev provides/conflicts libnewt-dev introduce libnewt-utf8-dev - whiptail conflicts/provides whiptail-provider whiptail-utf8 conflicts/provides whiptail-provider - whiptail-utf8 created (closes: #135382) - libnewt-dev requires newt, and slang - libnewt-utf8-dev requires newt-utf8 and slang-utf8 - tcl8.3-dev added to build-depends for utf8. - libnewt-utf8-pic depends on libnewt-utf8-dev * debian/rules: - add binary-runtime and binary-devel to binarytarget for utf8. - build document in utf8 also. - remove *~ on clean * Makefile.in: Accept BUILDING_UTF8=true as a sign of required UTF8 flag. * debian/create-utf8.sh: sed shlibs/shlibs.local so that packages compiled against utf8 version will require utf8 libs. * debian/README: added some documentation on the package. * debian/shlibs.local: update shlibs file to depend on utf8 version greater than 0.50.17-9.3. * With this, whiptail-utf8 should be used with slang1-utf8 (closes: #124083) -- Junichi Uekawa Sun, 24 Feb 2002 14:09:53 +0900 newt (0.50.17-9.2) unstable; urgency=low * NMU * Split out newt-utf8 and newt source packages (closes: #133936) * debian/create-utf8.sh: created, to facilitate creation of newt-utf8 version from newt. Portions ripped off from fetchmail sources. * debian/control.utf8: for utf8 version. * this version keeps the single -dev file. It might cause problems if packages linked to newt try to use slang too. * bump up the version build-dependency for slang1-*-dev * libnewt-pic: Depends on libnewt-dev -- Junichi Uekawa Fri, 15 Feb 2002 18:50:36 +0900 newt (0.50.17-9.1) unstable; urgency=low * Non Maintainer Upload. * fix problems with mono mode, patch thanks to Klaus Weidner (closes: #128941) * fixed char signedness problem patch thanks to Martin Michlmayr (closes: #127105) -- David Kimdon Mon, 11 Feb 2002 21:55:10 -0800 newt (0.50.17-9) unstable; urgency=high * Oops, fix the memory leak that I created while trying to fix the memory leak in newtTextboxSetText. (Closes: #124117) -- Enrique Zanardi Tue, 18 Dec 2001 13:33:50 +0000 newt (0.50.17-8) unstable; urgency=high * MU, close the bugs fixed in NMUs. (Closes: #119815, #120245, #119281, #119354, #117455, #115409, #116566, #121062, #117878, #109441) * libnewt.so points to libnewt.so.0.50 (Closes: #121893) * -pic packages now depend on non-pic ones. (Closes: #123325) * Fix memory leak in newtTextboxSetText. (Closes: #121505) * Use the proper package name in the prerm script for python-newt. (Closes: #121716) -- Enrique Zanardi Wed, 12 Dec 2001 10:20:06 +0000 newt (0.50.17-7.3) unstable; urgency=high * NMU for woody deadline * Include patch from Philip Blundell to fix UTF8. Closes: #119354 * Remove snack.py~ and Makefile.in~ which seem to have been introduced in the last NMU. -- Matthew Wilcox Wed, 28 Nov 2001 09:28:01 -0700 newt (0.50.17-7.2) unstable; urgency=high * NMU to include corrected snack.py. (Closes: #119815, #120245, #119281) -- Chris Lawrence Sat, 24 Nov 2001 17:57:55 -0600 newt (0.50.17-7.1) unstable; urgency=low * NMU to build with python (2.1). Somewhat fixes #109441. * Add postinst/prerm for python-newt to compile/remove .py files. Closes: #117455. * Build Tcl module for tcl8.3. * Call ldconfig, only when configuring. * Make libnewt0 depend on slang1-dev (>= 1.4.4-2) | slang1-utf8-dev (Closes: #115409). -- Matthias Klose Sun, 21 Oct 2001 19:33:50 +0200 newt (0.50.17-7) unstable; urgency=low * Changed colors for inactive buttons. (Closes: #99652, #54265, #60855, #61150) -- Enrique Zanardi Mon, 4 Jun 2001 10:20:06 +0100 newt (0.50.17-6) unstable; urgency=low * Oops, there was a bug in the patch. -- Enrique Zanardi Fri, 27 Apr 2001 08:44:37 +0100 newt (0.50.17-5) unstable; urgency=low * Some utf8-related fixes (Patch by Edmund Grimley Evans): - remove all use of mbtowc and wctomb, which are evil in a library, as they change an anonymous global state - fix a possible segfault in doReflow() if !resultPtr - remove some historical #if 0 code -- Enrique Zanardi Thu, 26 Apr 2001 14:08:49 +0100 newt (0.50.17-4) unstable; urgency=low * Rebuilt with utf8 version of slang1. (Closes: #93276) -- Enrique Zanardi Fri, 20 Apr 2001 10:02:54 +0100 newt (0.50.17-3) unstable; urgency=low * Builds utf8 versions of libnewt and libnewt-pic. (Closes: Bug#91963) Patch by Edmund Grimley Evans. -- Enrique Zanardi Wed, 11 Apr 2001 22:17:20 +0100 newt (0.50.17-2) unstable; urgency=low * Builds a PIC version of libnewt. (Closes: Bug#91951) * Builds a directory of html files. (Closes: Bug#89906) * Include the right file location in copyright file. (Closes: Bug#91962) -- Enrique Zanardi Wed, 11 Apr 2001 20:21:04 +0100 newt (0.50.17-1) unstable; urgency=low * New upstream version * Added a "abort signal" callback to libnewt, and a "suspend" callback to whiptail. (Closes: Bug#52952, Bug#61807, Bug#84054) * Closing ancient non-bug (just a difference in the way getopt and popt handle arguments). (Closes: Bug#17786) * Added Build-Depends. (Closes: Bug#70101) * Added patch by Oskar Liljeblad to handle NEWT_KEY_{HOME,END}. (Closes: Bug#80961) -- Enrique Zanardi Sun, 18 Feb 2001 10:32:49 +0000 newt (0.50.8-2) unstable; urgency=low * Added -I/usr/include/tcl8.2/ to the list of include dirs for whiptcl and tcl8.2-dev >= 8.2.3-3. (Closes: Bug#67066) * Added --scrolltext description to whiptail.1 manpage (Closes: Bug#75316) * Fixed typo in whiptail.1 manpage (Closes: Bug#75653) -- Enrique Zanardi Fri, 27 Oct 2000 09:52:53 +0100 newt (0.50.8-1) unstable; urgency=low * New upstream version. * whiptcl doesn't have hardcoded terminal size (Closes: Bug#62252) * Close bugs fixed in NMUs. (Closes: Bug#58059, Bug#47855, Bug#57651, Bug#56710, Bug#58817) * Whiptail remembers the state of the screen and restores it on exit (Closes: Bug#57455) * Latest stable version of newt. (Closes: Bug#52834, Bug#54474) -- Enrique Zanardi Wed, 28 Jun 2000 13:38:38 +0100 newt (0.50-7) frozen unstable; urgency=high * Ctrl-U must clear the whole buffer! . Closes: Bug#62828 -- Enrique Zanardi Sat, 22 Apr 2000 13:38:04 +0100 newt (0.50-6) frozen unstable; urgency=low * Use "-O2" on compilation to let it build on m68k and get rid of RC bug 59150 as suggested by Bjoern Brill. -- Enrique Zanardi Thu, 23 Mar 2000 19:37:15 +0000 newt (0.50-5.4) frozen unstable; urgency=low * Non-maintainer upload * Fixes bad cursor position in listboxes, Closes: Bug#58059 -- Eric Delaunay Fri, 10 Mar 2000 22:11:16 +0100 newt (0.50-5.3) frozen unstable; urgency=low * Non-maintainer upload * Don't install libnewt.a with install -s, Closes: Bug#57651 -- Wichert Akkerman Sun, 20 Feb 2000 15:38:54 +0100 newt (0.50-5.2) unstable; urgency=low * Non-maintainer upload * Fixes dependency calculation on debian/rules. closes: #53181 -- Randolph Chung Wed, 22 Dec 1999 16:17:56 -0700 newt (0.50-5.1) unstable; urgency=low * Non-maintainer upload * Adds clear line feature (c-u) to libnewt. closes: #36587 * break lines properly, closes: #43270 * Missing "val" in newt.h; "//" in form.c, closes: #47855 * Fixes sizing code for menu dialogs, closes: #51019 * Fixes whiptail dependencies, closes: #48475, #50165, #50346, #52311 -- Randolph Chung Tue, 14 Dec 1999 21:57:11 -0700 newt (0.50-5) unstable; urgency=low * If gpm is not running ignore gpm support. -- Enrique Zanardi Sun, 7 Nov 1999 19:59:43 +0000 newt (0.50-4) unstable; urgency=low * (finally) enabled gpm support. * fixed whiptail dependencies. -- Enrique Zanardi Sat, 9 Oct 1999 22:32:23 +0100 newt (0.50-3) unstable; urgency=low * explicitly linked to libdl. -- Enrique Zanardi Sat, 9 Oct 1999 21:22:16 +0100 newt (0.50-2) unstable; urgency=low * added a Replaces/Conflicts: newt0.25-dev to allow clean upgrades from slink. (Closes: #47025). -- Enrique Zanardi Sat, 9 Oct 1999 21:22:16 +0100 newt (0.50-1) unstable; urgency=low * new upstream version (Closes: #43427, #45955). * linked to slang 1.3 (Closes: #46951) * stripped debugging symbols from libnewt.a (Closes: #31246). * whiptail is on its own base package (Closes: #36435). * fixed documentation bug about "--clear" (Closes: #24972). * newtRedrawHelpLine() now test for length before memcpy'ng (Closes: #37032, #38602) * manpage updated to describe new options (Closes: #41304). * fixed typo in whiptail output (Closes: #44754). * added support for "password boxes". Patch by Joey Hess (Closes: #45961). -- Enrique Zanardi Tue, 5 Oct 1999 23:47:17 +0100 newt (0.30-1) unstable; urgency=low * New upstream version. -- Enrique Zanardi Thu, 10 Dec 1998 14:28:40 +0000 newt (0.25-3) frozen unstable; urgency=low * Back ported bugfix from newt-0.30 to make whiptail display messages properly. Without this fix, whiptail doesn't show the last word in a message. -- Enrique Zanardi Thu, 10 Dec 1998 12:26:13 +0000 newt (0.25-2) unstable; urgency=low * Excluded tcl and python wrappers. Added code to debian/rules and debian/control-snippet to build a new package, newt-scripting, when the wrappers are mature enough. -- Enrique Zanardi Mon, 3 Aug 1998 13:52:29 +0100 newt (0.25-1) unstable; urgency=low * New upstream version. -- Enrique Zanardi Thu, 30 Jul 1998 17:00:39 +0100 newt (0.21-6) unstable; urgency=low * debian/shlibs really fixed now. -- Enrique Zanardi Wed, 4 Mar 1998 15:38:19 +0000 newt (0.21-5) unstable; urgency=low * Install shared lib mode 644. * debian/shlibs file fixed. * updated Standards-Version. -- Enrique Zanardi Thu, 12 Feb 1998 11:44:44 +0000 newt (0.21-4) unstable; urgency=low * whiptail now has its own package, fixes: Bug#17476 * newt0.21-dev now provides and conflicts newt-dev, fixes: Bug#17477 * Added whiptail(1) manpage, fixes: Bug#16857 * whiptail now uses full screen, fixes: Bug#17155 * Defines the dependency on libc*-dev at build-time, fixes: Bug#17208 -- Enrique Zanardi Sat, 30 Jan 1998 20:14:09 +0000 newt (0.21-3) unstable; urgency=low * Defined newtTextboxAddLine. -- Enrique Zanardi Sat, 10 Jan 1998 03:18:20 +0000 newt (0.21-2) unstable; urgency=low * Added patches by Bruce Perens: * - whiptail don't make over-size windows. * - whiptail will scroll the text and/or the menu to fit on the screen. * - some variables now defined as const. -- Enrique Zanardi Wed, 7 Jan 1998 13:42:34 +0000 newt (0.21-1) unstable; urgency=low * New upstream version. * Not included python support. -- Enrique Zanardi Mon, 5 Jan 1998 16:56:29 +0000 newt (0.10-1) unstable; urgency=low * New package. -- Enrique Zanardi Fri, 26 Dec 1997 18:58:38 +0000 debian/whiptail.docs0000644000000000000000000000002711766635560011677 0ustar debian/README.whiptail debian/libnewt-dev.install0000644000000000000000000000016011766635560013012 0ustar newt.h usr/include tutorial/* usr/share/doc/libnewt-dev/tutorial.html usr/lib/*/libnewt.so usr/lib/*/pkgconfig debian/python-newt-dbg.preinst0000644000000000000000000000024112112731206013612 0ustar #!/bin/sh set -e # handle symlink to directory conversion (#700781) DOCDIR=/usr/share/doc/python-newt-dbg if [ -L $DOCDIR ] ; then rm $DOCDIR fi #DEBHELPER# debian/palette.ubuntu0000644000000000000000000000024012144466311012066 0ustar root=,magenta checkbox=,magenta entry=,magenta label=magenta, actlistbox=,magenta helpline=,magenta roottext=,magenta emptyscale=magenta disabledentry=magenta, debian/compat0000644000000000000000000000000211766635560010403 0ustar 9 debian/python3-newt.dirs0000644000000000000000000000003712144466257012443 0ustar /usr/lib/python3/dist-packages debian/libnewt0.52.postinst0000644000000000000000000000043212164370567012756 0ustar #!/bin/sh set -e #DEBHELPER# case "$1" in configure) # Install alternatives update-alternatives --install /etc/newt/palette newt-palette /etc/newt/palette.ubuntu 50 update-alternatives --install /etc/newt/palette newt-palette /etc/newt/palette.original 20 ;; esac debian/patches/0000755000000000000000000000000012144731077010623 5ustar debian/patches/720_newt_combiwrap.patch0000644000000000000000000000254611766635560015274 0ustar Description: Text incorrectly wrapping at combining characters Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570630 Author: Theppitak Karoonboonyanan Forwarded: no Last-Updated: 2010-02-20 diff -ruN8p newt-0.52.11-old/textbox.c newt-0.52.11/textbox.c --- newt-0.52.11-old/textbox.c 2010-02-20 21:22:43.000000000 +0700 +++ newt-0.52.11/textbox.c 2010-02-20 21:23:04.000000000 +0700 @@ -205,34 +205,36 @@ static void doReflow(const char * text, fprintf(stderr,"adding %d\n",((width / 2) - (len)) / 2); #endif howbad += ((width / 2) - (len)) / 2; } text = end; if (*text) text++; } else { const char *spcptr = NULL; - int spc =0,w2, x; + int spc =0,w2, x, w; chptr = text; w2 = 0; - for (i = 0; i < width - 1;) { + for (i = 0; ;) { if ((x=mbrtowc(&tmp,chptr,end-chptr,&ps))<=0) break; + w = wcwidth(tmp); + if (w>0) + i+=w; + if (i >= width) + break; if (spc && !iswspace(tmp)) spc = 0; else if (!spc && iswspace(tmp)) { spc = 1; spcptr = chptr; w2 = i; } chptr += x; - x = wcwidth(tmp); - if (x>0) - i+=x; } howbad += width - w2 + 1; #ifdef DEBUG_WRAP fprintf(stderr,"adding %d\n",width - w2 + 1, chptr); #endif if (spcptr) chptr = spcptr; if (result) { strncat(result, text, chptr - text ); debian/patches/endianness.patch0000644000000000000000000000117712144473615014002 0ustar Author: Alastair McKinstry Description: Force .mo files to all be little-endian so that the libnewt package can be M-A: same Last-Updated: 2013-05-14 Forwarded: no Index: newt-0.52.15/po/Makefile =================================================================== --- newt-0.52.15.orig/po/Makefile 2013-03-25 14:16:36.000000000 +0000 +++ newt-0.52.15/po/Makefile 2013-05-14 18:41:36.000000000 +0100 @@ -41,7 +41,7 @@ report: @for cat in $(CATALOGS); do \ echo -n "$$cat: "; \ - msgfmt -v --statistics -o /dev/null $$cat; \ + msgfmt --endianness little -v --statistics -o /dev/null $$cat; \ done clean: debian/patches/snackmodule.patch0000644000000000000000000000475612144731077014165 0ustar Author: Alastair McKinstry Description: Changes needed to build python snackmodules. Multiple previous patches rolled into this. Last-Updated: 2013-05-16 Forwarded: no Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/Makefile.in 2013-05-15 17:03:17.000000000 +0100 @@ -12,7 +12,8 @@ TAG = r$(subst .,-,$(VERSION)) SONAME = @SONAME@ -PYTHONVERS = $(shell pyversions --supported; py3versions --supported) +PYTHONVERS := $(shell pyversions --supported; py3versions --supported) +PYTHONDBG := $(addsuffix -dbg, $(PYTHONVERS)) WHIPTCLSO = @WHIPTCLSO@ PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey @@ -77,22 +78,17 @@ $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS) _snackmodule.so: snackmodule.c $(LIBNEWTSH) - @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS); do \ + @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) $(PYTHONDBG); do \ pyconfig=$$ver-config; \ - if ! $$pyconfig --cflags > /dev/null 2>&1 && \ - python-config --cflags > /dev/null 2>&1; then \ - echo $$pyconfig not found, using python-config; \ - pyconfig=python-config; \ - fi; \ mkdir -p $$ver; \ PCFLAGS=`$$pyconfig --cflags`; \ PIFLAGS=`$$pyconfig --includes`; \ - PLDFLAGS=`$$pyconfig --ldflags`; \ - PLFLAGS=`$$pyconfig --libs`; \ - echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ - $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + PLDFLAGS=`$$pyconfig --ldflags | sed -e 's/\-lpython[0-9.]*[_a-z]*//'`; \ + PLFLAGS=`$$pyconfig --libs | sed -e 's/\-lpython[0-9.]*[_a-z]*//'`; \ + echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $(CFLAGS) -fPIC $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + $(CC) $(SHCFLAGS) $(CPPFLAGS) $(CFLAGS) $$PIFLAGS $$PCFLAGS -fPIC -c -o $$ver/snackmodule.o snackmodule.c; \ + echo $(CC) --shared -fPIC $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + $(CC) --shared -fPIC $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ done || : touch $@ debian/patches/lithuanian.patch0000644000000000000000000000277611766635560014025 0ustar Author: Alastair McKinstry Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=675678 Description: Updated Lithuanian translation. Last-Updated: 2012-06-14 Forwarded: no Index: newt.git/po/lt.po =================================================================== --- newt.git.orig/po/lt.po 2011-11-11 11:00:15.000000000 +0000 +++ newt.git/po/lt.po 2012-06-15 13:45:48.000000000 +0100 @@ -2,19 +2,22 @@ # Copyright (C) 2003 Free Software Foundation # This file is distributed under the same license as the newt package. # Kęstutis Biliūnas , 2004. -# -# +# Rimas Kudelis , 2012. msgid "" msgstr "" "Project-Id-Version: newt 0.51.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-09-14 16:03+0200\n" -"PO-Revision-Date: 2004-01-13 22:07+0200\n" -"Last-Translator: Kęstutis Biliūnas \n" +"PO-Revision-Date: 2012-06-02 19:22+0300\n" +"Last-Translator: Rimas Kudelis \n" "Language-Team: Lithuanian \n" +"Language: lt\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%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%" +"100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Virtaal 0.7.1\n" #: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 msgid "Ok" @@ -22,7 +25,7 @@ #: ../dialogboxes.c:51 msgid "Cancel" -msgstr "Atšaukti" +msgstr "Atsisakyti" #: ../dialogboxes.c:498 msgid "Yes" debian/patches/620_asturian.patch0000644000000000000000000000417611766635560014102 0ustar Author: Marcos Alvarez Costales Description: Updated Asturian support for Newt. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=#538951 Last-Updaed: 2009-12-18 Forwarded: no diff -ruN newt-0.52.11-old/po/ast.po newt-0.52.11/po/ast.po --- newt-0.52.11-old/po/ast.po 2009-12-18 02:18:12.000000000 +0000 +++ newt-0.52.11/po/ast.po 2009-12-18 02:15:00.000000000 +0000 @@ -1,34 +1,35 @@ -# Spanish translations for newt -# Copyright (C) 2003 Free Software Foundation -# This file is distributed under the same license as the newt package. -# Alastair McKinstry , 2003 -msgid "" -msgstr "" -"Project-Id-Version: newt 0.51.4\n" -"Report-Msgid-Bugs-To: mckinstry@debian.org\n" -"POT-Creation-Date: 2005-11-22 09:35+0100\n" -"PO-Revision-Date: 2009-03-09 07:36+0100\n" -"Last-Translator: Marcos Alvarez Costales \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: dialogboxes.c:43 -#: dialogboxes.c:48 -#: dialogboxes.c:493 -msgid "Ok" -msgstr "Aceutar" - -#: dialogboxes.c:51 -msgid "Cancel" -msgstr "Encaboxar" - -#: dialogboxes.c:498 -msgid "Yes" -msgstr "S" - -#: dialogboxes.c:500 -msgid "No" -msgstr "Non" - +# Newt Debian. +# Copyright (C) 2009 +# This file is distributed under the same license as the PACKAGE package. +# Marcos , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Newt Debian\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: 2009-07-28 08:13+0100\n" +"Last-Translator: Marcos \n" +"Language-Team: Asturian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../dialogboxes.c:43 +#: ../dialogboxes.c:48 +#: ../dialogboxes.c:493 +msgid "Ok" +msgstr "Aceutar" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "Encaboxar" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "Sí" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "Non" + debian/patches/python-dbg.patch0000644000000000000000000000323412144534430013713 0ustar Author: Michael Vogt at Ubuntu Description: Build for python-dbg package Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531725 Forwarded: not-needed Last-Updated: 2012-01-09 Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-05-14 23:21:21.000000000 +0100 +++ newt-0.52.15/Makefile.in 2013-05-14 23:22:10.000000000 +0100 @@ -90,6 +90,8 @@ PLDFLAGS=`$$pyconfig --ldflags`; \ PLFLAGS=`$$pyconfig --libs`; \ echo $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + $(CC) $(subst -O2,-O0,$(CFLAGS)) -I/usr/include/$${ver}_d -fPIC -c -o $$ver/snackmodule_d.o snackmodule.c ;\ + $(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\ $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ echo $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ @@ -152,6 +154,7 @@ [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \ [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\ install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\ + install -m 755 $$ver/_snackmodule_d.so $(instroot)/$(libdir)/$$ver/site-packages ;\ install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\ done || : debian/patches/italian.patch0000644000000000000000000000311111766635560013272 0ustar Author: Milo Casagrande Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559499 Description: Updated Italian translation. Last-Updated: 2009-12-18 Forwarded: no diff -ruN newt-0.52.11-old/po/it.po newt-0.52.11/po/it.po --- newt-0.52.11-old/po/it.po 2008-07-30 13:42:55.000000000 +0100 +++ newt-0.52.11/po/it.po 2009-12-18 02:17:46.000000000 +0000 @@ -1,23 +1,23 @@ # Italian translations for newt -# Copyright (C) 2003 Free Software Foundation +# Copyright (C) 2003-2009 Free Software Foundation # This file is distributed under the same license as the newt package. # Giuseppe Sacco , 2004. -# +# Milo Casagrande , 2009. msgid "" msgstr "" -"Project-Id-Version: newt 0.51.4\n" +"Project-Id-Version: newt\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-09-14 16:03+0200\n" -"PO-Revision-Date: 2003-07-19 11:25+0100\n" -"Last-Translator: Giuseppe Sacco \n" -"Language-Team: Debian Italian \n" +"PO-Revision-Date: 2009-12-04 22:23+0100\n" +"Last-Translator: Milo Casagrande \n" +"Language-Team: Italian \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 msgid "Ok" -msgstr "Ok" +msgstr "OK" #: ../dialogboxes.c:51 msgid "Cancel" @@ -25,7 +25,7 @@ #: ../dialogboxes.c:498 msgid "Yes" -msgstr "S" +msgstr "Sì" #: ../dialogboxes.c:500 msgid "No" debian/patches/hardening.patch0000644000000000000000000000275012144637641013611 0ustar Author: Alastair McKinstry Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658430 Description: Add hardening flags to Makefile.in Last-Updated: 2013-05-16 Forwarded: no Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-03-25 14:16:36.000000000 +0000 +++ newt-0.52.15/Makefile.in 2013-05-14 18:51:55.000000000 +0100 @@ -89,10 +89,10 @@ PIFLAGS=`$$pyconfig --includes`; \ PLDFLAGS=`$$pyconfig --ldflags`; \ PLFLAGS=`$$pyconfig --libs`; \ - echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ - $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + echo $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + echo $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ done || : touch $@ debian/patches/python_memory_allocation.patch0000644000000000000000000000223312144454732016762 0ustar Author: Thomas Viehmann Description: Fix for python memory handling Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=445392 Last-Updated: 2009-04-20 Forwarded: no Index: newt-0.52.15/snackmodule.c =================================================================== --- newt-0.52.15.orig/snackmodule.c 2013-05-14 16:35:23.000000000 +0100 +++ newt-0.52.15/snackmodule.c 2013-05-14 16:35:50.000000000 +0100 @@ -275,7 +275,7 @@ static snackWidget * snackWidgetNew (void) { snackWidget * widget; - widget = PyObject_NEW(snackWidget, &snackWidgetType); + widget = PyObject_New(snackWidget, &snackWidgetType); if (!widget) return NULL; @@ -841,7 +841,7 @@ if (help == Py_None) help = NULL; - form = PyObject_NEW(snackForm, &snackFormType); + form = PyObject_New(snackForm, &snackFormType); form->fo = newtForm(NULL, help, 0); return form; @@ -853,7 +853,7 @@ if (!PyArg_ParseTuple(args, "ii", &cols, &rows)) return NULL; - grid = PyObject_NEW(snackGrid, &snackGridType); + grid = PyObject_New(snackGrid, &snackGridType); grid->grid = newtCreateGrid(cols, rows); return grid; debian/patches/uighir.patch0000644000000000000000000000256611766635560013155 0ustar Origin: Sahran Description: Translation file for Uighir Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=newt_newt_po_ug.zip;att=2;bug=627014 Forwarded: no Last-Updated: 2011-12-03 Index: newt-0.52.14/po/ug.po =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ newt-0.52.14/po/ug.po 2011-12-03 12:26:41.000000000 +0000 @@ -0,0 +1,35 @@ +# Uyghur translation for newt_newt. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Sahran , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: newt_newt\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: 2011-02-15 20:10+0600\n" +"Last-Translator: Sahran \n" +"Language-Team: Uyghur Computer Science Association \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../dialogboxes.c:43 +#: ../dialogboxes.c:48 +#: ../dialogboxes.c:493 +msgid "Ok" +msgstr "جەزملە" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "ۋاز كەچ" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "ھەئە" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "ياق" + debian/patches/no-libpython.patch0000644000000000000000000000221712144723124014262 0ustar Author: Alastair McKinstry Description: Remove linkages to -lpython*.* from link line for modules. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655244 Forwarded: no Last-Updated: 2012-01-09 Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-05-14 16:36:17.000000000 +0100 +++ newt-0.52.15/Makefile.in 2013-05-14 16:37:04.000000000 +0100 @@ -87,8 +87,8 @@ mkdir -p $$ver; \ PCFLAGS=`$$pyconfig --cflags`; \ PIFLAGS=`$$pyconfig --includes`; \ - PLDFLAGS=`$$pyconfig --ldflags`; \ - PLFLAGS=`$$pyconfig --libs`; \ + PLDFLAGS=`$$ver-config --ldflags | sed -e 's/\-lpython[0-9.]*[a-z]*//'`; \ + PLFLAGS=`$$ver-config --libs | sed -e 's/\-lpython[0-9.]*[a-z]*//'`; \ echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ $(CC) $(subst -O2,-O0,$(CFLAGS)) -I/usr/include/$${ver}_d -fPIC -c -o $$ver/snackmodule_d.o snackmodule.c ;\ $(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\ debian/patches/escape_key.patch0000644000000000000000000000113611766635560013766 0ustar Author: Julien-externe BLACHE Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584098 Description: Fix to allow ESC key to work in whiptail. Last-Updated: 2010-06-21 Forwarded: no diff -ruN newt-0.52.11-old/form.c newt-0.52.11/form.c --- newt-0.52.11-old/form.c 2009-09-24 16:03:09.000000000 +0100 +++ newt-0.52.11/form.c 2010-06-21 13:09:31.000000000 +0100 @@ -474,6 +474,7 @@ if (!(form->flags & NEWT_FLAG_NOF12)) { newtFormAddHotKey(co, NEWT_KEY_F12); } + newtFormAddHotKey (co, NEWT_KEY_ESCAPE); if (vertBar) form->vertBar = vertBar; debian/patches/tcl86.patch0000644000000000000000000000110711766635560012614 0ustar Author: Alastair McKinstry Description: For tcl, build and ship whiptcl.so Forwarded: no Last-Updated: 2011-12-03 Index: newt-0.52.14/Makefile.in =================================================================== --- newt-0.52.14.orig/Makefile.in 2011-12-03 09:48:35.000000000 +0000 +++ newt-0.52.14/Makefile.in 2011-12-03 09:48:56.000000000 +0000 @@ -59,7 +59,7 @@ TARGET=depend $(PROGS) endif -all: $(TARGET) _snackmodule.so +all: $(TARGET) _snackmodule.so whiptcl.so test: test.o $(LIBNEWT) $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS) debian/patches/belarussian.patch0000644000000000000000000000221311766635560014163 0ustar Author: Viktar Siarheichyk Description: Belarussian support for Newt. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595938 Last-Updaed: 2010-10-16 Forwarded: no diff -ruN newt-0.52.11-old/po/be.po newt-0.52.11/po/be.po --- newt-0.52.11-old/po/be.po 1970-01-01 01:00:00.000000000 +0100 +++ newt-0.52.11/po/be.po 2010-10-16 15:20:19.000000000 +0100 @@ -0,0 +1,33 @@ +msgid "" +msgstr "" +"Project-Id-Version: be\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: \n" +"Last-Translator: Viktar Siarheichyk \n" +"Language-Team: Belarusian (Official spelling) \n" +"Language: Belarusian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Belarusian\n" +"X-Poedit-Country: BELARUS\n" + +#: ../dialogboxes.c:43 +#: ../dialogboxes.c:48 +#: ../dialogboxes.c:493 +msgid "Ok" +msgstr "Добра" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "Скасаваць" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "Так" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "Не" + debian/patches/bidi.patch0000644000000000000000000016340011766635560012570 0ustar Author: Various, including Eugeniy Meshcheryakov, Alastair McKinstry Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=323832 Description: Bidirectional text support for NEWT. Last-Updated: 2011-12-05 Forwarded: no Index: newt-0.52.14/button.c =================================================================== --- newt-0.52.14.orig/button.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/button.c 2012-01-02 10:53:23.000000000 +0000 @@ -113,7 +113,7 @@ SLsmg_set_color(NEWT_COLORSET_ACTBUTTON); newtGotorc(co->top+ pushed, co->left + 1 + pushed); SLsmg_write_char('<'); - SLsmg_write_string(bu->text); + write_string_int(bu->text, NULL); SLsmg_write_char('>'); } else { if (pushed) { @@ -145,7 +145,7 @@ newtGotorc(co->top + 1 + pushed, co->left + 1 + pushed); SLsmg_write_char(' '); - SLsmg_write_string(bu->text); + write_string_int(bu->text, NULL); SLsmg_write_char(' '); } Index: newt-0.52.14/checkbox.c =================================================================== --- newt-0.52.14.orig/checkbox.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/checkbox.c 2012-01-02 10:53:23.000000000 +0000 @@ -210,7 +210,7 @@ break; } - SLsmg_write_string(cb->text); + write_string_int(cb->text, NULL); if (cb->hasFocus) SLsmg_set_color(cb->active); Index: newt-0.52.14/checkboxtree.c =================================================================== --- newt-0.52.14.orig/checkboxtree.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/checkboxtree.c 2012-01-02 10:53:23.000000000 +0000 @@ -492,7 +492,7 @@ currRow = co->top + i; } - SLsmg_write_nstring((*item)->text, co->width - 4 - (3 * (*item)->depth)); + write_nstring_int((*item)->text, co->width - 4 - (3 * (*item)->depth), NULL); item++; i++; Index: newt-0.52.14/configure.ac =================================================================== --- newt-0.52.14.orig/configure.ac 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/configure.ac 2012-01-02 10:53:23.000000000 +0000 @@ -29,7 +29,10 @@ AC_SUBST([GNU_LD]) fi -AC_CHECK_HEADERS([sys/select.h alloca.h]) +AC_CHECK_HEADERS([sys/select.h alloca.h fribidi/fribidi.h dlfcn.h]) +AC_SEARCH_LIBS([dlopen], [dl]) +AC_SUBST([LIBS]) + AC_CHECK_HEADER([slang.h], [], [ old_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} -I/opt/local/include" @@ -102,6 +105,7 @@ fi AC_SUBST([WHIPTCLSO]) + AC_ARG_WITH([gpm-support], [ --with-gpm-support compile with GPM support]) if test "x$with_gpm_support" = "xyes"; then Index: newt-0.52.14/entry.c =================================================================== --- newt-0.52.14.orig/entry.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/entry.c 2012-01-02 10:53:23.000000000 +0000 @@ -233,12 +233,15 @@ if (len <= co->width) { i = len; - SLsmg_write_string(chptr); + /* BIDI: do not replaced, because it will not work. + * More work needed */ + SLsmg_write_nstring(chptr, len); while (i < co->width) { SLsmg_write_char('_'); i++; } } else + /* BIDI: will not work for RTL text */ SLsmg_write_nstring(chptr, co->width); newtGotorc(co->top, co->left + wstrlen(en->buf+en->firstChar, en->cursorPosition - en->firstChar)); Index: newt-0.52.14/label.c =================================================================== --- newt-0.52.14.orig/label.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/label.c 2012-01-02 10:53:23.000000000 +0000 @@ -80,7 +80,9 @@ SLsmg_set_color(la->cs); newtGotorc(co->top, co->left); - SLsmg_write_string(la->text); + /* BIDI: need to check if nstring is really needed. + * Where it is used? */ + write_nstring_int(la->text, co->width, NULL); } static void labelDestroy(newtComponent co) { Index: newt-0.52.14/listbox.c =================================================================== --- newt-0.52.14.orig/listbox.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/listbox.c 2012-01-02 10:53:23.000000000 +0000 @@ -530,7 +530,7 @@ else SLsmg_set_color(NEWT_COLORSET_LISTBOX); - SLsmg_write_nstring(item->text, li->curWidth); + write_nstring_int(item->text, li->curWidth, NULL); if (li->flags & NEWT_FLAG_MULTIPLE) { newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust); Index: newt-0.52.14/newt.c =================================================================== --- newt-0.52.14.orig/newt.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/newt.c 2012-01-02 10:53:23.000000000 +0000 @@ -18,6 +18,478 @@ #include "newt.h" #include "newt_pr.h" +#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) +#include +#include + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +/* No sense in enabling shaping if we don't have BIDI support. */ +typedef struct +{ + int is_shaped; + wchar_t isolated; + wchar_t initial; + wchar_t medial; + wchar_t final; +} +arabic_char_node; + +#define ARABIC_BASE 0x621 +#define ARABIC_END 0x64A + +static const arabic_char_node arabic_shaping_table[] = { +/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, +/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, +/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, +/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, +/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, +/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, +/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, +/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, +/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, +/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, +/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, +/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, +/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, +/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, +/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, +/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, +/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, +/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, +/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, +/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, +/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, +/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, +/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, +/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, +/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, +/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, +/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, +/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, +/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, +/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, +/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, +/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, +/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, +/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, +/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, +/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, +/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} +}; + +typedef struct { + wchar_t c; + arabic_char_node ar_node; +} +extra_char_node; + +#define EXTRA_BASE 0x67E +#define EXTRA_END 0x6CC +static const extra_char_node extra_shaping_table[] = { + {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, + {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, + {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, + {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, + {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, + {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, + {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, +}; + +static const arabic_char_node *get_char_node(wchar_t w) +{ + if (w >= ARABIC_BASE && w <= ARABIC_END) + return &arabic_shaping_table[w - ARABIC_BASE]; + else if (w >= EXTRA_BASE && w <= EXTRA_END) { + const extra_char_node *node = extra_shaping_table; + + while (node->c) { + if (node->c == w) + return &node->ar_node; + node++; + } + return NULL; + } + return NULL; +} + +static int do_shaping(wchar_t *buf, int len) { + int i,j; + + wchar_t *newbuf; + + if (len < 1) + return 0; + + newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); + + for (i = 0, j = 0; i < len; i++, j++) { + int have_previous = FALSE, have_next = FALSE; + const arabic_char_node *node, *node1; + int prev, next; + + if (buf[i] == L'\0') + break; + + /* If it is non-joiner, ignore it */ + if (buf[i] == 0x200C) { + j--; + continue; + } + + newbuf[j] = buf[i]; + + /* If it's not in our range, skip it. */ + node = get_char_node(buf[i]); + if (!node) + { + continue; + } + + /* The character wasn't included in the unicode shaping table. */ + if (!node->is_shaped) + { + continue; + } + + for (prev = i - 1; prev >= 0; prev--) + if (wcwidth(buf[prev]) || buf[prev] == 0x200C) + break; + + if (prev >= 0 && (node1 = get_char_node(buf[prev])) + && ( node1->initial || node1->medial)) + { + have_previous = TRUE; + } + + for (next = i + 1; next < len; next++) + if (wcwidth(buf[next]) || buf[next] == 0x200C) + break; + + if (next < len && (node1 = get_char_node(buf[next])) + && (node1->medial || node1->final)) + { + have_next = TRUE; + } + + /* + * FIXME: do not make ligature if there are combining + * characters between two parts. + */ + if (buf[i] == 0x644 && have_next && next == i + 1) + { + switch (buf[next]) + { + case 0x622: + newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); + i++; + continue; + case 0x623: + newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); + i++; + continue; + case 0x625: + newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); + i++; + continue; + case 0x627: + newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); + i++; + continue; + default: + break; + } + } + + /** Medial **/ + if (have_previous && have_next && node->medial) + { + newbuf[j] = node->medial; + } + + /** Final **/ + else if (have_previous && node->final) + { + newbuf[j] = node->final; + } + + /** Initial **/ + else if (have_next && node->initial) + { + newbuf[j] = node->initial; + } + + /** Isolated **/ + else if (node->isolated) + { + newbuf[j] = node->isolated; + } + } + for (i = 0; i < len && i < j; i++) { + buf[i] = newbuf[i]; + } + while (i < len) { + buf[i++] = L'\0'; + } + + free(newbuf); + return 0; +} + +/* Converts bidi wchar text {in} to visual wchar text which is displayable + * in text mode. Uses {base_dir} as default base direction. + * Returns malloc'ed converted text or NULL in case of error or if {need_out} is + * not set. Modifies {base_dir} to reflect actual direction. + */ +static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) +{ + FriBidiChar *out = NULL; + static void *handle = NULL; + static int skip_out = 0; + + fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, + FriBidiCharType *, FriBidiChar *, + FriBidiStrIndex *, FriBidiStrIndex *, + FriBidiLevel *); + + if (skip_out) + return NULL; + dlerror(); /* clear error state */ + if (!handle) { + handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); + /* call dlerror() on failure to clear error state in dlopen modules */ + if (!handle) dlerror(); + } + if (!handle) { + handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); + } + if (!handle) { + dlerror(); + skip_out = 1; + return NULL; + } + func_ptr = dlsym(handle, "fribidi_log2vis"); + if (!func_ptr) { + skip_out = 1; + if (dlclose(handle)) + dlerror(); + handle = NULL; + return NULL; + } + + if (need_out) { + out = (FriBidiChar *)calloc(len+1, sizeof(FriBidiChar)); + if(!out) + { + dlclose(handle); + handle = NULL; + return (wchar_t *) out; + } + + do_shaping(in, len); + len = wcsnlen(in, len); + } + (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); + + return (wchar_t *) out; +} + +/* + * Converts text given in {str} from logical order to visual order. + * Uses {dir} as base direction ('N', 'R', 'L'). + * Returns malloc'ed converted string. Modifies {dir} to reflect actual + * direction. + */ +static char *_newt_log2vis(const char *str, char *dir) +{ + wchar_t *wcs; + char *rstr = NULL; + int len = strlen(str); + int ret; + FriBidiCharType basedir; + + switch (*dir) + { + case 'R': basedir = FRIBIDI_TYPE_R; + break; + case 'L': basedir = FRIBIDI_TYPE_L; + break; + default: basedir = FRIBIDI_TYPE_ON; + break; + } + + if (len) { + wchar_t *owcs; + int newlen; + + wcs = malloc(sizeof(*wcs) * (len + 1)); + if (!wcs) + return NULL; + ret = mbstowcs(wcs, str, len + 1); + if (ret < 0) { + free(wcs); + return NULL; + } + owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); + if (FRIBIDI_DIR_TO_LEVEL(basedir)) + *dir = 'R'; + else + *dir = 'L'; + + free(wcs); + if (!owcs) + return NULL; + + newlen = wcstombs(NULL, owcs, 0); + if (newlen < 0) { + free(owcs); + return NULL; + } + rstr = malloc(newlen + 1); + if (!rstr) { + free(owcs); + return NULL; + } + ret = wcstombs(rstr, owcs, newlen + 1); + free(owcs); + if (ret < 0) { + free(rstr); + return NULL; + } + } + return rstr; +} + +/* Returns base direction of text given in {str}. + */ +char get_text_direction(const char *str) +{ + int len = strlen(str); + char dir = 'N'; + wchar_t *wcs; + int ret; + + FriBidiCharType basedir = FRIBIDI_TYPE_ON; + + if (len) { + wcs = malloc(sizeof(*wcs) * (len + 1)); + if (!wcs) + return dir; + ret = mbstowcs(wcs, str, len + 1); + if (ret < 0) { + free(wcs); + return dir; + } + wchar_to_textmod_visual(wcs, ret, &basedir, 1); + free(wcs); + if (FRIBIDI_DIR_TO_LEVEL(basedir)) + dir = 'R'; + else + dir = 'L'; + } + return dir; +} + +/* If width of string {str} is less then {width} adds + * final spaces to make it {width} position wide. + * Returns malloc'ed padded string or NULL in case of errors + * or if string does not need padding. + */ +static char *pad_line(const char *str, int width) +{ + int len = strlen(str); + int w = _newt_wstrlen(str, len); + + if (w < width) { + char *newstr = malloc(len + 1 + (width - w)); + if (!newstr) + return NULL; + memcpy(newstr, str, len); + memset(newstr + len, ' ', width - w); + newstr[len+width-w] = '\0'; + return newstr; + } + return NULL; +} + +/* + * Writes string {str}. Uses {dir} as default direction. + * Returns direction of the string in {dir}. + */ +void write_string_int(const char *str, char *dir) +{ + char dummy; + char *tmpstr; + + if (!dir) { + dummy = 'N'; + dir = &dummy; + } + + tmpstr = _newt_log2vis(str, dir); + if (tmpstr) + str = tmpstr; + SLsmg_write_string(str); + if (tmpstr) + free(tmpstr); +} + +/* Writes at most {n} positions of the string {str}. + * Adds final (logical) spaces if string width is less than {n}. + * Uses {dir} as default direction. + * Returns direction of the string in {dir} + */ +void write_nstring_int(const char *str, int n, char *dir) +{ + char dummy; + char *tmpstr, *tmpstr1; + + if (!dir) { + dummy = 'N'; + dir = &dummy; + } + + tmpstr1 = pad_line(str, n); + if (tmpstr1) + str = tmpstr1; + tmpstr = _newt_log2vis(str, dir); + if (tmpstr) { + free(tmpstr1); + str = tmpstr; + } + SLsmg_write_nstring(str, n); + if (tmpstr) + free(tmpstr); + else + free(tmpstr1); +} +#else +void write_string_int(const char *str, char *dir) +{ + SLsmg_write_string(str); +} + +void write_nstring_int(const char *str, int w, char *dir) +{ + SLsmg_write_nstring(str, w); +} + +char get_text_direction(const char *str) +{ + return 'L'; +} +#endif + struct Window { int height, width, top, left; SLsmg_Char_Type * buffer; @@ -808,7 +1280,7 @@ SLsmg_set_char_set(0); SLsmg_write_char(' '); SLsmg_set_color(NEWT_COLORSET_TITLE); - SLsmg_write_string((char *)currentWindow->title); + write_string_int((char *)currentWindow->title, NULL); SLsmg_set_color(NEWT_COLORSET_BORDER); SLsmg_write_char(' '); SLsmg_set_char_set(1); @@ -1062,7 +1534,7 @@ buf[SLtt_Screen_Cols] = '\0'; } SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); - SLsmg_write_string(buf); + write_string_int(buf, NULL); } void newtPushHelpLine(const char * text) { @@ -1107,7 +1579,7 @@ } SLsmg_gotorc(row, col); - SLsmg_write_string((char *)text); + write_string_int((char *)text, NULL); } int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { Index: newt-0.52.14/newt.c-old =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ newt-0.52.14/newt.c-old 2012-01-02 10:53:23.000000000 +0000 @@ -0,0 +1,1438 @@ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_ALLOCA_H +#include +#endif + +#include "newt.h" +#include "newt_pr.h" + +#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) +#include +#include + +/* No sense in enabling shaping if we don't have BIDI support. */ +typedef struct +{ + int is_shaped; + wchar_t isolated; + wchar_t initial; + wchar_t medial; + wchar_t final; +} +arabic_char_node; + +#define ARABIC_BASE 0x621 +#define ARABIC_END 0x64A + +static const arabic_char_node arabic_shaping_table[] = { +/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, +/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, +/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, +/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, +/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, +/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, +/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, +/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, +/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, +/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, +/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, +/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, +/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, +/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, +/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, +/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, +/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, +/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, +/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, +/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, +/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, +/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, +/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, +/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, +/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, +/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, +/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, +/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, +/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, +/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, +/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, +/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, +/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, +/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, +/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, +/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, +/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} +}; + +typedef struct { + wchar_t c; + arabic_char_node ar_node; +} +extra_char_node; + +#define EXTRA_BASE 0x67E +#define EXTRA_END 0x6CC +static const extra_char_node extra_shaping_table[] = { + {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, + {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, + {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, + {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, + {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, + {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, + {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, +}; + +static const arabic_char_node *get_char_node(wchar_t w) +{ + if (w >= ARABIC_BASE && w <= ARABIC_END) + return &arabic_shaping_table[w - ARABIC_BASE]; + else if (w >= EXTRA_BASE && w <= EXTRA_END) { + const extra_char_node *node = extra_shaping_table; + + while (node->c) { + if (node->c == w) + return &node->ar_node; + node++; + } + return NULL; + } + return NULL; +} + +static int do_shaping(wchar_t *buf, int len) { + int i,j; + + wchar_t *newbuf; + + if (len < 1) + return 0; + + newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); + + for (i = 0, j = 0; i < len; i++, j++) { + int have_previous = FALSE, have_next = FALSE; + const arabic_char_node *node, *node1; + int prev, next; + + if (buf[i] == L'\0') + break; + + /* If it is non-joiner, ignore it */ + if (buf[i] == 0x200C) { + j--; + continue; + } + + newbuf[j] = buf[i]; + + /* If it's not in our range, skip it. */ + node = get_char_node(buf[i]); + if (!node) + { + continue; + } + + /* The character wasn't included in the unicode shaping table. */ + if (!node->is_shaped) + { + continue; + } + + for (prev = i - 1; prev >= 0; prev--) + if (wcwidth(buf[prev]) || buf[prev] == 0x200C) + break; + + if (prev >= 0 && (node1 = get_char_node(buf[prev])) + && ( node1->initial || node1->medial)) + { + have_previous = TRUE; + } + + for (next = i + 1; next < len; next++) + if (wcwidth(buf[next]) || buf[next] == 0x200C) + break; + + if (next < len && (node1 = get_char_node(buf[next])) + && (node1->medial || node1->final)) + { + have_next = TRUE; + } + + /* + * FIXME: do not make ligature if there are combining + * characters between two parts. + */ + if (buf[i] == 0x644 && have_next && next == i + 1) + { + switch (buf[next]) + { + case 0x622: + newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); + i++; + continue; + case 0x623: + newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); + i++; + continue; + case 0x625: + newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); + i++; + continue; + case 0x627: + newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); + i++; + continue; + default: + break; + } + } + + /** Medial **/ + if (have_previous && have_next && node->medial) + { + newbuf[j] = node->medial; + } + + /** Final **/ + else if (have_previous && node->final) + { + newbuf[j] = node->final; + } + + /** Initial **/ + else if (have_next && node->initial) + { + newbuf[j] = node->initial; + } + + /** Isolated **/ + else if (node->isolated) + { + newbuf[j] = node->isolated; + } + } + for (i = 0; i < len && i < j; i++) { + buf[i] = newbuf[i]; + } + while (i < len) { + buf[i++] = L'\0'; + } + + free(newbuf); + return 0; +} + +/* Converts bidi wchar text {in} to visual wchar text which is displayable + * in text mode. Uses {base_dir} as default base direction. + * Returns malloc'ed converted text or NULL in case of error or if {need_out} is + * not set. Modifies {base_dir} to reflect actual direction. + */ +static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) +{ + FriBidiChar *out = NULL; + static void *handle = NULL; + + fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, + FriBidiCharType *, FriBidiChar *, + FriBidiStrIndex *, FriBidiStrIndex *, + FriBidiLevel *); + + if (!handle) + handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); + if (!handle) + handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); + if (!handle) + return NULL; + + func_ptr = dlsym(handle, "fribidi_log2vis"); + if (!func_ptr) { + dlclose(handle); + handle = NULL; + return NULL; + } + + if (need_out) { + out = (FriBidiChar *)malloc(sizeof(FriBidiChar)*(len+1)); + if(!out) + { + dlclose(handle); + handle = NULL; + return (wchar_t *) out; + } + + do_shaping(in, len); + len = wcsnlen(in, len); + } + (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); + + return (wchar_t *) out; +} + +/* + * Converts text given in {str} from logical order to visual order. + * Uses {dir} as base direction ('N', 'R', 'L'). + * Returns malloc'ed converted string. Modifies {dir} to reflect actual + * direction. + */ +static char *_newt_log2vis(const char *str, char *dir) +{ + wchar_t *wcs; + char *rstr = NULL; + int len = strlen(str); + int ret; + FriBidiCharType basedir; + + switch (*dir) + { + case 'R': basedir = FRIBIDI_TYPE_R; + break; + case 'L': basedir = FRIBIDI_TYPE_L; + break; + default: basedir = FRIBIDI_TYPE_ON; + break; + } + + if (len) { + wchar_t *owcs; + int newlen; + + wcs = malloc(sizeof(*wcs) * (len + 1)); + if (!wcs) + return NULL; + ret = mbstowcs(wcs, str, len + 1); + if (ret < 0) { + free(wcs); + return NULL; + } + owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); + if (FRIBIDI_DIR_TO_LEVEL(basedir)) + *dir = 'R'; + else + *dir = 'L'; + + free(wcs); + if (!owcs) + return NULL; + + newlen = wcstombs(NULL, owcs, 0); + if (newlen < 0) { + free(owcs); + return NULL; + } + rstr = malloc(newlen + 1); + if (!rstr) { + free(owcs); + return NULL; + } + ret = wcstombs(rstr, owcs, newlen + 1); + free(owcs); + if (ret < 0) { + free(rstr); + return NULL; + } + } + return rstr; +} + +/* Returns base direction of text given in {str}. + */ +char get_text_direction(const char *str) +{ + int len = strlen(str); + char dir = 'N'; + wchar_t *wcs; + int ret; + + FriBidiCharType basedir = FRIBIDI_TYPE_ON; + + if (len) { + wcs = malloc(sizeof(*wcs) * (len + 1)); + if (!wcs) + return dir; + ret = mbstowcs(wcs, str, len + 1); + if (ret < 0) { + free(wcs); + return dir; + } + wchar_to_textmod_visual(wcs, ret, &basedir, 1); + free(wcs); + if (FRIBIDI_DIR_TO_LEVEL(basedir)) + dir = 'R'; + else + dir = 'L'; + } + return dir; +} + +/* If width of string {str} is less then {width} adds + * final spaces to make it {width} position wide. + * Returns malloc'ed padded string or NULL in case of errors + * or if string does not need padding. + */ +static char *pad_line(const char *str, int width) +{ + int len = strlen(str); + int w = _newt_wstrlen(str, len); + + if (w < width) { + char *newstr = malloc(len + 1 + (width - w)); + if (!newstr) + return NULL; + memcpy(newstr, str, len); + memset(newstr + len, ' ', width - w); + newstr[len+width-w] = '\0'; + return newstr; + } + return NULL; +} + +/* + * Writes string {str}. Uses {dir} as default direction. + * Returns direction of the string in {dir}. + */ +void write_string_int(const char *str, char *dir) +{ + char dummy; + char *tmpstr; + + if (!dir) { + dummy = 'N'; + dir = &dummy; + } + + tmpstr = _newt_log2vis(str, dir); + if (tmpstr) + str = tmpstr; + SLsmg_write_string(str); + if (tmpstr) + free(tmpstr); +} + +/* Writes at most {n} positions of the string {str}. + * Adds final (logical) spaces if string width is less than {n}. + * Uses {dir} as default direction. + * Returns direction of the string in {dir} + */ +void write_nstring_int(const char *str, int n, char *dir) +{ + char dummy; + char *tmpstr, *tmpstr1; + + if (!dir) { + dummy = 'N'; + dir = &dummy; + } + + tmpstr1 = pad_line(str, n); + if (tmpstr1) + str = tmpstr1; + tmpstr = _newt_log2vis(str, dir); + if (tmpstr) { + free(tmpstr1); + str = tmpstr; + } + SLsmg_write_nstring(str, n); + if (tmpstr) + free(tmpstr); + else + free(tmpstr1); +} +#else +void write_string_int(const char *str, char *dir) +{ + SLsmg_write_string(str); +} + +void write_nstring_int(const char *str, int w, char *dir) +{ + SLsmg_write_nstring(str, w); +} + +char get_text_direction(const char *str) +{ + return 'L'; +} +#endif + +struct Window { + int height, width, top, left; + SLsmg_Char_Type * buffer; + char * title; +}; + +struct keymap { + char * str; + int code; + char * tc; +}; + +static struct Window windowStack[20]; +static struct Window * currentWindow = NULL; + +static char * helplineStack[20]; +static char ** currentHelpline = NULL; + +static int cursorRow, cursorCol; +static int needResize = 0; +static int cursorOn = 1; +static int trashScreen = 0; + +static const char * defaultHelpLine = +" / between elements | selects | next screen" +; + +const struct newtColors newtDefaultColorPalette = { + "white", "blue", /* root fg, bg */ + "black", "lightgray", /* border fg, bg */ + "black", "lightgray", /* window fg, bg */ + "white", "black", /* shadow fg, bg */ + "red", "lightgray", /* title fg, bg */ + "lightgray", "red", /* button fg, bg */ + "red", "lightgray", /* active button fg, bg */ + "yellow", "blue", /* checkbox fg, bg */ + "blue", "brown", /* active checkbox fg, bg */ + "yellow", "blue", /* entry box fg, bg */ + "blue", "lightgray", /* label fg, bg */ + "black", "lightgray", /* listbox fg, bg */ + "yellow", "blue", /* active listbox fg, bg */ + "black", "lightgray", /* textbox fg, bg */ + "lightgray", "black", /* active textbox fg, bg */ + "white", "blue", /* help line */ + "yellow", "blue", /* root text */ + "blue", /* scale full */ + "red", /* scale empty */ + "blue", "lightgray", /* disabled entry fg, bg */ + "black", "lightgray", /* compact button fg, bg */ + "yellow", "red", /* active & sel listbox */ + "black", "brown" /* selected listbox */ +}; + +static const struct keymap keymap[] = { + { "\033OA", NEWT_KEY_UP, "ku" }, + { "\020", NEWT_KEY_UP, NULL }, /* emacs ^P */ + { "\033OB", NEWT_KEY_DOWN, "kd" }, + { "\016", NEWT_KEY_DOWN, NULL }, /* emacs ^N */ + { "\033OC", NEWT_KEY_RIGHT, "kr" }, + { "\006", NEWT_KEY_RIGHT, NULL }, /* emacs ^F */ + { "\033OD", NEWT_KEY_LEFT, "kl" }, + { "\002", NEWT_KEY_LEFT, NULL }, /* emacs ^B */ + { "\033OH", NEWT_KEY_HOME, "kh" }, + { "\033[1~", NEWT_KEY_HOME, NULL }, + { "\001", NEWT_KEY_HOME, NULL }, /* emacs ^A */ + { "\033Ow", NEWT_KEY_END, "kH" }, + { "\033[4~", NEWT_KEY_END, "@7" }, + { "\005", NEWT_KEY_END, NULL }, /* emacs ^E */ + + { "\033[3~", NEWT_KEY_DELETE, "kD" }, + { "\004", NEWT_KEY_DELETE, NULL }, /* emacs ^D */ + { "\033[2~", NEWT_KEY_INSERT, "kI" }, + + { "\033\t", NEWT_KEY_UNTAB, "kB" }, + + { "\033[5~", NEWT_KEY_PGUP, "kP" }, + { "\033[6~", NEWT_KEY_PGDN, "kN" }, + { "\033V", NEWT_KEY_PGUP, NULL }, + { "\033v", NEWT_KEY_PGUP, NULL }, + { "\026", NEWT_KEY_PGDN, NULL }, + + { "\033[[A", NEWT_KEY_F1, NULL }, + { "\033[[B", NEWT_KEY_F2, NULL }, + { "\033[[C", NEWT_KEY_F3, NULL }, + { "\033[[D", NEWT_KEY_F4, NULL }, + { "\033[[E", NEWT_KEY_F5, NULL }, + + { "\033OP", NEWT_KEY_F1, NULL }, + { "\033OQ", NEWT_KEY_F2, NULL }, + { "\033OR", NEWT_KEY_F3, NULL }, + { "\033OS", NEWT_KEY_F4, NULL }, + + { "\033[11~", NEWT_KEY_F1, "k1" }, + { "\033[12~", NEWT_KEY_F2, "k2" }, + { "\033[13~", NEWT_KEY_F3, "k3" }, + { "\033[14~", NEWT_KEY_F4, "k4" }, + { "\033[15~", NEWT_KEY_F5, "k5" }, + { "\033[17~", NEWT_KEY_F6, "k6" }, + { "\033[18~", NEWT_KEY_F7, "k7" }, + { "\033[19~", NEWT_KEY_F8, "k8" }, + { "\033[20~", NEWT_KEY_F9, "k9" }, + { "\033[21~", NEWT_KEY_F10, "k;" }, + { "\033[23~", NEWT_KEY_F11, "F1" }, + { "\033[24~", NEWT_KEY_F12, "F2" }, + { "\033", NEWT_KEY_ESCAPE, "@2" }, + { "\033", NEWT_KEY_ESCAPE, "@9" }, + + { "\177", NEWT_KEY_BKSPC, NULL }, + { "\010", NEWT_KEY_BKSPC, NULL }, + + { 0 }, /* LEAVE this one */ +}; +static void initKeymap(); + +static const char ident[] = // ident friendly + "$Version: Newt windowing library v" VERSION " $" + "$Copyright: (C) 1996-2003 Red Hat, Inc. Written by Erik Troan $" + "$License: Lesser GNU Public License. $"; + +static newtSuspendCallback suspendCallback = NULL; +static void * suspendCallbackData = NULL; + +void newtSetSuspendCallback(newtSuspendCallback cb, void * data) { + suspendCallback = cb; + suspendCallbackData = data; +} + +static void handleSigwinch(int signum) { + needResize = 1; +} + +static int getkeyInterruptHook(void) { + return -1; +} + +int _newt_wstrlen(const char *str, int len) { + mbstate_t ps; + wchar_t tmp; + int nchars = 0; + + if (!str) return 0; + if (!len) return 0; + if (len < 0) len = strlen(str); + memset(&ps,0,sizeof(mbstate_t)); + while (len > 0) { + int x,y; + + x = mbrtowc(&tmp,str,len,&ps); + if (x >0) { + str += x; + len -= x; + y = wcwidth(tmp); + if (y>0) + nchars+=y; + } else break; + } + return nchars; +} + +/** Trim a string to fit + * @param title - string. NULL will be inserted if necessary + * @param chrs - available space. (character cells) + */ +void trim_string(char *title, int chrs) +{ + char *p = title; + int ln = chrs; + int x = 0,y = 0; + wchar_t tmp; + mbstate_t ps; + + memset(&ps, 0, sizeof(ps)); + + while (*p) { + x = mbrtowc(&tmp, p, ln, &ps); + if (x < 0) { // error + *p = '\0'; + return; + } + y = wcwidth(tmp); + if (y > ln) { + *p = '\0'; + return; + } else { + p += x; + ln -= y; + } + } +} + +static int getkey() { + int c; + + while ((c = SLang_getkey()) == '\xC') { /* if Ctrl-L redraw whole screen */ + SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); + SLsmg_refresh(); + } + return c; + +} + +void newtFlushInput(void) { + while (SLang_input_pending(0)) { + getkey(); + } +} + +/** + * @brief Refresh the screen + */ +void newtRefresh(void) { + SLsmg_refresh(); +} + +void newtSuspend(void) { + SLtt_set_cursor_visibility (1); + SLsmg_suspend_smg(); + SLang_reset_tty(); + SLtt_set_cursor_visibility (cursorOn); +} + +/** + * @brief Return after suspension. + * @return 0 on success. + */ +int newtResume(void) { + SLsmg_resume_smg (); + SLsmg_refresh(); + return SLang_init_tty(0, 0, 0); +} + +void newtCls(void) { + SLsmg_set_color(NEWT_COLORSET_ROOT); + SLsmg_gotorc(0, 0); + SLsmg_erase_eos(); + + newtRefresh(); +} + +/** + * @brief Resize the screen + * @param redraw - boolean - should we redraw the screen? + */ +void newtResizeScreen(int redraw) { + SLtt_get_screen_size(); + SLsmg_reinit_smg(); + if (redraw) { + SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); + newtRefresh(); + } +} + +/** + * @brief Initialize the newt library + * @return int - 0 for success, else < 0 + */ +int newtInit(void) { + char * MonoValue, * MonoEnv = "NEWT_MONO"; + const char *lang; + int ret; + + if ((lang = getenv("LC_ALL")) == NULL) + if ((lang = getenv("LC_CTYPE")) == NULL) + if ((lang = getenv("LANG")) == NULL) + lang = ""; + if (strstr (lang, ".euc") != NULL) + trashScreen = 1; + + (void) strlen(ident); + + SLtt_get_terminfo(); + SLtt_get_screen_size(); + SLutf8_enable(-1); /* init. utf8 according to locale */ + + MonoValue = getenv(MonoEnv); + if ( MonoValue == NULL ) { + SLtt_Use_Ansi_Colors = 1; + } else { + SLtt_Use_Ansi_Colors = 0; + } + + if ((ret = SLsmg_init_smg()) < 0) + return ret; + if ((ret = SLang_init_tty(0, 0, 0)) < 0) + return ret; + + newtSetColors(newtDefaultColorPalette); + newtCursorOff(); + initKeymap(); + + /*memset(&sa, 0, sizeof(sa)); + sa.sa_handler = handleSigwinch; + sigaction(SIGWINCH, &sa, NULL);*/ + + SLsignal_intr(SIGWINCH, handleSigwinch); + SLang_getkey_intr_hook = getkeyInterruptHook; + + return 0; +} + +/** + * @brief Closedown the newt library, tidying screen. + * @returns int , 0. (no errors reported) + */ +int newtFinished(void) { + SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); + newtCursorOn(); + SLsmg_refresh(); + SLsmg_reset_smg(); + SLang_reset_tty(); + + return 0; +} + +/** + * @brief Set the colors used. + * @param colors - newtColor struct used. + */ +void newtSetColors(struct newtColors colors) { + if (!SLtt_Use_Ansi_Colors) { + int i; + + for (i = 2; i < 25; i++) + SLtt_set_mono(i, NULL, 0); + + SLtt_set_mono(NEWT_COLORSET_SELLISTBOX, NULL, SLTT_BOLD_MASK); + + SLtt_set_mono(NEWT_COLORSET_ACTBUTTON, NULL, SLTT_REV_MASK); + SLtt_set_mono(NEWT_COLORSET_ACTCHECKBOX, NULL, SLTT_REV_MASK); + SLtt_set_mono(NEWT_COLORSET_ACTLISTBOX, NULL, SLTT_REV_MASK); + SLtt_set_mono(NEWT_COLORSET_ACTTEXTBOX, NULL, SLTT_REV_MASK); + + SLtt_set_mono(NEWT_COLORSET_ACTSELLISTBOX, NULL, SLTT_REV_MASK | SLTT_BOLD_MASK); + + SLtt_set_mono(NEWT_COLORSET_DISENTRY, NULL, 0); // FIXME + SLtt_set_mono(NEWT_COLORSET_FULLSCALE, NULL, SLTT_ULINE_MASK | SLTT_REV_MASK); + SLtt_set_mono(NEWT_COLORSET_EMPTYSCALE, NULL, SLTT_ULINE_MASK); + return; + } + SLtt_set_color(NEWT_COLORSET_ROOT, "", colors.rootFg, colors.rootBg); + SLtt_set_color(NEWT_COLORSET_BORDER, "", colors.borderFg, colors.borderBg); + SLtt_set_color(NEWT_COLORSET_WINDOW, "", colors.windowFg, colors.windowBg); + SLtt_set_color(NEWT_COLORSET_SHADOW, "", colors.shadowFg, colors.shadowBg); + SLtt_set_color(NEWT_COLORSET_TITLE, "", colors.titleFg, colors.titleBg); + SLtt_set_color(NEWT_COLORSET_BUTTON, "", colors.buttonFg, colors.buttonBg); + SLtt_set_color(NEWT_COLORSET_ACTBUTTON, "", colors.actButtonFg, + colors.actButtonBg); + SLtt_set_color(NEWT_COLORSET_CHECKBOX, "", colors.checkboxFg, + colors.checkboxBg); + SLtt_set_color(NEWT_COLORSET_ACTCHECKBOX, "", colors.actCheckboxFg, + colors.actCheckboxBg); + SLtt_set_color(NEWT_COLORSET_ENTRY, "", colors.entryFg, colors.entryBg); + SLtt_set_color(NEWT_COLORSET_LABEL, "", colors.labelFg, colors.labelBg); + SLtt_set_color(NEWT_COLORSET_LISTBOX, "", colors.listboxFg, + colors.listboxBg); + SLtt_set_color(NEWT_COLORSET_ACTLISTBOX, "", colors.actListboxFg, + colors.actListboxBg); + SLtt_set_color(NEWT_COLORSET_TEXTBOX, "", colors.textboxFg, + colors.textboxBg); + SLtt_set_color(NEWT_COLORSET_ACTTEXTBOX, "", colors.actTextboxFg, + colors.actTextboxBg); + SLtt_set_color(NEWT_COLORSET_HELPLINE, "", colors.helpLineFg, + colors.helpLineBg); + SLtt_set_color(NEWT_COLORSET_ROOTTEXT, "", colors.rootTextFg, + colors.rootTextBg); + + SLtt_set_color(NEWT_COLORSET_EMPTYSCALE, "", "white", + colors.emptyScale); + SLtt_set_color(NEWT_COLORSET_FULLSCALE, "", "white", + colors.fullScale); + SLtt_set_color(NEWT_COLORSET_DISENTRY, "", colors.disabledEntryFg, + colors.disabledEntryBg); + + SLtt_set_color(NEWT_COLORSET_COMPACTBUTTON, "", colors.compactButtonFg, + colors.compactButtonBg); + + SLtt_set_color(NEWT_COLORSET_ACTSELLISTBOX, "", colors.actSelListboxFg, + colors.actSelListboxBg); + SLtt_set_color(NEWT_COLORSET_SELLISTBOX, "", colors.selListboxFg, + colors.selListboxBg); +} + +/* Keymap handling - rewritten by Henning Makholm , + * November 2003. + */ + +struct kmap_trie_entry { + char c ; /* character got from terminal */ + int code; /* newt key, or 0 if c does not make a complete sequence */ + struct kmap_trie_entry *contseq; /* sub-trie for character following c */ + struct kmap_trie_entry *next; /* try this if char received != c */ +}; +/* Here are some static entries that will help in handling esc O foo and + esc [ foo as variants of each other: */ +static struct kmap_trie_entry + kmap_trie_escO = { 'O', 0, 0, 0 }, + kmap_trie_escBrack = { '[', 0, 0, &kmap_trie_escO }, + kmap_trie_root = { '\033', 0, &kmap_trie_escBrack, 0 }; +static int keyreader_buf_len = 10 ; +static unsigned char default_keyreader_buf[10]; +static unsigned char *keyreader_buf = default_keyreader_buf; + +#if 0 /* for testing of the keymap manipulation code */ +static void dumpkeys_recursive(struct kmap_trie_entry *curr, int i, FILE *f) { + int j, ps ; + char seen[256]={0}; + if( curr && i >= keyreader_buf_len ) { + fprintf(f,"ARGH! Too long sequence!\n") ; + return ; + } + for(;curr;curr=curr->next) { + keyreader_buf[i] = curr->c ; + ps = seen[(unsigned char)curr->c]++ ; + if( ps || curr->code || (!curr->code && !curr->contseq) ) { + for(j=0;j<=i;j++) { + if( keyreader_buf[j] > 32 && keyreader_buf[j]<127 && + keyreader_buf[j] != '^' && keyreader_buf[j] != '\\' ) + fprintf(f,"%c",keyreader_buf[j]); + else if( keyreader_buf[j] > 0 && keyreader_buf[j]<=32 ) + fprintf(f,"^%c",keyreader_buf[j] + 0x40); + else + fprintf(f,"\\%03o", + (unsigned)(unsigned char)keyreader_buf[j]); + } + if( curr->code ) + fprintf(f,": 0x%X\n",curr->code); + else + fprintf(f,": (just keymap)\n"); + } + dumpkeys_recursive(curr->contseq,i+1,f); + } +} +static void dump_keymap(void) { + FILE *f = fopen("newt.keydump","wt"); + if (f) { + dumpkeys_recursive(&kmap_trie_root,0,f); + fclose(f); + } +} +#endif + +/* newtBindKey may overwrite a binding that is there already */ +static void newtBindKey(char *keyseq, int meaning) { + struct kmap_trie_entry *root = &kmap_trie_root ; + struct kmap_trie_entry **curptr = &root ; + + /* Try to make sure the common matching buffer is long enough. */ + if( strlen(keyseq) > keyreader_buf_len ) { + int i = strlen(keyseq)+10; + unsigned char *newbuf = malloc(i); + if (newbuf) { + if (keyreader_buf != default_keyreader_buf) + free(keyreader_buf); + keyreader_buf = newbuf; + keyreader_buf_len = i; + } + } + + if (*keyseq == 0) return; /* binding the empty sequence is meaningless */ + + while(1) { + while ((*curptr) && (*curptr)->c != *keyseq) + curptr = &(*curptr)->next; + if ((*curptr)==0) { + struct kmap_trie_entry* fresh + = calloc(strlen(keyseq),sizeof(struct kmap_trie_entry)); + if (fresh == 0) return; /* despair! */ + *curptr = fresh; + while (keyseq[1]) { + fresh->contseq = fresh+1; + (fresh++)->c = *(keyseq++); + } + fresh->c = *keyseq; + fresh->code = meaning; + return; + } + if (keyseq[1]==0) { + (*curptr)->code = meaning; + return; + } else { + curptr = &(*curptr)->contseq; + keyseq++; + } + } +} + +/* This function recursively inserts all entries in the "to" trie into + corresponding positions in the "from" trie, except positions that + are already defined in the "from" trie. */ +static void kmap_trie_fallback(struct kmap_trie_entry *to, + struct kmap_trie_entry **from) { + if (*from == NULL) + *from = to ; + if (*from == to) + return ; + for (;to!=NULL;to=to->next) { + struct kmap_trie_entry **fromcopy = from ; + while ((*fromcopy) && (*fromcopy)->c != to->c) + fromcopy = &(*fromcopy)->next ; + if (*fromcopy) { + if ((*fromcopy)->code == 0) + (*fromcopy)->code = to->code; + kmap_trie_fallback(to->contseq, &(*fromcopy)->contseq); + } else { + *fromcopy = malloc(sizeof(struct kmap_trie_entry)); + if (*fromcopy) { + **fromcopy = *to ; + (*fromcopy)->next = 0 ; + } + } + } +} + +int newtGetKey(void) { + int key; + unsigned char *chptr = keyreader_buf, *lastmatch; + int lastcode; + struct kmap_trie_entry *curr = &kmap_trie_root; + + do { + key = getkey(); + if (key == SLANG_GETKEY_ERROR) { + /* Either garbage was read, or stdin disappeared + * (the parent terminal was proably closed) + * if the latter, die. + */ + if (feof(stdin)) + exit(1); + if (needResize) { + needResize = 0; + return NEWT_KEY_RESIZE; + } + + /* ignore other signals */ + continue; + } + + if (key == NEWT_KEY_SUSPEND && suspendCallback) + suspendCallback(suspendCallbackData); + } while (key == NEWT_KEY_SUSPEND); + + /* Read more characters, matching against the trie as we go */ + lastcode = *chptr = key; + lastmatch = chptr ; + while(1) { + while (curr->c != key) { + curr = curr->next ; + if (curr==NULL) goto break2levels; + } + if (curr->code) { + lastcode = curr->code; + lastmatch = chptr; + } + curr = curr->contseq; + if (curr==NULL) break; + + if (SLang_input_pending(5) <= 0) + break; + + if (chptr==keyreader_buf+keyreader_buf_len-1) break; + *++chptr = key = getkey(); + } + break2levels: + + /* The last time the trie matched was at position lastmatch. Back + * up if we have read too many characters. */ + while (chptr > lastmatch) + SLang_ungetkey(*chptr--); + + return lastcode; +} + +/** + * @brief Wait for a keystroke + */ +void newtWaitForKey(void) { + newtRefresh(); + + getkey(); + newtClearKeyBuffer(); +} + +/** + * @brief Clear the keybuffer + */ +void newtClearKeyBuffer(void) { + while (SLang_input_pending(1)) { + getkey(); + } +} + +/** + * Open a new window. + * @param left. unsigned int Size; _not_ including border + * @param top: unsigned int size, _not_ including border + * @param width unsigned int + * @param height unsigned int + * @param title - title string + * @return zero on success (currently no errors reported) + */ +int newtOpenWindow(unsigned int left, unsigned int top, + unsigned int width, unsigned int height, + const char * title) { + int j, row, col; + int n; + int i; + + newtFlushInput(); + + if (!currentWindow) { + currentWindow = windowStack; + } else { + currentWindow++; + } + + currentWindow->left = left; + currentWindow->top = top; + currentWindow->width = width; + currentWindow->height = height; + currentWindow->title = title ? strdup(title) : NULL; + + currentWindow->buffer = malloc(sizeof(SLsmg_Char_Type) * (width + 3) * (height + 3)); + + row = top - 1; + col = left - 1; + /* clip to the current screen bounds - msw */ + if (row < 0) + row = 0; + if (col < 0) + col = 0; + if (left + width > SLtt_Screen_Cols) + width = SLtt_Screen_Cols - left; + if (top + height > SLtt_Screen_Rows) + height = SLtt_Screen_Rows - top; + n = 0; + for (j = 0; j < height + 3; j++, row++) { + SLsmg_gotorc(row, col); + SLsmg_read_raw(currentWindow->buffer + n, + currentWindow->width + 3); + n += currentWindow->width + 3; + } + + newtTrashScreen(); + + SLsmg_set_color(NEWT_COLORSET_BORDER); + SLsmg_set_char_set(1); + SLsmg_draw_box(top - 1, left - 1, height + 2, width + 2); + SLsmg_set_char_set(0); + + if (currentWindow->title) { + trim_string (currentWindow->title, width-4); + i = wstrlen(currentWindow->title,-1) + 4; + i = ((width - i) / 2) + left; + SLsmg_gotorc(top - 1, i); + SLsmg_set_char_set(1); + SLsmg_write_char(SLSMG_RTEE_CHAR); + SLsmg_set_char_set(0); + SLsmg_write_char(' '); + SLsmg_set_color(NEWT_COLORSET_TITLE); + write_string_int((char *)currentWindow->title, NULL); + SLsmg_set_color(NEWT_COLORSET_BORDER); + SLsmg_write_char(' '); + SLsmg_set_char_set(1); + SLsmg_write_char(SLSMG_LTEE_CHAR); + SLsmg_set_char_set(0); + } + + SLsmg_set_color(NEWT_COLORSET_WINDOW); + SLsmg_fill_region(top, left, height, width, ' '); + + SLsmg_set_color(NEWT_COLORSET_SHADOW); + SLsmg_fill_region(top + height + 1, left, 1, width + 2, ' '); + SLsmg_fill_region(top, left + width + 1, height + 1, 1, ' '); + + for (i = top; i < (top + height + 1); i++) { + SLsmg_gotorc(i, left + width + 1); + SLsmg_write_string(" "); + } + + return 0; +} + +/** + * @brief Draw a centered window. + * @param width - width in char cells + * @param height - no. of char cells. + * @param title - fixed title + * @returns 0. No errors reported + */ +int newtCenteredWindow(unsigned int width,unsigned int height, + const char * title) { + unsigned int top, left; + + top = (SLtt_Screen_Rows - height) / 2; + + /* I don't know why, but this seems to look better */ + if ((SLtt_Screen_Rows % 2) && (top % 2)) top--; + + left = (SLtt_Screen_Cols - width) / 2; + + newtOpenWindow(left, top, width, height, title); + + return 0; +} + +/** + * @brief Remove the top window + */ +void newtPopWindow(void) { + int j, row, col; + int n = 0; + + row = col = 0; + + row = currentWindow->top - 1; + col = currentWindow->left - 1; + if (row < 0) + row = 0; + if (col < 0) + col = 0; + for (j = 0; j < currentWindow->height + 3; j++, row++) { + SLsmg_gotorc(row, col); + SLsmg_write_raw(currentWindow->buffer + n, + currentWindow->width + 3); + n += currentWindow->width + 3; + } + + free(currentWindow->buffer); + free(currentWindow->title); + + if (currentWindow == windowStack) + currentWindow = NULL; + else + currentWindow--; + + SLsmg_set_char_set(0); + + newtTrashScreen(); + + newtRefresh(); +} + +void newtGetWindowPos(int * x, int * y) { + if (currentWindow) { + *x = currentWindow->left; + *y = currentWindow->top; + } else + *x = *y = 0; +} + +void newtGetrc(int * row, int * col) { + *row = cursorRow; + *col = cursorCol; +} + +void newtGotorc(int newRow, int newCol) { + if (currentWindow) { + newRow += currentWindow->top; + newCol += currentWindow->left; + } + + cursorRow = newRow; + cursorCol = newCol; + SLsmg_gotorc(cursorRow, cursorCol); +} + +void newtDrawBox(int left, int top, int width, int height, int shadow) { + if (currentWindow) { + top += currentWindow->top; + left += currentWindow->left; + } + + SLsmg_draw_box(top, left, height, width); + + if (shadow) { + SLsmg_set_color(NEWT_COLORSET_SHADOW); + SLsmg_fill_region(top + height, left + 1, 1, width - 1, ' '); + SLsmg_fill_region(top + 1, left + width, height, 1, ' '); + } +} + +void newtClearBox(int left, int top, int width, int height) { + if (currentWindow) { + top += currentWindow->top; + left += currentWindow->left; + } + + SLsmg_fill_region(top, left, height, width, ' '); +} + +static void initKeymap(void) { + const struct keymap * curr; + + /* First bind built-in default bindings. They may be shadowed by + the termcap entries that get bound later. */ + for (curr = keymap; curr->code; curr++) { + if (curr->str) + newtBindKey(curr->str,curr->code); + } + + /* Then bind strings from termcap entries */ + for (curr = keymap; curr->code; curr++) { + if (curr->tc) { + char *pc = SLtt_tgetstr(curr->tc); + if (pc) { + newtBindKey(pc,curr->code); + } + } + } + + /* Finally, invent lowest-priority keybindings that correspond to + searching for esc-O-foo if esc-[-foo was not found and vice + versa. That is needed because of strong confusion among + different emulators of VTxxx terminals; some terminfo/termcap + descriptions are apparently written by people who were not + aware of the differences between "applicataion" and "terminal" + keypad modes. Or perhaps they were, but tried to make their + description work with a program that puts the keyboard in the + wrong emulation mode. In short, one needs this: */ + kmap_trie_fallback(kmap_trie_escO.contseq, &kmap_trie_escBrack.contseq); + kmap_trie_fallback(kmap_trie_escBrack.contseq, &kmap_trie_escO.contseq); +} + +/** + * @brief Delay for a specified number of usecs + * @param int - number of usecs to wait for. + */ +void newtDelay(unsigned int usecs) { + fd_set set; + struct timeval tv; + + FD_ZERO(&set); + + tv.tv_sec = usecs / 1000000; + tv.tv_usec = usecs % 1000000; + + select(0, &set, &set, &set, &tv); +} + +struct eventResult newtDefaultEventHandler(newtComponent c, + struct event ev) { + struct eventResult er; + + er.result = ER_IGNORED; + return er; +} + +void newtRedrawHelpLine(void) { + char * buf; + + SLsmg_set_color(NEWT_COLORSET_HELPLINE); + + if (currentHelpline) { + /* buffer size needs to be wide enough to hold all the multibyte + currentHelpline + all the single byte ' ' to fill the line */ + int wlen = wstrlen(*currentHelpline, -1); + int len; + + if (wlen > SLtt_Screen_Cols) + wlen = SLtt_Screen_Cols; + len = strlen(*currentHelpline) + (SLtt_Screen_Cols - wlen); + buf = alloca(len + 1); + memset(buf, ' ', len); + memcpy(buf, *currentHelpline, strlen(*currentHelpline)); + buf[len] = '\0'; + } else { + buf = alloca(SLtt_Screen_Cols + 1); + memset(buf, ' ', SLtt_Screen_Cols); + buf[SLtt_Screen_Cols] = '\0'; + } + SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); + write_string_int(buf, NULL); +} + +void newtPushHelpLine(const char * text) { + if (!text) + text = defaultHelpLine; + + if (currentHelpline) + (*(++currentHelpline)) = strdup(text); + else { + currentHelpline = helplineStack; + *currentHelpline = strdup(text); + } + + newtRedrawHelpLine(); +} + +void newtPopHelpLine(void) { + if (!currentHelpline) return; + + free(*currentHelpline); + if (currentHelpline == helplineStack) + currentHelpline = NULL; + else + currentHelpline--; + + newtRedrawHelpLine(); +} + +void newtDrawRootText(int col, int row, const char * text) { + SLsmg_set_color(NEWT_COLORSET_ROOTTEXT); + + if (col < 0) { + col = SLtt_Screen_Cols + col; + } + + if (row < 0) { + row = SLtt_Screen_Rows + row; + } + + SLsmg_gotorc(row, col); + write_string_int((char *)text, NULL); +} + +int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { + switch (sense) { + case NEWT_FLAGS_SET: + return oldFlags | newFlags; + + case NEWT_FLAGS_RESET: + return oldFlags & (~newFlags); + + case NEWT_FLAGS_TOGGLE: + return oldFlags ^ newFlags; + + default: + return oldFlags; + } +} + +void newtBell(void) +{ + SLtt_beep(); +} + +void newtGetScreenSize(int * cols, int * rows) { + if (rows) *rows = SLtt_Screen_Rows; + if (cols) *cols = SLtt_Screen_Cols; +} + +void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop) { + c->left = newLeft; + c->top = newTop; +} + +void newtDefaultMappedHandler(newtComponent c, int isMapped) { + c->isMapped = isMapped; +} + +void newtCursorOff(void) { + cursorOn = 0; + SLtt_set_cursor_visibility (cursorOn); +} + +void newtCursorOn(void) { + cursorOn = 1; + SLtt_set_cursor_visibility (cursorOn); +} + +void newtTrashScreen(void) { + if (trashScreen) + SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); +} + Index: newt-0.52.14/newt_pr.h =================================================================== --- newt-0.52.14.orig/newt_pr.h 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/newt_pr.h 2012-01-02 10:53:23.000000000 +0000 @@ -84,6 +84,10 @@ struct event ev); int _newt_wstrlen(const char *str, int len); +void write_string_int(const char *, char *); +void write_nstring_int(const char *, int, char *); +char get_text_direction(const char *); + #define wstrlen(str,len) _newt_wstrlen((str),(len)) void trim_string(char *title, int chrs); Index: newt-0.52.14/textbox.c =================================================================== --- newt-0.52.14.orig/textbox.c 2012-01-01 15:54:37.000000000 +0000 +++ newt-0.52.14/textbox.c 2012-01-02 10:55:44.000000000 +0000 @@ -13,6 +13,7 @@ char ** lines; int numLines; int linesAlloced; + char *blankline; int doWrap; newtComponent sb; int topLine; @@ -117,6 +118,9 @@ tb->isActive = 0; tb->cs = COLORSET_TEXTBOX; tb->csActive = COLORSET_ACTTEXTBOX; + tb->blankline = malloc(width+1); + memset(tb->blankline,' ',width); + tb->blankline[width] = '\0'; if (flags & NEWT_FLAG_SCROLL) { co->width += 2; @@ -371,10 +375,12 @@ int i; struct textbox * tb = c->data; int size; + char dir = 'N'; + int newdir = 1; + int dw = 0; if (!c->isMapped) return; - if (tb->sb) { size = tb->numLines - c->height; newtScrollbarSet(tb->sb, tb->topLine, size ? size : 0); @@ -384,10 +390,32 @@ SLsmg_set_color(tb->cs); - for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { - newtGotorc(c->top + i, c->left); - SLsmg_write_nstring(tb->lines[i + tb->topLine], tb->textWidth); + + /* find direction of first visible paragraph */ + for (i = 0; i < tb->topLine; i++) { + if (!*tb->lines[i]) { + /* new line: new paragraph starts at the next line */ + newdir = 1; + dir = 'N'; + } + else if (newdir) { + /* get current paragraph direction, if possible */ + dir = get_text_direction(tb->lines[i]); + newdir = (dir == 'N') ? 1 : 0; + } + } + + for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { + newtGotorc(c->top + i, c->left); + SLsmg_write_string(tb->blankline); + newtGotorc(c->top + i, c->left); + /* BIDI: we need *nstring* here to properly align lines */ + write_nstring_int(tb->lines[i + tb->topLine], c->width - dw, &dir); + /* Does new paragraph follow? */ + if (!*tb->lines[i + tb->topLine]) + dir = 'N'; } + /* put cursor at beginning of text for better accessibility */ newtGotorc(c->top, c->left); } @@ -471,6 +499,7 @@ int i; struct textbox * tb = co->data; + if (tb->blankline) free(tb->blankline); if (tb->sb) tb->sb->ops->destroy(tb->sb); for (i = 0; i < tb->numLines; i++) debian/patches/python.patch0000644000000000000000000000116011766635560013174 0ustar Author: Alastair mcKinstry Description: Use Debian pyversions tool to get the list of python versions to build Forwarded: not-needed Last-Updated: 2011-12-03 diff -ruN newt-0.52.11-old/Makefile.in newt-0.52.11/Makefile.in --- newt-0.52.11-old/Makefile.in 2008-07-30 13:42:55.000000000 +0100 +++ newt-0.52.11/Makefile.in 2009-04-17 12:30:52.000000000 +0100 @@ -11,7 +11,7 @@ TAG = r$(subst .,-,$(VERSION)) SONAME = @SONAME@ -PYTHONVERS = @PYTHONVERS@ +PYTHONVERS = $(shell pyversions --supported) WHIPTCLSO = @WHIPTCLSO@ PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey debian/patches/bengali.patch0000644000000000000000000000341111766635560013255 0ustar Author: Md. Rezwan Shahid Description: Updated Bengali support for Newt. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524974 Last-Updated: 2009-12-18 Forwarded: no diff -ruN newt-0.52.11-old/po/bn.po newt-0.52.11/po/bn.po --- newt-0.52.11-old/po/bn.po 2008-07-30 13:42:55.000000000 +0100 +++ newt-0.52.11/po/bn.po 2009-12-18 02:09:59.000000000 +0000 @@ -2,31 +2,33 @@ # Copyright (C) 2005, Debian Foundation. # This file is distributed under the same license as the Newt_Newt package. # Progga , 2005. -# +# Md. Rezwan Shahid , 2009. msgid "" msgstr "" "Project-Id-Version: Newt_Newt HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-09-14 16:03+0200\n" -"PO-Revision-Date: 2005-11-20 19:00+0600\n" -"Last-Translator: Progga \n" -"Language-Team: Bangla \n" +"Report-Msgid-Bugs-To: mckinstry@debian.org\n" +"POT-Creation-Date: 2005-11-22 09:35+0100\n" +"PO-Revision-Date: 2009-04-19 10:29+0600\n" +"Last-Translator: Md. Rezwan Shahid \n" +"Language-Team: Bengali \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=UTf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: WordForge 0.5-beta1\n" -#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 +#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 msgid "Ok" msgstr "ঠিক আছে" -#: ../dialogboxes.c:51 +#: dialogboxes.c:51 msgid "Cancel" msgstr "বাতিল" -#: ../dialogboxes.c:498 +#: dialogboxes.c:498 msgid "Yes" msgstr "হ্যাঁ" -#: ../dialogboxes.c:500 +#: dialogboxes.c:500 msgid "No" msgstr "না" debian/patches/icelandic.patch0000644000000000000000000000242512144534336013561 0ustar Author: Sveinn í Felli Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=592828 Description: Icelandic support for NEWT Last-Updated: 2010-10-16 Forwarded: no Index: newt-0.52.15/po/is.po =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ newt-0.52.15/po/is.po 2013-05-14 22:57:29.000000000 +0100 @@ -0,0 +1,33 @@ +# translation of newt_newt_is.po to Icelandic +# Copyright (C) 2010 Free Software Foundation +# This file is distributed under the same license as the PACKAGE package. +# +# Sveinn í Felli , 2010. +msgid "" +msgstr "" +"Project-Id-Version: newt_newt_is\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: 2010-08-14 10:10+0000\n" +"Last-Translator: Sveinn í Felli \n" +"Language-Team: Icelandic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 +msgid "Ok" +msgstr "Í lagi" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "Hætta við" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "Já" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "Nei" debian/patches/irish.patch0000644000000000000000000000256311766635560013001 0ustar Author: Kevin Scannell Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579198 Description: Updated Irish support for Irish. Last-Updated: 2010-10-16 Forwarded: no diff -ruN newt-0.52.11-old/po/ga.po newt-0.52.11/po/ga.po --- newt-0.52.11-old/po/ga.po 2009-09-24 16:03:09.000000000 +0100 +++ newt-0.52.11/po/ga.po 2010-10-16 15:29:53.000000000 +0100 @@ -2,26 +2,27 @@ # Copyright (C) 2003,2004 Free Software Foundation # This file is distributed under the same license as the newt package. # Alastair McKinstry , 2003. +# Kevin Scannell , 2010. # msgid "" msgstr "" "Project-Id-Version: newt 0.51.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-09-14 16:03+0200\n" -"PO-Revision-Date: 2004-01-10 13:25+0100\n" -"Last-Translator: Alastair McKinstry \n" -"Language-Team: Irish \n" +"PO-Revision-Date: 2010-04-16 13:25-0600\n" +"Last-Translator: Kevin Scannell \n" +"Language-Team: Irish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 msgid "Ok" -msgstr "Ceart go Leor" +msgstr "OK" #: ../dialogboxes.c:51 msgid "Cancel" -msgstr "Ceallaigh" +msgstr "Cealaigh" #: ../dialogboxes.c:498 msgid "Yes" debian/patches/python3.patch0000644000000000000000000004220512144722151013244 0ustar Author: Matthias Klose Description: Patches for python3 support. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=691240 Last-Updated: 2013-05-15 Forwarded: no Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/Makefile.in 2013-05-15 16:05:52.000000000 +0100 @@ -12,7 +12,7 @@ TAG = r$(subst .,-,$(VERSION)) SONAME = @SONAME@ -PYTHONVERS = $(shell pyversions --supported) +PYTHONVERS = $(shell pyversions --supported; py3versions --supported) WHIPTCLSO = @WHIPTCLSO@ PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey Index: newt-0.52.15/peanuts.py =================================================================== --- newt-0.52.15.orig/peanuts.py 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/peanuts.py 2013-05-15 16:05:52.000000000 +0100 @@ -2,6 +2,7 @@ # Demo program to show use of python-newt module +from __future__ import absolute_import, print_function, unicode_literals from snack import * screen = SnackScreen() @@ -38,8 +39,8 @@ screen.finish() -print result -print "listbox:", li.current() -print "rb:", rb.getSelection() -print "bb:", bb.buttonPressed(result) -print "checkboxtree:", ct.getSelection() +print(result) +print("listbox:", li.current()) +print("rb:", rb.getSelection()) +print("bb:", bb.buttonPressed(result)) +print("checkboxtree:", ct.getSelection()) Index: newt-0.52.15/popcorn.py =================================================================== --- newt-0.52.15.orig/popcorn.py 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/popcorn.py 2013-05-15 16:05:52.000000000 +0100 @@ -1,5 +1,6 @@ #!/usr/bin/python +from __future__ import absolute_import, print_function, unicode_literals from snack import * import sys @@ -45,7 +46,7 @@ r2 = SingleRadioButton("Radio 2", r1) def something(): - print hello + print(hello) screen = SnackScreen() @@ -99,14 +100,14 @@ screen.finish() -print "val", e.value() -print "check", cb.value() -print "r1", r1.selected() -print "listbox", li.current() +print("val", e.value()) +print("check", cb.value()) +print("r1", r1.selected()) +print("listbox", li.current()) # returns a tuple of the wrapped text, the actual width, and the actual height -print res +print(res) -print foo -print 'lbcw', lbcw -print "ct selected", ct.getSelection() -print "ct current", ct.getCurrent() +print(foo) +print('lbcw', lbcw) +print("ct selected", ct.getSelection()) +print("ct current", ct.getCurrent()) Index: newt-0.52.15/snackmodule.c =================================================================== --- newt-0.52.15.orig/snackmodule.c 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/snackmodule.c 2013-05-15 16:05:52.000000000 +0100 @@ -12,10 +12,24 @@ #include #include "Python.h" +#include "structmember.h" #include "nls.h" #include "newt.h" #include "newt_pr.h" +#if PY_MAJOR_VERSION >= 3 + #define PyInt_FromLong PyLong_FromLong + #define PyInt_AsLong PyLong_AsLong + #define PyString_FromString PyUnicode_FromString + #define MOD_ERROR_VAL NULL + #define MOD_SUCCESS_VAL(val) val + #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) +#else + #define MOD_ERROR_VAL + #define MOD_SUCCESS_VAL(val) + #define MOD_INIT(name) void init##name(void) +#endif + typedef struct snackWidget_s snackWidget; typedef struct snackGrid_s snackGrid; typedef struct snackForm_s snackForm; @@ -68,6 +82,8 @@ static PyObject * ternaryWindow(PyObject * s, PyObject * args); static snackWidget * checkboxTreeWidget(PyObject * s, PyObject * args, PyObject * kwargs); static PyObject * pywstrlen(PyObject * s, PyObject * args); +static PyObject * widget_get_checkboxValue(PyObject *self, void *closure); +static PyObject * widget_get_radioValue(PyObject *self, void *closure); static PyMethodDef snackModuleMethods[] = { { "button", (PyCFunction) buttonWidget, METH_VARARGS, NULL }, @@ -107,12 +123,31 @@ { NULL } } ; +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_snack", /* m_name */ + NULL, /* m_doc */ + -1, /* m_size */ + snackModuleMethods, /* m_methods */ + NULL, /* m_reload */ + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL, /* m_free */ + }; +#endif + +static struct PyGetSetDef widget_getset[] = { + { "checkboxValue", widget_get_checkboxValue, 0, NULL, NULL }, + { "radioValue", widget_get_radioValue, 0, NULL, NULL }, + { NULL } +}; + struct snackGrid_s { PyObject_HEAD newtGrid grid; } ; -static PyObject * gridGetAttr(PyObject * s, char * name); static PyObject * gridPlace(snackGrid * s, PyObject * args); static PyObject * gridSetField(snackGrid * s, PyObject * args); @@ -123,20 +158,34 @@ }; static PyTypeObject snackGridType = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "snackgrid", /* tp_name */ sizeof(snackGrid), /* tp_size */ 0, /* tp_itemsize */ emptyDestructor, /* tp_dealloc */ 0, /* tp_print */ - gridGetAttr, /* tp_getattr */ + 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + gridMethods /* tp_methods */ }; struct snackForm_s { @@ -144,7 +193,6 @@ newtComponent fo; } ; -static PyObject * formGetAttr(PyObject * s, char * name); static PyObject * formAdd(snackForm * s, PyObject * args); static PyObject * formDraw(snackForm * s, PyObject * args); static PyObject * formRun(snackForm * s, PyObject * args); @@ -165,20 +213,34 @@ }; static PyTypeObject snackFormType = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "snackform", /* tp_name */ sizeof(snackForm), /* tp_size */ 0, /* tp_itemsize */ emptyDestructor, /* tp_dealloc */ 0, /* tp_print */ - formGetAttr, /* tp_getattr */ + 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + formMethods /* tp_methods */ }; struct snackWidget_s { @@ -191,7 +253,6 @@ } ; static PyObject * widgetAddCallback(snackWidget * s, PyObject * args); -static PyObject * widgetGetAttr(PyObject * s, char * name); static void widgetDestructor(PyObject * s); static PyObject * widgetEntrySetValue(snackWidget * s, PyObject * args); static PyObject * widgetLabelText(snackWidget * s, PyObject * args); @@ -255,21 +316,43 @@ { NULL } }; +static PyMemberDef widget_members[] = { + { "key" , T_INT, offsetof(snackWidget, co), 0, NULL }, + { "entryValue", T_STRING, offsetof(snackWidget, apointer), 0, NULL }, + { NULL } +}; + static PyTypeObject snackWidgetType = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "snackwidget", /* tp_name */ sizeof(snackWidget), /* tp_size */ 0, /* tp_itemsize */ widgetDestructor, /* tp_dealloc */ 0, /* tp_print */ - widgetGetAttr, /* tp_getattr */ + 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + widgetMethods, /* tp_methods */ + widget_members, /* tp_members */ + widget_getset /* tp_getset */ }; static snackWidget * snackWidgetNew (void) { @@ -863,10 +946,6 @@ return grid; } -static PyObject * gridGetAttr(PyObject * s, char * name) { - return Py_FindMethod(gridMethods, s, name); -} - static PyObject * gridPlace(snackGrid * grid, PyObject * args) { int x, y; @@ -890,7 +969,7 @@ &anchorFlags, &growFlags)) return NULL; - if (w->ob_type == &snackWidgetType) { + if (Py_TYPE(w) == &snackWidgetType) { newtGridSetField(grid->grid, x, y, NEWT_GRID_COMPONENT, w->co, pLeft, pTop, pRight, pBottom, anchorFlags, growFlags); @@ -905,10 +984,6 @@ return Py_None; } -static PyObject * formGetAttr(PyObject * s, char * name) { - return Py_FindMethod(formMethods, s, name); -} - static PyObject * formDraw(snackForm * s, PyObject * args) { newtDrawForm(s->fo); @@ -1000,20 +1075,18 @@ return Py_None; } -static PyObject * widgetGetAttr(PyObject * s, char * name) { - snackWidget * w = (snackWidget *) s; +static PyObject * widget_get_checkboxValue(PyObject *self, void *closure) +{ + snackWidget *w = (snackWidget *)self; - if (!strcmp(name, "key")) { - return Py_BuildValue("i", w->co); - } else if (!strcmp(name, "entryValue")) { - return Py_BuildValue("s", w->apointer); - } else if (!strcmp(name, "checkboxValue")) { return Py_BuildValue("i", w->achar == ' ' ? 0 : 1); - } else if (!strcmp(name, "radioValue")) { - return Py_BuildValue("i", newtRadioGetCurrent(w->co)); - } +} + +static PyObject * widget_get_radioValue(PyObject *self, void *closure) +{ + snackWidget *w = (snackWidget *)self; - return Py_FindMethod(widgetMethods, s, name); + return Py_BuildValue("i", newtRadioGetCurrent(w->co)); } static void widgetDestructor(PyObject * o) { @@ -1355,10 +1428,19 @@ Py_DECREF(o); } -void init_snack(void) { +MOD_INIT(_snack) +{ PyObject * d, * m; +#if PY_MAJOR_VERSION >= 3 + m = PyModule_Create(&moduledef); +#else m = Py_InitModule("_snack", snackModuleMethods); +#endif + + if (! m) + return MOD_ERROR_VAL; + d = PyModule_GetDict(m); setitemstring_decref(d, "ANCHOR_LEFT", PyInt_FromLong(NEWT_ANCHOR_LEFT)); @@ -1435,4 +1517,6 @@ setitemstring_decref(d, "COLORSET_COMPACTBUTTON", PyInt_FromLong(NEWT_COLORSET_COMPACTBUTTON)); setitemstring_decref(d, "COLORSET_ACTSELLISTBOX", PyInt_FromLong(NEWT_COLORSET_ACTSELLISTBOX)); setitemstring_decref(d, "COLORSET_SELLISTBOX", PyInt_FromLong(NEWT_COLORSET_SELLISTBOX)); + + return MOD_SUCCESS_VAL(m); } Index: newt-0.52.15/snack.py =================================================================== --- newt-0.52.15.orig/snack.py 2013-05-15 16:05:52.000000000 +0100 +++ newt-0.52.15/snack.py 2013-05-15 16:05:52.000000000 +0100 @@ -39,9 +39,11 @@ - EntryWindow """ + +from __future__ import absolute_import, print_function, unicode_literals import _snack -import types import string +import sys from _snack import FLAG_DISABLED, FLAGS_SET, FLAGS_RESET, FLAGS_TOGGLE, FD_READ, FD_WRITE, FD_EXCEPT @@ -304,7 +306,7 @@ "INSERT": _snack.KEY_INSERT, " " : ord(" ") } -for n in hotkeys.keys(): +for n in list(hotkeys.keys()): hotkeys[hotkeys[n]] = n for o,c in [ (ord(c),c) for c in string.ascii_letters+string.digits ]: hotkeys[c] = o @@ -328,14 +330,14 @@ self.w.addhotkey(hotkeys[keyname]) def add(self, widget): - if widget.__dict__.has_key('hotkeys'): + if 'hotkeys' in widget.__dict__: for key in widget.hotkeys.keys(): self.addHotKey(key) - if widget.__dict__.has_key('gridmembers'): + if 'gridmembers' in widget.__dict__: for w in widget.gridmembers: self.add(w) - elif widget.__dict__.has_key('w'): + elif 'w' in widget.__dict__: self.trans[widget.w.key] = widget return self.w.add(widget.w) return None @@ -408,14 +410,14 @@ if (growy): gridFlags = gridFlags | _snack.GRID_GROWY - if (what.__dict__.has_key('g')): + if 'g' in what.__dict__: return self.g.setfield(col, row, what.g, padding, anchorFlags, gridFlags) else: return self.g.setfield(col, row, what.w, padding, anchorFlags) def __init__(self, *args): - self.g = apply(_snack.grid, args) + self.g = _snack.grid(*args) self.gridmembers = [] colorsets = { "ROOT" : _snack.COLORSET_ROOT, @@ -604,9 +606,9 @@ self.item = 0 Grid.__init__(self, len(buttonlist), 1) for blist in buttonlist: - if (type(blist) == types.StringType): + if isinstance(blist, str if sys.version >= '3' else basestring): title = blist - value = string.lower(blist) + value = blist.lower() elif len(blist) == 2: (title, value) = blist else: @@ -622,7 +624,7 @@ self.item = self.item + 1 def buttonPressed(self, result): - if self.hotkeys.has_key(result): + if result in self.hotkeys: return self.hotkeys[result] for (button, value) in self.list: @@ -657,7 +659,7 @@ self.form_created = 0 args = list(args) args[:0] = [self] - apply(Grid.__init__, tuple(args)) + Grid.__init__(*tuple(args)) def add(self, widget, col, row, padding = (0, 0, 0, 0), anchorLeft = 0, anchorTop = 0, anchorRight = 0, @@ -713,7 +715,7 @@ """ def __init__(self, screen, title, *args): myargs = (self, screen, title, None) + args - apply(GridFormHelp.__init__, myargs) + GridFormHelp.__init__(*myargs) class CheckboxTree(Widget): """ CheckboxTree combo widget, @@ -788,7 +790,7 @@ l = Listbox(height, scroll = scroll, returnExit = 1) count = 0 for item in items: - if (type(item) == types.TupleType): + if type(item) == tuple: (text, key) = item else: text = item @@ -848,9 +850,9 @@ count = 0 entryList = [] for n in prompts: - if (type(n) == types.TupleType): + if type(n) == tuple: (n, e) = n - if (type(e) in types.StringTypes): + if isinstance(e, str if sys.version >= '3' else basestring): e = Entry(entryWidth, e) else: e = Entry(entryWidth) debian/patches/welsh.patch0000644000000000000000000000225411766635560013002 0ustar Author: Alastair McKinstry Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677458 Description: Updated Welsh translation. Last-Updated: 2012-06-14 Forwarded: no Index: newt.git/po/cy.po =================================================================== --- newt.git.orig/po/cy.po 2012-06-15 13:41:25.000000000 +0100 +++ newt.git/po/cy.po 2012-06-15 13:41:41.000000000 +0100 @@ -7,20 +7,23 @@ "Project-Id-Version: Newt\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-09-14 16:03+0200\n" -"PO-Revision-Date: 2004-11-20 04:23-0500\n" -"Last-Translator: Dafydd Harries \n" +"PO-Revision-Date: 2012-06-08 18:54-0000\n" +"Last-Translator: Dafydd Tomos \n" "Language-Team: Welsh \n" +"Language: cy\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 +#: ../dialogboxes.c:43 +#: ../dialogboxes.c:48 +#: ../dialogboxes.c:493 msgid "Ok" msgstr "Iawn" #: ../dialogboxes.c:51 msgid "Cancel" -msgstr "Diddymu" +msgstr "Canslo" #: ../dialogboxes.c:498 msgid "Yes" debian/patches/kazakh.patch0000644000000000000000000000261611766635560013133 0ustar Author: Baurzhan Muftakhidinov Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=589007 Description: Kazakh translation for NEWT Last-Updated: 2010-10-16 Forwarded: no diff -ruN newt-0.52.11-old/po/kk.po newt-0.52.11/po/kk.po --- newt-0.52.11-old/po/kk.po 1970-01-01 01:00:00.000000000 +0100 +++ newt-0.52.11/po/kk.po 2010-10-16 15:25:10.000000000 +0100 @@ -0,0 +1,38 @@ +# Kazakh translation for debian installer, newt_newt_po +# Copyright (C) 2010 HZ +# This file is distributed under the same license as the debian installer package. +# Baurzhan Muftakhidinov , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: sid\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: 2010-07-14 11:45+0600\n" +"Last-Translator: Baurzhan Muftakhidinov \n" +"Language-Team: Kazakh \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" +"X-Poedit-Language: Kazakh\n" +"X-Poedit-Country: KAZAKHSTAN\n" + +#: ../dialogboxes.c:43 +#: ../dialogboxes.c:48 +#: ../dialogboxes.c:493 +msgid "Ok" +msgstr "Ок" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "Бас тарту" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "Ия" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "Жоқ" + debian/patches/snackmodule-fpic.patch0000644000000000000000000000434112144701376015071 0ustar Description: snackmodule.* must be compiled -fPIC for amd64, etc. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655151 Author: Alastair McKinstry Last-Updated: 20130-05-16 Forwarded: no Index: newt-0.52.15/Makefile.in =================================================================== --- newt-0.52.15.orig/Makefile.in 2013-05-15 13:26:06.000000000 +0100 +++ newt-0.52.15/Makefile.in 2013-05-15 13:29:53.000000000 +0100 @@ -89,12 +89,13 @@ PIFLAGS=`$$pyconfig --includes`; \ PLDFLAGS=`$$ver-config --ldflags | sed -e 's/\-lpython[0-9.]*[a-z]*//'`; \ PLFLAGS=`$$ver-config --libs | sed -e 's/\-lpython[0-9.]*[a-z]*//'`; \ - echo $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + echo $(CC) -fPIC $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ $(CC) $(subst -O2,-O0,$(CFLAGS)) -I/usr/include/$${ver}_d -fPIC -c -o $$ver/snackmodule_d.o snackmodule.c ;\ - $(CC) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\ - $(CC) $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ - echo $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ - $(CC) $(CFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + echo $(CC) -fPIC $$PIFLAGS $$PCFLAGS $(CPPFLAGS) $(CFLAGS) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\ + $(CC) -fPIC $$PIFLAGS $$PCFLAGS $(CPPFLAGS) $(CFLAGS) --shared $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\ + $(CC) -fPIC $(CFLAGS) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \ + echo $(CC) -fPIC $(CFLAGS) $(CPPFLAGS) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ + $(CC) $(CFLAGS) -fPIC --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS); \ done || : touch $@ debian/patches/messagebox_escape.patch0000644000000000000000000000122511766635560015332 0ustar Author: Alastair McKinstry Description: Fix for bug: incorrect result given for selected by ESC pressed in whiptail Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=#665784 Last-Updated: 2012-05-16 Forwarded: no Index: newt-0.52.14/dialogboxes.c =================================================================== --- newt-0.52.14.orig/dialogboxes.c 2012-05-16 12:15:50.000000000 +0100 +++ newt-0.52.14/dialogboxes.c 2012-05-16 12:16:29.000000000 +0100 @@ -568,7 +568,7 @@ answer = newtFormGetCurrent(form); - if (answer == no) + if ((rc == DLG_OKAY) && (answer == no)) return DLG_CANCEL; } else { debian/patches/sinhala.patch0000644000000000000000000000243411766635560013277 0ustar Author: Danishka Navin Description: Sinhala translation of NEWT Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=640766 Last-Updated: 2011-12-03 Forwarded: no Index: newt-0.52.14/po/si.po =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ newt-0.52.14/po/si.po 2011-12-03 12:36:04.000000000 +0000 @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Danishka Navin , 2011. +# + +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2006-09-14 16:03+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Danishka Navin \n" +"Language-Team: Sinhala \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493 +msgid "Ok" +msgstr "හරි" + +#: ../dialogboxes.c:51 +msgid "Cancel" +msgstr "නවතන්න" + +#: ../dialogboxes.c:498 +msgid "Yes" +msgstr "ඔව්" + +#: ../dialogboxes.c:500 +msgid "No" +msgstr "නැත" debian/patches/series0000644000000000000000000000072012144722167012037 0ustar endianness.patch #hardening.patch python.patch tcl86.patch icelandic.patch # python-dbg.patch python_memory_allocation.patch bengali.patch italian.patch belarussian.patch kazakh.patch irish.patch escape_key.patch uighir.patch sinhala.patch bidi.patch python_init_once.patch #snackmodule-fpic.patch # 620_asturian.patch (100%) # 720_newt_combiwrap.patch messagebox_escape.patch welsh.patch lithuanian.patch python3.patch compiler-warnings.patch snackmodule.patch debian/patches/compiler-warnings.patch0000644000000000000000000000707712144715203015310 0ustar Index: newt-0.52.15/newt.c =================================================================== --- newt-0.52.15.orig/newt.c 2013-05-15 15:00:08.000000000 +0100 +++ newt-0.52.15/newt.c 2013-05-15 15:11:45.000000000 +0100 @@ -1,5 +1,6 @@ #include "config.h" +#define ENABLE_SLFUTURE_CONST 1 #include #include #include Index: newt-0.52.15/whiptcl.c =================================================================== --- newt-0.52.15.orig/whiptcl.c 2013-03-25 14:16:36.000000000 +0000 +++ newt-0.52.15/whiptcl.c 2013-05-15 15:23:38.000000000 +0100 @@ -137,45 +137,44 @@ if (arg < -1) { /* this could buffer oveflow, bug we're not setuid so I don't care */ - interp->result = malloc(200); - interp->freeProc = TCL_DYNAMIC; - sprintf(interp->result, "%s: %s\n", + char *result = Tcl_Alloc(200); + sprintf(result, "%s: %s\n", poptBadOption(optCon, POPT_BADOPTION_NOALIAS), poptStrerror(arg)); - + Tcl_SetResult(interp, result, TCL_DYNAMIC); return TCL_ERROR; } if (mode == MODE_NONE) { - interp->result = "no dialog mode was specified"; + Tcl_SetResult(interp, "no dialog mode was specified", TCL_STATIC); return TCL_ERROR; } else if (rc) { - interp->result = "multiple modes were specified"; + Tcl_SetResult(interp, "multiple modes were specified", TCL_STATIC); return TCL_ERROR; } if (!(text = poptGetArg(optCon))) { - interp->result = "missing text parameter"; + Tcl_SetResult(interp, "missing text parameter", TCL_STATIC); return TCL_ERROR; } if (!(nextArg = poptGetArg(optCon))) { - interp->result = "height missing"; + Tcl_setResult(interp,"height missing", TCL_STATIC); return TCL_ERROR; } height = strtoul(nextArg, &end, 10); if (*end) { - interp->result = "height is not a number"; + Tcl_SetResult(interp,"height is not a number", TCL_STATIC); return TCL_ERROR; } if (!(nextArg = poptGetArg(optCon))) { - interp->result = "width missing"; + Tcl_SetResult(interp, "width missing", TCL_STATIC); return TCL_ERROR; } width = strtoul(nextArg, &end, 10); if (*end) { - interp->result = "width is not a number"; + Tcl_SetResult(interp, "width is not a number", TCL_STATIC); return TCL_ERROR; } @@ -195,36 +194,28 @@ case MODE_YESNO: rc = messageBox(text, height, width, MSGBOX_YESNO, flags); - if (rc == DLG_OKAY) - interp->result = "yes"; - else - interp->result = "no"; + Tcl_SetResult( interp, rc == DLG_OKAY ? "yes " : "no" , TCL_STATIC); if (rc == DLG_ERROR) rc = 0; break; case MODE_INPUTBOX: rc = inputBox(text, height, width, optCon, flags, &result); if (rc ==DLG_OKAY) { - interp->result = result; - interp->freeProc = TCL_DYNAMIC; + Tcl_SetResult( interp, result, TCL_DYNAMIC); } break; case MODE_MENU: rc = listBox(text, height, width, optCon, flags, default_item, &result); if (rc==DLG_OKAY) { - interp->result = result; - interp->freeProc = TCL_DYNAMIC; + Tcl_SetResult(interp, result, TCL_DYNAMIC); } break; case MODE_RADIOLIST: rc = checkList(text, height, width, optCon, 1, flags, &selections); if (rc==DLG_OKAY) { - interp->result = selections[0]; - interp->freeProc = TCL_DYNAMIC; - - free(selections); + Tcl_SetResult( interp, selections[0], TCL_DYNAMIC); } break; @@ -247,7 +238,7 @@ newtPopWindow(); if (rc == DLG_ERROR) { - interp->result = "bad paramter for whiptcl dialog box"; + Tcl_SetResult(interp, "bad paramter for whiptcl dialog box", TCL_STATIC); return TCL_ERROR; } debian/patches/python_init_once.patch0000644000000000000000000000135412144722102015204 0ustar Author: Alastair McKinstry Description: newtInit() should only be called once Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557960 Forwarded: no Last-Updated: 2011-12-04 Index: newt-0.52.15/snackmodule.c =================================================================== --- newt-0.52.15.orig/snackmodule.c 2013-05-15 16:05:12.000000000 +0100 +++ newt-0.52.15/snackmodule.c 2013-05-15 16:05:12.000000000 +0100 @@ -286,10 +286,14 @@ } static PyObject * initScreen(PyObject * s, PyObject * args) { + static int init_newt = 1; suspend.cb = NULL; suspend.data = NULL; - newtInit(); + if (init_newt) { + newtInit(); + init_newt = 0; + } newtCls(); Py_INCREF(Py_None); debian/README.Debian0000644000000000000000000000104311766635560011244 0ustar Note that libnewt ships with some locale files. These are not used by libnewt directly, but by whiptail, and its derivatives newt-tcl and python-newt. It is simpler to include them in the library, which is required by the other packages, than to create a package exclusively for these small files. Debian's version of newt include Bidirectional text support not yet present upstream, including an API addition "newtCheckboxSetWidth". Please only use this within Debian until it is supported upstream. - Alastair McKinstry debian/control0000644000000000000000000001046312261311263010572 0ustar Source: newt Section: devel Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Alastair McKinstry Standards-Version: 3.9.4 Homepage: https://fedorahosted.org/newt/ Vcs-Git: git://git.fedorahosted.org/git/newt X-Python-Version: >= 2.5 X-Python3-Version: >= 3.2 Build-Depends: debhelper (>=9), sgmltools-lite, gettext, dh-autoreconf, libslang2-dev (>=2.0.4-2), libpopt-dev, libfribidi-dev, tcl8.6-dev, python-all-dev:any (>= 2.6.6-3~), python-all-dbg:any, python3-all-dev:any, python3-all-dbg:any, libpython-all-dev (>= 2.6.6-3~), libpython-all-dbg, libpython3-all-dev, libpython3-all-dbg Package: libnewt-dev Architecture: any Multi-Arch: same Section: libdevel Depends: libslang2-dev (>= 2.0.2), libnewt0.52 (=${binary:Version}), ${misc:Depends} Description: Developer's toolkit for newt windowing library These are the header files and libraries for developing applications which use newt. Newt is a windowing toolkit for text mode, which provides many widgets and stackable windows. Package: libnewt-pic Architecture: any Multi-Arch: same Section: libdevel Priority: extra Depends: libnewt-dev (=${binary:Version}), ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Not Erik's Windowing Toolkit, shared library subset kit This is used to develop subsets of the newt shared libraries for use on custom installation floppies and in embedded systems. Unless you're making one of those, you won't need this package. Package: newt-tcl Architecture: any Section: interpreters Priority: extra Depends: libnewt0.52 (=${binary:Version}) , tcl8.6 | tcl8.5 | tcl8.4, ${misc:Depends}, ${shlibs:Depends} Description: NEWT module for Tcl This module allows you to build a text UI for your Tcl scripts using newt. Package: python-newt Architecture: any Section: python Provides: ${python:Provides} Depends: libnewt0.52 (=${binary:Version}) , ${python:Depends}, ${misc:Depends}, ${shlibs:Depends} Description: NEWT module for Python This module allows you to build a text UI for your Python scripts using newt. Package: python3-newt Architecture: any Section: python Provides: ${python3:Provides} Depends: libnewt0.52 (=${binary:Version}) , ${python3:Depends}, ${misc:Depends}, ${shlibs:Depends} Description: NEWT module for Python3 This module allows you to build a text UI for your Python3 scripts using newt. Package: python-newt-dbg Architecture: any Section: debug Priority: extra Depends: libnewt0.52 (=${binary:Version}), python-newt (=${binary:Version}), python-dbg, ${misc:Depends}, ${shlibs:Depends} Description: NEWT module for Python (debug extension) This module allows you to build a text UI for your Python scripts using newt. . This package contains the extension built for the Python debug interpreter. Package: python3-newt-dbg Architecture: any Section: debug Priority: extra Depends: libnewt0.52 (=${binary:Version}), python3-newt (=${binary:Version}), python3-dbg, ${misc:Depends}, ${shlibs:Depends} Description: NEWT module for Python3 (debug extension) This module allows you to build a text UI for your Python3 scripts using newt. . This package contains the extension built for the Python3 debug interpreter. Package: libnewt0.52 Architecture: any Section: libs Priority: important Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Recommends: libfribidi0 Multi-Arch: same Description: Not Erik's Windowing Toolkit - text mode windowing with slang Newt is a windowing toolkit for text mode built from the slang library. It allows color text mode applications to easily use stackable windows, push buttons, check boxes, radio buttons, lists, entry fields, labels, and displayable text. Scrollbars are supported, and forms may be nested to provide extra functionality. This package contains the shared library for programs that have been built with newt. Package: whiptail Architecture: any Section: utils Priority: important Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Displays user-friendly dialog boxes from shell scripts Whiptail is a "dialog" replacement using newt instead of ncurses. It provides a method of displaying several different types of dialog boxes from shell scripts. This allows a developer of a script to interact with the user in a much friendlier manner. debian/tests/0000755000000000000000000000000011766635560010347 5ustar debian/tests/bug557960.py0000644000000000000000000000077111766635560012203 0ustar #!/usr/bin/env python # bug557960: segfault on second call to SnackScreen. from snack import * s = SnackScreen() g = Grid(1, 1) ok = Button("Ok") g.setField(ok, 0, 0) s.gridWrappedWindow(g, "Ok") F = Form() F.add(ok) res = F.run() s.popWindow() s.finish() print "New screen" s = SnackScreen() # print "We do not get here if run in screen." g = Grid(1, 1) ok = Button("Ok") g.setField(ok, 0, 0) s.gridWrappedWindow(g, "segfaults in screen") F = Form() F.add(ok) res = F.run() s.popWindow() s.finish() debian/rules0000755000000000000000000000631212261312304010242 0ustar #!/usr/bin/make -f # # Created 20 December 1997 by Enrique Zanardi # Modified 2002-2011 by Alastair McKinstry, # # Copying and modification is unlimited, provided that the modified # version is marked as being modified. # Uncomment this to turn on verbose mode. # export DH_VERBOSE=1 # Magic debhelper rule. %: dh $@ --with python2,python3,autoreconf DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LIBDIR:=/lib/$(DEB_HOST_MULTIARCH) USRLIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH) DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) PYVERS:=$(shell pyversions --supported) PY3VERS:=$(shell py3versions --supported) ifeq ($(DEB_HOST_ARCH_OS),hurd) GPMSUPPORT= else GPMSUPPORT= --with-gpm-support endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) NOSTRIP=--with-nostrip=no else NOSTRIP=--with-nostrip=yes endif COLORSFILE = --with-colorsfile=/etc/newt/palette override_dh_auto_clean: dh_auto_clean # remove autogenerated files rm -rf Makefile config.h* config.log config.status .depend libnewt.pc \ configure install-sh po/*.mo python* tutorial libnewt_pic.a po/newt.pot rm -f debian/shlibs.local rm -f debian/python*-newt*.examples override_dh_auto_configure: # Nasty hack. why is it necessary? cp /usr/share/automake-1.*/install-sh ./install-sh dh_auto_configure -- $(GPMSUPPORT) $(NOSTRIP) $(COLORSFILE) CFLAGS="-I/usr/include/tcl8.6 $(CFLAGS)" \ CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" FFLAGS="$(FFLAGS)" override_dh_auto_build: dh_auto_build sgmltools --backend html tutorial.sgml ar cqv libnewt_pic.a shared/*.o override_dh_auto_install: dh_auto_install mkdir -p debian/tmp/$(LIBDIR)/. mv debian/tmp/$(USRLIBDIR)/*.so.* debian/tmp/$(LIBDIR)/. ln -sf $(LIBDIR)/$$(readlink debian/tmp/$(USRLIBDIR)/libnewt.so) \ debian/tmp/$(USRLIBDIR)/libnewt.so for v in $(PYVERS); do \ pylib=usr/lib/$$v/dist-packages ; \ mkdir -p debian/python-newt/$$pylib ; \ mkdir -p debian/python-newt-dbg/$$pylib ;\ mv $$v-dbg/_snackmodule.so debian/python-newt-dbg/$$pylib/_snackmodule_d.so; \ cp snack.py $$v/* debian/python-newt/$$pylib; \ done for v in $(PY3VERS); do \ pylib=usr/lib/python3/dist-packages ; \ abitag=.$$($$v -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \ abitagdbg=.$$($$v-dbg -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))"); \ mkdir -p debian/python3-newt/$$pylib ; \ mkdir -p debian/python3-newt-dbg/$$pylib ;\ mv $$v/_snackmodule.so $$v/_snack$$abitag-$(DEB_HOST_MULTIARCH).so; \ mv $$v-dbg/_snackmodule.so debian/python3-newt-dbg/$$pylib/_snack$$abitagdbg-$(DEB_HOST_MULTIARCH).so; \ cp snack.py $$v/* debian/python3-newt/$$pylib; \ done -find debian/python-* debian/python3-* -name '*.o' | xargs rm -f dh_install -p libnewt-dev libnewt.a $(USRLIBDIR) mkdir -p debian/libnewt-pic/$(USRLIBDIR) cp newt*.ver debian/libnewt-pic/$(USRLIBDIR)/libnewt_pic.map override_dh_strip: dh_strip -Npython-newt -Npython-newt-dbg -Npython3-newt -Npython3-newt-dbg dh_strip -ppython-newt --dbg-package=python-newt-dbg dh_strip -ppython3-newt --dbg-package=python3-newt-dbg debian/source/0000755000000000000000000000000011766635560010505 5ustar debian/source/format0000644000000000000000000000001411766635560011713 0ustar 3.0 (quilt) debian/whiptail.install0000644000000000000000000000001512164371624012401 0ustar whiptail bin debian/libnewt-dev.examples0000644000000000000000000000010411766635560013160 0ustar build-tree/*/testtree.c build-tree/*/test.c build-tree/*/testgrid.c debian/libnewt.symbols0000644000000000000000000001261212154111367012247 0ustar libnewt.so.0.52 libnewt #MINVER# NEWT_0.52.11@NEWT_0.52.11 0.52.15 NEWT_0.52.13@NEWT_0.52.13 0.52.15 NEWT_0.52.6@NEWT_0.52.6 0.52.15 NEWT_0.52.9@NEWT_0.52.9 0.52.15 NEWT_0.52@NEWT_0.52 0.52.15 _newt_wstrlen@NEWT_0.52 0.52.15 newtBell@NEWT_0.52 0.52.15 newtButton@NEWT_0.52 0.52.15 newtButtonBar@NEWT_0.52 0.52.15 newtButtonBarv@NEWT_0.52 0.52.15 newtCenteredWindow@NEWT_0.52 0.52.15 newtCheckbox@NEWT_0.52 0.52.15 newtCheckboxGetValue@NEWT_0.52 0.52.15 newtCheckboxSetFlags@NEWT_0.52 0.52.15 newtCheckboxSetValue@NEWT_0.52 0.52.15 newtCheckboxTree@NEWT_0.52 0.52.15 newtCheckboxTreeAddArray@NEWT_0.52 0.52.15 newtCheckboxTreeAddItem@NEWT_0.52 0.52.15 newtCheckboxTreeFindItem@NEWT_0.52 0.52.15 newtCheckboxTreeGetCurrent@NEWT_0.52 0.52.15 newtCheckboxTreeGetEntryValue@NEWT_0.52 0.52.15 newtCheckboxTreeGetMultiSelection@NEWT_0.52 0.52.15 newtCheckboxTreeGetSelection@NEWT_0.52 0.52.15 newtCheckboxTreeMulti@NEWT_0.52 0.52.15 newtCheckboxTreeSetCurrent@NEWT_0.52 0.52.15 newtCheckboxTreeSetEntry@NEWT_0.52 0.52.15 newtCheckboxTreeSetEntryValue@NEWT_0.52 0.52.15 newtCheckboxTreeSetWidth@NEWT_0.52 0.52.15 newtClearBox@NEWT_0.52 0.52.15 newtClearKeyBuffer@NEWT_0.52 0.52.15 newtCls@NEWT_0.52 0.52.15 newtCompactButton@NEWT_0.52 0.52.15 newtComponentAddCallback@NEWT_0.52 0.52.15 newtComponentAddDestroyCallback@NEWT_0.52.9 0.52.15 newtComponentDestroy@NEWT_0.52.9 0.52.15 newtComponentTakesFocus@NEWT_0.52 0.52.15 newtCreateGrid@NEWT_0.52 0.52.15 newtCursorOff@NEWT_0.52 0.52.15 newtCursorOn@NEWT_0.52 0.52.15 newtDefaultColorPalette@NEWT_0.52 0.52.15 newtDefaultEventHandler@NEWT_0.52 0.52.15 newtDefaultMappedHandler@NEWT_0.52 0.52.15 newtDefaultPlaceHandler@NEWT_0.52 0.52.15 newtDelay@NEWT_0.52 0.52.15 newtDrawBox@NEWT_0.52 0.52.15 newtDrawForm@NEWT_0.52 0.52.15 newtDrawRootText@NEWT_0.52 0.52.15 newtEntry@NEWT_0.52 0.52.15 newtEntryGetValue@NEWT_0.52 0.52.15 newtEntrySet@NEWT_0.52 0.52.15 newtEntrySetColors@NEWT_0.52.13 0.52.15 newtEntrySetFilter@NEWT_0.52 0.52.15 newtEntrySetFlags@NEWT_0.52 0.52.15 newtFinished@NEWT_0.52 0.52.15 newtFlushInput@NEWT_0.52 0.52.15 newtForm@NEWT_0.52 0.52.15 newtFormAddComponent@NEWT_0.52 0.52.15 newtFormAddComponents@NEWT_0.52 0.52.15 newtFormAddHotKey@NEWT_0.52 0.52.15 newtFormDestroy@NEWT_0.52 0.52.15 newtFormGetCurrent@NEWT_0.52 0.52.15 newtFormRun@NEWT_0.52 0.52.15 newtFormSetBackground@NEWT_0.52 0.52.15 newtFormSetCurrent@NEWT_0.52 0.52.15 newtFormSetHeight@NEWT_0.52 0.52.15 newtFormSetSize@NEWT_0.52 0.52.15 newtFormSetTimer@NEWT_0.52 0.52.15 newtFormSetWidth@NEWT_0.52 0.52.15 newtFormWatchFd@NEWT_0.52 0.52.15 newtGetKey@NEWT_0.52 0.52.15 newtGetScreenSize@NEWT_0.52 0.52.15 newtGetWindowPos@NEWT_0.52 0.52.15 newtGetrc@NEWT_0.52 0.52.15 newtGotorc@NEWT_0.52 0.52.15 newtGridAddComponentsToForm@NEWT_0.52 0.52.15 newtGridBasicWindow@NEWT_0.52 0.52.15 newtGridFree@NEWT_0.52 0.52.15 newtGridGetSize@NEWT_0.52 0.52.15 newtGridHCloseStacked@NEWT_0.52 0.52.15 newtGridHStacked@NEWT_0.52 0.52.15 newtGridPlace@NEWT_0.52 0.52.15 newtGridSetField@NEWT_0.52 0.52.15 newtGridSimpleWindow@NEWT_0.52 0.52.15 newtGridVCloseStacked@NEWT_0.52 0.52.15 newtGridVStacked@NEWT_0.52 0.52.15 newtGridWrappedWindow@NEWT_0.52 0.52.15 newtGridWrappedWindowAt@NEWT_0.52 0.52.15 newtInit@NEWT_0.52 0.52.15 newtLabel@NEWT_0.52 0.52.15 newtLabelSetColors@NEWT_0.52.13 0.52.15 newtLabelSetText@NEWT_0.52 0.52.15 newtListbox@NEWT_0.52 0.52.15 newtListboxAppendEntry@NEWT_0.52 0.52.15 newtListboxClear@NEWT_0.52 0.52.15 newtListboxClearSelection@NEWT_0.52 0.52.15 newtListboxDeleteEntry@NEWT_0.52 0.52.15 newtListboxGetCurrent@NEWT_0.52 0.52.15 newtListboxGetEntry@NEWT_0.52 0.52.15 newtListboxGetSelection@NEWT_0.52 0.52.15 newtListboxInsertEntry@NEWT_0.52 0.52.15 newtListboxItemCount@NEWT_0.52 0.52.15 newtListboxSelectItem@NEWT_0.52 0.52.15 newtListboxSetCurrent@NEWT_0.52 0.52.15 newtListboxSetCurrentByKey@NEWT_0.52 0.52.15 newtListboxSetData@NEWT_0.52 0.52.15 newtListboxSetEntry@NEWT_0.52 0.52.15 newtListboxSetWidth@NEWT_0.52 0.52.15 newtOpenWindow@NEWT_0.52 0.52.15 newtPopHelpLine@NEWT_0.52 0.52.15 newtPopWindow@NEWT_0.52 0.52.15 newtPopWindowNoRefresh@NEWT_0.52.6 0.52.15 newtPushHelpLine@NEWT_0.52 0.52.15 newtRadioGetCurrent@NEWT_0.52 0.52.15 newtRadioSetCurrent@NEWT_0.52.11 0.52.15 newtRadiobutton@NEWT_0.52 0.52.15 newtRedrawHelpLine@NEWT_0.52 0.52.15 newtReflowText@NEWT_0.52 0.52.15 newtRefresh@NEWT_0.52 0.52.15 newtResizeScreen@NEWT_0.52 0.52.15 newtResume@NEWT_0.52 0.52.15 newtRunForm@NEWT_0.52 0.52.15 newtScale@NEWT_0.52 0.52.15 newtScaleSet@NEWT_0.52 0.52.15 newtScaleSetColors@NEWT_0.52.13 0.52.15 newtScrollbarSet@NEWT_0.52 0.52.15 newtScrollbarSetColors@NEWT_0.52.13 0.52.15 newtSetColor@NEWT_0.52.6 0.52.15 newtSetColors@NEWT_0.52 0.52.15 newtSetFlags@NEWT_0.52 0.52.15 newtSetHelpCallback@NEWT_0.52 0.52.15 newtSetSuspendCallback@NEWT_0.52 0.52.15 newtSuspend@NEWT_0.52 0.52.15 newtTextbox@NEWT_0.52 0.52.15 newtTextboxGetNumLines@NEWT_0.52 0.52.15 newtTextboxReflowed@NEWT_0.52 0.52.15 newtTextboxSetColors@NEWT_0.52.13 0.52.15 newtTextboxSetHeight@NEWT_0.52 0.52.15 newtTextboxSetText@NEWT_0.52 0.52.15 newtTrashScreen@NEWT_0.52 0.52.15 newtVerticalScrollbar@NEWT_0.52 0.52.15 newtWaitForKey@NEWT_0.52 0.52.15 newtWinChoice@NEWT_0.52 0.52.15 newtWinEntries@NEWT_0.52 0.52.15 newtWinMenu@NEWT_0.52 0.52.15 newtWinMessage@NEWT_0.52 0.52.15 newtWinMessagev@NEWT_0.52 0.52.15 newtWinTernary@NEWT_0.52 0.52.15 debian/python3-newt-dbg.dirs0000644000000000000000000000003712144466257013175 0ustar /usr/lib/python3/dist-packages debian/whiptail.manpages0000644000000000000000000000001311766635560012535 0ustar whiptail.1 debian/palette.original0000644000000000000000000000000012144466311012342 0ustar debian/watch0000644000000000000000000000025512144637036010227 0ustar version=3 https://fedorahosted.org/releases/n/e/newt/newt-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz)) # Bart Martens Wed, 27 Feb 2013 06:42:29 +0000