[rkward-cvs] SF.net SVN: rkward-code:[4731] trunk/rkward/rkward/rbackend/rpackages/ rkward

tfry at users.sf.net tfry at users.sf.net
Mon Apr 29 07:35:04 UTC 2013


Revision: 4731
          http://sourceforge.net/p/rkward/code/4731
Author:   tfry
Date:     2013-04-29 07:35:01 +0000 (Mon, 29 Apr 2013)
Log Message:
-----------
rename rk.capture.device to rk.embed.device

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/NAMESPACE
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_graphics.R
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R

Added Paths:
-----------
    trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd

Removed Paths:
-------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.capture.device.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/NAMESPACE
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/NAMESPACE	2013-04-28 09:27:06 UTC (rev 4730)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/NAMESPACE	2013-04-29 07:35:01 UTC (rev 4731)
@@ -1,6 +1,7 @@
 export(makeActiveBinding)
 export(.onAttach)
 export(q)
+export(Quartz)
 export(quit)
 export(require)
 export(RK)
@@ -9,7 +10,6 @@
 export(.rk.cached.available.packages)
 export(rk.call.plugin)
 export(.rk.callstack.info)
-export(rk.capture.device)
 export(.rk.cat.output)
 export(rk.clear.plot.history)
 export(.rk.data.frame.delete.row)
@@ -23,6 +23,7 @@
 export(rk.duplicate.device)
 export(rk.edit)
 export(rk.edit.files)
+export(rk.embed.device)
 export(.rk.find.package.pluginmaps)
 export(rk.first.plot)
 export(.rk.fix.assignments)

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_graphics.R	2013-04-28 09:27:06 UTC (rev 4730)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_graphics.R	2013-04-29 07:35:01 UTC (rev 4731)
@@ -4,26 +4,8 @@
 # overriding x11 to get informed, when a new x11 window is opened
 #' @export
 "rk.screen.device" <- function (...) {
-	args <- list (...)
-	rk.capture.device ({
-		if (!exists (".rk.default.device")) {
-			if (base::.Platform$OS.type == "unix") {
-				device <- grDevices::x11
-			} else {
-				device <- grDevices::windows
-				if (is.null (args[["width"]])) args[["width"]] <- options ("rk.screendevice.width")[[1]]
-				if (!is.numeric (args[["width"]])) args[["width"]] <- 7
-				if (is.null (args[["height"]])) args[["height"]] <- options ("rk.screendevice.height")[[1]]
-				if (!is.numeric (args[["height"]])) args[["height"]] <- 7
-			}
-		} else {
-			device <- .rk.default.device
-			if (is.character (.rk.default.device)) {
-				device <- get (.rk.default.device)
-			}
-		}
-		do.call (device, args)
-	})
+	.Deprecated("RK")
+	dev.new (...)
 }
 
 # Fetch the current size of the given RK() device from the frontend, and redraw

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2013-04-28 09:27:06 UTC (rev 4730)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2013-04-29 07:35:01 UTC (rev 4731)
@@ -128,23 +128,23 @@
 	invisible (ret)	# Current always NULL
 }
 
-#' Capture / embed non-RKWard device windows
+#' Embed non-RKWard device windows
 #'
-#' \code{rk.capture.device} evaluates the given expression, and if this has created a window on the screen, tries to embed it as an RKWard window.
+#' \code{rk.embed.device} evaluates the given expression, and if this has created a window on the screen, tries to embed it as an RKWard window.
 #'
 #' @param expr  Expression to evaluate. 
 #'
 #' @details Theoretically, \code{expr} can be any valid R expression. However typically this should be calls to X11(), Windows(), or, perhaps dev.copy().
-#'       Importantly, the expression should create exactly one new window for \code{rk.capture.device()} to work. Keep in mind, that this is not
+#'       Importantly, the expression should create exactly one new window for \code{rk.embed.device()} to work. Keep in mind, that this is not
 #'       always the case for \code{plot(...)} and similar commands, which will re-use an existing plot window, if available.
 #'
-#' @note \code{rk.capture.device()} will not work on all platforms (most importantly, not in most MacOSX binaries). Further, note that a captured
+#' @note \code{rk.embed.device()} will not work on all platforms (most importantly, not in most MacOSX binaries). Further, note that a captured
 #'       \code{X11()} or \code{Windows} device may look similar to an \code{RK()} device, but is actually a very different thing.
 #'
 #' @seealso \link{RK}
 #'
 #' @export
