lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev dev.16 patch 1


From: Leonid Pauzner
Subject: Re: lynx-dev dev.16 patch 1
Date: Thu, 2 Dec 1999 19:39:50 +0300 (MSK)

1-Dec-99 20:00 I wrote:
> 1-Dec-99 11:44 Leonid Pauzner wrote:
>> Since Tom introduce LYGetNewline()/LYSetNewline()
>> and I completely forgot about yet another Newline initialization in
>> GridText.c, I made the next step for partial display code simplification.
>> Lots of (-) below.

> Uh, DISP_PARTIAL code normally relay on 'newdoc'
> while SOURCE_CACHE - on 'curdoc', so partial mode while loading
> cached sources will be broken by this patch.
> Wrong newline position will be displayed for this marginally not visible
> case - only for slow machines. Please do not applay this patch until we
> find a proper fix [this is the other instance of 'curdoc' vs LYK_WHEREIS
> problem in partial mode].
> Sorry.

Here a revised patch.

* remove global Newline_partial, use LYGetNewline() instead.


diff -u old/htformat.c ./htformat.c
--- old/htformat.c      Wed Dec  1 08:09:44 1999
+++ ./htformat.c        Wed Dec  1 11:31:32 1999
@@ -516,6 +516,7 @@
        /*
        **  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.)
        **
        **  display_partial could only be enabled in HText_new()
        **  so a new HTMainText object available - all HText_ functions use it,
@@ -528,6 +529,8 @@
        **
        **  So repaint the page only when necessary:
        */
