lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev dev.15 patch 4 (pass #2)


From: Leonid Pauzner
Subject: lynx-dev dev.15 patch 4 (pass #2)
Date: Mon, 29 Nov 1999 21:50:02 +0300 (MSK)

[sorry, I resend this message again since the previous one
happen to be with broken date/subject info.]
-------------------------------------------------


This patch should be applayed on top of my "patch 4"

28-Nov-99 00:21 Leonid Pauzner wrote:
> +* 'prev_target' now PRIVATE to LYMainLoop.c [defined outside of mainloop()],
> +  this undo some dev.15 changes. -LP, KW
> +* replace HText_pageDisplay() calls from partial mode (LYUtils.c
> +  and HTFormat.c) with LYMainLoop_pageDisplay() function implemented
> +  in LYMainLoop.c, it simply call HText_pageDisplay() but has access
> +  to LYMainLoop.c PRIVATE variables. -LP, KW
>  1999-11-17 (2.8.3dev.15)


* slightly reorganize partial mode logic: 'display_partial' variable
  now initialized directly in HText_new(), no need in specialized
  semaphore any more. -LP


diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Sun Nov 28 00:05:16 1999
+++ ./gridtext.c        Sun Nov 29 18:48:46 2099
@@ -866,11 +866,13 @@

 #ifdef DISP_PARTIAL
     /*
-     * By this function we create HText object and set new Lines counter
+     * By this function we create HText object
      * so we may start displaying the document while downloading. - LP
      */
-    if (display_partial)
-        NumOfLines_partial = 0;  /* enable HTDisplayPartial() */
+    if (display_partial_flag) {
+        display_partial = TRUE;  /* enable HTDisplayPartial() */
+        NumOfLines_partial = 0;  /* initialize */
+    }

     /*
      *  These two fields should only be set to valid line numbers
diff -u old/htformat.c ./htformat.c
--- old/htformat.c      Sun Nov 28 00:05:20 1999
+++ ./htformat.c        Sun Nov 29 18:49:24 2099
@@ -518,11 +518,9 @@
        **  HText_getNumOfLines() = "current" number of complete lines received
        **  NumOfLines_partial = number of lines at the moment of last repaint.
        **
-       **  We update NumOfLines_partial only when we repaint the display.
-       **  -1 is the special value:
-       **  This is a synchronization flag switched to 0 when HText_new()
-       **  starts a new HTMainText object - all HText_ functions use it,
-       **  lines counter in particular [we call it from HText_getNumOfLines()].
+       **  display_partial could only be enabled in HText_new()
+       **  so a new HTMainText object available - all HText_ functions use it,
+       **  lines counter HText_getNumOfLines() in particular.
        **
        **  Otherwise HTMainText holds info from the previous document
        **  and we may repaint it instead of the new one:
@@ -531,9 +529,7 @@
        **
        **  So repaint the page only when necessary:
        */
-       if ((NumOfLines_partial != -1)
-               /* new HText object available  */
-       && ((Newline_partial + display_lines) > NumOfLines_partial)
+       if (((Newline_partial + display_lines) > NumOfLines_partial)
                /* current page not complete... */
        && (partial_threshold > 0 ?
                ((Newline_partial + partial_threshold) < HText_getNumOfLines()) 
:
@@ -557,24 +553,10 @@
 PUBLIC void HTFinishDisplayPartial NOARGS
 {
 #ifdef DISP_PARTIAL
-                   if (display_partial) {
-                       /*
-                        *  Override Newline with a new value if user
-                        *  scrolled the document while downloading.
-                        */
-                       if (Newline_partial != Newline
-                        && NumOfLines_partial > 0)
-                           Newline = Newline_partial;
-                   }
-
                    /*
                     *  End of incremental rendering stage here.
                     */
                    display_partial = FALSE;
-                   NumOfLines_partial = -1;       /* initialize to -1 */
-                               /* -1 restrict HTDisplayPartial()   */
-                               /* until HText_new() start next HTMainText */
-                               /* and set the flag to 0  */
 #endif /* DISP_PARTIAL */
 }

diff -u old/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Sun Nov 28 00:05:30 1999
+++ ./lymainlo.c        Sun Nov 29 18:57:26 2099
@@ -200,11 +200,15 @@
 PRIVATE char prev_target[512];

 #ifdef DISP_PARTIAL
-PUBLIC int Newline_partial = 0;     /* required for display_partial mode */
-PUBLIC int NumOfLines_partial = -1; /* initialize to -1 the very first time */
-PUBLIC BOOLEAN display_partial = FALSE;
+PUBLIC BOOLEAN display_partial = FALSE; /* could be enabled in HText_new() */
+PUBLIC int Newline_partial = 0;     /* newline position in partial mode */
+PUBLIC int NumOfLines_partial = 0;  /* number of lines displayed in partial 
mode */
 PUBLIC int Newline = 0;
 #else
+/* Whether we need Newline global?
+ * seems mouse code in LYStrings.c use it...
+ * not a partial mode any more.
+ */
 PRIVATE int Newline = 0;
 #endif

@@ -368,7 +372,31 @@
 PUBLIC void LYMainLoop_pageDisplay ARG1 (
    int,   line_num)
 {
-           HText_pageDisplay(line_num, prev_target);
+#ifdef DISP_PARTIAL
+               /*
+                * Disable display_partial if requested URL has #fragment
+                * and we are not popped from the history stack
+                * so can't calculate correct newline position for fragment.
+                * Otherwise user got the new document from the first page
+                * and be moved to #fragment later after download
+                * completed, but only if s/he did not mess screen up by
+                * scrolling before...  So fall down to old behavior here.
+                * ... until we rewrite HTFindPoundSelector()
+                */
+               if (display_partial && newdoc.line == 1 && 
strchr(newdoc.address, '#')) {
+                   display_partial = FALSE; /* restrict for this document */
+                   return;  /* no repaint */
+               }
+
+               /*
+                *  Override Newline with a new value if user
+                *  scrolled the document while downloading.
+                *  Newline = Newline_partial;
+                */
+#endif
+
+               Newline = line_num;
+               HText_pageDisplay(Newline, prev_target);
 }

 PRIVATE int do_change_link NOARGS
@@ -5259,24 +5287,16 @@
                    LYPermitURL = TRUE;
                }

+               /* reset these two variables here before getfile()
+                * so they will be available in partial mode
+                * (was previously implemented in case NORMAL).
+                */
                *prev_target = '\0';    /* Reset for new coming document */
-               Newline = newdoc.line; /* bypass for partial mode */
+               Newline = newdoc.line;  /* bypass for partial mode */
 #ifdef DISP_PARTIAL
-               display_partial = display_partial_flag; /* restore */
                Newline_partial = Newline;  /* initialize */
-               /*
-                * Disable display_partial if requested URL has #fragment
-                * and we are not popped from the history stack
-                * so can't calculate correct newline position for fragment.
-                * Otherwise user got the new document from the first page
-                * and be moved to #fragment later after download
-                * completed, but only if s/he did not mess screen up by
-                * scrolling before...  So fall down to old behavior here.
-                */
-               if (newdoc.line == 1 && strchr(newdoc.address, '#')) {
-                   display_partial = FALSE;
-               }
 #endif /* DISP_PARTIAL */
+
 #ifdef USE_PSRC
                psrc_first_tag = TRUE;
 #endif
@@ -5731,11 +5751,11 @@
                    /* - already set and probably updated in partial mode */
                    /* incremental rendering stage already closed (but see 
below) */

-                   if (Newline != Newline_partial || display_partial == TRUE) {
+                   if (display_partial == TRUE) {
                       /* This is the case when we came from the history stack
-                       * _and_ cached HText was used instead of HT*Copy() call.
-                       * Set Newline and close partial mode here.
-                       */
+                       * _and_ cached HText was used instead of HT*Copy() call.
+                       * Set Newline and close partial mode here.
+                       */
                       Newline = Newline_partial;
                       display_partial = FALSE;
                    }







reply via email to

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