Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry R Michel committed Sep 7, 2023
2 parents 4d3329d + b56f742 commit c707de2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gist/browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions i0/graph.i
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion i0/std.i
Original file line number Diff line number Diff line change
Expand Up @@ -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... */
Expand Down
17 changes: 12 additions & 5 deletions yorick/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion yorick/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/* ------------------------------------------------------------------------ */
Expand Down

0 comments on commit c707de2

Please sign in to comment.