Hello community,

here is the log from the commit of package libstfl for openSUSE:Factory checked 
in at 2018-02-20 17:57:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstfl (Old)
 and      /work/SRC/openSUSE:Factory/.libstfl.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstfl"

Tue Feb 20 17:57:11 2018 rev:11 rq:578319 version:0.24

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstfl/libstfl.changes  2015-05-15 
07:44:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libstfl.new/libstfl.changes     2018-02-20 
17:58:41.534650576 +0100
@@ -1,0 +2,17 @@
+Sun Feb 18 06:53:38 UTC 2018 - avin...@opensuse.org
+
+- update to 0.24
+  * increased table MAX_ROWS and MAX_COLS
+  * Added "process" variable
+  * Added stfl_redraw API
+  * Added example2
+  * Fixed updating of "pos_name" in list widget
+  * Added stfl_text() function
+  * removed unimplemented stfl_lookup() function
+  * Fixed compiler warning in wt_list.c
+  * cosmetic changes in parser.c
+- cleanup spec file with spec-cleaner
+- rebase stfl-optflags.patch
+  * version number removed from context for better reusability
+
+-------------------------------------------------------------------

Old:
----
  stfl-0.23.tar.gz

New:
----
  stfl-0.24.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstfl.spec ++++++
--- /var/tmp/diff_new_pack.7nN3Ib/_old  2018-02-20 17:58:42.882602062 +0100
+++ /var/tmp/diff_new_pack.7nN3Ib/_new  2018-02-20 17:58:42.886601918 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libstfl
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define soname 0
 Name:           libstfl
-Version:        0.23
+Version:        0.24
 Release:        0
 Summary:        Structured Terminal Forms Library
 License:        LGPL-3.0+
@@ -28,10 +28,8 @@
 Source99:       libstfl-rpmlintrc
 Patch1:         stfl-optflags.patch
 Patch2:         stfl-ncurses.patch
-#BuildRequires:        swig perl python python-devel ruby ruby-devel
 BuildRequires:  ncurses-devel
-BuildRequires:  pkg-config
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+BuildRequires:  pkgconfig
 
 %description
 .............................................................................
@@ -75,10 +73,8 @@
 
 %build
 make %{?_smp_mflags} \
-    prefix="%{_prefix}" \
-       libdir="%{_lib}" \
        CC="gcc" \
-       OPTFLAGS="%{optflags}" \
+       OPTFLAGS="%{optflags}"\
        FOUND_SPL=0 \
        FOUND_SWIG=0 \
        FOUND_RUBY=0 \
@@ -86,14 +82,9 @@
        FOUND_PYTHON=0
 
 %install
-make DESTDIR=%{buildroot} install %{?_smp_mflags} \
-       prefix="%{_prefix}" \
+%make_install \
        libdir="%{_lib}" \
-       FOUND_SPL=0 \
-       FOUND_SWIG=0 \
-       FOUND_RUBY=0 \
-       FOUND_PERL=0 \
-       FOUND_PYTHON=0
+       prefix="%{_prefix}"
 
 [ -e "%{buildroot}%{_libdir}/libstfl.so.%{soname}" ] || {
     pushd "%{buildroot}%{_libdir}/"
@@ -102,17 +93,14 @@
 }
 
 %post   -n libstfl%{soname} -p /sbin/ldconfig
-
 %postun -n libstfl%{soname} -p /sbin/ldconfig
 
 %files -n libstfl%{soname}
-%defattr(-,root,root)
 %doc COPYING README
 %{_libdir}/libstfl.so.%{soname}
 %{_libdir}/libstfl.so.%{soname}.*
 
 %files -n libstfl-devel
-%defattr(-,root,root)
 %{_includedir}/stfl.h
 %{_libdir}/libstfl.so
 %{_libdir}/libstfl.a

++++++ stfl-0.23.tar.gz -> stfl-0.24.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/Makefile new/stfl-0.24/Makefile
--- old/stfl-0.23/Makefile      2014-10-13 20:13:08.000000000 +0200
+++ new/stfl-0.24/Makefile      2015-02-12 14:14:33.000000000 +0100
@@ -25,7 +25,7 @@
 export LDLIBS += -lncursesw
 
 SONAME  := libstfl.so.0
-VERSION := 0.23
+VERSION := 0.24
 
 all: libstfl.so.$(VERSION) libstfl.a example
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/README new/stfl-0.24/README
--- old/stfl-0.23/README        2014-04-25 13:51:13.000000000 +0200
+++ new/stfl-0.24/README        2015-01-05 11:50:54.000000000 +0100
@@ -51,7 +51,7 @@
        ncursesw
                The wide-character ncurses library. On some distributions
                this might be part of the ncurses package, on other
-               distrubutions this might be an extra package.
+               distributions this might be an extra package.
 
        SWIG
                STFL is using SWIG for generating the Perl, Python and Ruby
@@ -59,7 +59,7 @@
 
        Perl, Python, Ruby, SPL
                In order to create the language bindings you need to have
-               the languages themself installed.
+               the languages themselves installed.
 
 Since STFL is a wide-character library it will only work on systems which
 do have wide-character support in the system libraries. This might not be
@@ -74,21 +74,21 @@
 describe such trees in an efficient and still easy to read and maintain way.
 
 The Structured Terminal Forms Language has only two syntactical constructs:
-Variable declarations and widget instanciations. Each widget instanciation
-may contain variable declarations and child widget instanciations.
+Variable declarations and widget instantiations. Each widget instantiation
+may contain variable declarations and child widget instantiations.
 
-A widget can be instanciated by simly writing down the type of the widget.
+A widget can be instantiated by simply writing down the type of the widget.
 Example given:
 
        vbox
 