+       int Newline_partial = LYGetNewline();
+
        if (((Newline_partial + display_lines) > NumOfLines_partial)
                /* current page not complete... */
        && (partial_threshold > 0 ?
diff -u old/lyutils.c ./lyutils.c
--- old/lyutils.c       Wed Dec  1 08:28:16 1999
+++ ./lyutils.c Wed Dec  1 09:25:00 1999
@@ -2330,6 +2330,8 @@
        {
            BOOLEAN do_refresh;
            int res;
+           int Newline_partial = LYGetNewline();
+
            switch (cmd)
            {
            case LYK_WHEREIS: /* search within the document */

diff -u old/gridtext.c ./gridtext.c
--- old/gridtext.c      Wed Dec  1 08:15:20 1999
+++ ./gridtext.c        Wed Dec  1 09:28:20 1999
@@ -46,10 +46,6 @@

 #undef DEBUG_APPCH

-#ifdef DISP_PARTIAL
-#include <LYMainLoop.h>
-#endif
-
 #ifdef SOURCE_CACHE
 #include <HTFile.h>
 #endif
@@ -8082,10 +8078,7 @@
            FREE(HTMainAnchor->source_cache_file);
            return FALSE;
        }
-#ifdef DISP_PARTIAL
-       display_partial = display_partial_flag;  /* restore */
-       Newline_partial = LYGetNewline();  /* initialize */
-#endif
+
        if (HText_HaveUserChangedForms()) {
            /*
             * Issue a warning.  Will not restore changed forms, currently.
@@ -8125,10 +8118,6 @@
                                         UCLYhndl_for_unspec);
        /* not UCLYhndl_HTFile_for_unspec - we are talking about remote 
documents... */

-#ifdef DISP_PARTIAL
-       display_partial = display_partial_flag;  /* restore */
-       Newline_partial = LYGetNewline();  /* initialize */
-#endif
        if (HText_HaveUserChangedForms()) {
            /*
             * Issue a warning.  Will not restore changed forms, currently.
diff -u old/lyglobal.h ./lyglobal.h
--- old/lyglobal.h      Wed Dec  1 08:15:22 1999
+++ ./lyglobal.h        Wed Dec  1 09:24:08 1999
@@ -289,7 +289,6 @@
 extern BOOLEAN no_url_redirection;   /* Don't follow URL redirections */
 #ifdef DISP_PARTIAL
 extern BOOLEAN display_partial;      /* Display document while loading */
-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 */
diff -u old/lyhistor.c ./lyhistor.c
--- old/lyhistor.c      Wed Dec  1 08:15:32 1999
+++ ./lyhistor.c        Thu Dec  2 18:17:06 1999
@@ -15,6 +15,9 @@
 #include <LYStrings.h>
 #include <LYCharUtils.h>
 #include <LYCharSets.h>
+#ifdef DISP_PARTIAL
+#include <LYMainLoop.h>
+#endif

 #ifdef DIRED_SUPPORT
 #include <LYUpload.h>
@@ -426,7 +429,7 @@
        doc->internal_link = history[nhist].internal_link;
 #ifdef DISP_PARTIAL
        /* assume we pop the 'doc' to show it soon... */
-       Newline_partial = doc->line;    /* reinitialize */
+       LYSetNewline(doc->line);        /* reinitialize */
 #endif /* DISP_PARTIAL */
        CTRACE((tfp, "LYpop[%d]: address:%s\n     title:%s\n",
                    nhist, doc->address, doc->title));
@@ -455,7 +458,7 @@
        doc->internal_link = history[number].internal_link; /* ?? */
 #ifdef DISP_PARTIAL
        /* assume we pop the 'doc' to show it soon... */
-       Newline_partial = doc->line;    /* reinitialize */
+       LYSetNewline(doc->line);        /* reinitialize */
 #endif /* DISP_PARTIAL */
     }
 }
diff -u old/lymainlo.c ./lymainlo.c
--- old/lymainlo.c      Wed Dec  1 08:15:34 1999
+++ ./lymainlo.c        Thu Dec  2 19:33:02 1999
@@ -202,7 +202,6 @@

 #ifdef DISP_PARTIAL
 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 */
 #endif

@@ -375,14 +374,22 @@

 /*
  * This is for traversal call from within partial mode in LYUtils.c
- * and HTFormat. It simply calls HText_pageDisplay()
- * but utilizes LYMainLoop.c PRIVATE variables (currently 'prev_target').
+ * and HTFormat.c  It simply calls HText_pageDisplay() but utilizes
+ * LYMainLoop.c PRIVATE variables.
  * Perhaps, this could adhere more logic from mainloop(), in the future.
  */
 PUBLIC void LYMainLoop_pageDisplay ARGS1(
        int,            line_num)
 {
 #ifdef DISP_PARTIAL
+#ifdef SOURCE_CACHE
+       /*
+        * Source Cache code acts within refresh cycle, so it relay on 'curdoc',
+        * those who will go to getfile() relay on 'newdoc' instead.
+        * So bypass here. Sorry for possible confusion...
+        */
+       if (!from_source_cache)
+#endif
     /*
      * Disable display_partial if requested URL has #fragment and we are not
      * popped from the history stack so can't calculate correct newline
@@ -398,15 +405,15 @@

     /*
      *  Override Newline with a new value if user
-     *  scrolled the document while loading.
-     *  Newline = Newline_partial;
+     *  scrolled the document while loading (in LYUtils.c).
      */
-#endif
-
+#endif /* DISP_PARTIAL */
     Newline = line_num;
+
     HText_pageDisplay(Newline, prev_target);
 }

+
 PRIVATE int do_change_link NOARGS
 {
     /* Is there a mouse-clicked link waiting? */
@@ -5313,11 +5320,8 @@
                 * 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 */
-#ifdef DISP_PARTIAL
-               Newline_partial = Newline;  /* initialize */
-#endif /* DISP_PARTIAL */
+               *prev_target = '\0';    /* Reset for new coming document */
+               Newline = newdoc.line;  /* set for LYGetNewline() */

 #ifdef USE_PSRC
                psrc_first_tag = TRUE;
@@ -5767,23 +5771,24 @@
                     *  Set Newline to the saved line.  It contains the
                     *  line the user was on if s/he has been in the file
                     *  before, or it is 1 if this is a new file.
+                    *
+                    * We already set Newline before getfile() and probably
+                    * update it explicitely if popping from the history stack
+                    * via LYpop() or LYpop_num() within getfile() cycle.
+                    *
+                    * In partial mode, Newline was probably updated in
+                    * LYMainLoop_pageDisplay() if user scrolled
+                    * the document while loading.
+                    * Incremental loading stage already closed in HT*Copy().
                     */
 #ifdef DISP_PARTIAL
                    /* Newline = newdoc.line; */
-                   /* - already set and probably updated in partial mode */
-                   /* incremental rendering stage already closed (but see 
below) */
-
-                   if (display_partial == TRUE || Newline != Newline_partial) {
-                       /* 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.
-                        */
-                       Newline = Newline_partial;
-                       display_partial = FALSE;
-                   }
 #else
-                   Newline = newdoc.line; /* now here, no partial mode */
-                   /* *prev_target = '\0'; */ /* Reset for this document. - FM 
*/
+                   /* Should not be needed either if we remove
+                    * "DISP_PARTIAL" from LYHistory.c, but lets leave it
+                    * as an important comment for now.
+                    */
+                   Newline = newdoc.line;
 #endif

                    /*



reply via email to

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