xset/xget gateway now uses MVC features [viewport] 38/5738/1
Bruno JOFRET [Fri, 23 Dec 2011 11:30:18 +0000 (12:30 +0100)]
Change-Id: Ie5ca1502e5375d2e659879bfb59efbc6d8ebd9c6

scilab/modules/graphics/sci_gateway/c/sci_xget.c

index e4178a3..6fa17a1 100644 (file)
@@ -251,8 +251,18 @@ int sci_xget(char *fname,unsigned long fname_len)
     }
     else if(strcmp(cstk(l1),"viewport") == 0)
     {
-      sciGetViewport(sciGetCurrentFigure(), x1);
-      x2 = 2;
+      int* viewport;
+      double pdblViewport[2];
+
+      getOrCreateDefaultSubwin();
+      getGraphicObjectProperty(getCurrentFigure(), __GO_VIEWPORT__, jni_int_vector, &viewport);
+      pdblViewport[0] = viewport[0];
+      pdblViewport[1] = viewport[1];
+
+      createMatrixOfDouble(pvApiCtx, Lhs + 1, 1, 2, pdblViewport);
+      LhsVar(1)=Rhs+1;
+      PutLhsVar();
+      return 0;
     }
     else if(strcmp(cstk(l1),"alufunction") == 0)
     {