lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev USE_COLOR_STYLE, PDCurces 2.3 and DJGPP


From: Leonid Pauzner
Subject: lynx-dev USE_COLOR_STYLE, PDCurces 2.3 and DJGPP
Date: Fri, 2 Apr 1999 00:55:17 +0400 (MSD)

This is my story of building DJGPP lynx with -lss support,
mostly for Tom and Doug (and maybe Wayne Buttles if he occasionally look here):

Know nothing about color curces etc. I check PDCurces 2.3
(from Wayne Buttles site) and yes, the header file define "chtype"
as long (not short int) so I guess it may work with more colors.

First I read INSTALLATION:

  --enable-color-style                  (define USE_COLOR_STYLE)
        Use this option to enable optional and *experimental* color style.
        (Also defines USE_HASH, LINKEDSTYLES)

so define USE_COLOR_STYLES and USE_HASH
(btw, why should we define both? does we may use these options separately?)

Now I build and found out the problem in LYCurces.c/start_curses():
few lines appears not ifdefed properly:

diff -u old/lycurses.c ./lycurses.c
--- old/lycurses.c      Thu Mar 18 11:05:48 1999
+++ ./lycurses.c        Tue Mar 30 21:24:02 1999
@@ -621,8 +621,10 @@
            lynx_has_color = TRUE;
            start_color();
        }
+#if USE_COLOR_TABLE
        lynx_init_colors();
        lynx_called_initscr = TRUE;
+#endif /* USE_COLOR_TABLE */

        /* Inform pdcurses that we're interested in knowing when mouse buttons
         * are clicked.  Maybe someday pdcurses will support it.


Using the above fix I build lynx successefully, but occasionally
without colors at all: something was not initialized, probably
parse_userstyles().

Looking more closely, it turns out there are two version of start_curces():
one for DJGPP and for others. Now I remove the entire DJGPP variant
and was trying with generic start_curces() for DJGPP platform -
seems no visible difference (probably screen gets redraw faster
when returning from system() calls), both with/without USE_COLOR_STYLE.
What was the original problem?  see my patch below.

Now I could start lynx -lss=... with lss files from the sample directory
and got new color impressions. (Not sure I get more colors
but certainly different. Nothing is colored in a source mode -
should it?).



diff -u old/lycurses.c ./lycurses.c
--- old/lycurses.c      Thu Mar 18 11:05:48 1999
+++ ./lycurses.c        Fri Apr  2 00:00:26 1999
@@ -600,44 +600,7 @@
 }
 #endif /* USE_COLOR_TABLE */

-#if defined (DJGPP) && !defined (USE_SLANG)
-/*
- * Sorry about making a completely new function,
- * but the real one is messy! WB
- */
-PUBLIC void start_curses NOARGS
-{
-    static BOOLEAN first_time = TRUE;
-
-    if(first_time)
-    {
-       initscr();              /* start curses */
-       first_time = FALSE;
-       cbreak();
-       keypad(stdscr, TRUE);
-       fflush(stdin);
-       fflush(stdout);
-       if (has_colors()) {
-           lynx_has_color = TRUE;
-           start_color();
-       }
-       lynx_init_colors();
-       lynx_called_initscr = TRUE;
-
-       /* Inform pdcurses that we're interested in knowing when mouse buttons
-        * are clicked.  Maybe someday pdcurses will support it.
-        */
-       if (LYUseMouse)
-           lynx_enable_mouse (1);
-
-    } else
-       sock_init();

-    LYCursesON = TRUE;
-    clear();
-    noecho();
-}
-#else
 PUBLIC void start_curses NOARGS
 {
 #ifdef USE_SLANG
@@ -805,6 +768,10 @@
        lynx_called_initscr = TRUE;
 #endif /* USE_COLOR_TABLE */
     }
+#ifdef __DJGPP__
+    else sock_init();
+#endif /* __DJGPP__ */
+
 #endif /* VMS */

     /* nonl();  */ /* seems to slow things down */
@@ -840,7 +807,7 @@

     LYCursesON = TRUE;
 }
-#endif /* defined (DJGPP) && !defined (USE_SLANG) */
+

 PUBLIC void lynx_enable_mouse ARGS1(int,state)
 {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]