1 /*
2  *  R : A Computer Language for Statistical Data Analysis
3  *  Copyright (C) 2001-3 Paul Murrell
4  *                2003-2019 The R Core Team
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, a copy is available at
18  *  https://www.R-project.org/Licenses/
19  */
20 
21 #include "grid.h"
22 
isMask(SEXP mask)23 Rboolean isMask(SEXP mask) {
24     return Rf_inherits(mask, "GridMask");
25 }
26 
resolveMask(SEXP mask,pGEDevDesc dd)27 SEXP resolveMask(SEXP mask, pGEDevDesc dd)
28 {
29     SEXP resolveFn, R_fcall, result;
30     PROTECT(resolveFn = findFun(install("resolveMask"), R_gridEvalEnv));
31     PROTECT(R_fcall = lang2(resolveFn, mask));
32     result = eval(R_fcall, R_gridEvalEnv);
33     UNPROTECT(2);
34     return result;
35 }
36 
37