Hi Qian,
I've found some additional "fricas?D.*" places with a grep.
See attached patch. Would they also make sense to merge with yours?
On 4/21/24 14:55, Qian Yun wrote:
Currently, when using "write" to write out a viewport, we have
"image.bm", "image.xpm", but also "fricas2D.ps", "fricas3D.ps".
This patch makes PS output to have unified name "image.ps".
This is more consistent and easier for follow up Makefile treatment.
Note that in the view2D/view3D control panel, you can also click
buttons to save image (instead of viewport directory) under
current directory, you can only save "fricas2D.ps" for 2D images,
and "fricas3D.xpm" "fricas3D.ps" for 3D images. Here the name
distinction makes sense to avoid file overwrite.
I guess, my patch contains also renaming those cases to "image.*".
Perhaps it would be better to create a dialog for choosing/entering a
filename while saving a file from an interactive viewport control panel.
Otherwise, there remains stil the problem of overriding a previous image
by saving from another viewport control panel.
--
Ralf
- Qian
diff --git a/src/graph/view2D/write2d.c b/src/graph/view2D/write2d.c
index 05bbf62e..7968dd3a 100644
--- a/src/graph/view2D/write2d.c
+++ b/src/graph/view2D/write2d.c
@@ -184,15 +184,15 @@ writeViewport(int thingsToWrite)
break;
case Postscript:
- /*** Create postscript output for viewport (in fricas2D.ps)
***/
+ /*** Create postscript output for viewport (in image.ps) ***/
fricas_sprintf_to_buf2(PSfilename, "%s%s", viewDirName,
- "/fricas2D.ps");
+ "/image.ps");
if (PSInit(viewport->viewWindow,viewport->titleWindow) ==
psError)
return (-1);
drawViewport(PSoption); /* write new script file in /tmp */
if (PSCreateFile(viewBorderWidth,viewport->viewWindow,
viewport->titleWindow, viewport->title) ==
psError)
- return(-1); /* concat script & proc into
fricas2D.ps */
+ return(-1); /* concat script & proc into image.ps */
break;
} /* switch on ii */
diff --git a/src/graph/view3D/write3d.c b/src/graph/view3D/write3d.c
index ac5a1210..344fb49e 100644
--- a/src/graph/view3D/write3d.c
+++ b/src/graph/view3D/write3d.c
@@ -194,15 +194,15 @@ writeViewport (int thingsToWrite)
break;
case Postscript:
- /*** Create postscript output for viewport (in fricas3D.ps)
***/
+ /*** Create postscript output for viewport (in image.ps) ***/
fricas_sprintf_to_buf2(PSfilename, "%s%s", viewDirName,
- "/fricas3D.ps");
+ "/image.ps");
if (PSInit(viewport->viewWindow,viewport->titleWindow) ==
psError)
return(-1);
drawViewport(PSoption); /* write new script file in /tmp */
if (PSCreateFile(viewBorderWidth,viewport->viewWindow,
viewport->titleWindow, viewport->title) ==
psError)
- return(-1); /* concat script & proc into fricas3D.ps */
+ return(-1); /* concat script & proc into image.ps */
break;
} /* switch on ii */
} /* if thingsToWrite >> ii */
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/75473ddd-cef7-4bfd-9101-3b77cd271203%40hemmecke.org.
From cd7a8fb7cf2479f6a2a4492739befe824dfc7b10 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Mon, 22 Apr 2024 00:12:30 +0200
Subject: additional renaming to "image.*"
---
src/doc/htex/ug07.htex | 6 +++---
src/graph/view2D/main2d.c | 2 +-
src/graph/view3D/main3d.c | 2 +-
src/graph/view3D/process3d.c | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/doc/htex/ug07.htex b/src/doc/htex/ug07.htex
index e0fca419..c7aef04a 100644
--- a/src/doc/htex/ug07.htex
+++ b/src/doc/htex/ug07.htex
@@ -755,7 +755,7 @@ of lines connecting points.
%
\item[PS] writes the current viewport contents to
\index{graphics!2D control-panel!ps}
-a file {\bf fricas2D.ps}.
+a file {\bf image.ps}.
The file is placed in the directory from which \Language{} or the {\bf
viewAlone} program was invoked.
\index{PostScript}
@@ -2409,13 +2409,13 @@ be written using the control-panel.
The {\bf Exit} button leaves the save menu.
The {\bf Pixmap} button writes an \Language{} pixmap of
\index{graphics!3D control-panel!pixmap}
-the current viewport contents. The file is called {\bf fricas3D.pixmap} and is
+the current viewport contents. The file is called {\bf image.pixmap} and is
located in the directory from which \Language{} or {\bf viewAlone} was
started.
The {\bf PS} button writes the current viewport contents to
\index{graphics!3D control-panel!ps}
PostScript output rather than to the viewport window.
-By default the file is called {\bf fricas3D.ps}; however, if a file
+By default the file is called {\bf image.ps}; however, if a file
\index{file!.Xdefaults @{\bf .Xdefaults}}
name is specified in the user's {\bf .Xdefaults} file it is
\index{graphics!.Xdefaults!PostScript file name}
diff --git a/src/graph/view2D/main2d.c b/src/graph/view2D/main2d.c
index a7fc898f..ec247466 100644
--- a/src/graph/view2D/main2d.c
+++ b/src/graph/view2D/main2d.c
@@ -217,7 +217,7 @@ main(void)
backgroundColor = WhitePixel(dsply,scrn);
}
- strcpy(PSfilename, "fricas2D.ps");
+ strcpy(PSfilename, "image.ps");
/**** Open global fonts ****/
serverFont = XQueryFont(dsply,XGContextFromGC(DefaultGC(dsply,scrn)));
diff --git a/src/graph/view3D/main3d.c b/src/graph/view3D/main3d.c
index 05a30ab9..b227a4fd 100644
--- a/src/graph/view3D/main3d.c
+++ b/src/graph/view3D/main3d.c
@@ -322,7 +322,7 @@ main(void)
}
}
- strcpy(PSfilename, "fricas3D.ps");
+ strcpy(PSfilename, "image.ps");
XSync(dsply,0);
diff --git a/src/graph/view3D/process3d.c b/src/graph/view3D/process3d.c
index 2a0f5c55..7681c9db 100644
--- a/src/graph/view3D/process3d.c
+++ b/src/graph/view3D/process3d.c
@@ -737,14 +737,14 @@ buttonAction (int bKey)
case pixmap:
- strcpy(control->message, " Creating fricas3D.xpm now ... ");
+ strcpy(control->message, " Creating image.xpm now ... ");
writeControlMessage();
XGetWindowAttributes(dsply,viewport->viewWindow,&vwInfo);
- write_pixmap_file(dsply, scrn, "fricas3D.xpm",
+ write_pixmap_file(dsply, scrn, "image.xpm",
viewport->titleWindow,0,0,vwInfo.width,
vwInfo.height+titleHeight);
clearControlMessage();
- strcpy(control->message, " fricas3D.xpm in working dir ");
+ strcpy(control->message, " image.xpm in working dir ");
writeControlMessage();
break;
--
2.34.1