The R Project SVN R

Rev

Rev 52666 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 52666 Rev 52804
Line 1018... Line 1018...
1018
		size = GlobalSize(hglb);
1018
		size = GlobalSize(hglb);
1019
		ans = allocVector(RAWSXP, size); /* no R allocation below */
1019
		ans = allocVector(RAWSXP, size); /* no R allocation below */
1020
		pans = RAW(ans);
1020
		pans = RAW(ans);
1021
		for (j = 0; j < size; j++) pans[j] = *pc++;
1021
		for (j = 0; j < size; j++) pans[j] = *pc++;
1022
	    } else if (format == CF_UNICODETEXT) {
1022
	    } else if (format == CF_UNICODETEXT) {
1023
		char *text; int n, ienc = CE_NATIVE;
1023
		int n, ienc = CE_NATIVE;
1024
		const wchar_t *wpc = (wchar_t *) pc;
1024
		const wchar_t *wpc = (wchar_t *) pc;
1025
		n = wcslen(wpc);
1025
		n = wcslen(wpc);
1026
		text = alloca(2 * (n+1));  /* UTF-8 is at most 1.5x longer */
1026
		char text[2 * (n+1)];  /* UTF-8 is at most 1.5x longer */
1027
		R_CheckStack();
1027
		R_CheckStack();
1028
		wcstoutf8(text, wpc, n+1);
1028
		wcstoutf8(text, wpc, n+1);
1029
		if(!strIsASCII(text)) ienc = CE_UTF8;
1029
		if(!strIsASCII(text)) ienc = CE_UTF8;
1030
		ans = splitClipboardText(text, ienc);
1030
		ans = splitClipboardText(text, ienc);
1031
	    } else if (format == CF_TEXT || format == CF_OEMTEXT) {
1031
	    } else if (format == CF_TEXT || format == CF_OEMTEXT) {
Line 1647... Line 1647...
1647
    xd = (gadesc *) gdd->dev->deviceSpecific;
1647
    xd = (gadesc *) gdd->dev->deviceSpecific;
1648
    if (!xd) return(NULL);
1648
    if (!xd) return(NULL);
1649
    return getHandle(xd->gawin);
1649
    return getHandle(xd->gawin);
1650
}
1650
}
1651
 
1651
 
-
 
1652
/* This assumes a menuname of the form 
1652
/* This assumes a menuname of the form $Graph<nn>Main, $Graph<nn>Popup, $Graph<nn>LocMain,
1653
   $Graph<nn>Main, $Graph<nn>Popup, $Graph<nn>LocMain,
1653
   or $Graph<nn>LocPopup where <nn> is the
1654
   or $Graph<nn>LocPopup where <nn> is the
1654
   device number.  We've already checked the $Graph prefix. */
1655
   device number.  We've already checked the $Graph prefix. */
1655
 
1656
 
1656
menu getGraphMenu(const char* menuname)
1657
menu getGraphMenu(const char* menuname)
1657
{
1658
{
Line 1813... Line 1814...
1813
}
1814
}
1814
 
1815
 
1815
static SEXP mkCharUcs(wchar_t *name)
1816
static SEXP mkCharUcs(wchar_t *name)
1816
{
1817
{
1817
    int n = wcslen(name), N = 3*n+1;
1818
    int n = wcslen(name), N = 3*n+1;
1818
    char *buf;
1819
    char buf[N];
1819
    buf = alloca(N);
-
 
1820
    R_CheckStack();
1820
    R_CheckStack();
1821
    wcstombs(buf, name, N); buf[N-1] = '\0';
1821
    wcstombs(buf, name, N); buf[N-1] = '\0';
1822
    return mkCharCE(buf, CE_UTF8);
1822
    return mkCharCE(buf, CE_UTF8);
1823
}
1823
}
1824
 
1824