diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..d236acd --- /dev/null +++ b/NEWS.md @@ -0,0 +1,6 @@ +# User visible changes in Yorick + +## "emmt" Branch + +- Graphic window title can be specified by the `title` keyword of the `window` + command. diff --git a/README.md b/README.md index 1f565f9..2258e99 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,18 @@ that includes scientific visualization functions, and text and binary I/O functions geared to millions of numbers. Yorick is open source software, under a -[BSD license](https://github.com/dhmunro/yorick/blob/master/LICENSE.md). +[BSD license](https://github.com/LLNL/yorick/blob/master/LICENSE.md). Yorick runs under UNIX, MacOS X (X windows), and MS Windows. You can find many yorick resources online: -* Home pages at [yorick.github.com][] and [yorick.sourceforge.net][], +* Home page at [yorick.sourceforge.net][], including the user manual and extensive documentation. * User forums at [yorick.sourceforge.net][]. -* Browse or download sourcecode at [github.com/dhmunro/yorick][]. +* Browse or download sourcecode at [github.com/LLNL/yorick][]. * Read end of Quick start section below on running yorick demo programs. -[yorick.github.com]: http://yorick.github.com -[yorick.sourceforge.net]: http://yorick.sourceforge.net -[github.com/dhmunro/yorick]: http://github.com/dhmunro/yorick +[yorick.sourceforge.net]: https://yorick.sourceforge.net +[github.com/LLNL/yorick]: https://github.com/LLNL/yorick Files in the regexp/ subdirectory are the work of Guido van Rossum and Henry Spencer; read the files for details. The latter is Copyright @@ -27,7 +26,7 @@ Henry Spencer; read the files for details. The latter is Copyright Files in the fft directory are C translations of the Swarztrauber fortran FFTPACK routines. Files in the matrix directory are C translations of the fortran LAPACK routines. The original fortran is -available from [netlib.org](http://netlib.org/). +available from [netlib.org](https://netlib.org/). Quick start diff --git a/gist/browser.c b/gist/browser.c index 2cfe289..315cebb 100644 --- a/gist/browser.c +++ b/gist/browser.c @@ -792,7 +792,7 @@ static int MakeX(int help) p_stderr("gist: (SYNTAX) dpi unintelligble in display command\n"); return 0; } - if (dpi<40 && dpi>200) { + if (dpi<40 || dpi>200) { p_stderr( "gist: (SYNTAX) dpi not between 40 and 200 in display command\n"); return 0; diff --git a/i0/graph.i b/i0/graph.i index 19d1f20..7134278 100644 --- a/i0/graph.i +++ b/i0/graph.i @@ -15,7 +15,8 @@ extern window; private=0/1, hcp="hcp_filename", dump=0/1, legends=1/0, style="style_sheet_filename", width=wpixels,height=hpixels,rgb=1, - parent=id,xpos=x_in_parent,ypos=y_in_parent + parent=id,xpos=x_in_parent,ypos=y_in_parent, + title="Yorick $n" select window N as the current graphics output window. N may range from 0 to 63, inclusive. Each graphics window corresponds to @@ -40,6 +41,9 @@ extern window; of hardcopy paper. Supplying these keywords will not change the size of an existing window; only newly created windows. + By default, the X xindow title is "Yorick $n" with $n the window + number. Keyword title can be used to specify any other name. + By default, an X window will attempt to use shared colors, which permits several Yorick graphics windows (including windows from multiple instances of Yorick) to use a common palette. You can @@ -302,7 +306,7 @@ func no_window(name, style=) As a convenience, no_window accepts a style= keyword, which it will pass along to the window command. If you need to set other window properties, call the window function after no_window. - + Additionally, the no_window function changes the behavior of the single picture commands hcps, eps, pdf, png, jpeg (and other functions based on the hcps command) to write the current drawing to the specified diff --git a/i0/std.i b/i0/std.i index f15daee..34c2e81 100644 --- a/i0/std.i +++ b/i0/std.i @@ -1695,7 +1695,7 @@ func median(x, which) if (is_void(which)) which= 1; list= sort(x, which); dims= dimsof(x); - if (which<1) which= dims(1)-which; + if (which<1) which= dims(1)+which; n= dims(1+which); odd= n%2; n/= 2; /* index with half above, half below... */ diff --git a/yorick/graph.c b/yorick/graph.c index 8141cb8..6c67b58 100644 --- a/yorick/graph.c +++ b/yorick/graph.c @@ -1939,10 +1939,10 @@ static char *GetHCPname(int n) } #undef N_KEYWORDS -#define N_KEYWORDS 14 +#define N_KEYWORDS 15 static char *windowKeys[N_KEYWORDS+1]= { "display", "dpi", "private", "hcp", "legends", "dump", "style", "wait", - "width", "height", "rgb", "parent", "xpos", "ypos", 0 }; + "width", "height", "rgb", "parent", "xpos", "ypos", "title", 0 }; static Instruction *yg_pc_resume = 0; extern void yg_got_expose(void); @@ -1961,6 +1961,7 @@ void Y_window(int nArgs) int wait_for_expose = 0; int rgb = 0; int n0 = GhGetPlotter(); + const char* title = NULL; if (stack<=sp && YNotNil(stack++)) { n= (int)YGetInteger(stack-1); @@ -2007,6 +2008,12 @@ void Y_window(int nArgs) } #endif + if (YNotNil(keySymbols[14])) { + title = YGetString(keySymbols[14]); + } else { + title = window_name(n); + } + if (nGiven || keySymbols[0] || keySymbols[1] || keySymbols[2]) { /* display= and/or dpi= keywords */ char *display= 0; @@ -2046,7 +2053,7 @@ void Y_window(int nArgs) #ifndef NO_XLIB gist_private_map = privmap; gist_rgb_hint = rgb; - engine= DISPLAY_ENGINE(window_name(n), 0, dpi, display); + engine= DISPLAY_ENGINE(title, 0, dpi, display); if (!engine) YError("failed to open X display or create X window"); else wait_for_expose = 1; ghDevices[n].display= engine; @@ -2072,10 +2079,10 @@ void Y_window(int nArgs) if (hcp && hcp[0]) { long len= strlen(hcp); if (len>3 && strcmp(&hcp[len-3], ".ps")==0) { - engine= GpPSEngine(window_name(n), 0, hcpDump, SetHCPname(n, hcp)); + engine= GpPSEngine(title, 0, hcpDump, SetHCPname(n, hcp)); if (!engine) YError("failed to create PostScript file"); } else { - engine= GpCGMEngine(window_name(n), 0, hcpDump, SetHCPname(n, hcp)); + engine= GpCGMEngine(title, 0, hcpDump, SetHCPname(n, hcp)); if (!engine) YError("failed to create binary CGM file"); } ghDevices[n].hcp= engine; diff --git a/yorick/ops.c b/yorick/ops.c index 956dd25..4e167cb 100644 --- a/yorick/ops.c +++ b/yorick/ops.c @@ -580,9 +580,11 @@ void CallShell(void) void Y_system(int nArgs) { char *line; + int retval; if (nArgs!=1) YError("system function takes exactly one argument"); line= YGetString(sp); - if (line && line[0]) p_system(line); + if (line && line[0]) retval = p_system(line); + PushIntValue(retval); } /* ------------------------------------------------------------------------ */