summaryrefslogtreecommitdiffstats
path: root/scilab/modules/graphics
diff options
context:
space:
mode:
authorYann Collette <yann.collette@scilab.org>2010-03-12 15:23:24 +0100
committerYann Collette <yann.collette@scilab.org>2010-03-12 15:23:24 +0100
commitfb0946b02f531db8b26ba705633bafd6584ea7db (patch)
tree5a69204709eaacc51335d2986ec899d829743a28 /scilab/modules/graphics
parent0abe7bc8dd5d0bdaa148fb3aef179d31cc609f1d (diff)
downloadscilab-fb0946b02f531db8b26ba705633bafd6584ea7db.zip
scilab-fb0946b02f531db8b26ba705633bafd6584ea7db.tar.gz
allow the user to use set, get and delete whether or not we are in nwni mode and with a scilab compiled without-gui
Diffstat (limited to 'scilab/modules/graphics')
-rw-r--r--scilab/modules/graphics/sci_gateway/c/gw_graphics.c13
-rw-r--r--scilab/modules/graphics/src/nographics/nographics.c35
2 files changed, 44 insertions, 4 deletions
diff --git a/scilab/modules/graphics/sci_gateway/c/gw_graphics.c b/scilab/modules/graphics/sci_gateway/c/gw_graphics.c
index 7475cf3..c94df1d 100644
--- a/scilab/modules/graphics/sci_gateway/c/gw_graphics.c
+++ b/scilab/modules/graphics/sci_gateway/c/gw_graphics.c
@@ -115,7 +115,18 @@ int gw_graphics(void)
115 } 115 }
116 else 116 else
117 { 117 {
118 Scierror(999,_("Scilab graphic module disabled -nogui or -nwni mode.\n")); 118 if ( (strcmp(Tab[Fin-1].name, "set")==0 ||
119 strcmp(Tab[Fin-1].name, "delete")==0 ||
120 strcmp(Tab[Fin-1].name, "get")==0) &&
121 (VarType(1)==sci_tlist || VarType(1)==sci_mlist))
122 {
123 callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
124 return 0;
125 }
126 else
127 {
128 Scierror(999,_("Scilab graphic module disabled -nogui or -nwni mode.\n"));
129 }
119 } 130 }
120 131
121 return 0; 132 return 0;
diff --git a/scilab/modules/graphics/src/nographics/nographics.c b/scilab/modules/graphics/src/nographics/nographics.c
index d81e7b0..602067e 100644
--- a/scilab/modules/graphics/src/nographics/nographics.c
+++ b/scilab/modules/graphics/src/nographics/nographics.c
@@ -14,6 +14,8 @@
14/*--------------------------------------------------------------------------*/ 14/*--------------------------------------------------------------------------*/
15#include <string.h> 15#include <string.h>
16#include "gw_graphics.h" 16#include "gw_graphics.h"
17#include "stack-c.h"
18#include "callFunctionFromGateway.h"
17#include "graphicModuleLoad.h" 19#include "graphicModuleLoad.h"
18#include "TerminateGraphics.h" 20#include "TerminateGraphics.h"
19#include "getDictionaryGetProperties.h" 21#include "getDictionaryGetProperties.h"
@@ -41,12 +43,40 @@
41#include "Interaction.h" 43#include "Interaction.h"
42#include "InitObjects.h" 44#include "InitObjects.h"
43#include "ObjectStructure.h" 45#include "ObjectStructure.h"
46
44/*--------------------------------------------------------------------------*/ 47/*--------------------------------------------------------------------------*/
48
49/*
50 We need to add "manually" the functions set, get and delete because
51 if the module graphics is not loaded and because set, get and delete
52 are essentially functions from the graphics module, they will not be
53 available in NWNI mode and if Scilab has been compiled with the flag
54 --without-gui.
55*/
56
57#define DELETE_INDEX 62
58#define GET_INDEX 63
59#define SET_INDEX 64
60
45int gw_graphics(void) 61int gw_graphics(void)
46{ 62{
47 Scierror(999,_("Scilab Graphics module not installed.\n")); 63 Rhs = Max(0, Rhs);
48 return 0; 64
65 if ( (Fin==DELETE_INDEX || Fin==GET_INDEX || Fin==SET_INDEX) &&
66 (VarType(1)==sci_tlist || VarType(1)==sci_mlist))
67 {
68 int lw = 1 + Top - Rhs;
69 if (Fin==DELETE_INDEX) C2F(overload)(&lw,"delete",6);
70 if (Fin==GET_INDEX) C2F(overload)(&lw,"get",3);
71 if (Fin==SET_INDEX) C2F(overload)(&lw,"set",3);
72 }
73 else
74 {
75 Scierror(999,_("Scilab Graphics module not installed.\n"));
76 }
77 return 0;
49} 78}
79
50/*--------------------------------------------------------------------------*/ 80/*--------------------------------------------------------------------------*/
51void loadGraphicModule( void ) 81void loadGraphicModule( void )
52{ 82{
@@ -957,4 +987,3 @@ BOOL sciIsExistingFigure(int figNum)
957{ 987{
958 return FALSE; 988 return FALSE;
959} 989}
960/*--------------------------------------------------------------------------*/