lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Re: [PATCH 2.8.4dev.10] style assignment tracing


From: Ilya Zakharevich
Subject: lynx-dev Re: [PATCH 2.8.4dev.10] style assignment tracing
Date: Sat, 21 Oct 2000 18:07:37 -0400
User-agent: Mutt/1.2i

On Fri, Oct 20, 2000 at 02:08:23AM -0400, Ilya Zakharevich wrote:
> This patch provides better tracing of style choices.  Both when styles
> are assigned into text-lines, and when lss directives are converted to
> "numeric colors".

The previous patch was tracing style assignment for the "static part"
of the document.  What follows adds similar tracing for "dynamic part"
too (links and contents of user-editable stuff).

Enjoy,
Ilya

--- ./src/LYStrings.c~  Sun Oct 15 20:56:24 2000
+++ ./src/LYStrings.c   Fri Oct 20 22:07:40 2000
@@ -3266,11 +3273,14 @@ PUBLIC void LYRefreshEdit ARGS1(
      *  may be used directly to avoid complications. - kw
      */
     if (edit->sy == (LYlines - 1)) {
+       CTRACE((tfp, "STYLE.getstr: switching to NORMAL style.\n"));
        if (s_normal != NOSTYLE) {
            curses_style(s_normal, ABS_ON);
        } else {
            attrset(A_NORMAL);  /* need to do something about colors? */
        }
+    } else {
+       CTRACE((tfp, "STYLE.getstr: no style switch.\n"));
     }
 #endif
     if (edit->hidden) {
--- ./src/LYUtils.c-predebug    Sun Oct 15 03:47:20 2000
+++ ./src/LYUtils.c     Fri Oct 20 18:42:04 2000
@@ -228,11 +228,6 @@ PUBLIC void highlight ARGS3(
        if (flag == ON || links[cur].type == WWW_FORM_LINK_TYPE)
 #endif
        {
-
-#ifdef USE_COLOR_STYLE
-#define LXP (links[cur].lx)
-#define LYP (links[cur].ly)
-#endif
 #ifndef USE_COLOR_STYLE
        if (links[cur].type == WWW_FORM_LINK_TYPE ||
            !links[cur].hightext) {
@@ -247,12 +242,13 @@ PUBLIC void highlight ARGS3(
            target1_drawn = YES;
 #endif
        }
-#else
-       move(links[cur].ly, links[cur].lx);
-       if (flag == ON) {
-           LynxChangeStyle(s_alink, STACK_ON, 0);
-       } else {
-           int s, x;
+#else  /* here USE_COLOR_STYLE defined */
+       int s = s_alink;
+
+#  define LXP (links[cur].lx)
+#  define LYP (links[cur].ly)
+       if (flag != ON) {
+           int x;
                /*
                 *  This is where we try to restore the original style when
                 *  a link is unhighlighted.  The purpose of cached_styles[][]
@@ -262,6 +258,8 @@ PUBLIC void highlight ARGS3(
                 *  until we find one.
                 */
            if (LYP >= 0 && LYP < CACHEH && LXP >= 0 && LXP < CACHEW) {
+               CTRACE((tfp, "STYLE.highlight.off: cached style @(%d,%d): ",
+                       LYP, LXP));
                s = cached_styles[LYP][LXP];
                if (s == 0) {
                    for (x = LXP-1; x >= 0; x--) {
@@ -270,17 +268,27 @@ PUBLIC void highlight ARGS3(
                                s = cached_styles[LYP][x];
                                cached_styles[LYP][LXP] = s;
                            }
+                           CTRACE((tfp, "found %d, x_offset=%d.\n",
+                                   cached_styles[LYP][x], (int)x-LXP));
                            break;
                        }
                    }
-                   if (s == 0)
-                       s = s_a;
+                   if (s == 0) {
+                       CTRACE((tfp, "not found, assume <a>.\n"));
+                       s = s_a;                        
+                   }
+               } else {
+                   CTRACE((tfp, "found %d.\n", s));
                }
            } else {
+               CTRACE((tfp, "STYLE.highlight.off: can't use cache.\n"));
                s = s_a;
            }
-           LynxChangeStyle(s, STACK_ON, 0);
+       } else {
+           CTRACE((tfp, "STYLE.highlight.on: @(%d,%d).\n", LYP, LXP));
        }
+       move(LYP, LXP);
+       LynxChangeStyle(s, STACK_ON, 0);
 #endif
        }
 
@@ -305,6 +313,7 @@ PUBLIC void highlight ARGS3(
            if (flag == OFF) {
                hl2_drawn = TRUE;
                redraw_lines_of_link(cur);
+               CTRACE((tfp, "STYLE.highlight.off: NOFIX branch.\n", LYP, LXP));
            } else
 #endif
            if (!hl1_drawn) {
@@ -335,6 +344,9 @@ PUBLIC void highlight ARGS3(
 #ifndef USE_COLOR_STYLE
            lynx_start_link_color (flag == ON, links[cur].inUnderline);
 #else
+           CTRACE((tfp, "STYLE.highlight.line2: @(%d,%d), style=%d.\n", 
+                   links[cur].ly + 1, links[cur].hightext2_offset, 
+                   flag == ON ? s_alink : s_a));
            LynxChangeStyle(flag == ON ? s_alink : s_a, ABS_ON, 0);
 #endif
 

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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