-Sometimes one wants to give the instanciated widget a name so the widget
-can be easily accesed later. This can be done by appending the widget name
+Sometimes one wants to give the instantiated widget a name so the widget
+can be easily accessed later. This can be done by appending the widget name
 using square brackets:
 
        label[foobar]
 
-Child widgets are instanciated the same way but must be indented:
+Child widgets are instantiated the same way but must be indented:
 
        vbox
          label[label1]
@@ -97,7 +97,7 @@
 Note that one must not use tabs for the indenting. Only blanks are allowed.
 
 Variables are declared like child widgets. A variable consists of a key and
-a value, seperated by a colon. Values can be quoted using single or double
+a value, separated by a colon. Values can be quoted using single or double
 quotes when they contain blanks.
 
        vbox
@@ -163,7 +163,7 @@
          input#foobar
            text:"Black text on red background."
 
-While widget instanciations must alsways be on a new line, variable declarions
+While widget instantiations must always be on a new line, variable declarations
 can also be written on the same line as the widget they are for and it is
 possible to declare more than one variable in one line:
 
@@ -175,7 +175,7 @@
 Sometimes one wants to generate STFL code from scripts. In this cases it can
 become hard to automatically generate the indenting correctly. For such
 situations it is possible to use a different format with curly brackets. The
-following two code fragmentsa are identical:
+following two code fragments are identical:
 
        vbox
          hbox
@@ -208,7 +208,7 @@
 may have the focus at a time.
 
 The STFL parser can also read external files. This can be done by putting the
-filename in < > brackets in the STFL file. Note that this is not a varbatim
+filename in < > brackets in the STFL file. Note that this is not a verbatim
 include but calls another parser instance recursively. So there is an extra
 indenting / curly brackets state for the external file.
 
@@ -222,7 +222,7 @@
 ---------------------------
 
 STFL is using a generic syntax whenever the style (color, etc.) of a text
-can be specified: A comma seperated key=value list, where the key can be
+can be specified: A comma separated key=value list, where the key can be
 'bg' for background, 'fg' for foreground and 'attr' for text attributes.
 Example given the following style string can be used for creating bold
 blinking white text on blue background:
@@ -265,7 +265,7 @@
 Key and Keybinding Descriptions
 -------------------------------
 
-Key descriptings are strings describing a key press event. With some
+Key descriptions are strings describing a key press event. With some
 exceptions this are the return values of the ncurses keyname() and key_name()
 functions. The exceptions are:
 
@@ -285,10 +285,10 @@
                A function key has been pressed.
 
        UNKNOWN
-               An unkown key has been pressed.
+               An unknown key has been pressed.
                (Usually this is the result of a broken multibyte sequence)
 
-A key binding description is a whitespace-seperated list of key descriptions
+A key binding description is a whitespace-separated list of key descriptions
 used in bind_* variables to bind keys to widget actions. Each widget provides
 default bindings for all its actions. If you want to extend the list of bind
 keys instead of overwriting them you must use the special key-description "**"
@@ -307,7 +307,7 @@
 ~~~~~~~~~~~~~
 
 This widgets simply layouts its child widgets vertically or horizontally
-repectively. The following variables are supported by both widgets:
+respectively. The following variables are supported by both widgets:
 
        bind_left, bind_right
                The keybindings in a hbox for changing the focus to the
@@ -388,7 +388,7 @@
 
        bind_delete
                Delete the character under the cursor. Default value is the
-               DEL key.
+               DC (DEL) key.
 
        bind_backspace
                Delete the character before the cursor. Default value is the
@@ -401,6 +401,9 @@
        style_focus
                The style of this widget when it does have the focus.
 
+       size
+               The length (width) of the input box.
+
        text
                The value displayed in the input box.
 
@@ -419,7 +422,7 @@
 
        bind_toggle
                The keys used to toggle the checkbox value. Default value is
-    "ENTER SPACE", meaning the ENTER and SPACE keys.
+               "ENTER SPACE", meaning the ENTER and SPACE keys.
 
        style_normal
                The style of this widget when it does not have the
@@ -457,7 +460,7 @@
                Default values are the UP, DOWN, LEFT and RIGHT keys.
 
        style_normal
-               The style for the table bordes.
+               The style for the table borders.
 
        .expand
                Contains the information if child widgets should be expanded
@@ -507,7 +510,11 @@
 
        bind_page_up, bind_page_down
                The key bindings for scrolling up or down by page. Default
-               values are the PAGE_UP and PAGE_DOWN keys.
+               values are the PPAGE (PAGE_UP) and NPAGE (PAGE_DOWN) keys.
+
+       bind_home, bind_end
+               The key bindings for moving to top or bottom of list. Default
+               values are the HOME and END keys.
 
        style_focus
                Style of the active list item when the widget has the focus.
@@ -526,7 +533,7 @@
                The widget name of the current list item.
 
        offset
