1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2008 - INRIA - Jean-Baptiste Silvy
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 function [curDriver] = driver(driverName)
11 // set or get the current driver
16 // no param just return the current driver
17 curDriver = %driverName;
18 elseif (argn(2) == 1) then
19 if (type(driverName) <> 10) then
20 // wrong type for driverName
25 if (~checkDriverName(driverName)) then
26 error(gettext("driver: wrong value for first input argument: must be ""Rec"", ""X11"", ""Pos"", ""PPM"" or ""GIF""."));
30 %driverName = driverName;
31 curDriver = driverName;
33 if (driverName <> "Rec" | driverName <> "X11") then
34 // to avoid drawing when in export mode
35 // However, drawlater should not create any graphic window
42 // incorrect number of arguments
50 function [check] = checkDriverName(driverName)
51 // check that the driver name is obne of the admissible ones
52 check = driverName == "Rec"..
53 | driverName == "X11"..
54 | driverName == "Pos"..
55 | driverName == "GIF"..
56 | driverName == "PPM";