lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Re: dev22 - SOURCE_CACHE!=NONE and partial display mode


From: Leonid Pauzner
Subject: Re: lynx-dev Re: dev22 - SOURCE_CACHE!=NONE and partial display mode
Date: Fri, 16 Apr 1999 04:16:53 +0400 (MSD)

15-Apr-99 17:07 Leonid Pauzner wrote:
> 15-Apr-99 16:03 I wrote:

>>   - add partial display mode for HTreparse_document() operations - LP

>> (yes, I know this fix looks ugly, display partial staff should went
>> from mainloop() to HT*Copy(), will be done later
>> but how about corrupted screen?)

> Now a better fix for display partial mode - more clean and should be used
> for dev23 patch integration series. LYMain.c changes excluded.
> More LYMainLoop.c and GridText.c changes welcome.


And now I fix the problem with screen repainting in partial mode,
the patch against the previous one:


diff -u ../gridtext.c ./gridtext.c
--- ../gridtext.c       Thu Apr 15 16:27:52 1999
+++ ./gridtext.c        Fri Apr 16 03:00:12 1999
@@ -123,6 +123,7 @@
 PUBLIC char * source_cache_filename = NULL;
 PUBLIC HTChunk * source_cache_chunk = NULL;
 PUBLIC int LYCacheSource = SOURCE_CACHE_NONE;
+PUBLIC BOOLEAN from_source_cache = FALSE;  /* mutable */
 #endif

 #if defined(USE_COLOR_STYLE)
@@ -6259,9 +6260,8 @@

     CTRACE(tfp, "Reparse %s\n", (ok ? "succeeded" : "failed"));

-    if (ok)  {/* fix few flags: */
-       more = HText_canScrollDown();  /* the length may be changed */
-    }
+    if (ok)
+       from_source_cache = TRUE;  /* flag for mainloop events */

     return ok;
 }
diff -u ../lyglobal.h ./lyglobal.h
--- ../lyglobal.h       Thu Apr 15 12:51:30 1999
+++ ./lyglobal.h        Fri Apr 16 02:03:14 1999
@@ -252,6 +252,7 @@
 #ifdef SOURCE_CACHE
 extern char * source_cache_filename;
 extern HTChunk * source_cache_chunk;
+extern BOOLEAN from_source_cache; /* mutable */
 extern int LYCacheSource;
 #define SOURCE_CACHE_NONE      0
 #define SOURCE_CACHE_FILE      1
Only in ..: lyhistor.c
Only in ..: lymain.c
diff -u ../lymainlo.c ./lymainlo.c
--- ../lymainlo.c       Thu Apr 15 16:38:34 1999
+++ ./lymainlo.c        Fri Apr 16 03:59:22 1999
@@ -1127,7 +1127,6 @@
              */
             Newline = www_search_result;
             www_search_result = -1;  /* reset */
-            more = HText_canScrollDown();
        }

        if (first_file == TRUE) {
@@ -1247,8 +1246,7 @@
         */
        if (HTdocument_settings_changed()) {
            HTUserMsg(gettext("Reparsing document under current settings..."));
-           if (HTreparse_document())
-               refresh_screen = TRUE;
+           if (HTreparse_document()) {}
            else {
                /*
                 * Urk.  I have no idea how to recover from a failure here.
@@ -1258,8 +1256,32 @@
                goto new_cmd;
            }
        }
+
+       /*
+        *  Trying to accomodate HTreparse_document() logic
+        *  with mainloop events. Set all the necessaty flags here...
+        */
+       if (from_source_cache) {
+               from_source_cache = FALSE; /* reset */
+
+               refresh_screen = TRUE; /* ? */
+                   /*
+                    *  Make sure curdoc.line will not be equal
+                    *  to Newline, so we get a redraw.
+                    */
+                   curdoc.line = -1;
+
+           /*
+            * This information can get clobbered if we go to an internal
+            * page while viewing source.  Normally it would be recreated
+            * by reloading the file; we have to do it ourselves.  -dsb
+            */
+           if (curdoc.link < 0 && nlinks > 0)
+               curdoc.link = 0;
+       }
 #endif

+
        /*
         *  If the curdoc.line is different than Newline then there must
         *  have been a change since last update.  Run HText_pageDisplay()
@@ -1275,9 +1297,9 @@
            if (lynx_edit_mode && nlinks > 0 && !HTList_isEmpty(tagged))
              showtags(tagged);
 #endif /* DIRED_SUPPORT */
+
            /*
-            *  If more equals TRUE, then there is more
-            *  info below this page .
+            *  If more equals TRUE, then there is more info below this page.
             */
            more = HText_canScrollDown();
            curdoc.line = Newline = HText_getTopOfScreen()+1;
@@ -1340,15 +1362,12 @@
            if (lynx_edit_mode && nlinks > 0 && !HTList_isEmpty(tagged))
                showtags(tagged);
 #endif /* DIRED_SUPPORT */
-#ifdef SOURCE_CACHE
+
            /*
-            * This information can get clobbered if we go to an internal
-            * page while viewing source.  Normally it would be recreated
-            * by reloading the file; we have to do it ourselves.  -dsb
+            *  If more equals TRUE, then there is more info below this page.
             */
-           if (curdoc.link < 0 && nlinks > 0)
-               curdoc.link = 0;
-#endif
+           more = HText_canScrollDown();
+
            if (user_mode == NOVICE_MODE)
                noviceline(more);  /* print help message */
            refresh_screen = FALSE;
@@ -2099,7 +2118,6 @@
 #endif
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                /*
                 * These normally get cleaned up after getfile() returns;
                 * since we're not calling getfile(), we have to clean them
@@ -2228,7 +2246,6 @@
            }
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
            HTuncache_current_document();
@@ -2274,7 +2291,6 @@
            }
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
            HTuncache_current_document();
@@ -2313,7 +2329,6 @@
                      SOFT_DOUBLE_QUOTE_ON : SOFT_DOUBLE_QUOTE_OFF);
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
            HTuncache_current_document();
@@ -2373,7 +2388,6 @@
            HTUserMsg(Old_DTD ? USING_DTD_0 : USING_DTD_1);
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
            HTuncache_current_document();
@@ -5598,7 +5612,6 @@
                     CLICKABLE_IMAGES_ON : CLICKABLE_IMAGES_OFF);
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
 #endif
@@ -5615,7 +5628,6 @@
                      PSEUDO_INLINE_ALTS_ON : PSEUDO_INLINE_ALTS_OFF);
 #ifdef SOURCE_CACHE
            if (HTreparse_document()) {
-               refresh_screen = TRUE;
                break;
            }
 #endif
@@ -5633,7 +5645,6 @@
                LYUseDefaultRawMode_flag = LYUseDefaultRawMode;
 #ifdef SOURCE_CACHE
                if (HTreparse_document()) {
-                   refresh_screen = TRUE;
                    break;
                }
 #endif




reply via email to

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