xset() + xget() removal: minimize their footprints in .sce & .sci 36/19036/8
Samuel GOUGEON [Fri, 3 Feb 2017 18:01:35 +0000 (19:01 +0100)]
 * xset():
   - All scilab .sce + .sci files scanned for "/xset[^e]/"
   - 183 hits removed in 42 files
   - 8 hits for xset("fpf"..) remaining in 6 files

 * xget():
   - All scilab .sce + .sci files scanned for "/[^e]xget[^emp]/"
   - 72 hits removed in 21 files
   - 2 hits for xset("fpf"..) remaining in 2 files

Change-Id: Iaaf6a1f05f6f4ccb92b6191838621a215d34fc8f

41 files changed:
scilab/modules/compatibility_functions/macros/mtlb_axes.sci
scilab/modules/compatibility_functions/macros/mtlb_get.sci
scilab/modules/compatibility_functions/macros/mtlb_image.sci
scilab/modules/compatibility_functions/macros/mtlb_pcolor.sci
scilab/modules/development_tools/macros/testexamples.sce
scilab/modules/graphics/demos/2d_3d_plots/contourf2.dem.sce
scilab/modules/graphics/demos/basic_functions/basic_functions_2.dem.sce
scilab/modules/graphics/demos/bezier/Macros.sci
scilab/modules/graphics/demos/fec/fec.ex2.dem.sce
scilab/modules/graphics/demos/fec/fec.ex4.dem.sce
scilab/modules/graphics/demos/fec/fec_demo.sci
scilab/modules/graphics/demos/xsetechfig.sce
scilab/modules/graphics/macros/%_fec.sci
scilab/modules/graphics/macros/%_xset.sci
scilab/modules/graphics/macros/contourf.sci
scilab/modules/graphics/macros/ged_insert.sci
scilab/modules/graphics/macros/gr_macros.sce
scilab/modules/graphics/macros/polarplot.sci
scilab/modules/graphics/macros/titlepage.sci
scilab/modules/optimization/macros/datafit.sci
scilab/modules/scicos/macros/scicos_scicos/default_options.sci
scilab/modules/scicos/macros/scicos_scicos/do_compile_superblock42.sci
scilab/modules/scicos/macros/scicos_scicos/do_eval.sci
scilab/modules/scicos/macros/scicos_scicos/do_terminate.sci
scilab/modules/scicos/macros/scicos_scicos/do_version.sci
scilab/modules/scicos/macros/scicos_scicos/standard_draw_ports.sci
scilab/modules/scicos/macros/scicos_scicos/standard_draw_ports_up.sci
scilab/modules/scicos/tests/unit_tests/PENDULUM_ANIM.sci
scilab/modules/scicos_blocks/macros/Hydraulics/bache_draw_ports.sci
scilab/modules/scicos_blocks/macros/Hydraulics/puit_draw_ports.sci
scilab/modules/scicos_blocks/macros/Hydraulics/source_draw_ports.sci
scilab/modules/scicos_blocks/macros/Hydraulics/vanne_draw_ports.sci
scilab/modules/scicos_blocks/macros/Misc/TEXT_f.sci
scilab/modules/scicos_blocks/macros/Misc/anim_pen.sci
scilab/modules/scicos_blocks/macros/Misc/bplatform2.sci
scilab/modules/scicos_blocks/macros/Sinks/CLKOUTV_f.sci
scilab/modules/signal_processing/macros/yulewalk.sci
scilab/modules/umfpack/macros/ana_style.sci
scilab/modules/xcos/demos/PENDULUM_ANIM.sci
scilab/modules/xcos/macros/xcos_simulate.sci
scilab/modules/xcos/tests/unit_tests/PENDULUM_ANIM.sci

index 59416d1..87fe89d 100644 (file)
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function h=mtlb_axes(varargin)
+function h = mtlb_axes(varargin)
     global AXES_T
     if AXES_T==[] then AXES_T=list([]),end
-    win=xget("window")
+    win = gcf().figure_id
     k=find(AXES_T(1)==win)
     if k==[] then
         AXES_T(1)=[AXES_T(1);win]
@@ -36,5 +36,4 @@ function h=mtlb_axes(varargin)
         error(msprintf(gettext("%s: This feature has not been implemented.\n"),"mtlb_axes"));
     end
 
-
 endfunction
index c2b7338..02bf09d 100644 (file)
@@ -13,8 +13,8 @@
 function v=mtlb_get(H,property)
 
     [lhs,rhs]=argn()
-    win=xget("window")
-    xset("window",H)
+    win = gcf().figure_id
+    scf(H)
     if rhs==1 then
     else
         v=[]
@@ -22,7 +22,7 @@ function v=mtlb_get(H,property)
         case "backingstore" then
         case "color" then
         case "colormap" then
-            v=xget("colormap")
+            v = H.color_map
         case "currentaxes" then
             error(msprintf(gettext("%s: No equivalent for ''%s'' property.\n"), "mtlb_get", property));
         case "currentcharacter" then
@@ -42,7 +42,7 @@ function v=mtlb_get(H,property)
         case "menubar" then
             error(msprintf(gettext("%s: No equivalent for ''%s'' property.\n"), "mtlb_get", property));
         case "mincolormap" then
-            v=xget("colormap")
+            v = H.color_map
             v=size(v,1)
         case "name" then
             error(msprintf(gettext("%s: No equivalent for ''%s'' property.\n"), "mtlb_get", property));
@@ -63,8 +63,8 @@ function v=mtlb_get(H,property)
         case "pointer" then
             v="arrow"
         case "position" then
-            o=xget("wpos")
-            sz=xget("wdim")
+            o = H.figure_position
+            sz= H.figure_size
             v=[o(:);sz(:)]'
         case "resize" then
             v="on"
@@ -87,7 +87,7 @@ function v=mtlb_get(H,property)
         case "children" then
             error(msprintf(gettext("%s: No equivalent for ''%s'' property.\n"), "mtlb_get", property));
         case "clipping" then
-            v=xget("clipping")
+            v= gca().clip_box
             if v(1)<>0 then v="on",else v="off",end
         case "interruptible" then
             error(msprintf(gettext("%s: No equivalent for ''%s'' property.\n"), "mtlb_get", property));
@@ -101,5 +101,5 @@ function v=mtlb_get(H,property)
             v="on"
         end
     end
-    xset("window",win)
+    scf(win)
 endfunction
index ed296ea..33fab3a 100644 (file)
@@ -11,7 +11,7 @@
 // along with this program.
 
 function h=mtlb_image(varargin)
-    h=xget("window")
+    h = gcf().figure_id
     //find first propertyname position
     Rhs=size(varargin)
     for k=1:Rhs
index 2a0b3b6..0046927 100644 (file)
@@ -11,7 +11,7 @@
 // along with this program.
 
 function h=mtlb_pcolor(varargin)
-    h=xget("window")
+    h = gcf().figure_id
     //find first propertyname position
     Rhs=size(varargin)
     for k=1:Rhs
index 070ab4a..ba80ef6 100644 (file)
@@ -69,12 +69,12 @@ function r=xdel_run(w,opt)
 
     r=%f
     if winsid()==[] then return,end
-    cur=xget("window")
+    cur = gcf().figure_id
     //
     if argn(2)==1 then
         ids_=[]
         for k=1:size(w,"*")
-            xset("window",w(k))
+            scf(w(k))
             if get("figure_style")=="new" then ids_=[ids_,w(k)],end
         end
         load(%U,"ids_ref")
@@ -87,7 +87,7 @@ function r=xdel_run(w,opt)
         xdel(w)
     else
         if get("figure_style")=="old" then return,end
-        ids_=xget("window")
+        ids_ = cur
         load(%U,"ids_ref")
         if or(ids_ref<>ids_) then r=%t,return,end
         %wins_=ghdl2tree(gcf());
@@ -95,7 +95,7 @@ function r=xdel_run(w,opt)
         if %CMP(%wins_,%wins_ref) then r=%t,return,end
         xdel()
     end
-    if or(winsid()==cur) then xset("window",cur),end
+    if or(winsid()==cur) then scf(cur),end
 
 endfunction
 
@@ -110,10 +110,12 @@ function r=clf_run(w,opt)
 
     r=%f
     if winsid()==[] then return,end
-    cur=xget("window")
+    cur = gcf().figure_id
     rhs=argn(2)
-    if rhs==1&type(w)==10 then opt=w;rhs=0,end
-    if winsid()==[] then return,end
+    if rhs==1 & type(w)==10 then
+        opt = w;
+        rhs = 0
+    end
     //
     if rhs==1 then
         ids_=[]
@@ -122,7 +124,7 @@ function r=clf_run(w,opt)
             for h=H,w=[w,h.figure_id],end
         end
         for k=1:size(w,"*")
-            xset("window",w(k))
+            scf(w(k))
             if get("figure_style")=="new" then ids_=[ids_,w(k)],end
         end
         load(%U,"ids_ref")
@@ -135,7 +137,7 @@ function r=clf_run(w,opt)
         if rhs==1 then clf(w),else clf(w,opt),end
     else
         if get("figure_style")=="old" then return,end
-        ids_=xget("window")
+        ids_ = cur
         load(%U,"ids_ref")
         if or(ids_ref<>ids_) then r=%t,return,end
         %wins_=ghdl2tree(gcf());
@@ -143,7 +145,7 @@ function r=clf_run(w,opt)
         if %CMP(%wins_,%wins_ref) then r=%t,return,end
         clf()
     end
-    if or(winsid()==cur) then xset("window",cur),end
+    if or(winsid()==cur) then scf(cur),end
 
 endfunction
 
@@ -155,14 +157,14 @@ function r=xbasc_run(w)
     //
     //Compare the graphic windows to be cleared with the reference given in  a Scilab  binary file.
     // This function must mirror the  xbasc_build one.
-    r=%f
+    r = %f
     if winsid()==[] then return,end
