diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2001-07-25 00:54:30 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2001-07-25 00:54:30 -0400 |
commit | 864412f0359169368927737c2908ff357ea343a0 (patch) | |
tree | b7aeae150ebc564c421b39ca20e07c00e060562a /src | |
parent | 6e9e7ef2b46e5342abc371216f4851517278a494 (diff) | |
download | lynx-snapshots-864412f0359169368927737c2908ff357ea343a0.tar.gz |
snapshot of project "lynx", label v2-8-5dev_1
Diffstat (limited to 'src')
-rw-r--r-- | src/LYCurses.c | 2 | ||||
-rw-r--r-- | src/LYEdit.c | 4 | ||||
-rw-r--r-- | src/LYMainLoop.c | 2 | ||||
-rw-r--r-- | src/LYStrings.c | 32 | ||||
-rw-r--r-- | src/LYStyle.c | 16 |
5 files changed, 48 insertions, 8 deletions
diff --git a/src/LYCurses.c b/src/LYCurses.c index 29b5882d..fda863cd 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -1538,7 +1538,7 @@ PUBLIC WINDOW *LYstartPopup ARGS4( LYsubwindow(form_window); # ifdef USE_COLOR_STYLE { - attr_t b; + long b; /* Get a proper value for the attribute */ LynxWChangeStyle(form_window, s_menu_bg, STACK_ON); diff --git a/src/LYEdit.c b/src/LYEdit.c index 288bd596..3c7a725c 100644 --- a/src/LYEdit.c +++ b/src/LYEdit.c @@ -156,6 +156,7 @@ PUBLIC int edit_current_file ARGS3( sprintf(position, "%d", lineno); edit_temporary_file(filename, position, NULL); + result = TRUE; done: /* @@ -165,6 +166,7 @@ done: *number_sign = '#'; FREE(filename); + CTRACE((tfp, "edit_current_file returns %d\n", result)); return (result); } @@ -173,7 +175,9 @@ PUBLIC void edit_temporary_file ARGS3( char *, position, char *, message) { +#ifdef UNIX struct stat stat_info; +#endif char *format = "%s %s"; char *command = NULL; char *editor_arg = ""; diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 68bbd908..886213c3 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -6143,7 +6143,7 @@ try_again: * WINDOW structures are already filled based on the old size. * So we notify the ncurses library directly here. - kw */ -#if defined(NCURSES) && defined(HAVE_RESIZETERM) +#if defined(NCURSES) && defined(HAVE_RESIZETERM) && defined(HAVE_WRESIZE) resizeterm(LYlines, LYcols); wresize(LYwin, LYlines, LYcols); #else diff --git a/src/LYStrings.c b/src/LYStrings.c index fa9927a3..3f4b9d1b 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -703,6 +703,36 @@ PUBLIC int LYmbcsstrlen ARGS3( #define GetChar() wgetch(my_subwindow ? my_subwindow : LYwin) #endif +#if !defined(GetChar) && defined(PDCURSES) +/* PDCurses sends back key-modifiers that we don't use, but would waste time + * upon, e.g., repainting the status line + */ +PRIVATE int myGetChar NOARGS +{ + int c; + BOOL done = FALSE; + + do { + switch (c = wgetch(LYwin)) + { + case KEY_SHIFT_L : + case KEY_SHIFT_R : + case KEY_CONTROL_L : + case KEY_CONTROL_R : + case KEY_ALT_L : + case KEY_ALT_R : + case KEY_RESIZE : + break; + default: + done = TRUE; + break; + } + } while (!done); + return c; +} +#define GetChar() myGetChar() +#endif + #if !defined(GetChar) && defined(SNAKE) #define GetChar() wgetch(LYwin) #endif @@ -713,7 +743,7 @@ PUBLIC int LYmbcsstrlen ARGS3( #if !defined(GetChar) #if HAVE_KEYPAD -#define GetChar getch +#define GetChar() getch() #else #ifndef USE_GETCHAR #define USE_GETCHAR diff --git a/src/LYStyle.c b/src/LYStyle.c index 8acfaab2..65c6670f 100644 --- a/src/LYStyle.c +++ b/src/LYStyle.c @@ -1,6 +1,6 @@ /* character level styles for Lynx * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-) - * @Id: LYStyle.c 1.46 Sat, 07 Jul 2001 18:30:13 -0700 dickey @ + * @Id: LYStyle.c 1.47 Tue, 24 Jul 2001 17:54:30 -0700 dickey @ */ #include <HTUtils.h> #include <HTML.h> @@ -190,7 +190,7 @@ PRIVATE void parse_attributes ARGS5( curPair = our_pairs[!!(cA & A_BOLD)][!!(cA & M_BLINK)][fA][bA] - 1; else { curPair = ++colorPairs; - init_pair(curPair, fA, bA); + init_pair((short)curPair, (short)fA, (short)bA); if (fA < MAX_COLOR && bA < MAX_COLOR && curPair < 255) @@ -216,7 +216,7 @@ PRIVATE void parse_attributes ARGS5( /* parse a style option of the format * STYLE:<OBJECT>:FG:BG */ -PRIVATE void parse_style ARGS1(char*,buffer) +PRIVATE void parse_style ARGS1(char*, param) { static struct { char *name; @@ -254,6 +254,7 @@ PRIVATE void parse_style ARGS1(char*,buffer) unsigned n; BOOL found = FALSE; + char *buffer = strdup(param); char *tmp = strchr(buffer, ':'); char *element, *mono, *fg, *bg; @@ -339,6 +340,7 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n"), buffer); else parse_attributes(mono,fg,bg, DSTYLE_ELEMENTS,element); } + FREE(buffer); } #ifdef LY_FIND_LEAKS @@ -366,6 +368,7 @@ PRIVATE void initialise_default_stylesheet NOARGS }; unsigned n; char temp[80]; + CTRACE((tfp, "initialize_default_stylesheet\n")); for (n = 0; n < TABLESIZE(table); n++) { parse_style(strcpy(temp, table[n])); } @@ -410,10 +413,11 @@ PRIVATE void style_initialiseHashTable NOARGS * need to remember the STYLE: lines we encounter and parse them * after curses has started */ -HTList *lss_styles = NULL; +PRIVATE HTList *lss_styles = NULL; PUBLIC void parse_userstyles NOARGS { + static BOOL first = TRUE; char *name; HTList *cur = lss_styles; @@ -453,9 +457,11 @@ PUBLIC void parse_userstyles NOARGS /* Add a STYLE: option line to our list. Process "default:" early for it to have the same semantic as other lines: works at any place of the style file, the first line overrides the later ones. */ -PRIVATE void HStyle_addStyle ARGS1(char*,buffer) +PRIVATE void HStyle_addStyle ARGS1(char*, buffer) { char *name = NULL; + + CTRACE((tfp, "HStyle_addStyle(%s)\n", buffer)); StrAllocCopy(name, buffer); if (lss_styles == NULL) lss_styles = HTList_new(); |