lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Patch for partial-threshold code


From: Eric
Subject: lynx-dev Patch for partial-threshold code
Date: Sun, 27 Sep 1998 09:09:53 -0400

Here's a patch that adds the number-of-lines-rendered-before-redraw
(as I call it, partial threshold) configurability.  Works on my machine
so far.  Please send bug reports or suggestions--I am just a beginner
at Lynx programming.
summary
 - adds -partial_thres[=NUMBER] option to set the # of lines
 - adds PARTIAL_THRES config variable in lynx.cfg to set the # of lines
 - adds partial_thres variable in .lynxrc to set the # of lines--selecting
   save to disk and hitting Accept Changes in options will save this variable
   to the current value.  Haven't looked into making a form entry for this yet.
   With -partial_thres command line option, I don't think it's necessary


diff -urN lynx2-8-1/WWW/Library/Implementation/HTFormat.c 
lynx2-8-1.eric/WWW/Library/Implementation/HTFormat.c
--- lynx2-8-1/WWW/Library/Implementation/HTFormat.c     Sun Sep 13 10:35:55 1998
+++ lynx2-8-1.eric/WWW/Library/Implementation/HTFormat.c        Sun Sep 27 
09:01:17 1998
@@ -503,11 +503,13 @@
                /* new hypertext document available  */
        && ((Newline_partial + display_lines) > NumOfLines_partial)
                /* current page not complete... */