-               The numer of the list item displayed in the first line (this
+               The number of the list item displayed in the first line (this
                becomes >0 when scrolling).
 
 
@@ -550,7 +557,11 @@
 
        bind_page_up, bind_page_down
                The key bindings for scrolling up or down by page. Default
-               values are the PAGE_UP and PAGE_DOWN keys.
+               values are the PPAGE (PAGE_UP) and NPAGE (PAGE_DOWN) keys.
+
+       bind_home, bind_end
+               The key bindings for moving to top or bottom of text. Default
+               values are the HOME and END keys.
 
        style_normal
                The style the text itself is displayed.
@@ -576,8 +587,11 @@
 A widget for editing multiline text. The text itself is stored within
 listitem child widgets.
 
-       bind_up, bind_down, bind_left, bind_right, bind_page_up, bind_page_down
-               Key bindings for navigating the text
+       bind_up, bind_down, bind_left, bind_right, bind_page_up, bind_page_down,
+       bind_home, bind_end, bind_delete, bind_backspace, bind_enter
+               Key bindings for navigating the text. The default values are 
UP, DOWN,
+               LEFT, RIGHT, PPAGE (PAGE_UP), NPAGE (PAGE_DOWN), HOME or Ctrl-A,
+               END of Ctrl-E, DC (DEL), BACKSPACE and ENTER keys respectively.
 
        style_normal
                The style the text itself is displayed.
@@ -601,16 +615,26 @@
 ~~~~~
 
 A widget which has the modal variable set to '1' will not pass any events
-to its parent widgets. Eighter the event is handled by the widget itself or
+to its parent widgets. Either the event is handled by the widget itself or
 it is returned directly to the caller of stfl_run().
 
 autobind
 ~~~~~~~~
 
 Setting autobind to '0' disables all automatically assigned keybindings for
-this widget. Actions which aren't set explicitely bind to keys using the
+this widget. Actions which aren't set explicitly bind to keys using the
 bind_* variables are left unbind and can't be triggered using the user
-interface.
+interface. Setting autobind to '0' does not prevent typing of regular text
+into input and textedit widgets; for such functionality see 'process'. 
+
+process
+~~~~~~~~
+
+Setting process to '0' disables all keypress processing on the widget and
+passes the keypress events to the caller of stfl_run(). This setting is
+similar to autobind, but it will stop all key processing on the widget,
+including typing of regular text into input and textedit widgets. When
+this variable is set back to '1', processing resumes as usual.
 
 on_*
 ~~~~
@@ -619,7 +643,7 @@
 the value of the on_* variable to the caller of stfl_run(). The on_* variables
 are evaluated before the keypresses are passed to the widget. The '*' part
 of the on_* variables is a key description. E.g. "on_^X:foobar" will let
-stfl_run() return the string "foobar" when Ctrl-X is beeing pressed.
+stfl_run() return the string "foobar" when Ctrl-X is being pressed.
 
 can_focus
 ~~~~~~~~~
@@ -643,7 +667,7 @@
 C API Notes
 ~~~~~~~~~~~
 
-All functions listed here are also available thru the STFL C-API.
+All functions listed here are also available through the STFL C-API.
 
 All strings returned by stfl functions are constant and must not be freed or
 modified by the caller. When the caller wants to preserve a string for longer
@@ -666,7 +690,7 @@
 and the scripting language to UTF-8.
 
 Programs using STFL directly might use the STFL "ipool" API for easy conversion
-betweed wide characters and other encodings.
+between wide characters and other encodings.
 
 SPL API Notes
 ~~~~~~~~~~~~~
@@ -734,9 +758,9 @@
 value when something changed in the form (e.g. the user changed the focus of
 the current widget) but all inputs have been handled internally inside of STFL.
 The event string can be "TIMEOUT" when the timeout has been reached, a key
-description is key has been pressed that is not beeing hadled internally in
+description is key has been pressed that is not being handled internally in
 STFL or the value of an on_* variable can be returned if a keypress has been
-catched using such a variable.
+caught using such a variable.
 
 The 2nd parameter is a timeout in ms. When no key has been pressed until this
 timeout has been reached the function returns with a "TIMEOUT" event. Set this
@@ -753,14 +777,24 @@
 
 When the timeout parameter is set to -3, rendering (and setting the :x, :y, :w
 and :h pseudo-variables) is done but the screen is not updated and no events
-are fetched. This is usefull for incrementing rendering processes where
+are fetched. This is useful for incrementing rendering processes where
 appropriate :x, :y, :w and/or :h values are needed for finishing the layout.
 
+stfl_redraw()
+~~~~~~~~~~~~
+
+The stfl_run() function automatically refreshes the screen on each run.
+This function can be used to instruct stfl_run() to completely redraw the
+screen on its next run, instead of just refreshing. This feature is useful
+when another program has printed unwanted text to the terminal and a full
+redraw is needed. In most programs that support "clear screen" feature, it
+is made available on Ctrl+L.
+
 stfl_reset()
 ~~~~~~~~~~~~
 
 The stfl_run() function automatically activates ncurses. This function
-can be used to explicitely switch back to normal text mode. In some
+can be used to explicitly switch back to normal text mode. In some
 languages this is automatically done on program termination.
 
 stfl_get(form, name)
@@ -788,7 +822,7 @@
 stfl_quote(text)
 ~~~~~~~~~~~~~~~~
 
-Quote the text so it can be savely used as variable value in STFL code.
+Quote the text so it can be safely used as variable value in STFL code.
 
 stfl_dump(form, name, prefix, focus)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -802,6 +836,14 @@
 
 The function returns an null value when there was an error.
 
+stfl_text(form, name)
+~~~~~~~~~~~~~~~~~~~~~
+
+Return the concatenation of all "listitem text" variables under the specified
+widget. This is useful for reading the text in "textedit" widgets.
+
+The function returns an null value when there was an error.
+
 stfl_modify(form, name, mode, text)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -851,22 +893,15 @@
 The widget type of the root element of the tree passed in the 4th parameter
 doesn't matter in the *_inner modes.
 
-stfl_lookup(form, path, newname)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Lookup widgets in the form using a path and optionally assign a new name.
-
-This function is not implemented yet.
-
 stfl_error()
 ~~~~~~~~~~~~
 
 Return the error status of the last STFL call. This is null when no error
-occoured and the error message otherwise. An error could e.g. be a parser
+occurred and the error message otherwise. An error could e.g. be a parser
 error for broken STFL code.
 
 WARNING: This is a planned feature! This version of STFL simply calls abort()
-if an internal error is catched.
+if an internal error is caught.
 
 stfl_error_action(mode)
 ~~~~~~~~~~~~~~~~~~~~~~~
@@ -892,7 +927,7 @@
 The default mode is "interactive".
 
 WARNING: This is a planned feature! This version of STFL simply calls abort()
-if an internal error is catched.
+if an internal error is caught.
 
 
 Pseudo Variables
@@ -901,7 +936,7 @@
 When a widget has a name (declared using the 'widget[name]' syntax in the STFL
 code), there are also some special pseudo-variables which can only be accessed
 for reading. Note that this pseudo-variables do only have valid values after
-the widget has been drawed already. So it is always a good idea to run
+the widget has been drawn already. So it is always a good idea to run
 stfl_run() with a timeout of -1 before accessing the pseudo-variables.
 
 widgetname:x
@@ -940,5 +975,4 @@
 
 - Implement so far unimplemented widgets
 - Missing error handling and reporting
-- Implement stfl_lookup() function
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/base.c new/stfl-0.24/base.c
--- old/stfl-0.23/base.c        2014-09-29 09:04:41.000000000 +0200
+++ new/stfl-0.24/base.c        2015-01-05 11:50:54.000000000 +0100
@@ -561,7 +561,7 @@
                        goto unshift_next_event;
                }
 
