Commit a71d0fd9 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 2.11.1

parent 5b7b5f4d
This diff is collapsed.
Revision: 51801
Last Changed Date: 2010-04-22
Revision: 52157
Last Changed Date: 2010-05-31
This diff is collapsed.
......@@ -535,7 +535,8 @@ R_PROG_INSTALL
## we would like a POSIX sed, and need one on Solaris
AC_PATH_PROGS(SED, sed, /bin/sed, [/usr/xpg4/bin:$PATH])
AC_PATH_PROGS(TR, tr, /bin/tr, [/usr/xpg4/tr:$PATH])
## we need an tr that interprets \r for Rdiff
AC_PATH_PROGS(TR, tr, /bin/tr, [/usr/xpg4/bin:$PATH])
## Make
: ${MAKE=make}
AC_SUBST(MAKE)
......@@ -544,7 +545,7 @@ R_PROG_PAGER
## Perl
R_PROG_PERL
## Tar -- we prefer a GNU version
AC_PATH_PROGS(TAR, [${TAR} gtar tar], "")
AC_PATH_PROGS(TAR, [${TAR} gtar gnutar tar], "")
## TeXMF stuff
R_PROG_TEXMF
## Unzip && zip && gzip && bip2
......
......@@ -17,7 +17,7 @@ Windows distributions.
---------------------------------------------------
The some of the public header files are distributed under the more
Some of the public header files are distributed under the more
permissive terms of the file COPYING.LIB. This applies only to the
files
......@@ -94,6 +94,8 @@ src/library/grDevices/inst/afm/cm*.afm
doc/manual/R-intro.texi
in part
Copyright (C) 1990 W. N. Venables
Copyright (C) 1992 W. N. Venables & D. M. Smith
Copyright (C) 1997 R. Gentleman & R. Ihaka
......@@ -394,7 +396,7 @@ http://lists.gnu.org/archive/html/bug-gnulib/2003-02/msg00019.html
Distributed under the GNU Library General Public License
version 2 or later.
src/main/Rstrptime.c
src/main/Rstrptime.h
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
Distributed under the GNU Library General Public License
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -541,8 +541,7 @@ interesting object in the package, giving its name and a description
be included). Normally this file is missing, and the corresponding
information is automatically generated from the documentation sources
(using @code{Rdindex()} from package @pkg{tools}) when installing from
source and when using the package builder (@pxref{Checking and building
packages}).
source.
Rather than editing this file, it is preferable to put customized
information about the package into an overview man page
......@@ -652,11 +651,12 @@ want to ship Ratfor source files, please do so in a subdirectory of
@file{src} and not in the main subdirectory.}, Objective C and Objective
C++@footnote{either or both of which may not be supported on particular
platforms} with associated extensions @file{.c}, @file{.cc} or
@file{.cpp} or @file{.C}, @file{.f}, @file{.f90} or @file{.f95},
@file{.m}, and @file{.mm} or @file{.M}, respectively. We recommend
using @file{.h} for headers, also for C++@footnote{Using @file{.hpp},
although somewhat popular, is not guaranteed to be portable.} or Fortran
9x include files.
@file{.cpp}, @file{.f}, @file{.f90} or @file{.f95}, @file{.m}, and
@file{.mm} or @file{.M}, respectively. We recommend using @file{.h} for
headers, also for C++@footnote{Using @file{.hpp}, although somewhat
popular, is not guaranteed to be portable.} or Fortran 9x include files.
(Use of @file{.C} for C++ is now deprecated and will be removed in @R{}
2.12.0.)
It is not portable (and may not be possible at all) to mix all these
languages in a single package, and we do not support using both C++ and
......@@ -944,7 +944,7 @@ which is a minimal version of Bourne-style @command{sh}.) When
@env{R_HOME}@footnote{and also @env{RHOME} for backwards compatiblity,
but this will be removed in future.} and @env{R_ARCH} will be set.
Use @env{R_ARCH} to decide if this is a 64-bit build (its value there is
@samp{/x64} and to install DLLs to the correct place
@samp{/x64}) and to install DLLs to the correct place
(@code{$@{R_HOME@}/libs$@{R_ARCH@}}).
In some rare circumstances, the configuration and cleanup scripts need
......@@ -1007,7 +1007,7 @@ GCC.
There are some macros which are built whilst configuring the building of
@R{} itself and are stored in
@file{@var{R_HOME}/etc@var{R_ARCH}/Makeconf}. That makefile is included
as a @file{Makefile} @emph{before} @file{Makevars[.win]}, and so the
as a @file{Makefile} @emph{after} @file{Makevars[.win]}, and the
macros it defines can be used in the latter. These include
@table @code
......@@ -1128,6 +1128,46 @@ directory for some purpose other than building a DLL, use a
It is sometimes useful to have a target @samp{clean} in @file{Makevars}
or @file{Makevars.win}: this will be used by @command{R CMD build}.
If you want to run @R{} code in @file{Makevars}, e.g.@: to find
configuration information, please do ensure that you use the correct
copy of @code{R} or @code{Rscript}: there might not be one in the path
at all, or it might be the wrong version or architecture. The correct
way to do this is @emph{via}
@example
$(R_HOME)/bin$(R_ARCH_BIN)/Rscript @var{filename}
$(R_HOME)/bin$(R_ARCH_BIN)/Rscript -e '@var{R expression}'
@end example
@noindent
where @code{$(R_ARCH_BIN)} is only needed currently on Windows.
Since @file{Makeconf} is included after @file{Makevars[.win]}, the values
of the macros it defines cannot be used in GNU-style conditionals. However,
environment variables can be and so for example a way on Windows to
select different macros for 32- and 64-bit code is
@example
ifeq "$@{R_ARCH@}" "/x64"
PKG_LIBS = @var{value for 64-bit Windows}
else
PKG_LIBS = @var{value for 32-bit Windows}
endif
@end example
@noindent
To make this simpler, as from @R{} 2.11.1 (but not in @R{} 2.11.0) you
can use
@example
ifeq "$(WIN)" "64"
PKG_LIBS = @var{value for 64-bit Windows}
else
PKG_LIBS = @var{value for 32-bit Windows}
endif
@end example
@menu
* Back-compatibility for Makevars::
@end menu
......@@ -2449,6 +2489,9 @@ file by
SystemRequirements: GNU make
@end example
Since the only viable make for Windows is GNU make, it is permissible to
use GNU extensions in files @file{Makevars.win} or @file{Makefile.win}.
@item
Make use of the abilities of your compilers to check the
standards-conformance of your code. For example, @command{gcc} can be used
......@@ -2472,10 +2515,16 @@ on most @R{} platforms (including those mostly used by the
platforms. It is rather unlikely that the use of @code{long} in C code
has been thought through: if you need a longer type than @code{int} you
should use a configure test for a C99 type such as @code{int_fast64_t}
(and failing that, @code{long long}, but not that @code{long long} is
not a standard C++ type, and C++ compilers set up for strict checking
will reject it) and typedef your own type to be @code{long} or
(and failing that, @code{long long} @footnote{but note that @code{long
long} is not a standard C++ type, and C++ compilers set up for strict
checking will reject it}) and typedef your own type to be @code{long} or
@code{long long}, or use another suitable type (such as @code{size_t}).
It is not safe to assume that @code{long} and pointer types are the same
size, and they are not on 64-bit Windows. If you need to convert
pointers to and from integers use the C99 integer types @code{intptr_t}
and @code{uintptr_t}.
Note that @code{integer} in @acronym{FORTRAN} corresponds to @code{int}
in C on all @R{} platforms.
......@@ -9025,6 +9074,7 @@ The most useful function for printing from a C routine compiled into
@code{printf}, but is guaranteed to write to @R{}'s output (which might
be a @acronym{GUI} console rather than a file). It is wise to write
complete lines (including the @code{"\n"}) before returning to @R{}.
It is defined in @file{R_ext/Print.h}.
The function @code{REprintf} is similar but writes on the error stream
(@code{stderr}) which may or may not be different from the standard
......@@ -9878,11 +9928,13 @@ static R_INLINE int ind_2(int l, int j)
@end example
Be aware that using inlining with functions in more than one compilation
unit is almost impossible to do portably: see
@uref{http://www.greenend.org.uk/rjk/2003/03/inline.html}. All the @R{}
unit is almost impossible to do portably, see
@uref{http://www.greenend.org.uk/rjk/2003/03/inline.html}, so this usage
is for @code{static} functions as in the example. All the @R{}
configure code has checked is that @code{R_INLINE} can be used in a
single C file with the compiler used to build @R{}. We recommend that
packages making extensive use of inlining include their own configure code.
packages making extensive use of inlining include their own configure
code.
@node Controlling visibility, Standalone Mathlib, Inlining C functions, The R API
@section Controlling visibility
......@@ -11014,15 +11066,15 @@ Both applications which embed @R{} and those which use a @code{system}
call to invoke @R{} (as @command{Rscript.exe}, @command{Rterm.exe} or
@command{R.exe}) need to be able to find the @R{} @file{bin} directory.
The simplest way to do so is the ask the user to set an environment
variable @env{R_HOME} and use that, but naive users may be fluxommed as
variable @env{R_HOME} and use that, but naive users may be flummoxed as
to how to do so or what value to use.
The @R{} for Windows installers have for a long time allowed the value
of @code{R_HOME} to be recorded in the Windows Registry: this is
optional but the default. Where is it is recorded has changed over the
years to allow for multiple versions of @R{} to be installed at once,
and as from @R{} 2.11.0, to allow 32- and 64-bit versions of @R{} to be
installed on the same machine.
optional but selected by default. @emph{Where} is it is recorded has
changed over the years to allow for multiple versions of @R{} to be
installed at once, and as from @R{} 2.11.0, to allow 32- and 64-bit
versions of @R{} to be installed on the same machine.
The basic Registry location is @code{Software\R-core\R}. For an
administrative install this is under @code{HKEY_LOCAL_MACHINE} and on a
......
: ${JAVA_HOME=@JAVA_HOME@}
: ${R_JAVA_LD_LIBRARY_PATH=@R_JAVA_LD_LIBRARY_PATH@}
if test -n "@R_LD_LIBRARY_PATH@"; then
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib@R_ARCH@:@R_LD_LIBRARY_PATH@}
else
: ${R_LD_LIBRARY_PATH=${R_HOME}/lib@R_ARCH@}
fi
if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
fi
......
......@@ -83,7 +83,7 @@ if test -n "${JAVAC}"; then
rm -f A.java A.class
echo "public class A { }" > A.java
if "${JAVAC}" A.java 2>&AS_MESSAGE_LOG_FD; then
if test -e A.class; then
if test -f A.class; then
r_cv_javac_works=yes
fi
fi
......@@ -96,7 +96,7 @@ if test "${r_cv_javac_works}" = yes; then
rm -f A.java A.class
echo "public class A { }" > A.java
if "${JAVAC}" -source 1.4 -target 1.4 A.java 2>&AS_MESSAGE_LOG_FD; then
if test -e A.class; then
if test -f A.class; then
r_cv_javac14_works=yes
fi
fi
......@@ -178,7 +178,7 @@ if test ${r_cv_java_works} = yes; then
## includes consist of two parts - jni.h and machine-dependent jni_md.h
jinc=''
for pinc in include ../include jre/include; do
if test -e "${JAVA_HOME}/${pinc}/jni.h"; then jinc="${JAVA_HOME}/${pinc}"; break; fi
if test -f "${JAVA_HOME}/${pinc}/jni.h"; then jinc="${JAVA_HOME}/${pinc}"; break; fi
done
## only if we get jni.h we can try to find jni_md.h
if test -n "${jinc}"; then
......@@ -196,7 +196,7 @@ if test ${r_cv_java_works} = yes; then
## prepend . and append less-likely ones
jmdirs=". ${jmdirs} genunix ppc x86 iris hp-ux aix win32 cygwin openbsd"
for pimd in ${jmdirs}; do
if test -e "${jinc}/${pimd}/jni_md.h"; then jmdinc="${jinc}/${pimd}"; break; fi
if test -f "${jinc}/${pimd}/jni_md.h"; then jmdinc="${jinc}/${pimd}"; break; fi
done
if test -z "${jmdinc}"; then
# ultima-ratio: use find and pray that it works
......
......@@ -60,7 +60,7 @@ assign("ptime", proc.time(), pos = "CheckExEnv")
## Use postscript as incomplete files may be viewable, unlike PDF.
## Choose a size that is close to on-screen devices, fix paper
grDevices::ps.options(width = 7, height = 7, paper = "a4", reset = TRUE)
grDevices::postscript(paste(pkgname, "-Ex.ps", sep=""))
grDevices::postscript(paste(pkgname, "-Ex.ps", sep=""), encoding = "ISOLatin1")
assign("par.postscript", graphics::par(no.readonly = TRUE), pos = "CheckExEnv")
options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly"))
......@@ -3,5 +3,6 @@
R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk
R_PKGS_RECOMMENDED = boot cluster codetools foreign KernSmooth lattice mgcv nlme rpart survival MASS class nnet spatial Matrix
# mgcv requires nlme and MASS, but that is handled in src/library/Recommended/Makefile*
R_PKGS_RECOMMENDED = MASS lattice Matrix nlme survival boot cluster codetools foreign KernSmooth rpart class nnet spatial mgcv
# there are dependencies in src/library/Recommended/Makefile*
# which this order respects
......@@ -90,6 +90,12 @@
#define _(String) (String)
#endif
#ifdef Win32
/* avoid latest MinGW's redefinition in stdio.h */
int trio_sprintf(char *buffer, const char *format, ...);
#define sprintf trio_sprintf
#endif
/*
The declaration for x is unusual for a .C() but is managed by
casting in the code itself. However, it does mean that we cannot
......
......@@ -147,23 +147,6 @@ static void getappname(HANDLE Instance)
setappname(title);
}
#if 0
/*
* Special function for making printf work on Windows systems.
* This function is never called, it merely tricks the compiler into
* including printf and scanf support.
*/
void app_init_printf(void)
{
#ifdef __BORLANDC__
#if __BORLANDC__ <= 0x410
_InitEasyWin();
#endif
#else
printf(" ");
#endif
}
#endif
/*
* The main Windows entry point is the WinMain function.
......
......@@ -143,6 +143,7 @@ lzma_strm_init(lzma_stream *strm)
strm->internal->supported_actions[LZMA_FULL_FLUSH] = false;
strm->internal->supported_actions[LZMA_FINISH] = false;
strm->internal->sequence = ISEQ_RUN;
strm->internal->allow_buf_error = false;
strm->total_in = 0;
strm->total_out = 0;
......
......@@ -13,6 +13,28 @@
**************************************************
CHANGES IN R VERSION 2.11.1
NEW FEATURES
o The Rgui console, pagers and editor on the 64-bit build now have
a title bar icon.
o The outer frame/console for Rgui/Rterm mentions '(64-bit)' to
make it easier to distinguish running copies of R.
o The package entries in listbox shown by the 'Install package(s)
...' menu are now explicitly sorted in the current locale
(there were in most previous releases, but not in 2.11.0).
o R CMD INSTALL can install zipfiles as binary packages.
o Errors in the Rconsole file are ignored: silently on startup,
with a warning when Rconsole is loaded interactively.
CHANGES IN R VERSION 2.11.0
......@@ -515,7 +537,7 @@ BUG FIXES
o winDialog() and winDialogString() check that they are being
used in an interactive session.
o The Korean translation of the RGui menus has been corrected
o The Korean translation of the Rgui menus has been corrected
and restored. (Thanks to June Kim and Seung-ho Kang.)
o The list of hives in the readRegistry() defaults contained
......@@ -614,7 +636,7 @@ BUG FIXES
set, semi-transparent text and lines might have been omitted.
o Some (but not all) Korean users have been having problems with
Korean translations of the RGui menus. These had not been
Korean translations of the Rgui menus. These had not been
updated for a long time, and have now been removed.
......
......@@ -72,7 +72,6 @@ FAQ</a> for Windows-specific information.</p>
<ul>
<li><a href="index.html">The current official release.</a></li>
<li>Patches to the official release are incorporated in the <a href="rpatched.html">r-patched snapshot build</a>.</li>
<li><a href="../../windows@OTHERBITSUFFIX@/base">@OTHERBITSIZE@ bit builds for Windows</a></li>
<li><a href="../../windows/base/old/">Previous releases</a></li>
</ul>
......
......@@ -68,7 +68,7 @@ FAQ</a> for Windows-specific information.</p>
<ul>
<li><a href="index.html">The current official release.</a></li>
<li>A build of the development version (which will eventually become
the next major release of R) is available in the <a href="rdevel.html">r-devel snapshot build</a>.
the next major release of R) is available in the <a href="../../windows/base/rdevel.html">r-devel snapshot build</a>.
<li><a href="../../windows@OTHERBITSUFFIX@/base">@OTHERBITSIZE@ bit builds for Windows</a></li>
<li><a href="../../windows/base/old/">Previous releases</a></li>
</ul>
......
......@@ -77,8 +77,10 @@ SEXP do_winver(SEXP call, SEXP op, SEXP args, SEXP env)
(int) osvi.dwMajorVersion, (int) osvi.dwMinorVersion,
LOWORD(osvi.dwBuildNumber));
} else if(osvi.dwMajorVersion == 6) {
if(osvi.wProductType == VER_NT_WORKSTATION) desc = "Vista";
else desc = "Server 2008";
if(osvi.wProductType == VER_NT_WORKSTATION) {
if(osvi.dwMinorVersion == 0) desc = "Vista";
else desc = "7";
} else desc = "Server 2008";
} else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
desc = "2000";
else if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
......@@ -571,6 +573,7 @@ SEXP do_loadRconsole(SEXP call, SEXP op, SEXP args, SEXP env)
errorcall(call, _("invalid '%s' argument"), "file");
getActive(&gui); /* Will get defaults if there's no active console */
if (loadRconsole(&gui, translateChar(STRING_ELT(sfile, 0)))) applyGUI(&gui);
if (strlen(gui.warning)) warning(gui.warning);
return R_NilValue;
}
......@@ -599,9 +602,11 @@ SEXP do_sysinfo(SEXP call, SEXP op, SEXP args, SEXP rho)
PGNSI pGNSI;
SYSTEM_INFO si;
if(osvi.dwMajorVersion == 6) {
if(osvi.wProductType == VER_NT_WORKSTATION)
strcpy(ver, "Vista");
else
if(osvi.wProductType == VER_NT_WORKSTATION) {
if(osvi.dwMinorVersion == 0)
strcpy(ver, "Vista");
else strcpy(ver, "7");
} else
strcpy(ver, "Server 2008");
}
if(osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
......
......@@ -10,14 +10,14 @@ PERL5LIB=${R_SHARE_DIR}/perl;${PERL5LIB}
TEXINPUTS=.;${TEXINPUTS};${R_SHARE_DIR}/texmf;
## from etc/Renviron
R_PLAFORM='i386-pc-mingw32'
#R_PLATFORM='i386-pc-mingw32'
R_PAPERSIZE_USER=${R_PAPERSIZE}
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
## Default TeXMF stuff
R_LATEXCMD=${R_LATEXCMD-${LATEX-'latex'}}
R_PDFLATEXCMD=${R_PDFLATEXCMD-${PDFLATEX-'pdflatex'}}
R_DVIPSCMD=${R_DVIPSCMD-${DVIPS-'dvips'}}
R_MAKEINDEXCMD=${R_MAKEINDEX-${MAKEINDEX-'makeindex'}}
R_MAKEINDEXCMD=${R_MAKEINDEXCMD-${MAKEINDEX-'makeindex'}}
R_RD4DVI=${R_RD4DVI-'ae'}
R_RD4PDF=${R_RD4PDF-'times,hyper'}
R_GZIPCMD=${R_GZIPCMD-'gzip'}
......
......@@ -77,8 +77,8 @@ rcico.o: Rcmd.exe.manifest
rgico.o: Rgui.exe.manifest
rtico.o: Rterm.exe.manifest
else
Rgui.exe: rgui.o rgico64.o
Rterm.exe: rterm.o rtico.o
Rgui.exe: graphappmain.o rgui.o rgico64.o
Rterm.exe: graphappmain.o rterm.o rtico.o
rtico.o: Rterm64.manifest
rgico64.o: Rgui64.manifest
endif
......
......@@ -11,7 +11,21 @@
extern void
GA_startgraphapp(HINSTANCE Instance, HINSTANCE PrevInstance, int CmdShow);
#ifdef WIN64
int PASCAL
WinMain (HINSTANCE Instance, HINSTANCE PrevInstance, LPSTR CmdLine,
int CmdShow)
{
extern int __argc;
extern char **__argv;
extern void AppMain(int argc, char **argv);
GA_startgraphapp(Instance, PrevInstance, CmdShow);
AppMain(__argc, __argv);
return 0;
}
#else
int PASCAL
WinMain (HINSTANCE Instance, HINSTANCE PrevInstance, LPSTR CmdLine,
int CmdShow)
......@@ -25,3 +39,4 @@ WinMain (HINSTANCE Instance, HINSTANCE PrevInstance, LPSTR CmdLine,
return 0;
}
#endif
......@@ -44,13 +44,8 @@ char *getRVersion(void)
#include <wincon.h>
typedef BOOL (*AC)(DWORD);
int
#ifdef WIN64
main
#else
AppMain
#endif
(int argc, char **argv)
int AppMain(int argc, char **argv)
{
AC entry;
......
......@@ -56,13 +56,7 @@ static void my_onintr(int nSig)
PostThreadMessage(mainThreadId,0,0,0);
}
int
#if defined(WIN64) && !defined(FOR_Rscript)
main
#else
AppMain
#endif
(int argc, char **argv)
int AppMain(int argc, char **argv)
{
CharacterMode = RTerm;
if(strcmp(getDLLVersion(), getRVersion()) != 0) {
......@@ -81,7 +75,11 @@ AppMain
gl_hist_init(R_HistorySize, 1);
if (R_RestoreHistory) gl_loadhistory(R_HistoryFile);
saveConsoleTitle();
#ifdef WIN64
SetConsoleTitle("Rterm (64-bit)");
#else
SetConsoleTitle("Rterm");
#endif
}
Rf_mainloop();
/* NOTREACHED */
......
......@@ -150,6 +150,7 @@ void getDefaults(Gui gui)
gui->pointsize = 10;
strcpy(gui->language, "");
gui->buffered = 1;
gui->warning[0] = 0;
#ifdef USE_MDI
gui->toolbar = ((RguiMDI & RW_TOOLBAR) != 0);
......@@ -218,6 +219,7 @@ void getActive(Gui gui)
gui->guiColors[i] = guiColors[i];
/* MDIsize is not currently a choice in the dialog, only in the Rconsole file, so is not set here */
gui->warning[0] = 0;
} else
getDefaults(gui);
}
......@@ -489,6 +491,7 @@ static void load(button b) /* button callback */
getChoices(&newGUI);
if (loadRconsole(&newGUI, optf)) {
if (strlen(newGUI.warning)) askok(newGUI.warning);
cleanup();
showDialog(&newGUI);
}
......@@ -656,14 +659,10 @@ int loadRconsole(Gui gui, const char *optf)
done = 1;
}
}
if (!done) {
char buf[128];
snprintf(buf, 128, G_("Error at line %d of file %s"),
optline(), optfile());
askok(buf);
cfgerr = 1;
}
if (!done)
snprintf(gui->warning, sizeof(gui->warning),
G_("Ignored '%s' at line %d of file %s"),
opt[0], optline(), optfile());
}
return !cfgerr;
}
......
......@@ -41,6 +41,8 @@ struct structGUI
rect MDIsize;
char language[20];
int buffered;
char warning[256]; /* When loading the Rconsole, the warning system isn't set
up, so save one warning here. */
};
typedef struct structGUI *Gui;
......
......@@ -25,9 +25,6 @@
#include <Defn.h>
#ifdef Win32
#define USE_MDI 1
#endif
/* R user interface based on GraphApp */
#include "Defn.h"
#undef append /* defined by graphapp/internal.h */
......@@ -37,9 +34,7 @@
#define GA_EXTERN
#include "graphapp/internal.h"
#include "graphapp/ga.h"
#ifdef USE_MDI
# include "graphapp/stdimg.h"
#endif
#include "graphapp/stdimg.h"
#include "console.h"
#include "rui.h"
......@@ -53,12 +48,10 @@
extern Rboolean UserBreak;
console RConsole = NULL;
#ifdef USE_MDI
int RguiMDI = RW_MDI | RW_TOOLBAR | RW_STATUSBAR;
int MDIset = 0;
window RFrame = NULL; /* some compilers want initialized for export */
rect MDIsize;
#endif
extern int ConsoleAcceptCmd, R_is_running;
extern Rboolean DebugMenuitem;
Rboolean R_LoadRconsole = TRUE; /* used in commandLineArgs */
......@@ -1019,12 +1012,9 @@ int RguiCommonHelp(menu m, HelpMenuItems hmenu)
static int RguiWindowMenu()
{
#ifdef USE_MDI
if (ismdi())
newmdimenu();
else
#endif
{
else {
MCHECK(newmenu(G_("Windows")));
MCHECK(newmenuitem(G_("Cascade"), 0, menucascade));
MCHECK(newmenuitem(G_("Tile &Horizontally"), 0, menutilehoriz));
......@@ -1056,22 +1046,34 @@ int setupui(void)
if(p && isdigit(p[1])) localeCP = atoi(p+1); else localeCP = 1252;
readconsolecfg();
#ifdef USE_MDI
int flags = StandardWindow | Document | Menubar;
if(mbcslocale) flags |= UseUnicode;
if (RguiMDI & RW_MDI) {
TRACERUI("Rgui");
RFrame = newwindow("RGui", MDIsize,
StandardWindow | Menubar | Workspace);
RFrame = newwindow(
#ifdef WIN64
"RGui (64-bit)",
#else
"RGui",
#endif
MDIsize,
StandardWindow | Menubar | Workspace);
setclose(RFrame, closeconsole);
show(RFrame);
TRACERUI("Rgui done");
}
TRACERUI("Console");
if (!(RConsole = newconsole("R Console", flags ))) return 0;
TRACERUI("Console done");
} else {
TRACERUI("Console");
#ifdef WIN64
if (!(RConsole = newconsole("R Console (64-bit)", flags ))) return 0;
#else
if (!(RConsole = newconsole("R Console", flags ))) return 0;
#endif
TRACERUI("Console");
int flags = StandardWindow | Document | Menubar;
if(mbcslocale) flags |= UseUnicode;
if (!(RConsole = newconsole("R Console", flags ))) return 0;
TRACERUI("Console done");
#ifdef USE_MDI
TRACERUI("Console done");
}
if (ismdi()) {
int btsize = 24;
rect r = rect(2, 2, btsize, btsize);
......@@ -1122,7 +1124,6 @@ int setupui(void)
PrintVersionString(s);
setstatus(s);
}
#endif
addto(RConsole);
setclose(RConsole, closeconsole);
setdrop(RConsole, dropconsole);
......@@ -1161,7 +1162,6 @@ int setupui(void)
MCHECK(mde = newmenuitem(G_("Data editor..."), 0, menude));
MCHECK(newmenuitem("-", 0, NULL));