The R Project SVN R

Rev

Rev 6648 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6648 Rev 6994
Line 927... Line 927...
927
static void NHelpKeyIn(control w,int key)
927
static void NHelpKeyIn(control w,int key)
928
{
928
{
929
    DevDesc *dd = (DevDesc *) getdata(w);
929
    DevDesc *dd = (DevDesc *) getdata(w);
930
    x11Desc *xd = (x11Desc *) dd->deviceSpecific;
930
    x11Desc *xd = (x11Desc *) dd->deviceSpecific;
931
 
931
 
932
    if (getkeystate() != CtrlKey)
932
    if (ggetkeystate() != CtrlKey)
933
	return;
933
	return;
934
    key = 'A' + key - 1;
934
    key = 'A' + key - 1;
935
    if (key == 'C')
935
    if (key == 'C')
936
	menuclpbm(xd->mclpbm);
936
	menuclpbm(xd->mclpbm);
937
    if (dd->displayList == R_NilValue)
937
    if (dd->displayList == R_NilValue)
Line 1851... Line 1851...
1851
    /* must free(dd) */
1851
    /* must free(dd) */
1852
 
1852
 
1853
    int   ps;
1853
    int   ps;
1854
    x11Desc *xd;
1854
    x11Desc *xd;
1855
    rect  rr;
1855
    rect  rr;
1856
    int a, d, w;
1856
    int a=0, d=0, w=0;
1857
 
1857
 
1858
    /* allocate new device description */
1858
    /* allocate new device description */
1859
    if (!(xd = (x11Desc *) malloc(sizeof(x11Desc))))
1859
    if (!(xd = (x11Desc *) malloc(sizeof(x11Desc))))
1860
	return 0;
1860
	return 0;
1861
 
1861
 
Line 1909... Line 1909...
1909
    dd->dp.top = (xd->kind == PRINTER) ? rr.y : 0;	/* top */
1909
    dd->dp.top = (xd->kind == PRINTER) ? rr.y : 0;	/* top */
1910
    dd->dp.bottom = dd->dp.top + rr.height;	/* bottom */
1910
    dd->dp.bottom = dd->dp.top + rr.height;	/* bottom */
1911
 
1911
 
1912
 
1912
 
1913
    /* Nominal Character Sizes in Pixels */
1913
    /* Nominal Character Sizes in Pixels */
1914
    gcharmetric(xd->gawin, xd->font, 0, &a, &d, &w);
1914
    gcharmetric(xd->gawin, xd->font, -1, &a, &d, &w);
1915
    dd->dp.cra[0] = w;
1915
    dd->dp.cra[0] = w;
1916
    dd->dp.cra[1] = a + d;
1916
    dd->dp.cra[1] = a + d;
1917
    /* Character Addressing Offsets */
1917
    /* Character Addressing Offsets */
1918
    /* These are used to plot a single plotting character */
1918
    /* These are used to plot a single plotting character */
1919
    /* so that it is exactly over the plotting point */
1919
    /* so that it is exactly over the plotting point */
Line 1966... Line 1966...
1966
	errorcall(call, "invalid filename argument");
1966
	errorcall(call, "invalid filename argument");
1967
    fn = CHAR(STRING(filename)[0]);
1967
    fn = CHAR(STRING(filename)[0]);
1968
    fixslash(fn);
1968
    fixslash(fn);
1969
    type = CADDR(args);
1969
    type = CADDR(args);
1970
    if (!isString(type) || LENGTH(type) != 1)
1970
    if (!isString(type) || LENGTH(type) != 1)
1971
	errorcall(call, "invalid filename argument");
1971
	errorcall(call, "invalid type argument");
1972
    tp = CHAR(STRING(type)[0]);
1972
    tp = CHAR(STRING(type)[0]);
1973
 
1973
 
1974
    if(!strcmp(tp, "png")) {
1974
    if(!strcmp(tp, "png")) {
1975
	SaveAsPng(dd, fn);
1975
	SaveAsPng(dd, fn);
1976
    } else if (!strcmp(tp,"bmp")) {
1976
    } else if (!strcmp(tp,"bmp")) {