useDynLib(dplR, .registration = TRUE, .fixes = "dplR.")


###############################################################
#
## Imports
#
###############################################################

import(graphics, stats)

importFrom(digest, digest)

importFrom(grDevices, dev.hold, dev.flush, rainbow, dev.capabilities,
           dev.cur, png, dev.off, dev.set, devAskNewPage, dev.capture)

importFrom(grid, gpar, grid.lines, grid.newpage, grid.polygon,
           grid.segments, grid.text, pushViewport, seekViewport, unit,
           viewport, vpList, vpTree, plotViewport, grid.grill, upViewport,
           grid.points, popViewport, grid.rect, textGrob, grid.draw,
           segmentsGrob, linesGrob, grobTree)

importFrom(lattice, panel.abline, panel.dotplot, panel.segments,
           trellis.par.set, xyplot)

importFrom(matrixStats, colAlls, colAnys, colMedians, colSds, rowAlls,
           rowAnys, rowSds)

importFrom(png, readPNG)

importFrom(R.utils, captureOutput)

importFrom(stringi, stri_trans_nfc, stri_trans_nfd)

importFrom(stringr, str_pad, str_trim)

importFrom(utils, head, packageDescription, read.fwf, tail,
           packageVersion, write.table, read.table, write.csv)

import(Matrix)

importFrom(XML, xmlEventParse)

importFrom(plyr, alply)

importFrom(signal, butter, filtfilt)

###############################################################
#
## Methods
#
###############################################################

S3method(plot, crn)
S3method(plot, crs)
S3method(plot, rwl)
S3method(print, redfit)
S3method(print, rwl.report)
S3method(summary, rwl)
S3method(time, rwl)
S3method(time, crn)
S3method("time<-", rwl)
S3method("time<-", crn)

###############################################################
#
## Exports
#
###############################################################

export("as.rwl",
       "autoread.ids",
       "bai.in",
       "bai.out",
       "ccf.series.rwl",
       "chron",
       "chron.stabilized",
       "cms",
       "combine.rwl",
       "common.interval",
       "corr.rwl.seg",
       "corr.series.seg",
       "crn.plot",
       "csv2rwl",
       "delete.ring",
       "detrend",
       "detrend.series",
       "ffcsaps",
       "fill.internal.NA",
       "gini.coef",
       "glk.legacy",
       "glk",
       "hanning",
       "i.detrend",
       "i.detrend.series",
       "insert.ring",
       "interseries.cor",
       "latexDate",
       "latexify",
       "morlet",
       "net",
       "pass.filt",
       "plot.crn",
       "plot.crs",
       "plot.rwl",
       "plotRings",
       "po.to.wc",
       "pointer",
       "powt",
       "print.redfit",
       "print.rwl.report",
       "rasterPlot",
       "rcs",
       "read.compact",
       "read.crn",
       "read.fh",
       "read.ids",
       "read.rwl",
       "read.tridas",
       "read.tucson",
       "redfit",
       "runcrit",
       "rwi.stats",
       "rwi.stats.legacy",
       "rwi.stats.running",
       "rwl.report",
       "rwl.stats",
       "sea",
       "seg.plot",
       "sens1",
       "sens2",
       "series.rwl.plot",
       "sgc",
       "skel.plot",
       "spag.plot",
       "sss",
       "strip.rwl",
       "summary.rwl",
       "tbrm",
       "time<-",
       "treeMean",
       "tridas.vocabulary",
       "uuid.gen",
       "wavelet.plot",
       "wc.to.po",
       "write.compact",
       "write.crn",
       "write.rwl",
       "write.tridas",
       "write.tucson",
       "xdate.floater",
       "xskel.ccf.plot",
       "xskel.plot")