-"rk.capture.device" <- function (expr) {
+"rk.embed.device" <- function (expr) {
 	oldd <- dev.cur ()
 	.rk.do.call ("startOpenX11", as.character (oldd));
 	on.exit (.rk.do.call ("endOpenX11", as.character (dev.cur())));
@@ -178,7 +178,7 @@
 				if (!is.numeric (width)) width <- 7
 				if (missing (height)) height <- getOption ("rk.screendevice.height")
 				if (!is.numeric (height)) height <- 7
-				rk.capture.device (eval (body (grDevices::devicename)))
+				rk.embed.device (eval (body (grDevices::devicename)))
 			} else {
 				eval (body (grDevices::devicename))
 			}
@@ -197,26 +197,26 @@
 #
 # These functions override the platform specific on-screen plotting devices by the same names.
 # The exact behavior depends on configuration settings, and can be one of: The original R device,
-# the original R device embedded using \code{rk.capture.device()}, or the call can be re-directed
+# the original R device embedded using \code{rk.embed.device()}, or the call can be re-directed
 # to the \code{RK()} device. In the last case not all function arguments may be honored.
 #
 # @note If you want to use the \link{RK} device, you should call that, explicitly. These
 #       overrides are provided to make it easy to use scripts that refer to the platform specific
 #       plotting devices provided by R.
 #
-# @seealso \link{RK} \link{rk.capture.device} \link[grDevices]{X11} \link[grDevices]{Windows}
+# @seealso \link{RK} \link{rk.embed.device} \link[grDevices]{X11} \link[grDevices]{Windows}
 #
 # @rdname DeviceOverrides
 #' @export
-"X11" <- rk.screen.device
-# NOTE: Not yet activated. Need to work on settings UI, first
-#"X11" <- .rk.make.device.wrapper ("X11")
+"X11" <- .rk.make.device.wrapper ("X11")
 #' @export
 "x11" <- X11
 #' @export
 "windows" <- .rk.make.device.wrapper ("windows")
 #' @export
 "win.graph" <- .rk.make.device.wrapper ("win.graph")  # NOTE: Has different formals() than windows()
+#' @export
+"Quartz" <- .rk.make.device.wrapper ("Quartz")
 
 #' Device for printing using the KDE print dialog
 #' 

Deleted: trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.capture.device.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.capture.device.Rd	2013-04-28 09:27:06 UTC (rev 4730)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.capture.device.Rd	2013-04-29 07:35:01 UTC (rev 4731)
@@ -1,35 +0,0 @@
-\name{rk.capture.device}
-\alias{rk.capture.device}
-\title{Capture / embed non-RKWard device windows}
-\usage{
-  rk.capture.device(expr)
-}
-\arguments{
-  \item{expr}{Expression to evaluate.}
-}
-\description{
-  \code{rk.capture.device} evaluates the given expression,
-  and if this has created a window on the screen, tries to
-  embed it as an RKWard window.
-}
-\details{
-  Theoretically, \code{expr} can be any valid R expression.
-  However typically this should be calls to X11(),
-  Windows(), or, perhaps dev.copy().  Importantly, the
-  expression should create exactly one new window for
-  \code{rk.capture.device()} to work. Keep in mind, that
-  this is not always the case for \code{plot(...)} and
-  similar commands, which will re-use an existing plot
-  window, if available.
-}
-\note{
-  \code{rk.capture.device()} will not work on all platforms
-  (most importantly, not in most MacOSX binaries). Further,
-  note that a captured \code{X11()} or \code{Windows}
-  device may look similar to an \code{RK()} device, but is
-  actually a very different thing.
-}
-\seealso{
-  \link{RK}
-}
-

Copied: trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd (from rev 4729, trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.capture.device.Rd)
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd	                        (rev 0)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/man/rk.embed.device.Rd	2013-04-29 07:35:01 UTC (rev 4731)
@@ -0,0 +1,35 @@
+\name{rk.embed.device}
+\alias{rk.embed.device}
+\title{Embed non-RKWard device windows}
+\usage{
+  rk.embed.device(expr)
+}
+\arguments{
+  \item{expr}{Expression to evaluate.}
+}
+\description{
+  \code{rk.embed.device} evaluates the given expression,
+  and if this has created a window on the screen, tries to
+  embed it as an RKWard window.
+}
+\details{
+  Theoretically, \code{expr} can be any valid R expression.
+  However typically this should be calls to X11(),
+  Windows(), or, perhaps dev.copy().  Importantly, the
+  expression should create exactly one new window for
+  \code{rk.embed.device()} to work. Keep in mind, that this
+  is not always the case for \code{plot(...)} and similar
+  commands, which will re-use an existing plot window, if
+  available.
+}
+\note{
+  \code{rk.embed.device()} will not work on all platforms
+  (most importantly, not in most MacOSX binaries). Further,
+  note that a captured \code{X11()} or \code{Windows}
+  device may look similar to an \code{RK()} device, but is
+  actually a very different thing.
+}
+\seealso{
+  \link{RK}
+}
+





More information about the rkward-tracker mailing list