changeset 15:89750191b165

imported patch 18_patch-AuxPanel.c.diff
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 20:38:16 +0900
parents 5a32b68b627d
children 598fcbe482b5
files lib/AuxPanel.c
diffstat 1 files changed, 43 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lib/AuxPanel.c	Mon Mar 08 20:38:16 2010 +0900
+++ b/lib/AuxPanel.c	Mon Mar 08 20:38:16 2010 +0900
@@ -462,7 +462,10 @@
 AuxPanelWidget cpw;
 Cardinal n;
 {
-  if (cpw->cpanel.dispauxsegmentsize > n) return;
+
+  if (cpw->cpanel.dispauxsegmentsize >= n) return;
+  /* $BI=<($7$?$$%;%0%a%s%H?t$,8=:_$NI=<(%;%0%a%s%H%5%$%:$HF1$8$J$i2?$b$7$J$$(B */
+
   n = ((n + 3) / 4) * 4 ;
   if (cpw->cpanel.dispauxsegments == NULL) {
     cpw->cpanel.dispauxsegments = 
@@ -590,15 +593,50 @@
   Cardinal i;
   DisplaySegment *dseg;
 
-  cpw->cpanel.numauxsegments = nseg;
+  ICString *to;
+
   allocDisplaySegments(cpw, nseg);
-  for (i = 0, dseg = cpw->cpanel.dispauxsegments ; i < nseg ; i++, dseg++) {
-    /* $BA4=q$-49$($K$J$C$F$7$^$&!#(BICCompareSegment $B$,;H$($k$J$i(B
-       $B;H$$$?$$$N$@$,!#(B */
+  dseg = cpw->cpanel.dispauxsegments;
+  for (i = 0; i < nseg ; i++) {
     copyString(segments +i, &dseg->seg);
     dseg->redrawpos = 0;
     dseg->width = 0;
+    dseg++;
   }
+  /* $B%;%0%a%s%H?t$,8:$k>l9g!"M>J,$K$J$C$?5l%;%0%a%s%HNN0h$N3+J|(B */
+  /* $B7k6I(B buffer.c: free(buf) $B$G3+J|$5$l$k$+$i$[$C$H$$$F$b$$$$(B? */
+  for (i = nseg; i < cpw->cpanel.numauxsegments; i++) {
+    to = &dseg->seg;
+    if (to->data != NULL) {
+      XtFree(to->data);
+      to->data = NULL;
+    }
+    dseg->redrawpos = 0;
+    dseg->width = 0;
+    dseg++;
+  }
+  cpw->cpanel.numauxsegments = nseg;
+
+/*
+(1) allocDisplaySegments$B$O(B
+cpw->cpanel.numauxsegments$B$r5l%;%0%a%s%H?t$@$H;W$C$F$k$+$i(B
+cpw->cpanel.numauxsegments = nseg $B$rKAF,$G$d$C$A$c$&$H$^$:$$$N$G$O(B?
+cpw->cpanel.numauxsegments = nseg $B$O:G8e$K$9$k!#(B
+(2) for$B%k!<%W$O!"5l%;%0%a%s%H?t$h$j?7%;%0%a%s%H?t$,8:$k>l9g(B
+XtFree$B$7$J$$$^$^$NI=<(%;%0%a%s%HNN0h$,=P$F$/$k!#(B
+copyString$B$O%;%0%a%s%H?t$,8:$k>l9g$KIT0B(B
+allocDisplaySegments$B$GBP1~$9$Y$-(B? (allocDisplaySegments$B$G(BXtFree$B$9$k(B?)
+copyString$B$GBP1~$9$Y$-(B?
+$B$3$3$GBP1~$9$Y$-(B?
+(3) allocDisplaySegments$B$G(B
+$BJQ99$5$l$k$N$O(B
+  cpw->cpanel.dispauxsegmentsize
+  cpw->cpanel.dispauxsegments     XtRealloc$B$NJV$jCM(B
+$BJQ99$5$l$J$$$1$I;H$o$l$k$N$O(B
+  cpw->cpanel.numauxsegments
+  $B$3$l$O$J$K(B? include/AuxPanelP.h$B$GDj5A$7$F$k$@$1$G%3%a%s%H$J$7(B
+*/
+
   Layout(cpw, False, False);
   if (XtIsRealized(w)) XClearWindow(XtDisplay(w), XtWindow(w));
   UpdateAuxDisplay(cpw);