-    cur=xget("window")
+    cur = gcf().figure_id
     //
     if argn(2)==1 then
         ids_=[]
         for k=1:size(w,"*")
-            xset("window",w(k))
+            scf(w(k))
             if get("figure_style")=="new" then ids_=[ids_,w(k)],end
         end
         load(%U,"ids_ref")
@@ -177,7 +179,7 @@ function r=xbasc_run(w)
         clf(w)
     else
         if get("figure_style")=="old" then return,end
-        ids_=xget("window");
+        ids_ = cur;
         load(%U,"ids_ref")
         if or(ids_ref<>ids_) then r=%t,return,end
         %wins_=ghdl2tree(gcf());
@@ -186,7 +188,7 @@ function r=xbasc_run(w)
         if %CMP(%wins_, %wins_ref) then r=%t,return,end
         clf()
     end
-    if or(winsid()==cur) then xset("window",cur),end
+    if or(winsid()==cur) then scf(cur), end
 
 endfunction
 
index d9090f3..d748fe4 100644 (file)
@@ -34,7 +34,7 @@ function demo_contourf2()
     g = [zeros(n,1); (1:n)'/n; ones(m-2*n,1)];
     b = [zeros(2*n,1); (1:m-2*n)'/(m-2*n)];
     h = [r g b];
-    xset("colormap",h);
+    my_handle.color_map = h;
     xset("fpf"," ");
     clf();
 
index 382133e..f6d7913 100644 (file)
@@ -16,6 +16,7 @@ function demo_basic_function2()
 
     plot2d([-100,500],[-100,600],[-1,-1],"022");
     a           = gca();
+    a.mark_size_unit = 'tabulated';
     t           = a.title;
     t.text      = my_plot_desc;
     t.font_size = 3;
@@ -54,10 +55,12 @@ function demo_basic_function2()
     "y1=50*cos(x)+90*ones(x);"];
 
     expr=[expr0;
-    "xset(''mark'',6,1);";
+    "a.mark_style = 6;";
+    "a.mark_size = 1;";
     "y1=transl(y1,200);";
     "xpoly(x1,y1,''marks'',0);";
-    "xset(''mark'',4,6);";
+    "a.mark_style = 4;";
+    "a.mark_size = 6;";
     "x1=transl(x1,80);";
     "xpoly(x1,y1,''marks'',0);"];
 
@@ -83,15 +86,19 @@ function demo_basic_function2()
     execstr(expr);
 
     // Demo II.9
-    expr=["xset(''font'',2,2);";
-    "xstring(200,200,''Character string'',0,0);";
-    "xstring(200,250,''Character string'',0,1);";
-    "xstring(400,300,''Chaine '',45,0);"];
+    expr=[
+        "a.font_style = 2;";
+        "a.font_size = 2;";
+        "xstring(200,200,''Character string'',0,0);";
+        "xstring(200,250,''Character string'',0,1);";
+        "xstring(400,300,''Chaine '',45,0);"];
     messagebox(["[II.5] xstring";expr],"modal");
     execstr(expr);
 
     // Demo II.10
-    expr=["xset(''mark'', 0, 0);"
+    expr=[
+        "a.mark_style = 0;";
+        "a.mark_size = 0;";
         "rect=xstringl(350,200,''Character string'');";
         "xrect(rect(1),rect(2),rect(3),rect(4));"]
     messagebox(["[II.6] xstringl";expr],"modal");
index 678574b..43f5ef8 100644 (file)
@@ -63,14 +63,15 @@ function bezier3d(p)
     // Shows a 3D Bezier curve and its polygon
     t=linspace(0,1,300);
     s=bezier(p,t);
-    dh=xget("dashes");
-    xset("dashes",3)
+    ax = gca();
+    dh = ax.line_style;
+    ax.line_style = 3;
     param3d(p(1,:),p(2,:),p(3,:),34,45)
-    xset("dashes",4);
+    ax.line_style = 4;
     param3d(s(1,:),s(2,:),s(3,:),34,45,"x@y@z",[0,0])
-    xset("dashes",dh);
+    ax.line_style = dh;
     xtitle("A 3d polygon and its Bezier curve");
-    current_axe = gca();current_axe.title.font_size = 3;
+    ax.title.font_size = 3;
 endfunction
 
 
index 733852a..5d08817 100644 (file)
@@ -17,7 +17,7 @@ function demo_fec_example2()
 
     show_window();
 
-    xset("colormap",jetcolormap(128));
+    curFig.color_map = jetcolormap(128);
 
     drawlater();
     amdbaR(path+"MESH");
index c308df5..0376573 100644 (file)
@@ -26,7 +26,7 @@ function demo_fec4()
 
     // Set the colormap
 
-    xset("colormap",jetcolormap(128));
+    curFig.color_map = jetcolormap(128);
 
     drawlater();
     colorbar(1,N+1);
index 5b5a409..bf907c1 100644 (file)
@@ -46,7 +46,7 @@ function []=meshvisu(col,rect)
     if rhs<=1;rect=[min(noeul(:,2)),min(noeul(:,3)),max(noeul(:,2)),max(noeul(:,3))];end
     if rhs<=2;iso="1";end
     plot2d(1,1,[1],"031"," ",rect);
-    xset("clipgrf");
+    gca().clip_state = "clipgrf";
     xx=trianl(:,2:4);
     xx=matrix(xx,prod(size(xx)),1);
     x=noeul(xx,2);
@@ -57,7 +57,7 @@ function []=meshvisu(col,rect)
     x=[x,x(:,1)]';
     y=[y,y(:,1)]';
     xpolys(x,y,col*ones(1,triang));
-    xset("clipoff");
+    gca().clip_state = "off";
 
 endfunction
 
@@ -68,13 +68,13 @@ function []=nvisu(rect)
     [lhs,rhs]=argn(0);
     if rhs==0;rect=[min(noeul(:,2)),min(noeul(:,3)),max(noeul(:,2)),max(noeul(:,3))];end
     plot2d(1,1,[1],"031"," ",rect);
-    xset("clipgrf");
+    gca().clip_state = "clipgrf";
     bords=noeul(find(noeul(:,4)>0),:);
     [no,ign]=size(bords);
     for i=1:no
         xstring(bords(i,2),bords(i,3),string(bords(i,4)));
     end
-    xset("clipoff");
+    gca().clip_state = "off";
 
 endfunction
 
@@ -88,7 +88,7 @@ function []=emc2V(i,j,k,sa,FN,rect)
 
     [lhs,rhs]=argn(0);
     plot2d(1,1,[1],"031"," ",rect);
-    xset("clipgrf");
+    gca().clip_state = "clipgrf";
     if rhs == 0 ; FN="MESH";end
     unit=file("open",FN,"old")
     resu=read(unit,noeuds,k);
@@ -105,7 +105,7 @@ function []=emc2V(i,j,k,sa,FN,rect)
     xsegs([noeul(:,2)-(1/sa)*resu(:,1),noeul(:,2)+(1/sa)*resu(:,1)]',...
     [noeul(:,3)-(1/sa)*resu(:,2),noeul(:,3)+(1/sa)*resu(:,2)]',...
     16*ones(nm)-16*nm);
-    xset("clipoff");
+    gca().clip_state = "off";
 
 endfunction
 
index 4990aa9..912e628 100644 (file)
@@ -9,8 +9,8 @@
 
 mode(-1)
 clf() ;
-
-xset("color",2)
+ax = gca();
+ax.foreground = 2;
 
 wrect=[0.2 0.1 0.6 0.6] ;
 frect=[0 -1 10 1] ;// coordonnees utilsateurs
@@ -19,7 +19,7 @@ dy=frect(4)-frect(2) ;ey=0.07*dy
 f=1/7 ;arect=ones(1,4)*f
 
 xsetech(wrect=wrect,frect=frect,arect=arect)
-xset("thickness",3)
+ax.thickness = 3;
 L=dx/(1-2*f)
 H=dy/(1-2*f)
 Lt=L/wrect(3)
@@ -33,7 +33,8 @@ xstring(frect(1)-f*L-wrect(1)*Lt+Lt-2*ex,frect(4)+f*H+wrect(2)*Ht-Ht+ey,"(1,0)")
 //Draw wrect relatives
 //===================
 
-xset("thickness",1) ;xset("color",2)
+ax.thickness = 1;
+ax.foreground = 2;
 //origin
 xsegs([frect(1)-f*L-wrect(1)*Lt ;frect(1)-f*L],..
 [frect(2)-f*H ;frect(2)-f*H]) ;
@@ -45,7 +46,8 @@ xstring(frect(1)-f*L+ex/2,(frect(2)-f*H+H+frect(4)+f*H+wrect(2)*Ht)/2,"yup")
 
 //width and height
 
-;xset("font",4,2)
+ax.font_style = 4;
+ax.font_size = 2;
 xsegs((frect(1)-f*L-ex)*ones(2,2),[frect(4)+f*H ,frect(4)+f*H-H/2-ey ;
 frect(4)+f*H-H/2+ey,frect(4)+f*H-H])
 xstring(frect(1)-f*L-ex,frect(4)+f*H-H/2-ey/2,"h")
@@ -54,38 +56,44 @@ xsegs([frect(1)-f*L,frect(1)-f*L+L/2+ex
 frect(1)-f*L+L/2-ex,frect(1)-f*L+L],(frect(4)+f*H+ey)*ones(2,2))
 
 xstring(frect(1)-f*L+L/2,frect(4)+f*H+ey/2,"w")
-xset("font",2,1)
-
+ax.font_style = 2;
+ax.font_size = 1;
 
 // wrect rectangle
-xset("color",5)
-xset("thickness",2)
+ax.foreground = 5;
+ax.thickness = 2;
 xrect(frect(1)-f*L,frect(4)+f*H,L,H)
-xset("thickness",1)
+ax.thickness = 1;
 // width and height
-xset("font",4,2) ;
+ax.font_style = 4;
+ax.font_size = 2;
 
 
-xset("foreground",5)
+ax.foreground = 5;
 drawaxis(x=frect(1)-f*L,y=frect(4)+f*H-H+[0,H],val=["0","1"],seg=0,sub_int=3)
 drawaxis(x=frect(1)-f*L+[0,L],y=frect(4)+f*H-H,val=["0","1"],dir="d",seg=0,sub_int=3)
-//xset('font',2,1)
+//ax.font_style = 2;
+//ax.font_size = 1;
+
 //user coordinate rectangle
 //=========================
-xset("color",5) ;xset("thickness",1)
+ax.foreground = 5;
+ax.thickness = 1;
 xsegs([4 ;4],[1 ;1+f*H]) ;xstring(4+ex/2,1+f*H/2-ey/2,"y_up")
 xsegs([4 ;4],[-1 ;-1-f*H]);xstring(4+ex,-1-f*H/2,"y_down")
 xsegs([10 ;10+f*L],[0 ;0]);xstring(10+ex/2,0,"x_right")
 xsegs([0 ;0-f*L],[0 ;0]);xstring(ex/2-f*L,0,"x_left")
-xset("color",0),xset("thickness",3)
+ax.foreground = -1;
+ax.thickness = 3;
 
 //draw a curve inside user coordinate rectangle
 //=============================================
-xset("color",14) ;xset("foreground",14)
+ax.foreground = 14;
+ax.foreground = 14;
 
 xrect(0,1,10,2)
 
-xset("color",16)
+ax.foreground = 16;
 r=xstringl(0,0,"yminx")
 xstring(0-r(3),-1-r(2)/2,"ymin")
 xstring(0-r(3),1-r(2)/2,"ymax")
@@ -94,7 +102,7 @@ xstring(0-r(3)/2,-1-r(2)*1.5,"xmin")
 xstring(10-r(3)/2,-1-r(2)*1.5,"xmax")
 t=0 :0.1 :10 ;
 plot2d(t,sin(t),style=16,axesflag=2)
-xset("foreground",0) ;xset("color",0)
+ax.foreground = -1;
 
 //Draw legend
 txt=["wrect=[xleft,yup,w,h]"
@@ -103,7 +111,8 @@ txt=["wrect=[xleft,yup,w,h]"
 " "
 "xsetech(wrect=wrect,frect=frect,arect=arect)"]
 
-xset("font",2,3)
+ax.font_style = 2;
+ax.font_size = 3;
 r=xstringl(0,0,txt)
 y=frect(4)+f*H+wrect(2)*Ht-Ht+ey
 x=frect(1)-f*L-wrect(1)*Lt+(Lt-r(3))/2
@@ -114,26 +123,26 @@ y=y+r(4)/5
 xstring(x,y,txt(4)) //
 
 y=y+r(4)/5
-xset("color",16)
+ax.foreground = 16;
 xstring(x,y,txt(3))//frect
 
 y=y+r(4)/5
-xset("color",14) //arect
+ax.foreground = 14; // arect
 k=strindex(txt(2),"=")
 xstring(x,y,part(txt(2),1:k))
 r1=xstringl(0,0,part(txt(2),1:k))
-xset("color",5)
+ax.foreground = 5;
 xstring(x+r1(3),y,part(txt(2),k+1:length(txt(2))))
 
 
 y=y+r(4)/5
 
 k=strindex(txt(1),"=") //wrect
-xset("color",5)
+ax.foreground = 5;
 xstring(x,y,part(txt(1),1:k))
-xset("color",2)
+ax.foreground = 2;
 r1=xstringl(0,0,part(txt(1),1:k))
 xstring(x+r1(3),y,part(txt(1),k+1:length(txt(1))))
 
 
-xset("color",0)
+ax.foreground = -1;
index a81ffd0..3109976 100644 (file)
@@ -22,7 +22,7 @@ function [] = %_fec()
     mode(0)
     exec("SCI/modules/graphics/demos/fec/fec_demo.sci",-1);
     clf();
-    xset("colormap",jetcolormap(128));
+    gcf().color_map = jetcolormap(128);
     N=20;
     n=1:N;
     x=cos(n*2*%pi/N);
index 3fd7a28..68e9273 100644 (file)
@@ -161,7 +161,7 @@ function contourf(x, y, z, nv, style, strf, leg, rect, nax)
         ii = ii + nl + 1;
     end
 
-    lp=xget("lastpattern");
+    lp = size(gcf().color_map, 1);
 
     if size(nv,"*") > 1 // case where nv is a vector defining the level curve values
         if  size(nv,"*") > lp
@@ -191,18 +191,18 @@ function contourf(x, y, z, nv, style, strf, leg, rect, nax)
     H=[];
     [FA,IA]=gsort(abs(Area));
 
-    drawlater(); // postpon the drawing here
-    a=gca();
-    old_foreground = a.foreground;
-    pat=xget("pattern");
+    drawlater(); // postpone the drawing here
+    ax = gca();
+    old_foreground = ax.foreground;
+    pat = old_foreground;
     for jj=IA',
         nl=CS(2,I(jj));
         lev1=CS(1,I(jj));
         if (lev1 ~= minz | draw_min) then
             xp=CS(1,I(jj)+(1:nl));
             yp=CS(2,I(jj)+(1:nl));
-            pat=size(find( nv <= lev1),"*");
-            xset("pattern",pat);
+            pat = size(find( nv <= lev1),"*");
+            ax.foreground = pat;
             xfpoly(xp,yp)
         end
     end
@@ -210,7 +210,7 @@ function contourf(x, y, z, nv, style, strf, leg, rect, nax)
     if style(1)<>-1 then
         contour2d(xx,yy,zz,nv,style,"000",leg,rect,nax);
     end
-    a.foreground = old_foreground;
+    ax.foreground = old_foreground;
     drawnow(); // draw all now!
 
 endfunction
index a125828..4da88b7 100644 (file)
@@ -10,7 +10,6 @@
 // along with this program.
 
 function ged_insert(k,win)
-    //xset, xget used because ged should handle both old and new style
 
     [lhs,rhs]=argn(0);
 
@@ -24,8 +23,8 @@ function ged_insert(k,win)
     active=active+1;men=k
     if  active>1 then return,end
 
-    ged_current_figure=xget("window")
-    xset("window",win)
+    ged_current_figure = gcf().figure_id
+    scf(win)
 
     scf(win);
     ged_cur_fig_handle=gcf();
@@ -219,7 +218,9 @@ function  ged_insert_end()
         f=gcf()
         clearglobal active men
     end
-    if win<>ged_current_figure then xset("window",ged_current_figure),end
+    if win <> ged_current_figure then
+        scf(ged_current_figure)
+    end
 
 endfunction
 function [men,xc,yc]=ged_click()
index 29653cb..7dc4af7 100644 (file)
@@ -204,15 +204,21 @@ function sd=Move(sd)
 endfunction
 
 function [sd1]=symbs(sd,del)
-    [lhs,rhs]=argn(0);sd1=[];
+    [lhs,rhs]=argn(0);
+    sd1 = [];
+    ax = gca();
     if rhs<=0 then
-        c=xget("mark")
-        n1=c(1);dime=c(2)
+        c = [ax.mark_style ax.mark_size];
+        n1=c(1);
+        dime=c(2)
         sd1=list("symbs",c(1),c(2));
     else
-        n1=sd(2);dime=sd(3)
+        n1=sd(2);
+        dime=sd(3)
     end
-    xset("mark",n1,dime);
+    ax.mark_style = n1;
+    ax.mark_size_unit = "tabulated";
+    ax.mark_size = dime;
 endfunction
 
 function [sd1]=dashs(sd,del)
@@ -227,11 +233,12 @@ function [sd1]=dashs(sd,del)
     else
         n1=sd(2)
     end
-    xset("dashes",n1);
+    gca().line_style = n1;
 endfunction
 
 function [sd1]=patts(sd,del)
-    [lhs,rhs]=argn(0);sd1=[];
+    [lhs,rhs]=argn(0);
+    sd1 = [];
     if rhs<=0 then
         n1=getcolor("Choose a pattern ",0)
         if n1==[] then
@@ -243,7 +250,7 @@ function [sd1]=patts(sd,del)
 
         n1=sd(2)
     end
-    xset("pattern",n1);
+    gca().foreground = n1;
 endfunction
 
 function [sd1]=Thick(sd,del)
@@ -252,7 +259,7 @@ function [sd1]=Thick(sd,del)
 
         T=string(1:15)
         ll=list()
-        t=xget("thickness")
+        t = gca().thickness
         ll(1)=list("Thickness",t,T);
         n1=x_choices("Choose a Thickness",ll);
         if n1==[] then
@@ -263,7 +270,7 @@ function [sd1]=Thick(sd,del)
     else
         n1=sd(2)
     end
-    xset("thickness",n1);
+    gca().thickness = n1;
 endfunction
 
 function sd1 =rect(sd,del)
@@ -525,7 +532,7 @@ endfunction
 function []=redraw(sd,s_t)
     ksd=size(sd)
     plot2d(0,0,[-1],s_t," ",sd(2));
-    xset("clipgrf");
+    gca().clip_state = "clipgrf";
     for k=3:ksd,
         obj=sd(k);
         if size(obj)<>0 then
@@ -554,8 +561,8 @@ function [x0,y0,x,y,ibutton]=xgetm(m_m)
     // Object aquisition
     kpd=driver();
     driver("X11");
-    alu=xget("alufunction")
-    xset("alufunction",6);
+    pdm_old = gcf().pixel_drawing_mode;
+    gcf().pixel_drawing_mode = "xor";
     // attente du click
     [ii,x0,y0]=xclick()
     x=x0;y=y0;
@@ -569,7 +576,7 @@ function [x0,y0,x,y,ibutton]=xgetm(m_m)
         m_m(x0,y0,x,y)
         x=rep(1);y=rep(2);
     end
-    xset("alufunction",alu);
+     gcf().pixel_drawing_mode = pdm_old;
     //m_m(x0,y0,x,y)
     driver(kpd);
 endfunction
@@ -587,7 +594,7 @@ function []=d_xfrect(x0,yy0,x,y)
     w=abs(x0-x);
     yi=max(yy0,y);
     h=abs(yy0-y);
-    xrects([xi,yi,w,h]',xget("pattern"));
+    xrects([xi,yi,w,h]',gca().foreground);
 endfunction
 
 function []=d_circle(c1,c2,x1,x2)
@@ -632,8 +639,8 @@ function [z]=xgetpoly(m_m)
     x=x0;y=y0;
     z=[x0;y0];
     ibutton=1
-    alu=xget("alufunction")
-    xset("alufunction",6);
+    pdm_old = gcf().pixel_drawing_mode;
+    gcf().pixel_drawing_mode = "xor";
     while and(ibutton<>[0 3 10])
         ibutton=-1
         while ibutton==-1
@@ -650,7 +657,7 @@ function [z]=xgetpoly(m_m)
             x0=x;y0=y;
         end
     end
-    xset("alufunction",alu);
+    gcf().pixel_drawing_mode = pdm_old;
 
     [nn,ll]=size(z);
     if ll==1 then z=[];end
@@ -670,8 +677,8 @@ function [xo,yo]=move_object(inst,xo,yo)
     // Object aquisition
     xos=xo;yos=yo
     kpd=driver();
-    alu=xget("alufunction")
-    xset("alufunction",6);
+    pdm_old = gcf().pixel_drawing_mode;
+    gcf().pixel_drawing_mode = "xor";
     execstr(inst) //erase
     driver("X11");
     // suivi de la souris en attendant le button release
@@ -687,7 +694,7 @@ function [xo,yo]=move_object(inst,xo,yo)
     else
         xo=rep(1);yo=rep(2);
     end
-    xset("alufunction",alu);
+    gcf().pixel_drawing_mode = pdm_old;
     driver(kpd);
     execstr(inst) //draw
 endfunction
index 7fcb187..ac13381 100644 (file)
@@ -166,7 +166,6 @@ function polarplot(theta,rho,style,strf,leg,rect)
     execstr("plot2d(x,y,"+strcat(opts,",")+")")
 
     fcolor=color("grey70");
-    xset("dashes",1)
 
     // CIRCULAR FRAME:
     // Radial values for the frame:
@@ -185,14 +184,16 @@ function polarplot(theta,rho,style,strf,leg,rect)
     // Tuning for smart 10^ display using LaTeX instead of D+## exponential display
     if abs(p)<4,
         Rtxt=string(R)
-        [v,k]=max(length(Rtxt)), tmp=xstringl(0,0,Rtxt(k))
+        [v,k]=max(length(Rtxt))
+        tmp=xstringl(0,0,Rtxt(k))
     else
         if dm<1, dm=dm*10, p=p-1, end
-        tmp=string(R/10^p)+"108"
-        [v,k]=max(length(tmp)), tmp=xstringl(0,0,tmp(k))
-        Rtxt="$\scriptstyle "+string(R/10^p)+"\:.10^{"+string(p)+"}$";
+        tmp = string(R/10^p)+"108"
+        [v,k] = max(length(tmp))
+        tmp = xstringl(0,0,tmp(k))
+        Rtxt = "$\scriptstyle "+string(R/10^p)+"\:.10^{"+string(p)+"}$";
     end
-    w=tmp(3); h=tmp(4);
+    w = tmp(3); h = tmp(4);
     format(fmt_in(2),fmt_in(1))  // Restoring entrance format
     R = [ R  rm ]
 
@@ -201,8 +202,9 @@ function polarplot(theta,rho,style,strf,leg,rect)
     for k=1:kM
         r=R(k)
         xarc(-r,r,2*r,2*r,Amin*64,dA*64)
-        e = gce();,e.line_style=3
-        e.foreground=fcolor;
+        e = gce();
+        e.line_style = 3
+        e.foreground = fcolor;
         if k==kM
             e.line_style=1;  // solid outer arc
         else
@@ -223,7 +225,9 @@ function polarplot(theta,rho,style,strf,leg,rect)
     rL=rm*1.03;  // Radius of angular labels
     for k=an  // draws and labels angular rays
         xsegs([0;rm*cosd(k)],[0;rm*sind(k)])
-        e = gce(); e.segs_color=fcolor; e.line_style=3;
+        e = gce();
+        e.segs_color = fcolor;
+        e.line_style = 3;
         xstring((rL+w/2)*cosd(k)-w/2, (rL+h/2)*sind(k)-h/2, string(k))
         e = gce();
         e.clip_state = "off";
index c855681..4f65a03 100644 (file)
@@ -17,17 +17,21 @@ function titlepage(str,win)
     [lhs,rhs]=argn(0)
 
     if ~isdef("str") then
-        error(msprintf(gettext("%s: Wrong number of input argument(s): %d or %d expected.\n"), "titlepage", 1, 2));
+        msg = _("%s: Wrong number of input argument(s): %d or %d expected.\n")
+        error(msprintf(msg, "titlepage", 1, 2));
     end
 
     if type(str) <> 10 then
-        error(msprintf(gettext("%s: Wrong type for input argument #%d: String array expected.\n"), "titlepage", 1));
+        msg = _("%s: Wrong type for input argument #%d: String array expected.\n")
+        error(msprintf(msg, "titlepage", 1));
     end
 
 
-    old=xget("window")
-    if rhs==2 then xset("window",win);end
+    old = gcf()
+    if rhs==2 then
+        scf(win)
+    end
     plot2d([0,1],[0,1],[-1,-1],"022");
     xstringb(0,0,str,1,1,"fill");
-    xset("window",old)
+    scf(old)
 endfunction
index 76d1651..207f4b9 100644 (file)
@@ -34,7 +34,7 @@ function [p,err]=datafit(iprint,G,varargin)
     //Z=[Y;X];
     //deff('e=G(p,z)','a=p(1),b=p(2),c=p(3),y=z(1),x=z(2),e=y-FF(x)')
     //[p,err]=datafit(G,Z,[3;5;10])
-    //xset('window',0)
+    //scf(0)
     //clf();
     //plot2d(X',Y',-1)
     //plot2d(X',FF(X)',5,'002')
@@ -43,7 +43,7 @@ function [p,err]=datafit(iprint,G,varargin)
     //a=34;b=12;c=14;
     //deff('s=DG(p,z)','y=z(1),x=z(2),s=-[x-p(2),-p(1),x*x]')
     //[p,err]=datafit(G,DG,Z,[3;5;10])
-    //xset('window',1)
+    //scf(1)
     //clf();
     //plot2d(X',Y',-1)
     //plot2d(X',FF(X)',5,'002')
index dfb76ea..fa9b6d4 100644 (file)
@@ -23,12 +23,7 @@ function options = default_options()
 
     options=scsoptlist()
     col3d=[0.8 0.8 0.8]
-    //if xget('use color')==1 then   //suppose always color screen
     options("3D")=list(%t,33)   // we add gray to color map
-    //else
-    //  options('3D')=list(%f,0)
-    //  col3d=[]
-    //end
     options("Background")=[8 1] //white,black
     options("Link")=[1,5] //black,red
     options("ID")=list([4 1 10 1],[4 1 2 1])
index 376cb85..c3dbfd4 100644 (file)
@@ -1467,7 +1467,7 @@ function  [ok,XX,alreadyran,flgcdgen,szclkINTemp,freof] = do_compile_superblock4
     Code_gene_run=[];
 
     //** OLD GRAPHICS
-    //** %windo=xget('window')
+    //** %windo = gcf().figure_id
 
     cpr=c_pass2(bllst,connectmat,clkconnect,cor,corinv)
 
@@ -1542,7 +1542,7 @@ function  [ok,XX,alreadyran,flgcdgen,szclkINTemp,freof] = do_compile_superblock4
     cpr.sim.funtyp=funtyp_save;
 
     //** OLD GRAPHICS
-    //** xset('window',%windo)
+    //** scf(%windo)
 
     ///////////////////
     //les pointeurs de cpr :
index ae6663d..4bccce7 100644 (file)
@@ -101,9 +101,9 @@ function [scs_m,cpr,needcompile,ok]=do_eval(scs_m,cpr,%scicos_context)
                 context=sblock.props.context
                 [scicos_context1,ierr]=script2var(context,%scicos_context)
                 if ierr <>0 then
-                    %now_win=xget("window")
+                    %now_win = gcf()
                     scicosmessage(["Cannot evaluate a context";lasterror()])
-                    xset("window",%now_win)
+                    scf(%now_win)
                 else
                     previous_full_uids = full_uids;
                     if length(o.model.uid) >= 1 then
index b476394..ff0d782 100644 (file)
@@ -38,14 +38,13 @@ function [alreadyran,%cpr] = do_terminate(scs_m,%cpr)
         alreadyran = %f ;
         state=%cpr.state;
 
-        //** win = xget('window');
+        //** win = gcf().figure_id;
         gh_win = gcf();
 
         //** run scicosim via 'finish' flag
         ierr = execstr("[state,t]=scicosim(%cpr.state,par.tf,par.tf,%cpr.sim,"+..
         "''finish'',par.tol)","errcatch")
 
-        //** xset('window',win)
         scf(gh_win);
 
         %cpr ; //get write access at the variable
@@ -97,7 +96,6 @@ function [alreadyran,%cpr] = do_terminate(scs_m,%cpr)
         end
         //**---------------------------------
 
-        //** xset('window',curwin)
         scf(curwin);
 
     end
index ad82eb2..97a4267 100644 (file)
@@ -211,9 +211,11 @@ function scs_m_new=do_version43(scs_m)
 
                 //@@ Change gr_i of INTEGRAL_m if needed
             elseif o.gui=="INTEGRAL_m" | o.gui=="INTEGRAL" then
-                gr_i=["thick=xget(''thickness'')"
-                "pat=xget(''pattern'')"
-                "fnt=xget(''font'')"
+                gr_i=[
+                "ax = gca();"
+                "thick = ax.thickness;"
+                "pat = ax.foreground;"
+                "fnt = [ax.font_style, ax.font_size]"
                 "xpoly(orig(1)+[0.7;0.62;0.549;0.44;0.364;0.291]*sz(1),orig(2)+[0.947;0.947;0.884;0.321;0.255;0.255]*sz(2),"'lines"')"
                 "txt=''1/s'';"
                 "style=5;"
@@ -224,16 +226,21 @@ function scs_m_new=do_version43(scs_m)
                 "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
                 "e=gce();"
                 "e.font_style=style;"
-                "xset(''thickness'',thick)"
-                "xset(''pattern'',pat)"
-                "xset(''font'',fnt(1),fnt(2))"]
-                old_gri=["thick=xget(''thickness'')"
-                "pat=xget(''pattern'')"
-                "fnt=xget(''font'')"
+                "ax.thickness = thick;"
+                "ax.foreground = pat;"
+                "ax.font_style = fnt(1);"
+                "ax.font_size = fnt(2);"
+                ]
+                old_gri=[
+                "ax = gca();"
+                "thick = ax.thickness;"
+                "pat = ax.foreground;"
+                "fnt = [ax.font_style, ax.font_size];"
                 "xpoly(orig(1)+[0.7;0.62;0.549;0.44;0.364;0.291]*sz(1),orig(2)+[0.947;0.947;0.884;0.321;0.255;0.255]*sz(2),"'lines"')"
-                "xset(''thickness'',thick)"
-                "xset(''pattern'',pat)"
-                "xset(''font'',fnt(1),fnt(2))"
+                "ax.thickness = thick;"
+                "ax.foreground = pat;"
+                "ax.font_style = fnt(1);"
+                "ax.font_size = fnt(2);"
                 ]
                 id=o.graphics.id
                 if id=="1/s" then id="",end
@@ -556,10 +563,13 @@ function scs_m_new=do_version43(scs_m)
 
                 //@@ Change gr_i of CLKGotoTagVisibility if needed
             elseif o.gui=="CLKGotoTagVisibility" then
-                gr_i=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-                "wd=xget(''wdim'').*[1.016,1.12];";
-                "thick=xget(''thickness'');xset(''thickness'',2);";
-                "p=wd(2)/wd(1);p=1;";
+                gr_i=[
+                "xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
+                "wd = gcf().figure_size .* [1.016,1.12];";
+                "gh_axes = gca();"
+                "thick = gh_axes.thickness;";
+                "gh_axes.thickness = 2;";
+                "p = wd(2)/wd(1); p=1; ";
                 "xarcs([orig(1)+0.05*sz(1);";
                 "orig(2)+0.95*sz(2);";
                 "0.9*sz(1)*p;";
@@ -568,7 +578,6 @@ function scs_m_new=do_version43(scs_m)
                 "360*64],scs_color(5));";
                 "txt=[''Goto Tag'';''Visibility'' ];"
                 "style=5;"
-                "gh_axes = gca();"
                 "axes_font_style = gh_axes.font_style ;"
                 "axes_font_size  = gh_axes.font_size  ;"
                 "gh_axes.font_style = 5;"
@@ -580,18 +589,23 @@ function scs_m_new=do_version43(scs_m)
                 "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-5,txt,w,h,''fill'');"
                 "gh_axes.font_style = axes_font_style ;"
                 "gh_axes.font_size  = axes_font_size  ;"
-                "xset(''thickness'',thick)"]
-                old_gri=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-                "wd=xget(''wdim'').*[1.016,1.12];";
-                "thick=xget(''thickness'');xset(''thickness'',2);";
-                "p=wd(2)/wd(1);p=1;";
+                "gca().thickness = thick;"]
+
+                old_gri=[
+                "xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
+                "wd = gcf().figure_size .*[1.016,1.12];";
+                "ax = gca();";
+                "thick = ax.thickness;";
+                "ax.thickness = 2;";
+                "p = wd(2)/wd(1); p = 1;";
                 "xarcs([orig(1)+0.05*sz(1);";
                 "orig(2)+0.95*sz(2);";
                 "0.9*sz(1)*p;";
                 "0.9*sz(2);";
                 "0;";
                 "360*64],scs_color(5));";
-                "xset(''thickness'',thick)"]
+                "ax.thickness = thick;"
+                ]
                 id=o.graphics.id
                 if id==["Goto Tag";"Visibility"] then id="",end
                 scs_m_new.objs(j).graphics.id=id
@@ -608,9 +622,11 @@ function scs_m_new=do_version43(scs_m)
                 //@@ Change gr_i of GotoTagVisibilityMO if needed
             elseif o.gui=="GotoTagVisibilityMO" then
                 gr_i=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-                "wd=xget(''wdim'').*[1.016,1.12];";
-                "thick=xget(''thickness'');xset(''thickness'',2);";
-                "p=wd(2)/wd(1);p=1;";
+                "wd = gcf().figure_size .* [1.016,1.12];";
+                "gh_axes = gca();"
+                "thick = gh_axes.thickness;";
+                "gh_axes.thickness = 2;";
+                "p = wd(2) / wd(1); p=1;";
                 "xarcs([orig(1)+0.05*sz(1);";
                 "orig(2)+0.95*sz(2);";
                 "0.9*sz(1)*p;";
@@ -619,7 +635,6 @@ function scs_m_new=do_version43(scs_m)
                 "360*64],scs_color(3));";
                 "txt=[''Goto Tag'';''Visibility'' ];"
                 "style=5;"
-                "gh_axes = gca();"
                 "axes_font_style = gh_axes.font_style ;"
                 "axes_font_size  = gh_axes.font_size  ;"
                 "gh_axes.font_style = 5;"
@@ -631,18 +646,22 @@ function scs_m_new=do_version43(scs_m)
                 "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-5,txt,w,h,''fill'');"
                 "gh_axes.font_style = axes_font_style ;"
                 "gh_axes.font_size  = axes_font_size  ;"
-                "xset(''thickness'',thick)"]
-                old_gri=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-                "wd=xget(''wdim'').*[1.016,1.12];";
-                "thick=xget(''thickness'');xset(''thickness'',2);";
-                "p=wd(2)/wd(1);p=1;";
+                "gh_axes.thickness = thick;"]
+
+                old_gri=[
+                "xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
+                "wd = gcf().figure_size .* [1.016,1.12];";
+                "ax = gca();";
+                "thick = ax.thickness;";
+                "ax.thickness = 2;";
+                "p = wd(2)/wd(1); p = 1;";
                 "xarcs([orig(1)+0.05*sz(1);";
                 "orig(2)+0.95*sz(2);";
                 "0.9*sz(1)*p;";
                 "0.9*sz(2);";
                 "0;";
                 "360*64],scs_color(3));";
-                "xset(''thickness'',thick)"]
+                "ax.thickness = thick;"]
                 id=o.graphics.id
                 if id==["Goto Tag";"Visibility"] then id="",end
                 scs_m_new.objs(j).graphics.id=id
