summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2000-06-29 07:20:38 +0000
committertron <tron@pkgsrc.org>2000-06-29 07:20:38 +0000
commit27b45298c06040c52981e01f2f8e615f9366c6a0 (patch)
treef9431840bab3f0f7c513284282c81e685dadddd2
parent4dbe06da66c5e370d94de878badbed5812bd08fa (diff)
downloadpkgsrc-27b45298c06040c52981e01f2f8e615f9366c6a0.tar.gz
Fix saving of user-defined colors. Patches by Brian Smith supplied in
PR pkg/10470 by Jim Bernard.
-rw-r--r--graphics/xfig/files/patch-sum4
-rw-r--r--graphics/xfig/patches/patch-ad87
-rw-r--r--graphics/xfig/patches/patch-ae21
3 files changed, 111 insertions, 1 deletions
diff --git a/graphics/xfig/files/patch-sum b/graphics/xfig/files/patch-sum
index abe0a6821bb..470308bb71f 100644
--- a/graphics/xfig/files/patch-sum
+++ b/graphics/xfig/files/patch-sum
@@ -1,5 +1,7 @@
-$NetBSD: patch-sum,v 1.3 2000/06/23 00:22:35 itohy Exp $
+$NetBSD: patch-sum,v 1.4 2000/06/29 07:20:38 tron Exp $
MD5 (patch-aa) = a639dce50175842177a142315d71585c
MD5 (patch-ab) = 151b97aa994fbe3bbac248e2d279f8c4
MD5 (patch-ac) = 53dbb7dbee82ade07f728095d90b632a
+MD5 (patch-ad) = 72420d6e45264bdb6afa4feaaf445cc2
+MD5 (patch-ae) = 13706774e756204259457d1ecfb1c798
diff --git a/graphics/xfig/patches/patch-ad b/graphics/xfig/patches/patch-ad
new file mode 100644
index 00000000000..d2c49bfdafd
--- /dev/null
+++ b/graphics/xfig/patches/patch-ad
@@ -0,0 +1,87 @@
+$NetBSD: patch-ad,v 1.1 2000/06/29 07:20:39 tron Exp $
+
+--- w_color.c.orig Mon Jan 3 11:09:46 2000
++++ w_color.c Mon Jun 12 12:18:40 2000
+@@ -250,7 +250,6 @@
+ choice_info *choice;
+ XColor col;
+ Pixel form_fg;
+- XGCValues values;
+ Widget below, beside, stdForm, stdLabel;
+ Widget sb;
+ char str[8];
+@@ -707,7 +706,8 @@
+ valScroll = XtCreateManagedWidget("valScroll", scrollbarWidgetClass,
+ mixingForm, Args, ArgCount);
+
+- original_background = values.foreground;
++ /* get background color of redLocked to restore background for locked sliders */
++ XtVaGetValues(redLocked, XtNbackground, &(original_background), NULL);
+ bars_locked = 0;
+
+ XtAddCallback(redScroll, XtNjumpProc, Thumbed, (XtPointer)S_RED);
+@@ -960,6 +960,8 @@
+ put_msg("No more user colors allowed");
+ modified[edit_fill] = True;
+ pick_memory(current_memory);
++ colorUsed[current_memory]=True;
++
+ }
+
+ /* delete a color memory (current_memory) from the user colors */
+@@ -1020,6 +1022,7 @@
+ num_usr_cols);
+ return;
+ }
++ colorUsed[indx] = True;
+ }
+
+ /* count the number of unique user colors actually used by Fig objects */
+@@ -1212,7 +1215,7 @@
+
+ /* if not, increment num_usr_cols */
+ if (indx>= num_usr_cols) {
+- if (num_usr_cols >= MAX_USR_COLS-1)
++ if (num_usr_cols >= MAX_USR_COLS)
+ return -1;
+ if (use_exist)
+ num_usr_cols = indx+1;
+@@ -1233,6 +1236,8 @@
+ colors[NUM_STD_COLS+indx] = user_colors[indx].pixel;
+
+ colorFree[indx] = False;
++ colorUsed[indx] = False;
++
+
+ /* if the color popup has been created create the widgets */
+ if (pen_color_button->panel) {
+@@ -1397,6 +1402,7 @@
+ XFreeColors(tool_d, tool_cm, pixels, 1, 0);
+ /* now set free flag for that cell */
+ colorFree[indx] = True;
++ colorUsed[indx] = False;
+ }
+
+ /* if any object in the figure uses the user color "color" return True */
+@@ -1903,8 +1909,11 @@
+ }
+
+ do_change = True;
+- if (current_memory >= 0)
++ if (current_memory >= 0) {
+ StoreMix_and_Mem();
++ if (!colorUsed[current_memory])
++ colorUsed[current_memory] = True;
++ }
+ update_scrl_triple((Widget)NULL, (XEvent *)NULL,
+ (String *)NULL, (Cardinal *)NULL);
+ }
+@@ -2058,6 +2067,8 @@
+ if (do_change) {
+ if (current_memory >= 0) {
+ StoreMix_and_Mem();
++ if (!colorUsed[current_memory])
++ colorUsed[current_memory] = True;
+ update_scrl_triple((Widget)NULL, (XEvent *)NULL,
+ (String *)NULL, (Cardinal *)NULL);
+ }
diff --git a/graphics/xfig/patches/patch-ae b/graphics/xfig/patches/patch-ae
new file mode 100644
index 00000000000..7cb4724117d
--- /dev/null
+++ b/graphics/xfig/patches/patch-ae
@@ -0,0 +1,21 @@
+$NetBSD: patch-ae,v 1.1 2000/06/29 07:20:41 tron Exp $
+
+--- w_file.c.orig Tue Jan 11 14:03:33 2000
++++ w_file.c Mon Jun 12 12:18:40 2000
+@@ -1206,8 +1206,10 @@
+ reset_layers();
+
+ /* save user colors in case preview changes them */
+- save_user_colors();
+- save_nuser_colors();
++ if (!user_colors_saved) {
++ save_user_colors();
++ save_nuser_colors();
++ }
+
+ /* make the cancel button sensitive */
+ XtSetSensitive(preview_stop, True);
+>Release-Note:
+>Audit-Trail:
+>Unformatted:
+