From 7ff5fd7181df190b00710a51c21c2c4779af421c Mon Sep 17 00:00:00 2001 From: msw Date: Mon, 2 Apr 2001 23:57:47 +0000 Subject: [PATCH] - redraw the screen in certain situations when LANG=ja_JP.eucJP to prevent corrupting kanji characters --- checkboxtree.c | 3 +++ configure.in | 2 +- form.c | 1 + listbox.c | 2 ++ newt.c | 17 ++++++++++++++++- newt.spec | 13 ++++++++++++- newt_pr.h | 1 + textbox.c | 4 +++- 8 files changed, 39 insertions(+), 4 deletions(-) diff --git a/checkboxtree.c b/checkboxtree.c index e70e54e..cf3ff41 100644 --- a/checkboxtree.c +++ b/checkboxtree.c @@ -424,6 +424,9 @@ static void ctDraw(newtComponent co) { item = ct->firstItem; i = 0; + + newtTrashScreen(); + while (*item && i < co->height) { newtGotorc(co->top + i, co->left); if (*item == *ct->currItem) { diff --git a/configure.in b/configure.in index 1ddaa4a..62091cc 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_CONFIG_HEADER(config.h) VERSION=$(awk '/^%define version/ {print $3}' newt.spec) -VERSION=0.50.21 +VERSION=0.50.22 SONAME=0.50 AC_SUBST(VERSION) AC_SUBST(SONAME) diff --git a/form.c b/form.c index 6f68886..952f879 100644 --- a/form.c +++ b/form.c @@ -590,6 +590,7 @@ void newtDrawForm(newtComponent co) { SLsmg_set_color(form->background); newtClearBox(co->left, co->top, co->width, co->height); + for (i = 0, el = form->elements; i < form->numComps; i++, el++) { /* the scrollbar *always* fits somewhere */ if (el->co == form->vertBar) { diff --git a/listbox.c b/listbox.c index ef276ae..e86fb18 100644 --- a/listbox.c +++ b/listbox.c @@ -486,6 +486,8 @@ static void listboxDraw(newtComponent co) if (!co->isMapped) return ; + newtTrashScreen(); + if(li->flags & NEWT_FLAG_BORDER) { if(li->isActive) SLsmg_set_color(NEWT_COLORSET_ACTLISTBOX); diff --git a/newt.c b/newt.c index 42b0371..8e20842 100644 --- a/newt.c +++ b/newt.c @@ -32,6 +32,7 @@ static char ** currentHelpline = NULL; static int cursorRow, cursorCol; static int needResize; static int cursorOn = 1; +static int trashScreen = 0; static const char * defaultHelpLine = " / between elements | selects | next screen" @@ -188,7 +189,11 @@ void newtResizeScreen(int redraw) { #endif int newtInit(void) { - char * MonoValue, * MonoEnv = "NEWT_MONO"; + char * MonoValue, * MonoEnv = "NEWT_MONO", * lang; + + lang = getenv ("LANG"); + if (lang && !strcasecmp (lang, "ja_JP.eucJP")) + trashScreen = 1; /* use the version variable just to be sure it gets included */ strlen(version); @@ -411,6 +416,8 @@ int newtOpenWindow(int left, int top, int width, int height, n += currentWindow->width + 3; } + newtTrashScreen(); + SLsmg_set_color(NEWT_COLORSET_BORDER); SLsmg_draw_box(top - 1, left - 1, height + 2, width + 2); @@ -490,6 +497,8 @@ void newtPopWindow(void) { SLsmg_set_char_set(0); + newtTrashScreen(); + newtRefresh(); } @@ -686,3 +695,9 @@ void newtCursorOn(void) { cursorOn = 1; SLtt_set_cursor_visibility (cursorOn); } + +void newtTrashScreen(void) { + if (trashScreen) + SLsmg_touch_screen(); +} + diff --git a/newt.spec b/newt.spec index 3be4f45..30b258e 100644 --- a/newt.spec +++ b/newt.spec @@ -1,6 +1,6 @@ Summary: A development library for text mode user interfaces. Name: newt -%define version 0.50.21 +%define version 0.50.22 Version: %{version} Release: 1 Copyright: LGPL @@ -105,6 +105,17 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Mon Apr 2 2001 Matt Wilson +- redraw the screen in certain situations when LANG=ja_JP.eucJP to + prevent corrupting kanji characters + +* Mon Apr 2 2001 Elloit Lee +- Allow python scripts to watch file handles +- Fix 64-bit warnings in snackmodule +- Misc snack.py cleanups +- Add NEWT_FD_EXCEPT to allow watching for fd exceptions +- In newtExitStruct, return the first file descriptor that an event occurred on + * Fri Mar 30 2001 Matt Wilson - don't blow the stack if we push a help line that is longer than the curret number of columns diff --git a/newt_pr.h b/newt_pr.h index 76f5e2f..258322d 100644 --- a/newt_pr.h +++ b/newt_pr.h @@ -26,6 +26,7 @@ void newtDrawBox(int left, int top, int width, int height, int shadow); void newtClearBox(int left, int top, int width, int height); int newtGetKey(void); +void newtTrashScreen(void); struct newtComponent_struct { /* common data */ diff --git a/textbox.c b/textbox.c index 2578738..ff0a64c 100644 --- a/textbox.c +++ b/textbox.c @@ -329,7 +329,9 @@ static void textboxDraw(newtComponent c) { } SLsmg_set_color(NEWT_COLORSET_TEXTBOX); - + + newtTrashScreen(); + for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { newtGotorc(c->top + i, c->left); SLsmg_write_string(tb->lines[i + tb->topLine]); -- 2.47.2