@@ -673,6 +692,7 @@ function scs_m_new=do_version43(scs_m)
                 "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-5,txt,w,h,''fill'');"
                 "gh_axes.font_style = axes_font_style ;"
                 "gh_axes.font_size  = axes_font_size  ;"]
+
                 old_gri=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');"]
                 id=o.graphics.id
                 if id==["Goto Tag";"Visibility"] then id="",end
@@ -727,7 +747,7 @@ function scs_m_new=do_version43(scs_m)
 
                 //@@ Change gr_i of Capacitor if needed
             elseif o.gui=="Capacitor" then
-                gr_i=["xset(''thickness'',2)"
+                gr_i=["gca().thickness = 2;"
                 "xx=orig(1)+[0 1/3 1/3 1/3 ]*sz(1);";
                 "yy=orig(2)+[1/2 1/2 1 0]*sz(2);";
                 "xpoly(xx,yy);"
@@ -750,7 +770,7 @@ function scs_m_new=do_version43(scs_m)
                 "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
                 "e=gce();"
                 "e.font_style=style;"]
-                old_gri=["xset(''thickness'',2)"
+                old_gri=["gca().thickness = 2;"
                 "xx=orig(1)+[0 1/3 1/3 1/3 ]*sz(1);";
                 "yy=orig(2)+[1/2 1/2 1 0]*sz(2);";
                 "xpoly(xx,yy);"
@@ -1103,7 +1123,9 @@ function scs_m=do_version251(scs_m)
                 end
             elseif o(5)=="AFFICH_f" then
                 scs_m(k)(3)(7)=[0;-1;0;0;1;1]
-                scs_m(k)(2)(9)=["xset(''font'',ipar(1),ipar(2))";
+                scs_m(k)(2)(9)=[
+                "gca().font_style = ipar(1);"
+                "gca().font_size = ipar(2);"
                 "str='' ''+part(''0'',ones(1,ipar(5)-ipar(6)-2))+''.''+part(''0'',ones(1,ipar(6)))"
                 "rr=xstringl(orig(1),orig(2),str)"
                 "xstring(orig(1)+max(0,(sz(1)-rr(3))/2),orig(2)+max(0,(sz(2)-rr(4))/2),str)"]
@@ -1253,12 +1275,15 @@ function o=block_version(o)
         string(ymin);
         string(ymax);
         string(N)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "t=(0:0.3:2*%pi)'';";
-        "xx=orig(1)+(1/5+(cos(2.2*t)+1)*3/10)*sz(1);";
-        "yy=orig(2)+(1/4.3+(sin(t)+1)*3/10)*sz(2);";
+        "xx = orig(1)+(1/5+(cos(2.2*t)+1)*3/10)*sz(1);";
+        "yy = orig(2)+(1/4.3+(sin(t)+1)*3/10)*sz(2);";
         "xpoly(xx,yy,''lines'');"
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;;"]
     case "BOUND_f" then
         rpar=model(8);in=model(2);nin=sum(in)
         if nin<>1 then
@@ -1270,16 +1295,19 @@ function o=block_version(o)
         thresh=rpar(1:nin),v=rpar(nin+1:2*nin)
         label=[strcat(sci2exp(thresh));
         strcat(sci2exp(v))]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=orig(1)+[1/5;1/2;1/2;1-1/5]*sz(1);";
         "yy=orig(2)+[1/2;1/2;1-1/5;1-1/5]*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',1);";
+        "ax.thickness = 1;";
         "xpoly(orig(1)+[1/9;1/5]*sz(1),orig(2)+[1/2;1/2]*sz(2),''lines'');";
         "xpoly(orig(1)+[1/2;1-1/9]*sz(1),orig(2)+[1/2;1/2]*sz(2),''lines'');";
         "xpoly(orig(1)+[1/2;1/2]*sz(1),orig(2)+[1/9;1/2]*sz(2),''lines'');";
         "xpoly(orig(1)+[1/2;1/2]*sz(1),orig(2)+[1-1/5;1-1/9]*sz(2),''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
     case "CLINDUMMY_f" then
         label=[]
         gr_i=["xstringb(orig(1),orig(2),[''DUMMY'';''CLSS''],sz(1),sz(2),''fill'');"]
@@ -1311,8 +1339,10 @@ function o=block_version(o)
         o = list("Block",..
         list([0,0],[2,2],%t,[],[],[],[],0,..
         list(..
-        ["wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
+        ["wd = gcf().figure_size .* [1.016,1.12];";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "p=wd(2)/wd(1);p=1;";
         "rx=sz(1)*p/2;ry=sz(2)/2;";
         "xarcs([orig(1)+0.05*sz(1);";
@@ -1321,13 +1351,13 @@ function o=block_version(o)
         "   0.9*sz(2);";
         "   0;";
         "   360*64],scs_color(5));";
-        "xset(''thickness'',1);";
+        "ax.thickness = 1;";
         "xx=[orig(1)+rx    orig(1)+rx;";
         "    orig(1)+rx    orig(1)+rx+0.6*rx*cos(%pi/6)];";
         "yy=[orig(2)+ry    orig(2)+ry ;";
         "  orig(2)+1.8*ry  orig(2)+ry+0.6*ry*sin(%pi/6)];";
         "xsegs(xx,yy,scs_color(10));";
-        "xset(''thickness'',thick);"],[])),..
+        "ax.thickness = thick;"],[])),..
         list("csuper",[],[],[],1,[]," ",..
         list(list([600,400,0,0],"foo",[],[]),..
         list("Block",list([399,162],[20,20],%t,"1",[],[],6,[],[]),..
@@ -1425,7 +1455,9 @@ function o=block_version(o)
     case "CURV_f" then
         label=[]
         gr_i=["model=arg1(3);rpar=model(8);ipar=model(9);n=ipar(1);";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=rpar(1:n);yy=rpar(n+1:2*n);";
         "rect=rpar(2*n+1:2*n+4);";
         "mxx=rect(3)-rect(1);";
@@ -1433,7 +1465,7 @@ function o=block_version(o)
         "xx=orig(1)+sz(1)*(1/10+(4/5)*((xx-rect(1))/mxx));";
         "yy=orig(2)+sz(2)*(1/10+(4/5)*((yy-rect(2))/mxy));";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
     case "DELAY_f" then
         orig=o(2)(1)
         sz=o(2)(2)
@@ -1536,7 +1568,10 @@ function o=block_version(o)
         sci2exp([]);
         sci2exp([]);
         string(per)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xrect(orig(1)+sz(1)/10,orig(2)+(1-1/10)*sz(2),sz(1)*8/10,sz(2)*8/10);";
         "xx=[orig(1)+sz(1)/5,orig(1)+sz(1)/5;";
         "orig(1)+(1-1/5)*sz(1),orig(1)+sz(1)/5];";
@@ -1547,7 +1582,7 @@ function o=block_version(o)
         "xx=orig(1)+(1/5+3*t/(10*%pi))*sz(1);";
         "yy=orig(2)+(1/4.3+(sin(t)+1)*3/10)*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
     case "EVTDLY_f" then
         dt=model(8);
         if model(11) then ff=0; else ff=-1; end
@@ -1635,14 +1670,16 @@ function o=block_version(o)
     case "LOOKUP_f" then
         model(10)="c"
         gr_i=["rpar=model(8);n=size(rpar,''*'')/2;";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=rpar(1:n);yy=rpar(n+1:2*n);";
         "mnx=min(xx);xx=xx-mnx*ones(xx);mxx=max(xx);";
         "xx=orig(1)+sz(1)*(1/10+(4/5)*xx/mxx);";
         "mnx=min(yy);yy=yy-mnx*ones(yy);mxx=max(yy);";
         "yy=orig(2)+sz(2)*(1/10+(4/5)*yy/mxx);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
         label=[]
     case "MAX_f" then
         in=model(2);nin=sum(in)
@@ -1710,11 +1747,14 @@ function o=block_version(o)
         pas=rpar(1)
         meth=ipar
         label=[string(pas);string(meth)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=orig(1)+[1;2;2;3;3;4;4]/5*sz(1);";
         "yy= orig(2)+[1;1;2;2;3;3;4]/5*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
     case "RAND_f" then
         rpar=model(8);flag=model(9);
         out=model(3);nout=sum(out)
@@ -1780,11 +1820,14 @@ function o=block_version(o)
         minp=rpar(1),maxp=rpar(2),pente=rpar(3)
         label=[string(minp);string(maxp);string(pente)]
 
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=orig(1)+[4/5;1/2+1/5;1/2-1/5;1/5]*sz(1);";
-        "yy=orig(2)+[1-1/5;1-1/5;1/5;1/5]*sz(2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
+        "xx = orig(1) + [4/5;1/2+1/5;1/2-1/5;1/5]*sz(1);";
+        "yy = orig(2) + [1-1/5;1-1/5;1/5;1/5]*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        "ax.thickness = thick;"]
     case "SAWTOOTH_f" then
         model(10)="c"
         gr_i=["txt=[''sawtooth'';''generator''];";
@@ -1815,18 +1858,21 @@ function o=block_version(o)
         string(per);
         string(N)];
 
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xrect(orig(1)+sz(1)/10,orig(2)+(1-1/10)*sz(2),sz(1)*8/10,sz(2)*8/10);";
-        "xx=[orig(1)+sz(1)/5,orig(1)+sz(1)/5;";
+        "xx = [orig(1)+sz(1)/5,orig(1)+sz(1)/5;";
         "orig(1)+(1-1/5)*sz(1),orig(1)+sz(1)/5];";
-        "yy=[orig(2)+sz(2)/5,orig(2)+sz(2)/5;";
+        "yy = [orig(2)+sz(2)/5,orig(2)+sz(2)/5;";
         "orig(2)+sz(2)/5,orig(2)+(1-1/5)*sz(2)];";
         "xarrows(xx,yy);";
-        "t=(0:0.3:2*%pi)'';";
-        "xx=orig(1)+(1/5+3*t/(10*%pi))*sz(1);";
-        "yy=orig(2)+(1/4.3+(sin(t)+1)*3/10)*sz(2);";
+        "t = (0:0.3:2*%pi)'';";
+        "xx = orig(1) + (1/5+3*t/(10*%pi))*sz(1);";
+        "yy = orig(2) + (1/4.3+(sin(t)+1)*3/10)*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        "ax.thickness = thick;"]
     case "SCOPXY_f" then
         [rpar,ipar]=model(8:9)
         win=ipar(1);N=ipar(3);clrs=-ipar(4);siz=ipar(5)
@@ -1844,12 +1890,15 @@ function o=block_version(o)
         string(ymax);
         string(N)];
         model(9)=[win;1;N;clrs;siz;1;wpos(:);wdim(:)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "t=(0:0.2:2*%pi)'';";
-        "xx=orig(1)+(1/5+(cos(3*t)+1)*3/10)*sz(1);";
-        "yy=orig(2)+(1/4.3+(sin(t+1)+1)*3/10)*sz(2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
+        "t = (0:0.2:2*%pi)'';";
+        "xx = orig(1)+(1/5+(cos(3*t)+1)*3/10)*sz(1);";
+        "yy = orig(2)+(1/4.3+(sin(t+1)+1)*3/10)*sz(2);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        "ax.thickness = thick;"]
     case "SELECT_f" then
         z0=model(7);nin=size(model(2),1);
         label=[string(nin);string(z0-1)]
@@ -1875,14 +1924,17 @@ function o=block_version(o)
         gr_i=[]
     case "SUPER_f" then
         label=[]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=orig(1)+      [2 4 4]*(sz(1)/7);";
         "yy=orig(2)+sz(2)-[2 2 6]*(sz(2)/10);";
         "xrects([xx;yy;[sz(1)/7;sz(2)/5]*ones(1,3)]);";
         "xx=orig(1)+      [1 2 3 4 5 6 3.5 3.5 3.5 4 5 5.5 5.5 5.5]*sz(1)/7;";
         "yy=orig(2)+sz(2)-[3 3 3 3 3 3 3   7   7   7 7 7   7   3  ]*sz(2)/10;";
         "xsegs(xx,yy,0);";
-        "xset(''thickness'',thick)"]
+        "ax.thickness = thick;"]
     case "TANBLK_f" then
         in=model(2);nin=sum(in)
         if nin<>1 then
@@ -1934,18 +1986,21 @@ function o=block_version(o)
         gr_i=[]
     case "TIME_f" then
         label=[]
-        gr_i=["wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "rx=sz(1)*p/2;ry=sz(2)/2;";
-        "xarc(orig(1)+0.05*sz(1),orig(2)+0.95*sz(2),0.9*sz(1)*p,0.9*sz(2),0,360*64);";
-        "xset(''thickness'',1);";
+        gr_i=[
+        "wd = gcf().figure_size .* [1.016,1.12];";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
+        "p = wd(2)/wd(1); p=1;";
+        "rx = sz(1)*p/2; ry=sz(2)/2;";
+        "xarc(orig(1) + 0.05*sz(1),orig(2)+0.95*sz(2),0.9*sz(1)*p,0.9*sz(2),0,360*64);";
+        "ax.thickness = 1;";
         "xx=[orig(1)+rx    orig(1)+rx;";
         "orig(1)+rx    orig(1)+rx+0.6*rx*cos(%pi/6)];";
         "yy=[orig(2)+ry    orig(2)+ry ;";
         "     orig(2)+1.8*ry  orig(2)+ry+0.6*ry*sin(%pi/6)];";
         "xsegs(xx,yy,0);";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
     case "TRASH_f" then
         in=model(2);nin=sum(in)
         if nin<>1 then
@@ -2217,7 +2272,9 @@ function  gr_i=convert_gri(name,gri)
 
     case "CURV_f" then
         gr_i=["model=arg1.model;rpar=model.rpar;ipar=model.ipar;n=ipar(1);";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=rpar(1:n);yy=rpar(n+1:2*n);";
         "rect=rpar(2*n+1:2*n+4);";
         "mxx=rect(3)-rect(1);";
@@ -2225,7 +2282,7 @@ function  gr_i=convert_gri(name,gri)
         "xx=orig(1)+sz(1)*(1/10+(4/5)*((xx-rect(1))/mxx));";
         "yy=orig(2)+sz(2)*(1/10+(4/5)*((yy-rect(2))/mxy));";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
 
     case "EVTDLY_f" then
         gr_i=["dt=model.rpar;";
@@ -2250,14 +2307,16 @@ function  gr_i=convert_gri(name,gri)
 
     case "LOOKUP_f" then
         gr_i=["rpar=model.rpar;n=size(rpar,''*'')/2;";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
+        "ax = gca();";
+        "thick = ax.thickness;";
+        "ax.thickness = 2;";
         "xx=rpar(1:n);yy=rpar(n+1:2*n);";
         "mnx=min(xx);xx=xx-mnx*ones(xx);mxx=max(xx);";
         "xx=orig(1)+sz(1)*(1/10+(4/5)*xx/mxx);";
         "mnx=min(yy);yy=yy-mnx*ones(yy);mxx=max(yy);";
         "yy=orig(2)+sz(2)*(1/10+(4/5)*yy/mxx);";
         "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        "ax.thickness = thick;"]
 
     case "REGISTER_f" then
 
index 1b64e1f..54bf7fc 100644 (file)
@@ -36,8 +36,8 @@ function standard_draw_ports(o)
         orient=%f;
     end
 
-    // xset('pattern',default_color(0));
-    // xset('thickness',1)
+    // gca().foreground = default_color(0);
+    // gca().thickness = 1;
     // draw input/output ports
     //------------------------
 
@@ -69,7 +69,7 @@ function standard_draw_ports(o)
         -1   1]*diag([xf/7,yf/14])
         dy=sz(2)/(nout+1)
 
-        //** xset('pattern',default_color(1))
+        //** gca().foreground = default_color(1);
 
         for k=1:nout
 
@@ -135,7 +135,7 @@ function standard_draw_ports(o)
 
         dy=sz(2)/(nout+1)
 
-        // xset('pattern',default_color(1))
+        // gca().foreground = default_color(1);
         for k=1:nout
 
             if outporttype==[] then
@@ -192,7 +192,7 @@ function standard_draw_ports(o)
 
 
     dx=sz(1)/(clkout+1)
-    //** xset('pattern',default_color(-1))
+    //** gca().foreground = default_color(-1);
 
     for k=1:clkout
         xfpoly(out(:,1)+ones(4,1)*(orig(1)+k*dx), out(:,2)+ones(4,1)*orig(2),1)
@@ -212,6 +212,6 @@ function standard_draw_ports(o)
         gh_e.background = default_color(-1);
     end
 
-    //** xset('pattern',default_color(0))
+    //** gca().foreground = default_color(0);
 
 endfunction
index 513113e..81a1633 100644 (file)
@@ -27,7 +27,7 @@ function standard_draw_ports_up(o)
     nout=size(o.model.out,1);
     outporttype=o.graphics.out_implicit
     [orig,sz]=(o.graphics.orig,o.graphics.sz)
-    xset("pattern",default_color(0));
+    gca().foreground = default_color(0);
 
     // set port shape
 
@@ -43,7 +43,7 @@ function standard_draw_ports_up(o)
 
 
     dy=sz(2)/3
-    xset("pattern",default_color(1))
+    gca().foreground = default_color(1);
     xpoly(out2(:,1)+ones(4,1)*orig(1)-1,..
     out2(:,2)+ones(4,1)*(orig(2)+sz(2)-dy*2),"lines",1)
     xpoly(in2(:,1)+ones(4,1)*(orig(1)+sz(1))+1,..
index bdbf9f7..f3a8867 100644 (file)
@@ -59,14 +59,16 @@ function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(model.rpar)
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "thick = gca().thickness;"
+        "gca().thickness = 2;"
         "xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]"
         "yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]"
         "xpoly(xx,yy,''lines'')"
         "xx=orig(1)+sz(1)*[.5 .6]"
         "yy=orig(2)+sz(2)*[.4 .8]"
         "xpoly(xx,yy)"
-        "xset(''thickness'',thick);"]
+        "gca().thickness = thick;"]
         x=standard_define([3 3],model,exprs,gr_i)
     end
 endfunction
index 72cb90d..322455d 100644 (file)
@@ -42,9 +42,9 @@ function bache_draw_ports(o)
     if subStr<>"" then
         orient=%f;
     end
-    xset("pattern",default_color(0));
+    gca().foreground = default_color(0);
 
-    //xset('thickness',1)
+    //gca().thickness = 1;
     // draw input/output ports
     //------------------------
 
@@ -71,7 +71,7 @@ function bache_draw_ports(o)
         0   1
         -1   1]*diag([xf/7,yf/14])
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
 
         for k=1:nout
             if outporttype==[] then
@@ -128,7 +128,7 @@ function bache_draw_ports(o)
 
 
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
         for k=1:nout
             if outporttype==[] then
                 xfpoly(out1(:,1)+ones(4,1)*orig(1)-1,..
@@ -177,7 +177,7 @@ function bache_draw_ports(o)
 
 
     dx=sz(1)/(clkout+1)
-    xset("pattern",default_color(-1))
+    gca().foreground = default_color(-1);
     for k=1:clkout
         xfpoly(out(:,1)+ones(4,1)*(orig(1)+k*dx),..
         out(:,2)+ones(4,1)*orig(2),1)
@@ -187,5 +187,5 @@ function bache_draw_ports(o)
         xfpoly(in(:,1)+ones(4,1)*(orig(1)+k*dx),..
         in(:,2)+ones(4,1)*(orig(2)+sz(2)),1)
     end
-    xset("pattern",default_color(0))
+    gca().foreground = default_color(0);
 endfunction
index 3770fd7..0da95ca 100644 (file)
@@ -42,9 +42,9 @@ function puit_draw_ports(o)
     if subStr<>"" then
         orient=%f;
     end
-    xset("pattern",default_color(0));
+    gca().foreground = default_color(0);
 
-    //xset('thickness',1)
+    //gca().thickness = 1;
     // draw input/output ports
     //------------------------
 
@@ -72,7 +72,7 @@ function puit_draw_ports(o)
         0   1
         -1   1]*diag([xf/7,yf/14])
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1));
+        gca().foreground = default_color(1);
 
         dy=sz(2)/(nin+1);
         for k=1:nin
@@ -122,7 +122,7 @@ function puit_draw_ports(o)
 
 
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
 
         dy=sz(2)/(nin+1)
         for k=1:nin
index 23465fc..a5ce389 100644 (file)
@@ -42,9 +42,9 @@ function source_draw_ports(o)
     if subStr<>"" then
         orient=%f;
     end
-    xset("pattern",default_color(0));
+    gca().foreground = default_color(0);
 
-    //xset('thickness',1)
+    //gca().thickness = 1;
     // draw input/output ports
     //------------------------
 
@@ -73,7 +73,7 @@ function source_draw_ports(o)
         0   1]*diag([xf/7,yf/14])
 
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
         xpoly(out2(:,1)+(orig(1)+sz(1)),..
         out2(:,2)+(orig(2)+sz(2)/2),"lines",1)
 
@@ -125,7 +125,7 @@ function source_draw_ports(o)
 
 
         dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
 
         xpoly(out2(:,1)+ones(4,1)*orig(1)-1,..
         out2(:,2)+ones(4,1)*(orig(2)+sz(2)/2),"lines",1)
index ffe9533..4f2cd58 100644 (file)
@@ -27,7 +27,8 @@ function vanne_draw_ports(o)
     if subStr<>"" then
         orient=%f;
     end
-    xset("pattern",default_color(0))
+    gca().foreground = default_color(0);
+
     // draw input/output ports
     //------------------------
 
@@ -43,7 +44,7 @@ function vanne_draw_ports(o)
         0   1
         -1   1]*diag([xf/7,yf/14])
         //dy=sz(2)/2
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
         //xpoly(out2(:,1)+(orig(1)+sz(1)),..
         //  out2(:,2)+(orig(2)+sz(2)-dy),"lines",1)
         xpoly(out2(:,1)+(orig(1)+sz(1)),..
@@ -68,7 +69,7 @@ function vanne_draw_ports(o)
 
 
         //dy=sz(2)/2
-        xset("pattern",default_color(1))
+        gca().foreground = default_color(1);
         //xpoly(out2(:,1)+ones(4,1)*orig(1)-1,..
         //    out2(:,2)+ones(4,1)*(orig(2)+sz(2)-dy),"lines",1)
         //dy=sz(2)/2
index e798a3f..e3b3816 100644 (file)
@@ -60,14 +60,12 @@ function [x,y,typ]=TEXT_f(job,arg1,arg2)
                 graphics.exprs = exprs
 
                 //** save the font
-                //** oldfont = xget('font')
                 gh_winpal = gca(); //** get the current Axes proprieties
                 default_font_style = gh_winpal.font_style ;
                 default_font_size  = gh_winpal.font_size  ;
                 default_font_color = gh_winpal.font_color ;
 
                 //** set the new font
-                //** xset('font',font,siz)
                 gh_winpal.font_style = font ;
                 gh_winpal.font_size  = siz  ;
 
@@ -76,7 +74,6 @@ function [x,y,typ]=TEXT_f(job,arg1,arg2)
                 r = xstringl(0,0,exprs(1),evstr(exprs(2)),evstr(exprs(3)));
 
                 //** restore the old font
-                //** xset('font',oldfont(1),oldfont(2));
                 gh_winpal.font_style = default_font_style ;
                 gh_winpal.font_size  = default_font_size  ;
                 gh_winpal.font_color = default_font_color ;
index fce7c12..c61b90c 100644 (file)
@@ -32,17 +32,18 @@ function [blocks] = anim_pen(blocks,flag)
     phi=rpar(3);
     rcirc=csiz/3;
     if flag==4 then
-        xset("window",win)
+        scf(win)
         set("figure_style","new")
         H=scf(win)
         clf(H)
         Axe=H.children
         Axe.data_bounds=rpar(4:7)
         Axe.isoview="on"
+        color_old = Axe.foreground
 
         S=[cos(phi),-sin(phi);sin(phi),cos(phi)]
         XY=S*[rpar(4),rpar(5);-csiz,-csiz]
-        xset("color",3)
+        Axe.foreground = 3;
         xsegs(XY(1,:),XY(2,:)-rcirc)
 
         x=0;
@@ -52,15 +53,15 @@ function [blocks] = anim_pen(blocks,flag)
         y1=-csiz;
         y2=csiz
         XY=S*[x1 x2 x2 x1 x1;y1,y1,y2,y2,y1]
-        xset("color",5)
+        Axe.foreground = 5;
         xfpoly(XY(1,:),XY(2,:))// cart
-        xset("color",2)
+        Axe.foreground = 2;
         xfarc(XY(1,1),XY(2,1),rcirc,rcirc,0,360*64) //wheel
         xfarc(XY(1,2),XY(2,2),rcirc,rcirc,0,360*64) //wheel
 
         XY=S*[x,x+plen*sin(theta);0,0+plen*cos(theta)]//pendulum
-        xset("color",2)
         xsegs(XY(1,:),XY(2,:))
+        Axe.foreground = color_old
 
     elseif flag==2 then
         Axe=H.children
index f76cb25..18d0921 100644 (file)
@@ -49,24 +49,24 @@ function [blocks] = bplatform2(blocks,flag)
         y0=(ymin+ymax)/2;
         XY1=[x0-3, x0+3,x0+3,x0-3,x0-3]
         XY2=[y0, y0,y0-2*tplat,y0-2*tplat,y0]
-        xset("color",5)
+        Axe.foreground = 5;
         xfpoly(XY1,XY2,0)
 
-        xset("color",2)
+        Axe.foreground = 2;
         xfarc(x0-rcirc/2,y0+6,rcirc,rcirc,0,360*64)
 
         XY1=[xmin, xmax];
         XY2=[ymin, ymin];
         xpoly(XY1,XY2,"lines",0) //Ground
 
-        xset("color",3)
+        Axe.foreground = 3;
         ym=y0-2*tplat;
         d0=ym/9;
         XY1=[x0,x0-0.2,x0+0.2 ,x0-0.2 ,x0+0.2, x0-0.2 ,x0+0.2 ,x0-0.2 , x0+0.2,x0     ];
         XY2=[ym,ym-d0 ,ym-2*d0,ym-3*d0,ym-4*d0,ym-5*d0,ym-6*d0,ym-7*d0,ym-8*d0,ym-9*d0];
         xpoly(XY1,XY2,"lines",0)
 
-        xset("color",0)
+        Axe.foreground = 0;
 
         //** UPDATE
     elseif flag==2 then
index 32d49df..a9724cc 100644 (file)
@@ -26,15 +26,16 @@ function [x,y,typ]=CLKOUTV_f(job,arg1,arg2)
     typ=[];
     select job
     case "plot" then
+        ax = gca();
         xf=60;
         yf=40;
         orig=arg1.graphics.orig;
         sz=arg1.graphics.sz;
         prt=arg1.model.ipar;
-        pat=xget("pattern");
-        xset("pattern",default_color(-1));
-        thick=xget("thickness");
-        xset("thickness",2);
+        pat = ax.foreground;
+        ax.foreground = default_color(-1);
+        thick = ax.thickness;
+        ax.thickness = 2;
         x=orig(1)+sz(1)*[1/2;1;  1;0;0  ];
         y=orig(2)+sz(2)*[0;  1/3;1;1;1/3];
         xo=orig(1);
@@ -43,11 +44,11 @@ function [x,y,typ]=CLKOUTV_f(job,arg1,arg2)
         gr_i=arg1.graphics.gr_i;
         if type(gr_i)==15 then
             coli=gr_i(2);
-            pcoli=xget("pattern");
+            pcoli = ax.foreground;
             xfpolys(x,y,coli);
-            xset("pattern",coli);
+            ax.foreground = coli;
             xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5);
-            xset("pattern",pcoli);
+            ax.foreground = pcoli;
             xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5);
         else
             xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5);
@@ -59,18 +60,20 @@ function [x,y,typ]=CLKOUTV_f(job,arg1,arg2)
         -1/14  1/7]*diag([xf,yf]);
         xfpoly(in(:,1)+ones(4,1)*(orig(1)+sz(1)/2),..
         in(:,2)+ones(4,1)*(orig(2)+sz(2)),1);
-        xset("thickness",thick);
-        xset("pattern",pat);
+        ax.thickness = thick;
+        ax.foreground = pat;
 
         ident = arg1.graphics.id
         if ident <> [] & ident <> "" then
-            font=xget("font");
-            xset("font", options.ID(1)(1), options.ID(1)(2));
+            font = [ax.font_style, ax.font_size];
+            ax.font_style = options.ID(1)(1);
+            ax.font_size = options.ID(1)(2);
             rectangle = xstringl(orig(1), orig(2), ident);
             w = rectangle(3);
             h = rectangle(4);
             xstringb(orig(1)+sz(1)/2-w/2, orig(2)-3*h/2 , ident , w, h);
-            xset("font", font(1), font(2));
+            ax.font_style = font(1);
+            ax.font_size = font(2);
         end
         x=[];y=[];
     case "getinputs" then
index 31581cc..06e577e 100644 (file)
@@ -28,10 +28,10 @@ function [Nz,Dz]=yulewalk(Norder, frq, mag)
     //
     // Example: f=[0,0.4,0.4,0.6,0.6,1];H=[0,0,1,1,0,0];Hz=yulewalk(8,f,H);
     //fs=1000;fhz = f*fs/2;
-    //clf(0);xset('window',0);plot2d(fhz',H');
+    //clf(0); scf(0); plot2d(fhz',H');
     //xtitle('Desired Frequency Response')
     //[frq,repf]=repfreq(Hz,0:0.001:0.5);
-    //clf(1);xset('window',1);plot2d(fs*frq',abs(repf'));
+    //clf(1); scf(1); plot2d(fs*frq',abs(repf'));
     //xtitle('Obtained Frequency Response')
     //
     [LHS,RHS]=argn(0);
index 75ce38a..13ef1f3 100644 (file)
@@ -37,7 +37,7 @@ function [col, mark] = ana_style(style)
                     end
                 end
                 col = evstr(part(style,1:ic-1))
-                nb_col = xget("lastpattern")
+                nb_col = size(gcf().color_map, 1)
                 if col < 1  |  col > nb_col then
                     col = default_markColor
                 end
index 2ddfffe..d7625e4 100644 (file)
@@ -59,14 +59,16 @@ function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(model.rpar)
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "thick = gca().thickness;"
+        "gca().thickness = 2;"
         "xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]"
         "yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]"
         "xpoly(xx,yy,''lines'')"
         "xx=orig(1)+sz(1)*[.5 .6]"
         "yy=orig(2)+sz(2)*[.4 .8]"
         "xpoly(xx,yy)"
-        "xset(''thickness'',thick);"]
+        "gca().thickness = thick;"]
         x=standard_define([3 3],model,exprs,gr_i)
     end
 endfunction
index e46304f..cfa802e 100644 (file)
@@ -292,11 +292,10 @@ function [%cpr, ok] = xcos_simulate(scs_m, needcompile)
             end
 
             ok = %f;
-            //xset('window',curwin)
+            // scf(curwin)
             return
         end
         //scf(gh_win);
-        //xset('window',win);
     end
 
     //** scicos simulation
index 2ddfffe..d7625e4 100644 (file)
@@ -59,14 +59,16 @@ function [x,y,typ]=PENDULUM_ANIM(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(model.rpar)
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
+        gr_i=[
+        "thick = gca().thickness;"
+        "gca().thickness = 2;"
         "xx=orig(1)+sz(1)*[.4 .6 .6 .4 .4]"
         "yy=orig(2)+sz(2)*[.2 .2 .4 .4 .2]"
         "xpoly(xx,yy,''lines'')"
         "xx=orig(1)+sz(1)*[.5 .6]"
         "yy=orig(2)+sz(2)*[.4 .8]"
         "xpoly(xx,yy)"
-        "xset(''thickness'',thick);"]
+        "gca().thickness = thick;"]
         x=standard_define([3 3],model,exprs,gr_i)
     end
 endfunction