-       && ((Newline_partial + display_lines)  < HText_getNumOfLines())) {
-               /*             ^^^^^^^^^^^^^
-                * and we MAY display the page in one stage:
-                * incremental rendering of the first page reported annoying
-                * on slow network connection.
+       && (partial_threshold > 0 ? ((Newline_partial + partial_threshold)  < 
HText_getNumOfLines()) :
+                ((Newline_partial + display_lines) < HText_getNumOfLines()))) {
+               /*
+                * Originally we rendered by increments of 2 lines,
+                * but that got annoying on slow network connections.
+                * Then we switched to full-pages.  Now it's configurable.
+                * If partial_threshold < 0, then it's a full page
                 */
            NumOfLines_partial = HText_getNumOfLines();
            HText_pageDisplay(Newline_partial, "");
diff -urN lynx2-8-1/lynx.cfg lynx2-8-1.eric/lynx.cfg
--- lynx2-8-1/lynx.cfg  Fri Sep 25 06:41:38 1998
+++ lynx2-8-1.eric/lynx.cfg     Sun Sep 27 09:03:13 1998
@@ -392,6 +392,10 @@
 
 # Display partial pages while downloading
 #PARTIAL:TRUE
+# Set the threshold # of lines Lynx must render before it
+# redraws the screen.  Anything < 0 implies use the screen
+# size.
+#PARTIAL_THRES:-1
 
 # While getting large files, Lynx shows the approximate rate of
 # transfer.  Set this to change the units shown (true for KB/sec,
diff -urN lynx2-8-1/src/LYGlobalDefs.h lynx2-8-1.eric/src/LYGlobalDefs.h
--- lynx2-8-1/src/LYGlobalDefs.h        Fri Sep 25 06:41:38 1998
+++ lynx2-8-1.eric/src/LYGlobalDefs.h   Sun Sep 27 09:00:41 1998
@@ -262,6 +262,7 @@
 extern BOOLEAN display_partial;      /* Display document during download */
 extern int Newline_partial;          /* -//- "current" newline position */
 extern int NumOfLines_partial;       /* -//- "current" number of lines */
+extern int partial_threshold;
 extern BOOLEAN debug_display_partial;  /* show with MessageSecs delay */
 extern BOOLEAN detected_forms_input_partial; /* trimHightext temp fix */
 #endif
diff -urN lynx2-8-1/src/LYMain.c lynx2-8-1.eric/src/LYMain.c
--- lynx2-8-1/src/LYMain.c      Sat Sep 26 23:28:34 1998
+++ lynx2-8-1.eric/src/LYMain.c Sun Sep 27 09:00:19 1998
@@ -360,6 +360,7 @@
 PUBLIC BOOLEAN display_partial = TRUE; /* Display document during download */
 PUBLIC BOOLEAN debug_display_partial = FALSE; /* Show with MessageSecs delay */
 PUBLIC BOOLEAN detected_forms_input_partial = FALSE; /* trimHightext temp fix 
*/
+PUBLIC int partial_threshold = -1;  /* # of lines to be d/l'ed until we 
repaint */
 #endif
 
 /* These are declared in cutil.h for current freeWAIS libraries. - FM */
@@ -2769,6 +2770,11 @@
    PARSE_SET(
       "partial",       TOGGLE_ARG,             &display_partial,
       "display partial pages while downloading"
+   ),
+   PARSE_INT(
+      "partial_thres",  IGNORE_ARG|INT_ARG,     partial_threshold,
+      "[=NUMBER]\nnumber of lines to render before repainting display\n\
+with partial-display logic"
    ),
 #endif
    PARSE_FUN(
diff -urN lynx2-8-1/src/LYReadCFG.c lynx2-8-1.eric/src/LYReadCFG.c
--- lynx2-8-1/src/LYReadCFG.c   Sat Sep 26 23:28:34 1998
+++ lynx2-8-1.eric/src/LYReadCFG.c      Sun Sep 27 09:00:26 1998
@@ -903,6 +903,7 @@
      PARSE_FUN("outgoing_mail_charset", CONF_FUN, outgoing_mail_charset_fun),
 #ifdef DISP_PARTIAL
      PARSE_SET("partial", CONF_BOOL, display_partial),
+     PARSE_INT("partial_thres", CONF_INT, partial_threshold),
 #endif
      PARSE_STR("personal_mailcap", CONF_STR, personal_type_map),
      PARSE_STR("personal_extension_map", CONF_STR, personal_extension_map),
diff -urN lynx2-8-1/src/LYrcFile.c lynx2-8-1.eric/src/LYrcFile.c
--- lynx2-8-1/src/LYrcFile.c    Sat Sep 26 23:28:34 1998
+++ lynx2-8-1.eric/src/LYrcFile.c       Sun Sep 27 09:00:32 1998
@@ -509,6 +509,20 @@
             else
                local_exec = FALSE;
 
+#ifdef DISP_PARTIAL
+       /*
+        * Partial display logic--set the threshold # of lines before
+        * Lynx redraws the screen
+        */
+       } else if ((cp = LYstrstr(line_buffer, "partial_thres")) != NULL &&
+                  cp-line_buffer < number_sign) {
+           if ((cp2 = (char *)strchr(cp, '=')) != NULL)
+               cp = cp2 + 1;
+           cp = LYSkipBlanks(cp);
+           if (atoi(cp) != 0)
+               partial_threshold = atoi(cp);
+#endif /* DISP_PARTIAL */
+
        /*
         *  Local execution mode - only links in local files.
         */
@@ -835,6 +849,19 @@
                ((keypad_mode == NUMBERS_AS_ARROWS) ?  "NUMBERS_AS_ARROWS" :
               ((keypad_mode == LINKS_ARE_NUMBERED) ? "LINKS_ARE_NUMBERED" :
                                      "LINKS_AND_FORM_FIELDS_ARE_NUMBERED")));
+
+#ifdef DISP_PARTIAL
+    /*
+     * Partial display threshold
+     */
+    fprintf(fp, "\
+# partial_thres specifies the number of lines Lynx should download and render
+# before we redraw the screen in Partial Display logic
+# e.g. partial_thres=2
+# would have Lynx redraw every 2 lines that it renders
+# partial_thres=-1 would use the entire screensize\n");
+    fprintf(fp, "partial_thres=%d\n\n", partial_threshold);
+#endif /* DISP_PARTIAL */
 
     /*
      *  Lineedit mode.

-- 
Eric
address@hidden

reply via email to

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