Skip to content

Commit

Permalink
restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Jun 15, 2022
1 parent 2ffdc71 commit 3f0bf4f
Show file tree
Hide file tree
Showing 54 changed files with 100 additions and 15,194 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ License: GPL (>= 2)
Depends:
R (>= 3.2.0)
Imports:
systemfonts (>= 1.0.0)
systemfonts (>= 1.0.0),
unigd
LinkingTo:
cpp11 (>= 0.2.4),
BH (>= 1.75.0),
systemfonts
systemfonts,
unigd
Suggests:
testthat,
xml2 (>= 1.0.0),
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ export(hgd_remove)
export(hgd_renderers)
export(hgd_state)
export(hgd_svg)
export(hgd_test_pattern)
export(hgd_url)
export(hgd_view)
export(hgd_watch)
importFrom(grDevices,dev.cur)
importFrom(grDevices,dev.list)
importFrom(grDevices,dev.off)
importFrom(systemfonts,font_info)
importFrom(systemfonts,match_font)
importFrom(unigd,ugd)
importFrom(utils,browseURL)
importFrom(utils,changedFiles)
importFrom(utils,fileSnapshot)
Expand Down
60 changes: 2 additions & 58 deletions R/cpp11.R
Original file line number Diff line number Diff line change
@@ -1,65 +1,9 @@
# Generated by cpp11: do not edit by hand

httpgd_ <- function(host, port, bg, width, height, pointsize, aliases, cors, token, webserver, silent, fix_text_width, extra_css, reset_par) {
.Call(`_httpgd_httpgd_`, host, port, bg, width, height, pointsize, aliases, cors, token, webserver, silent, fix_text_width, extra_css, reset_par)
}

httpgd_state_ <- function(devnum) {
.Call(`_httpgd_httpgd_state_`, devnum)
}

httpgd_info_ <- function(devnum) {
.Call(`_httpgd_httpgd_info_`, devnum)
}

httpgd_renderers_ <- function() {
.Call(`_httpgd_httpgd_renderers_`)
httpgd_ <- function(devnum, host, port, cors, token, webserver, silent, fix_text_width, extra_css) {
.Call(`_httpgd_httpgd_`, devnum, host, port, cors, token, webserver, silent, fix_text_width, extra_css)
}

httpgd_random_token_ <- function(len) {
.Call(`_httpgd_httpgd_random_token_`, len)
}

httpgd_renderer_is_str_ <- function(renderer_id) {
.Call(`_httpgd_httpgd_renderer_is_str_`, renderer_id)
}

httpgd_renderer_is_raw_ <- function(renderer_id) {
.Call(`_httpgd_httpgd_renderer_is_raw_`, renderer_id)
}

httpgd_plot_find_ <- function(devnum, plot_id) {
.Call(`_httpgd_httpgd_plot_find_`, devnum, plot_id)
}

httpgd_plot_str_ <- function(devnum, page, width, height, zoom, renderer_id) {
.Call(`_httpgd_httpgd_plot_str_`, devnum, page, width, height, zoom, renderer_id)
}

httpgd_plot_raw_ <- function(devnum, page, width, height, zoom, renderer_id) {
.Call(`_httpgd_httpgd_plot_raw_`, devnum, page, width, height, zoom, renderer_id)
}

httpgd_remove_ <- function(devnum, page) {
.Call(`_httpgd_httpgd_remove_`, devnum, page)
}

httpgd_remove_id_ <- function(devnum, id) {
.Call(`_httpgd_httpgd_remove_id_`, devnum, id)
}

httpgd_id_ <- function(devnum, page, limit) {
.Call(`_httpgd_httpgd_id_`, devnum, page, limit)
}

httpgd_clear_ <- function(devnum) {
.Call(`_httpgd_httpgd_clear_`, devnum)
}

httpgd_ipc_open_ <- function() {
invisible(.Call(`_httpgd_httpgd_ipc_open_`))
}

httpgd_ipc_close_ <- function() {
invisible(.Call(`_httpgd_httpgd_ipc_close_`))
}
119 changes: 0 additions & 119 deletions R/fonts.R

This file was deleted.

6 changes: 3 additions & 3 deletions R/httpgd-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
NULL

.onLoad <- function(libname, pkgname) {
httpgd_ipc_open_()
#httpgd_ipc_open_()
}

#' @importFrom grDevices dev.list dev.off
.onUnload <- function (libpath) {
hgd_close(all = TRUE)
httpgd_ipc_close_()
#hgd_close(all = TRUE)
#httpgd_ipc_close_()
library.dynam.unload("httpgd", libpath)
}
14 changes: 7 additions & 7 deletions R/httpgd.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


#' Asynchronous HTTP server graphics device.
#'
#' This function initializes a httpgd graphics device and
Expand Down Expand Up @@ -61,6 +60,7 @@
#' @return No return value, called to initialize graphics device.
#'
#' @importFrom systemfonts match_font
#' @importFrom unigd ugd
#' @export
#'
#' @examples
Expand Down Expand Up @@ -101,12 +101,12 @@ hgd <-
tok <- httpgd_random_token_(8)
}

aliases <- validate_aliases(system_fonts, user_fonts)
if (httpgd_(
host, port, bg, width, height,
pointsize, aliases, cors, tok, webserver, silent,
fix_text_width, extra_css,
reset_par
u <- ugd()

#aliases <- validate_aliases(system_fonts, user_fonts) TODO
if (httpgd_(u,
host, port, cors, tok, webserver, silent,
fix_text_width, extra_css
)) {
if (!silent && webserver) {
cat("httpgd server running at:\n")
Expand Down
Loading

0 comments on commit 3f0bf4f

Please sign in to comment.