Hello community,
here is the log from the commit of package newt
checked in at Fri Sep 5 20:30:58 CEST 2008.
--------
--- newt/newt.changes 2008-04-10 12:59:37.000000000 +0200
+++ newt/newt.changes 2008-09-01 13:29:22.000000000 +0200
@@ -1,0 +2,8 @@
+Mon Sep 1 12:48:05 CEST 2008 - lrupp@suse.de
+
+- update to 0.52.10:
+ + added support for help
+ + added cusor on/off stuff
+- rename newt-python to python-newt to follow the naming policy
+
+-------------------------------------------------------------------
Old:
----
newt-0.52.9.tar.bz2
New:
----
newt-0.52.10.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ newt.spec ++++++
--- /var/tmp/diff_new_pack.a31914/_old 2008-09-05 20:26:28.000000000 +0200
+++ /var/tmp/diff_new_pack.a31914/_new 2008-09-05 20:26:28.000000000 +0200
@@ -1,10 +1,17 @@
#
-# spec file for package newt (Version 0.52.9)
+# spec file for package newt (Version 0.52.10)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
@@ -12,10 +19,10 @@
Name: newt
-Url: http://cvs.fedora.redhat.com/viewcvs/devel/newt/
+Url: https://fedorahosted.org/newt/
Summary: Nifty Erik's Windowing Toolkit
-Version: 0.52.9
-Release: 2
+Version: 0.52.10
+Release: 1
%define soname 0_52
License: LGPL v2.1 or later
Group: System/Libraries
@@ -36,12 +43,13 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
-Newt is a programming library for color text-mode widget-based user
+Newt is a programming library for color text-mode, widget-based user
interfaces. Newt can be used to add stacked windows, entry widgets,
-check boxes, radio buttons, labels, plain text fields, scrollbars,
-etc., to text mode user interfaces.
+checkboxes, radio buttons, labels, plain text fields, scrollbars, etc.,
+to text mode user interfaces.
-This package also contains a Dialog replacement called whiptail.
+This package also contains a Dialog replacement called whiptail. Newt
+is based on the slang library.
@@ -105,10 +113,10 @@
%description doc
This package contains a tutorial about the Newt windowing toolkit.
-Newt is a programming library for color text-mode widget-based user
+Newt is a programming library for color text-mode, widget-based user
interfaces. Newt can be used to add stacked windows, entry widgets,
check boxes, radio buttons, labels, plain text fields, scrollbars,
-etc., to text mode user interfaces.
+etc., to text mode user interfaces. Newt is based on the slang library.
@@ -125,7 +133,8 @@
%description static
This package contains the static libraries needed to compile programs
-based on newt which don't need the shared libraries.
+based on newt which don't need the shared libraries. Install it if you
+need to link statically with libnewt.
Newt is a programming library for color text-mode widget-based user
interfaces. Newt can be used to add stacked windows, entry widgets,
@@ -138,16 +147,18 @@
--------
Erik Troan
-%package python
+%package -n python-newt
License: GPL v2 only; GPL v2 or later; LGPL v2.1 or later
Summary: Python bindings for newt
Group: System/Libraries
Requires: newt = %{version}
+Provides: newt-python = %{version}
+Obsoletes: newt-python < 0.52.10
#
-%description python
+%description -n python-newt
The newt-python package contains the Python bindings for the newt
-library providing a python API for creating text mode ionterfaces.
+library providing a python API for creating text mode interfaces.
@@ -159,16 +170,17 @@
%setup -q
%build
-%configure --without-tcl
# gpm support seems to smash the stack
# --with-gpm-support
+%configure --without-tcl
## make depend
make %{?jobs:-j%jobs} all
%install
make PYTHONVERS="python%{py_ver}" instroot="%buildroot" install install-sh
# currently we don't support these languages
-for lang in wo; do
+# FIXME: add to filesystem
+for lang in bal sr@latin wo; do
rm -rf %buildroot%_datadir/locale/$lang
done
#
@@ -221,13 +233,18 @@
%defattr (-,root,root)
%{_libdir}/libnewt.a
-%files python
+%files -n python-newt
%defattr(-,root,root)
%dir %_defaultdocdir/%name/examples
%doc %_defaultdocdir/%name/examples/*.py
%{py_sitedir}/*
%changelog
+* Mon Sep 01 2008 lrupp@suse.de
+- update to 0.52.10:
+ + added support for help
+ + added cusor on/off stuff
+- rename newt-python to python-newt to follow the naming policy
* Thu Apr 10 2008 ro@suse.de
- added baselibs.conf file to build xxbit packages
for multilib support
++++++ newt-0.52.9.tar.bz2 -> newt-0.52.10.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/checkboxtree.c new/newt-0.52.10/checkboxtree.c
--- old/newt-0.52.9/checkboxtree.c 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/checkboxtree.c 2008-07-30 14:42:55.000000000 +0200
@@ -501,8 +501,9 @@
list which is the last thing in the tree, and whose elements are
displayed at the bottom of the screen */
if (i < co->height) {
- spaces = alloca(co->width);
+ spaces = alloca(co->width + 1);
memset(spaces, ' ', co->width);
+ spaces[co->width] = '\0';
SLsmg_set_color(NEWT_COLORSET_LISTBOX);
while (i < co->height) {
@@ -717,7 +718,12 @@
const void * newtCheckboxTreeGetCurrent(newtComponent co) {
struct CheckboxTree * ct = co->data;
- if (!ct->currItem) return NULL;
+ if (!ct->currItem)
+ if (ct->itemlist)
+ return ct->itemlist->data;
+ else
+ return NULL;
+
return (*ct->currItem)->data;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/form.c new/newt-0.52.10/form.c
--- old/newt-0.52.9/form.c 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/form.c 2008-07-30 14:42:55.000000000 +0200
@@ -581,10 +581,9 @@
co->left = left;
for (i = 0, el = form->elements; i < form->numComps; i++, el++) {
- el->co->top += vertDelta;
el->top += vertDelta;
- el->co->left += horizDelta;
el->left += horizDelta;
+ el->co->ops->place(el->co, el->co->left, el->co->top);
}
}
@@ -606,7 +605,7 @@
} else {
/* only draw it if it'll fit on the screen vertically */
if (componentFits(co, i)) {
- el->co->top = el->top - form->vertOffset;
+ el->co->ops->place(el->co, el->left, el->top - form->vertOffset);
el->co->ops->mapped(el->co, 1);
el->co->ops->draw(el->co);
} else {
@@ -744,8 +743,9 @@
else if (new >= form->numComps)
new = (form->numComps - 1);
- while (!form->elements[new].co->takesFocus)
- new = new - dir;
+ while (!form->elements[new].co->takesFocus &&
+ new - dir >= 0 && new - dir < form->numComps)
+ new -= dir;
} else {
do {
new += dir;
@@ -755,6 +755,9 @@
new = form->numComps - 1;
else if (new >= form->numComps)
new = 0;
+ if (new == form->currComp)
+ /* back where we started */
+ return er;
} else if (new < 0 || new >= form->numComps)
return er;
} while (!form->elements[new].co->takesFocus);
@@ -865,11 +868,19 @@
co->width = 0;
if (!form->fixedHeight) co->height = 0;
- co->top = form->elements[0].co->top;
- co->left = form->elements[0].co->left;
+ co->top = -1;
+ co->left = -1;
+
for (i = 0, el = form->elements; i < form->numComps; i++, el++) {
if (el->co->ops == &formOps)
newtFormSetSize(el->co);
+ else if (el->co == form->vertBar)
+ continue;
+
+ if (co->top == -1) {
+ co->top = el->co->top;
+ co->left = el->co->left;
+ }
el->left = el->co->left;
el->top = el->co->top;
@@ -883,6 +894,7 @@
if (co->top > el->co->top) {
delta = co->top - el->co->top;
co->top -= delta;
+ form->numRows += delta;
if (!form->fixedHeight)
co->height += delta;
}
@@ -928,7 +940,8 @@
newtDrawForm(co);
if (form->currComp == -1) {
- gotoComponent(form, 0);
+ if (form->numComps)
+ gotoComponent(form, 0);
} else
gotoComponent(form, form->currComp);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/.gitignore new/newt-0.52.10/.gitignore
--- old/newt-0.52.9/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/newt-0.52.10/.gitignore 2008-07-30 14:42:55.000000000 +0200
@@ -0,0 +1,18 @@
+*.o
+*.so
+*.cache
+configure
+config.*
+.depend
+install-sh
+Makefile
+po/*.mo
+test
+testgrid
+whiptail
+libnewt*
+snack.pyc
+shared
+testtree
+showkey
+showchars
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/install-sh new/newt-0.52.10/install-sh
--- old/newt-0.52.9/install-sh 2008-03-21 13:18:26.000000000 +0100
+++ new/newt-0.52.10/install-sh 2008-07-30 14:43:28.000000000 +0200
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2006-10-14.15
+scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -48,7 +48,7 @@
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
@@ -58,34 +58,49 @@
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
-posix_glob=
posix_mkdir=
# Desired mode of installed file.
mode=0755
+chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
-chgrpcmd=
-stripcmd=
+mvcmd=$mvprog
rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
src=
dst=
dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
no_target_directory=
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
@@ -95,65 +110,55 @@
In the 4th, create DIRECTORIES.
Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
- -c) shift
- continue;;
+ -c) ;;
+
+ -C) copy_on_change=true;;
- -d) dir_arg=true
- shift
- continue;;
+ -d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- shift
- shift
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
- continue;;
+ shift;;
-o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
- shift
- shift
- continue;;
-
- -T) no_target_directory=true
- shift
- continue;;
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
@@ -165,21 +170,22 @@
*) break;;
esac
+ shift
done
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
- if test -n "$dstarg"; then
+ if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
+ set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
- dstarg=$arg
+ dst_arg=$arg
done
fi
@@ -224,7 +230,7 @@
do
# Protect names starting with `-'.
case $src in
- -*) src=./$src ;;
+ -*) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -242,22 +248,22 @@
exit 1
fi
- if test -z "$dstarg"; then
+ if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
- dst=$dstarg
+ dst=$dst_arg
# Protect names starting with `-'.
case $dst in
- -*) dst=./$dst ;;
+ -*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
+ echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
@@ -378,26 +384,19 @@
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix=/ ;;
- -*) prefix=./ ;;
- *) prefix= ;;
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
esac
- case $posix_glob in
- '')
- if (set -f) 2>/dev/null; then
- posix_glob=true
- else
- posix_glob=false
- fi ;;
- esac
+ eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
- $posix_glob && set -f
+ $posix_glob set -f
set fnord $dstdir
shift
- $posix_glob && set +f
+ $posix_glob set +f
IFS=$oIFS
prefixes=
@@ -459,41 +458,54 @@
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dst"; then
- $doit $rmcmd -f "$dst" 2>/dev/null \
- || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
- && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
- || {
- echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- } || exit 1
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
trap '' 0
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/newt.c new/newt-0.52.10/newt.c
--- old/newt-0.52.9/newt.c 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/newt.c 2008-07-30 14:42:55.000000000 +0200
@@ -41,7 +41,7 @@
static int trashScreen = 0;
extern int needResize;
-static const char * defaultHelpLine =
+static const char * const defaultHelpLine =
" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen"
;
@@ -131,6 +131,7 @@
{ 0 }, /* LEAVE this one */
};
static void initKeymap();
+static void freeKeymap();
static const char ident[] = // ident friendly
"$Version: Newt windowing library v" VERSION " $"
@@ -335,6 +336,8 @@
currentHelpline = NULL;
}
+ freeKeymap();
+
SLsmg_gotorc(SLtt_Screen_Rows - 1, 0);
newtCursorOn();
SLsmg_refresh();
@@ -425,17 +428,14 @@
*/
struct kmap_trie_entry {
+ char alloced; /* alloced/not first element in array */
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 struct kmap_trie_entry *kmap_trie_root = NULL;
static int keyreader_buf_len = 10 ;
static unsigned char default_keyreader_buf[10];
static unsigned char *keyreader_buf = default_keyreader_buf;
@@ -473,7 +473,7 @@
static void dump_keymap(void) {
FILE *f = fopen("newt.keydump","wt");
if (f) {
- dumpkeys_recursive(&kmap_trie_root,0,f);
+ dumpkeys_recursive(kmap_trie_root, 0, f);
fclose(f);
}
}
@@ -481,7 +481,7 @@
/* 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 *root = kmap_trie_root ;
struct kmap_trie_entry **curptr = &root ;
/* Try to make sure the common matching buffer is long enough. */
@@ -505,6 +505,7 @@
struct kmap_trie_entry* fresh
= calloc(strlen(keyseq),sizeof(struct kmap_trie_entry));
if (fresh == 0) return; /* despair! */
+ fresh->alloced = 1;
*curptr = fresh;
while (keyseq[1]) {
fresh->contseq = fresh+1;
@@ -545,6 +546,7 @@
*fromcopy = malloc(sizeof(struct kmap_trie_entry));
if (*fromcopy) {
**fromcopy = *to ;
+ (*fromcopy)->alloced = 1;
(*fromcopy)->next = 0 ;
}
}
@@ -555,7 +557,7 @@
int key;
unsigned char *chptr = keyreader_buf, *lastmatch;
int lastcode;
- struct kmap_trie_entry *curr = &kmap_trie_root;
+ struct kmap_trie_entry *curr = kmap_trie_root;
do {
key = getkey();
@@ -843,6 +845,22 @@
static void initKeymap(void) {
const struct keymap * curr;
+ struct kmap_trie_entry *kmap_trie_escBrack, *kmap_trie_escO;
+
+ /* Here are some entries that will help in handling esc O foo and
+ esc [ foo as variants of each other. */
+ kmap_trie_root = calloc(3, sizeof (struct kmap_trie_entry));
+ kmap_trie_escBrack = kmap_trie_root + 1;
+ kmap_trie_escO = kmap_trie_root + 2;
+
+ kmap_trie_root->alloced = 1;
+ kmap_trie_root->c = '\033';
+ kmap_trie_root->contseq = kmap_trie_escBrack;
+
+ kmap_trie_escBrack->c = '[';
+ kmap_trie_escBrack->next = kmap_trie_escO;
+
+ kmap_trie_escO->c = 'O';
/* First bind built-in default bindings. They may be shadowed by
the termcap entries that get bound later. */
@@ -870,8 +888,33 @@
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);
+ kmap_trie_fallback(kmap_trie_escO->contseq, &kmap_trie_escBrack->contseq);
+ kmap_trie_fallback(kmap_trie_escBrack->contseq, &kmap_trie_escO->contseq);
+}
+
+static void free_keys(struct kmap_trie_entry *kmap, struct kmap_trie_entry *parent, int prepare) {
+ if (kmap == NULL)
+ return;
+
+ free_keys(kmap->contseq, kmap, prepare);
+ free_keys(kmap->next, kmap, prepare);
+
+ if (!kmap->alloced && kmap - parent == 1)
+ return;
+
+ /* find first element in array */
+ while (!kmap->alloced)
+ kmap--;
+
+ kmap->alloced += prepare ? 1 : -1;
+ if (!prepare && kmap->alloced == 1)
+ free(kmap);
+}
+
+static void freeKeymap() {
+ free_keys(kmap_trie_root, NULL, 1);
+ free_keys(kmap_trie_root, NULL, 0);
+ kmap_trie_root = NULL;
}
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/newt.spec new/newt-0.52.10/newt.spec
--- old/newt-0.52.9/newt.spec 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/newt.spec 2008-07-30 14:42:55.000000000 +0200
@@ -1,7 +1,7 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Summary: A library for text mode user interfaces
Name: newt
-Version: 0.52.9
+Version: 0.52.10
Release: 1%{?dist}
License: LGPLv2
Group: System Environment/Libraries
@@ -101,6 +101,22 @@
%{python_sitearch}/*.py*
%changelog
+* Wed Jul 30 2008 Miroslav Lichvar - 0.52.10-1
+- improve --noitem description (#456305)
+- add setHeight to Textbox class
+- fix fixedheight forms
+- free keymap in newtFinished()
+- fix memory leak in textbox
+- fix valgrind error in checkboxtree
+- don't crash when running empty form
+- don't crash or hang when form has no focusable elements
+- before checkboxtree drawing return first item in GetCurrent()
+- redraw textbox in SetText()
+- add setColor description to SnackScreen docstring (Greg Swift)
+- make sure Widget isn't used directly (Greg Swift) (#452920)
+- add Serbian translations (Miloš Komarčević)
+- add Balochi translation (Mostafa Daneshvar)
+
* Fri Mar 21 2008 Miroslav Lichvar - 0.52.9-1
- handle component destruction (patch by Richard W.M. Jones)
- fix newtWinEntry definition
@@ -109,7 +125,7 @@
- improve SIGWINCH handling in form
- don't abort from whiptail gauge on SIGWINCH
- redisplay also last line
-- update Polish translation
+- update Polish translation (Piotr Drąg)
- update URL and Source tag
* Tue Feb 19 2008 Fedora Release Engineering - 0.52.8-2
Files old/newt-0.52.9/po/bal.mo and new/newt-0.52.10/po/bal.mo differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/po/bal.po new/newt-0.52.10/po/bal.po
--- old/newt-0.52.9/po/bal.po 1970-01-01 01:00:00.000000000 +0100
+++ new/newt-0.52.10/po/bal.po 2008-07-30 14:42:55.000000000 +0200
@@ -0,0 +1,35 @@
+# translation of newt.master.balochi.po to Balochi
+# translation of newt.master.balochi.po to
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+#
+# Mostafa Daneshvar , 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: newt.master.balochi\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-14 16:03+0200\n"
+"PO-Revision-Date: 2008-03-21 23:04+0430\n"
+"Last-Translator: Mostafa Daneshvar \n"
+"Language-Team: Balochi \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 "هوبنت"
+
+#: ../dialogboxes.c:51
+msgid "Cancel"
+msgstr "کنسل"
+
+#: ../dialogboxes.c:498
+msgid "Yes"
+msgstr "بله"
+
+#: ../dialogboxes.c:500
+msgid "No"
+msgstr "نه"
+
Files old/newt-0.52.9/po/sr@latin.mo and new/newt-0.52.10/po/sr@latin.mo differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/po/sr@latin.po new/newt-0.52.10/po/sr@latin.po
--- old/newt-0.52.9/po/sr@latin.po 1970-01-01 01:00:00.000000000 +0100
+++ new/newt-0.52.10/po/sr@latin.po 2008-07-30 14:42:55.000000000 +0200
@@ -0,0 +1,36 @@
+# translation of sr.po to Serbian
+# Serbian(Latin) translations for newt
+# Copyright (C) 2006 Red Hat, Inc.
+# This file is distributed under the same license as the newt package.
+#
+# Nikola Pajtić , 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: newt\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-14 16:03+0200\n"
+"PO-Revision-Date: 2008-03-13 14:53+0100\n"
+"Last-Translator: Nikola Pajtić \n"
+"Language-Team: Serbian (sr) \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%"
+"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: ../dialogboxes.c:43 ../dialogboxes.c:48 ../dialogboxes.c:493
+msgid "Ok"
+msgstr "U redu"
+
+#: ../dialogboxes.c:51
+msgid "Cancel"
+msgstr "Otkaži"
+
+#: ../dialogboxes.c:498
+msgid "Yes"
+msgstr "Da"
+
+#: ../dialogboxes.c:500
+msgid "No"
+msgstr "Ne"
Files old/newt-0.52.9/po/sr.mo and new/newt-0.52.10/po/sr.mo differ
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/po/sr.po new/newt-0.52.10/po/sr.po
--- old/newt-0.52.9/po/sr.po 1970-01-01 01:00:00.000000000 +0100
+++ new/newt-0.52.10/po/sr.po 2008-07-30 14:42:55.000000000 +0200
@@ -0,0 +1,36 @@
+# translation of sr.po to Serbian
+# Serbian translations for newt
+# Copyright (C) 2006 Red Hat, Inc.
+# This file is distributed under the same license as the newt package.
+#
+# Nikola Pajtić , 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: newt\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-09-14 16:03+0200\n"
+"PO-Revision-Date: 2008-03-13 14:53+0100\n"
+"Last-Translator: Nikola Pajtić \n"
+"Language-Team: Serbian (sr) \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%"
+"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: KBabel 1.11.4\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 "Не"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/snackmodule.c new/newt-0.52.10/snackmodule.c
--- old/newt-0.52.9/snackmodule.c 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/snackmodule.c 2008-07-30 14:42:55.000000000 +0200
@@ -204,6 +204,7 @@
static PyObject * widgetListboxSet(snackWidget * s, PyObject * args);
static PyObject * widgetListboxClear(snackWidget * s, PyObject * args);
static PyObject * widgetTextboxText(snackWidget * s, PyObject * args);
+static PyObject * widgetTextboxHeight(snackWidget * s, PyObject * args);
static PyObject * widgetCheckboxTreeAddItem(snackWidget * s, PyObject * args);
static PyObject * widgetCheckboxTreeGetSel(snackWidget * s, PyObject * args);
static PyObject * widgetCheckboxTreeGetCur(snackWidget * s, PyObject * args);
@@ -220,6 +221,7 @@
{ "setCallback", (PyCFunction) widgetAddCallback, METH_VARARGS, NULL },
{ "labelText", (PyCFunction) widgetLabelText, METH_VARARGS, NULL },
{ "textboxText", (PyCFunction) widgetTextboxText, METH_VARARGS, NULL },
+ { "textboxHeight", (PyCFunction) widgetTextboxHeight, METH_VARARGS, NULL },
{ "entrySetValue", (PyCFunction) widgetEntrySetValue, METH_VARARGS, NULL },
{ "listboxAddItem", (PyCFunction) widgetListboxAdd, METH_VARARGS, NULL },
{ "listboxInsertItem", (PyCFunction) widgetListboxIns, METH_VARARGS, NULL },
@@ -653,6 +655,17 @@
return Py_None;
}
+static PyObject * widgetTextboxHeight(snackWidget * s, PyObject * args) {
+ int height;
+
+ if (!PyArg_ParseTuple(args, "i", &height)) return NULL;
+
+ newtTextboxSetHeight(s->co, height);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
static snackWidget * listboxWidget(PyObject * s, PyObject * args) {
snackWidget * widget;
int height;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/snack.py new/newt-0.52.10/snack.py
--- old/newt-0.52.9/snack.py 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/snack.py 2008-07-30 14:42:55.000000000 +0200
@@ -54,7 +54,7 @@
snackArgs = {"append":-1}
class Widget:
- """Base class for NEWT toolkit
+ """Base class for NEWT toolkit - Do not use directly
methods:
@@ -70,7 +70,7 @@
self.w.setCallback(obj)
def __init__(self):
- self.w = None
+ raise NotImplementedError
class Button(Widget):
"""Basic button class, takes button text as parameter
@@ -212,11 +212,15 @@
- Textbox(self, width, height, scroll = 0, wrap = 0): scroll, wrap are flags
include scroll bars, or text wrap.
- setText(text) : set text.
+ - setHeight(height): set height.
"""
def setText(self, text):
self.w.textboxText(text)
+ def setHeight(self, height):
+ self.w.textboxHeight(height)
+
def __init__(self, width, height, text, scroll = 0, wrap = 0):
self.w = _snack.textbox(width, height, text, scroll, wrap)
@@ -441,6 +445,11 @@
- suspendcallback(self,cb, data=None) : set callback. data=data to pass to cb.
- openWindow(self,left, top, width, height, title): Open a window.
- pushHelpLine(self,text): put help line on screen. Returns current help line if text=None
+ - setColor(self, colorset, fg, bg): Set foreground and background colors;
+ colorset = key from snack.colorsets,
+ fg & bg = english color names defined by S-Lang
+ (ref: S-Lang Library C Programmer's Guide section:
+ 8.4.4. Setting Character Attributes)
"""
def __init__(self):
_snack.init()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/textbox.c new/newt-0.52.10/textbox.c
--- old/newt-0.52.9/textbox.c 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/textbox.c 2008-07-30 14:42:55.000000000 +0200
@@ -100,6 +100,7 @@
co->ops = &textboxOps;
+ co->isMapped = 0;
co->height = height;
co->top = top;
co->left = left;
@@ -300,6 +301,10 @@
int badness, height;
if (tb->lines) {
+ int i;
+
+ for (i = 0; i < tb->numLines; i++)
+ free(tb->lines[i]);
free(tb->lines);
tb->linesAlloced = tb->numLines = 0;
}
@@ -330,6 +335,8 @@
free(expanded);
+ textboxDraw(co);
+
newtTrashScreen();
}
@@ -350,6 +357,9 @@
struct textbox * tb = c->data;
int size;
+ if (!c->isMapped)
+ return;
+
if (tb->sb) {
size = tb->numLines - c->height;
if (tb->isActive) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/newt-0.52.9/whiptail.1 new/newt-0.52.10/whiptail.1
--- old/newt-0.52.9/whiptail.1 2008-03-21 13:17:45.000000000 +0100
+++ new/newt-0.52.10/whiptail.1 2008-07-30 14:42:55.000000000 +0200
@@ -114,7 +114,8 @@
.TP
.B \-\-noitem
The menu, checklist and radiolist widgets will display tags only, not
-the item strings.
+the item strings. The menu widget still needs some items specified,
+but checklist and radiolist expect only tag and status.
.TP
.BI \-\-separate\-output
For checklist widgets, output result one line at a time, with no
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org