-               if (w->type->f_process && w->type->f_process(w, fw, f, wch, rc 
== KEY_CODE_YES))
+               if (w->type->f_process && stfl_widget_getkv_int(w, L"process", 
1) && w->type->f_process(w, fw, f, wch, rc == KEY_CODE_YES))
                        goto unshift_next_event;
 
                if (stfl_widget_getkv_int(w, L"modal", 0))
@@ -675,6 +675,12 @@
        }
 }
 
+void stfl_form_redraw()
+{
+       if (curses_active)
+               clearok(curscr, 1);
+}
+
 void stfl_form_free(struct stfl_form *f)
 {
        pthread_mutex_lock(&f->mtx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/dump.c new/stfl-0.24/dump.c
--- old/stfl-0.23/dump.c        2009-04-27 06:23:45.000000000 +0200
+++ new/stfl-0.24/dump.c        2014-12-13 12:32:40.000000000 +0100
@@ -121,6 +121,25 @@
        newtxt(txt, L"}");
 }
 
+static void mytext(struct stfl_widget *w, struct txtnode **txt)
+{
+       if (!wcscmp(w->type->name, L"listitem"))
+       {
+               struct stfl_kv *kv = w->kv_list;
+               while (kv) {
+                       if (!wcscmp(kv->key, L"text"))
+                               newtxt(txt, L"%ls\n", kv->value);
+                       kv = kv->next;
+               }
+       }
+
+       struct stfl_widget *c = w->first_child;
+       while (c) {
+               mytext(c, txt);
+               c = c->next_sibling;
+       }
+}
+
 static wchar_t *txt2string(struct txtnode *txt)
 {
        int string_len = 0;
@@ -160,3 +179,10 @@
        return txt2string(txt);
 }
 
+wchar_t *stfl_widget_text(struct stfl_widget *w)
+{
+       struct txtnode *txt = 0;
+       mytext(w, &txt);
+       return txt2string(txt);
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/example.c new/stfl-0.24/example.c
--- old/stfl-0.23/example.c     2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/example.c     2015-01-05 11:47:32.000000000 +0100
@@ -42,10 +42,18 @@
        stfl_ipool_flush(ipool);
 
        const wchar_t *event = 0;
-       while (!event || wcscmp(event, L"ESC"))
+       while (1) {
                event = stfl_run(f, 0);
+               if (event) {
+                       if (!wcscmp(event, L"ESC"))
+                               break;
+                       else if (!wcscmp(event, L"^L"))
+                               stfl_redraw();
+               }
+       }
 
        stfl_reset();
+       printf("%ls", stfl_text(f, L"textedit"));
 
        printf("A: %ls\n", stfl_get(f, L"value_a"));
        printf("B: %ls\n", stfl_get(f, L"value_b"));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/example.stfl new/stfl-0.24/example.stfl
--- old/stfl-0.23/example.stfl  2014-04-25 13:51:13.000000000 +0200
+++ new/stfl-0.24/example.stfl  2014-12-13 12:32:40.000000000 +0100
@@ -99,6 +99,11 @@
       label .tie:r
         text:"Short (right)"
 
+  textedit[textedit]
+      .expand:0
+      listitem text:"This is the first line"
+      listitem text:"This is the second line"
+
   table
     .expand:0
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/parser.c new/stfl-0.24/parser.c
--- old/stfl-0.23/parser.c      2011-03-07 20:51:03.000000000 +0100
+++ new/stfl-0.24/parser.c      2014-12-15 15:45:41.000000000 +0100
@@ -105,7 +105,7 @@
        if (!text)
                return 0;
 
-       for (i=0; text[i] && (i<tlen || tlen<0); i++)
+       for (i=0; (i<tlen || tlen<0) && text[i]; i++)
        {
                if (text[i] == L'\'')
                        while (1) {
@@ -129,7 +129,7 @@
 
        value = malloc(sizeof(wchar_t)*(len_v+1));
 
-       for (i=j=0; text[i] && (i<tlen || tlen<0); i++)
+       for (i=j=0; (i<tlen || tlen<0) && text[i]; i++)
        {
                if (text[i] == L'\'')
                        while (1) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/perl5/example2.pl 
new/stfl-0.24/perl5/example2.pl
--- old/stfl-0.23/perl5/example2.pl     1970-01-01 01:00:00.000000000 +0100
+++ new/stfl-0.24/perl5/example2.pl     2015-01-05 11:52:19.000000000 +0100
@@ -0,0 +1,48 @@
+#!/usr/bin/env perl
+
+# Example STFL Program
+#
+# Authors:
+#   Davor Ocelic, docelic-s...@spinlocksolutions.com
+#   http://www.spinlocksolutions.com/
+#
+# License:
+#   GPL
+
+use warnings;
+use strict;
+use stfl;
+
+my $layout = <<EOT;
+table
+  list[list]
+    .expand:h
+    .border:lrtb
+    pos[listpos]:0
+    pos_name[listposname]:li0
+    listitem[li0] text[li0text]:"ListItem 0"
+    listitem[li1] text[li1text]:"ListItem 1"
+    listitem[li2] text[li2text]:"ListItem 2"
+  tablebr
+  label[label]
+    .expand:h
+    .border:lrtb
+    text[labeltext]:
+EOT
+
+my $stfl = stfl::create $layout;
+
+while (1) {
+  my $event = $stfl->run(0);
+  my $focus = $stfl->get_focus;
+  my $pos = $stfl->get('listpos');
+  my $pos_name = $stfl->get('listposname');
+  my $text = $stfl->get("${pos_name}text");
+
+  $stfl->set('labeltext', "List is at position $pos, name $pos_name, text 
'$text'");
+
+       next unless $event;
+
+  stfl::redraw if $event eq '^L';
+  last if $event eq 'ESC';
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/public.c new/stfl-0.24/public.c
--- old/stfl-0.23/public.c      2010-11-24 14:59:06.000000000 +0100
+++ new/stfl-0.24/public.c      2015-01-05 11:47:32.000000000 +0100
@@ -50,6 +50,11 @@
        stfl_form_free(f);
 }
 
+void stfl_redraw()
+{
+       stfl_form_redraw();
+}
+
 const wchar_t *stfl_run(struct stfl_form *f, int timeout)
 {
        stfl_form_run(f, timeout);
@@ -203,6 +208,38 @@
        return checkret(retbuffer);
 }
 
+const wchar_t *stfl_text(struct stfl_form *f, const wchar_t *name)
+{
+       static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+       static pthread_key_t retbuffer_key;
+       static int firstrun = 1;
+       static wchar_t *retbuffer = 0;
+       struct stfl_widget *w;
+
+       pthread_mutex_lock(&mtx);
+       pthread_mutex_lock(&f->mtx);
+
+       if (firstrun) {
+               pthread_key_create(&retbuffer_key, free);
+               firstrun = 0;
+       }
+
+       retbuffer = pthread_getspecific(retbuffer_key);
+
+       if (retbuffer)
+               free(retbuffer);
+
+       w = name && *name ? stfl_widget_by_name(f->root, name) : f->root;
+       retbuffer = stfl_widget_text(w);
+
+       pthread_setspecific(retbuffer_key, retbuffer);
+
+       pthread_mutex_unlock(&f->mtx);
+       pthread_mutex_unlock(&mtx);
+
+       return checkret(retbuffer);
+}
+
 static void stfl_modify_before(struct stfl_widget *w, struct stfl_widget *n)
 {
        if (!n || !w || !w->parent)
@@ -392,11 +429,6 @@
        return;
 }
 
-const wchar_t *stfl_lookup(struct stfl_form *f, const wchar_t *path, const 
wchar_t *newname)
-{
-       return checkret(0);
-}
-
 const wchar_t *stfl_error()
 {
        abort();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/python/example2.py 
new/stfl-0.24/python/example2.py
--- old/stfl-0.23/python/example2.py    1970-01-01 01:00:00.000000000 +0100
+++ new/stfl-0.24/python/example2.py    2015-01-05 11:52:19.000000000 +0100
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+# Example STFL Program
+#
+# Authors:
+#   Davor Ocelic, docelic-s...@spinlocksolutions.com
+#   http://www.spinlocksolutions.com/
+#
+# License:
+#   GPL
+
+import stfl
+
+layout = '''
+table
+  list[list]
+    .expand:h
+    .border:lrtb
+    pos[listpos]:0
+    pos_name[listposname]:li0
+    listitem[li0] text[li0text]:"ListItem 0"
+    listitem[li1] text[li1text]:"ListItem 1"
+    listitem[li2] text[li2text]:"ListItem 2"
+  tablebr
+  label[label]
+    .expand:h
+    .border:lrtb
+    text[labeltext]:
+'''
+
+stfl_obj = stfl.create(layout)
+
+while True:
+  event = stfl_obj.run(0)
+  focus = stfl_obj.get_focus
+  pos = stfl_obj.get('listpos')
+  pos_name = stfl_obj.get('listposname')
+  text = stfl_obj.get(pos_name + 'text')
+
+  stfl_obj.set('labeltext', "List is at position %s, name %s, text '%s'" % 
(pos, pos_name, text))
+
+  if not event: next
+
+  if event == '^L': stfl.redraw()
+  if event == 'ESC': break
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/ruby/example2.rb 
new/stfl-0.24/ruby/example2.rb
--- old/stfl-0.23/ruby/example2.rb      1970-01-01 01:00:00.000000000 +0100
+++ new/stfl-0.24/ruby/example2.rb      2015-01-05 11:52:19.000000000 +0100
@@ -0,0 +1,46 @@
+#!/usr/bin/env ruby
+
+# Example STFL Program
+#
+# Authors:
+#   Davor Ocelic, docelic-s...@spinlocksolutions.com
+#   http://www.spinlocksolutions.com/
+#
+# License:
+#   GPL
+
+require 'stfl'
+
+layout = <<EOT
+table
+  list[list]
+    .expand:h
+    .border:lrtb
+    pos[listpos]:0
+    pos_name[listposname]:li0
+    listitem[li0] text[li0text]:"ListItem 0"
+    listitem[li1] text[li1text]:"ListItem 1"
+    listitem[li2] text[li2text]:"ListItem 2"
+  tablebr
+  label[label]
+    .expand:h
+    .border:lrtb
+    text[labeltext]:
+EOT
+
+$stfl = Stfl.create layout
+
+loop do
+  event = $stfl.run 0
+  focus = $stfl.get_focus
+  pos = $stfl.get 'listpos'
+  pos_name = $stfl.get 'listposname'
+  text = $stfl.get "#{pos_name}text"
+
+  $stfl.set 'labeltext', "List is at position #{pos}, name #{pos_name}, text 
'#{text}'"
+
+       next unless event.length > 0
+
+  Stfl.redraw if event == '^L'
+  break if event == 'ESC'
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/spl/example2.spl 
new/stfl-0.24/spl/example2.spl
--- old/stfl-0.23/spl/example2.spl      1970-01-01 01:00:00.000000000 +0100
+++ new/stfl-0.24/spl/example2.spl      2015-01-05 11:52:19.000000000 +0100
@@ -0,0 +1,45 @@
+#!/usr/bin/env splrun
+
+/* Example STFL Program
+ *
+ * Authors:
+ *   Davor Ocelic, docelic-s...@spinlocksolutions.com
+ *   http://www.spinlocksolutions.com/
+ *
+ * License:
+ *   GPL
+ */
+
+load 'stfl';
+
+var layout = <<EOT
+table
+  list[list]
+    .expand:h
+    .border:lrtb
+    pos[listpos]:0
+    pos_name[listposname]:li0
+    listitem[li0] text[li0text]:"ListItem 0"
+    listitem[li1] text[li1text]:"ListItem 1"
+    listitem[li2] text[li2text]:"ListItem 2"
+  tablebr
+  label[label]
+    .expand:h
+    .border:lrtb
+    text[labeltext]:
+EOT;
+
+var stfl = stfl_create(layout);
+
+while (1) {
+       var event = stfl_run(stfl, 0);
+       var focus = stfl_get_focus(stfl);
+       var pos = stfl_get(stfl, 'listpos');
+       var pos_name = stfl_get(stfl, 'listposname');
+       var text = stfl_get(stfl, "${pos_name}text");
+
+       stfl_set(stfl, 'labeltext', "List is at position ${pos}, name 
${pos_name}, text '${text}'");
+
+       if (event ~== '^L') stfl_redraw();
+       if (event ~== 'ESC') break;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/spl/mod_stfl.c new/stfl-0.24/spl/mod_stfl.c
--- old/stfl-0.23/spl/mod_stfl.c        2011-05-23 15:06:04.000000000 +0200
+++ new/stfl-0.24/spl/mod_stfl.c        2015-01-05 11:47:32.000000000 +0100
@@ -98,6 +98,16 @@
 }
 
 /**
+ * Instruct STFL to completely redraw screen on next run
+ */
+// builtin stfl_redraw()
+static struct spl_node *handler_stfl_redraw(struct spl_task *task, void *data)
+{
+       stfl_redraw();
+       return 0;
+}
+
+/**
  * Return to standard text mode
  */
 // builtin stfl_reset()
@@ -185,32 +195,32 @@
 }
 
 /**
- * Import STFL code to an existing form
+ * Dump the text under a widget
  */
-// builtin stfl_modify(form, name, mode, text)
-static struct spl_node *handler_stfl_modify(struct spl_task *task, void *data)
+// builtin stfl_text(form, name)
+static struct spl_node *handler_stfl_text(struct spl_task *task, void *data)
 {
        struct stfl_form *f = clib_get_stfl_form(task);
        char *name = spl_clib_get_string(task);
-       char *mode = spl_clib_get_string(task);
-       char *text = spl_clib_get_string(task);
-       stfl_modify(f, stfl_ipool_towc(ipool, name), stfl_ipool_towc(ipool, 
mode), stfl_ipool_towc(ipool, text));
+       const char *text = stfl_ipool_fromwc(ipool, stfl_text(f, 
stfl_ipool_towc(ipool, name)));
+       struct spl_node *n = spl_new_nullable_ascii(text);
        stfl_ipool_flush(ipool);
-       return 0;
+       return n;
 }
 
 /**
- * Lookup widgets in the form using a path and optionally assign a new name
+ * Import STFL code to an existing form
  */
-// builtin stfl_lookup(form, path, newname)
-static struct spl_node *handler_stfl_lookup(struct spl_task *task, void *data)
+// builtin stfl_modify(form, name, mode, text)
+static struct spl_node *handler_stfl_modify(struct spl_task *task, void *data)
 {
        struct stfl_form *f = clib_get_stfl_form(task);
-       char *path = spl_clib_get_string(task);
-       char *newname = spl_clib_get_string(task);
-       struct spl_node *ret = spl_new_nullable_ascii(stfl_ipool_fromwc(ipool, 
stfl_lookup(f, stfl_ipool_towc(ipool, path), stfl_ipool_towc(ipool, newname))));
+       char *name = spl_clib_get_string(task);
+       char *mode = spl_clib_get_string(task);
+       char *text = spl_clib_get_string(task);
+       stfl_modify(f, stfl_ipool_towc(ipool, name), stfl_ipool_towc(ipool, 
mode), stfl_ipool_towc(ipool, text));
        stfl_ipool_flush(ipool);
-       return ret;
+       return 0;
 }
 
 /**
@@ -255,6 +265,7 @@
        spl_clib_reg(vm, "stfl_create", handler_stfl_create, 0);
 
        spl_clib_reg(vm, "stfl_run", handler_stfl_run, 0);
+       spl_clib_reg(vm, "stfl_redraw", handler_stfl_redraw, 0);
        spl_clib_reg(vm, "stfl_reset", handler_stfl_reset, 0);
 
        spl_clib_reg(vm, "stfl_get", handler_stfl_get, 0);
@@ -267,8 +278,8 @@
        spl_clib_reg(vm, "stfl_quote", handler_stfl_quote, 0);
 
        spl_clib_reg(vm, "stfl_dump", handler_stfl_dump, 0);
+       spl_clib_reg(vm, "stfl_text", handler_stfl_text, 0);
        spl_clib_reg(vm, "stfl_modify", handler_stfl_modify, 0);
-       spl_clib_reg(vm, "stfl_lookup", handler_stfl_lookup, 0);
 
        spl_clib_reg(vm, "stfl_error", handler_stfl_error, 0);
        spl_clib_reg(vm, "stfl_error_action", handler_stfl_error_action, 0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/stfl.h new/stfl-0.24/stfl.h
--- old/stfl-0.23/stfl.h        2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/stfl.h        2015-01-05 11:47:32.000000000 +0100
@@ -38,6 +38,7 @@
 extern void stfl_free(struct stfl_form *f);
 
 extern const wchar_t *stfl_run(struct stfl_form *f, int timeout);
+extern void stfl_redraw();
 extern void stfl_reset();
 
 extern const wchar_t * stfl_get(struct stfl_form *f, const wchar_t *name);
@@ -48,9 +49,9 @@
 
 extern const wchar_t *stfl_quote(const wchar_t *text);
 extern const wchar_t *stfl_dump(struct stfl_form *f, const wchar_t *name, 
const wchar_t *prefix, int focus);
+extern const wchar_t *stfl_text(struct stfl_form *f, const wchar_t *name);
 
 extern void stfl_modify(struct stfl_form *f, const wchar_t *name, const 
wchar_t *mode, const wchar_t *text);
-extern const wchar_t *stfl_lookup(struct stfl_form *f, const wchar_t *path, 
const wchar_t *newname);
 
 extern const wchar_t *stfl_error();
 extern void stfl_error_action(const wchar_t *mode);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/stfl_internals.h 
new/stfl-0.24/stfl_internals.h
--- old/stfl-0.23/stfl_internals.h      2014-04-25 13:36:07.000000000 +0200
+++ new/stfl-0.24/stfl_internals.h      2015-01-05 11:47:32.000000000 +0100
@@ -134,6 +134,7 @@
 extern void stfl_form_run(struct stfl_form *f, int timeout);
 extern void stfl_form_reset();
 extern void stfl_form_free(struct stfl_form *f);
+extern void stfl_form_redraw();
 
 extern void stfl_check_setfocus(struct stfl_form *f, struct stfl_widget *w);
 
@@ -142,6 +143,7 @@
 
 extern wchar_t *stfl_quote_backend(const wchar_t *text);
 extern wchar_t *stfl_widget_dump(struct stfl_widget *w, const wchar_t *prefix, 
int focus_id);
+extern wchar_t *stfl_widget_text(struct stfl_widget *w);
 
 extern void stfl_style(WINDOW *win, const wchar_t *style);
 extern void stfl_widget_style(struct stfl_widget *w, struct stfl_form *f, 
WINDOW *win);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/swig/basedecls.i 
new/stfl-0.24/swig/basedecls.i
--- old/stfl-0.23/swig/basedecls.i      2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/swig/basedecls.i      2015-01-05 11:47:32.000000000 +0100
@@ -85,13 +85,13 @@
                ipool_reset();
                return FROMWC(stfl_dump(self, TOWC(name), TOWC(prefix), focus));
        }
-       void modify(const char *name, const char *mode, const char *text) {
+       const char *text(const char *name) {
                ipool_reset();
-               stfl_modify(self, TOWC(name), TOWC(mode), TOWC(text));
+               return FROMWC(stfl_text(self, TOWC(name)));
        }
-       const char *lookup(const char *path, const char *newname) {
+       void modify(const char *name, const char *mode, const char *text) {
                ipool_reset();
-               return FROMWC(stfl_lookup(self, TOWC(path), TOWC(newname)));
+               stfl_modify(self, TOWC(name), TOWC(mode), TOWC(text));
        }
 }
 
@@ -145,16 +145,16 @@
        return FROMWC(stfl_dump(f, TOWC(name), TOWC(prefix), focus));
 }
 
-static void stfl_modify_wrapper(struct stfl_form *f, const char *name, const 
char *mode, const char *text)
+static const char *stfl_text_wrapper(struct stfl_form *f, const char *name)
 {
        ipool_reset();
-       stfl_modify(f, TOWC(name), TOWC(mode), TOWC(text));
+       return FROMWC(stfl_text(f, TOWC(name)));
 }
 
-static const char *stfl_lookup_wrapper(struct stfl_form *f, const char *path, 
const char *newname)
+static void stfl_modify_wrapper(struct stfl_form *f, const char *name, const 
char *mode, const char *text)
 {
        ipool_reset();
-       return FROMWC(stfl_lookup(f, TOWC(path), TOWC(newname)));
+       stfl_modify(f, TOWC(name), TOWC(mode), TOWC(text));
 }
 
 static const char *stfl_error_wrapper()
@@ -179,11 +179,12 @@
 static void stfl_set_focus_wrapper(struct stfl_form *f, const char *name);
 static const char *stfl_quote_wrapper(const char *text);
 static const char *stfl_dump_wrapper(struct stfl_form *f, const char *name, 
const char *prefix, int focus);
+static const char *stfl_text_wrapper(struct stfl_form *f, const char *name);
 static void stfl_modify_wrapper(struct stfl_form *f, const char *name, const 
char *mode, const char *text);
-static const char *stfl_lookup_wrapper(struct stfl_form *f, const char *path, 
const char *newname);
 static const char *stfl_error_wrapper();
 static void stfl_error_action_wrapper(const char *mode);
 extern void stfl_reset();
+extern void stfl_redraw();
 
 %init %{
        atexit(stfl_reset);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/swig/longnames.i 
new/stfl-0.24/swig/longnames.i
--- old/stfl-0.23/swig/longnames.i      2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/swig/longnames.i      2014-12-13 12:32:40.000000000 +0100
@@ -31,8 +31,8 @@
 
 %rename(stfl_quote) stfl_quote_wrapper;
 %rename(stfl_dump) stfl_dump_wrapper;
+%rename(stfl_text) stfl_text_wrapper;
 %rename(stfl_modify) stfl_modify_wrapper;
-%rename(stfl_lookup) stfl_lookup_wrapper;
 
 %rename(stfl_error) stfl_error_wrapper;
 %rename(stfl_error_action) stfl_error_action_wrapper;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/swig/shortnames.i 
new/stfl-0.24/swig/shortnames.i
--- old/stfl-0.23/swig/shortnames.i     2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/swig/shortnames.i     2015-01-05 11:47:32.000000000 +0100
@@ -31,11 +31,12 @@
 
 %rename(quote) stfl_quote_wrapper;
 %rename(dump) stfl_dump_wrapper;
+%rename(text) stfl_text_wrapper;
 %rename(modify) stfl_modify_wrapper;
-%rename(lookup) stfl_lookup_wrapper;
 
 %rename(error) stfl_error_wrapper;
 %rename(error_action) stfl_error_action_wrapper;
 
+%rename(redraw) stfl_redraw;
 %rename(reset) stfl_reset;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/widgets/wt_list.c 
new/stfl-0.24/widgets/wt_list.c
--- old/stfl-0.23/widgets/wt_list.c     2014-09-29 09:04:41.000000000 +0200
+++ new/stfl-0.24/widgets/wt_list.c     2015-01-24 14:03:17.000000000 +0100
@@ -75,6 +75,8 @@
                if (stfl_widget_getkv_int(c, L"can_focus", 1) &&
                    stfl_widget_getkv_int(c, L".display", 1))
                        maxpos= i;
+
+                       if(maxpos == pos) break;
        }
 
        if (maxpos >= 0 && pos > maxpos)
@@ -85,6 +87,9 @@
 
        if (pos != orig_pos)
                stfl_widget_setkv_int(w, L"pos", pos);
+
+       if (c)
+               stfl_widget_setkv_str(w, L"pos_name", c->name ? c->name : L""); 
 }
 
 static void stfl_focus_prev_pos(struct stfl_widget *w)
@@ -160,8 +165,6 @@
        struct stfl_widget *c;
        int i, j;
 
-       unsigned int width = 0;
-
        if (f->current_focus_id == w->id)
                f->cursor_x = f->cursor_y = -1;
 
@@ -182,8 +185,6 @@
                                stfl_style(win, style_selected);
                                cur_style = style_selected;
                        }
-
-                       stfl_widget_setkv_str(w, L"pos_name", c->name ? c->name 
: L""); 
                } else {
                        stfl_style(win, style_normal);
                        cur_style = style_normal;
@@ -202,12 +203,9 @@
                }
 
                if (is_richtext)
-                       width = stfl_print_richtext(w, win, w->y+i-offset, 
w->x, text, w->w, cur_style, has_focus);
-               else {
+                       stfl_print_richtext(w, win, w->y+i-offset, w->x, text, 
w->w, cur_style, has_focus);
+               else
                        mvwaddnwstr(win, w->y+i-offset, w->x, text, w->w);
-                       width = wcslen(text);
-               }
-
        }
 
        if (f->current_focus_id == w->id) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/stfl-0.23/widgets/wt_table.c 
new/stfl-0.24/widgets/wt_table.c
--- old/stfl-0.23/widgets/wt_table.c    2007-07-24 13:54:01.000000000 +0200
+++ new/stfl-0.24/widgets/wt_table.c    2014-12-15 15:43:44.000000000 +0100
@@ -26,8 +26,8 @@
 #include <stdlib.h>
 #include <assert.h>
 
-#define MAX_ROWS 20
-#define MAX_COLS 20
+#define MAX_ROWS 30
+#define MAX_COLS 30
 
 struct table_cell_data {
        struct stfl_widget *w;

++++++ stfl-optflags.patch ++++++
--- /var/tmp/diff_new_pack.7nN3Ib/_old  2018-02-20 17:58:43.054595872 +0100
+++ /var/tmp/diff_new_pack.7nN3Ib/_new  2018-02-20 17:58:43.058595728 +0100
@@ -1,9 +1,6 @@
-Index: Makefile
-===================================================================
 --- Makefile.orig
 +++ Makefile
-@@ -20,9 +20,10 @@
- 
+@@ -21,7 +21,8 @@
  include Makefile.cfg
  
 -export CC = gcc -pthread
@@ -15,4 +12,3 @@
 +export LDLIBS += -pthread -lncursesw
  
  SONAME  := libstfl.so.0
- VERSION := 0.23


Reply via email to