package b4a.ClassDraw;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.pc.*;

public class square_subs_0 {


public static RemoteObject  _class_globals(RemoteObject __ref) throws Exception{
 //BA.debugLineNum = 2;BA.debugLine="Sub Class_Globals";
 //BA.debugLineNum = 3;BA.debugLine="Private mx, my, mWidth As Int";
square._mx = RemoteObject.createImmutable(0);__ref.setField("_mx",square._mx);
square._my = RemoteObject.createImmutable(0);__ref.setField("_my",square._my);
square._mwidth = RemoteObject.createImmutable(0);__ref.setField("_mwidth",square._mwidth);
 //BA.debugLineNum = 4;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
public static RemoteObject  _draw(RemoteObject __ref,RemoteObject _c) throws Exception{
try {
		Debug.PushSubsStack("Draw (square) ","square",2,__ref.getField(false, "ba"),__ref,14);
if (RapidSub.canDelegate("draw")) return __ref.runUserSub(false, "square","draw", __ref, _c);
RemoteObject _r = RemoteObject.declareNull("anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper");
Debug.locals.put("c", _c);
 BA.debugLineNum = 14;BA.debugLine="Sub Draw(c As Canvas)";
Debug.ShouldStop(8192);
 BA.debugLineNum = 15;BA.debugLine="Private r As Rect";
Debug.ShouldStop(16384);
_r = RemoteObject.createNew ("anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper");Debug.locals.put("r", _r);
 BA.debugLineNum = 16;BA.debugLine="r.Initialize(mx, my, mx + mWidth, my + mWidth)";
Debug.ShouldStop(32768);
_r.runVoidMethod ("Initialize",(Object)(__ref.getField(true,"_mx")),(Object)(__ref.getField(true,"_my")),(Object)(RemoteObject.solve(new RemoteObject[] {__ref.getField(true,"_mx"),__ref.getField(true,"_mwidth")}, "+",1, 1)),(Object)(RemoteObject.solve(new RemoteObject[] {__ref.getField(true,"_my"),__ref.getField(true,"_mwidth")}, "+",1, 1)));
 BA.debugLineNum = 17;BA.debugLine="c.DrawRect(r, Colors.Red, False, 1dip)";
Debug.ShouldStop(65536);
_c.runVoidMethod ("DrawRect",(Object)((_r.getObject())),(Object)(square.__c.getField(false,"Colors").getField(true,"Red")),(Object)(square.__c.getField(true,"False")),(Object)(BA.numberCast(float.class, square.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 1))))));
 BA.debugLineNum = 18;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _initialize(RemoteObject __ref,RemoteObject _ba,RemoteObject _shapes,RemoteObject _x,RemoteObject _y,RemoteObject _width) throws Exception{
try {
		Debug.PushSubsStack("Initialize (square) ","square",2,__ref.getField(false, "ba"),__ref,7);
if (RapidSub.canDelegate("initialize")) return __ref.runUserSub(false, "square","initialize", __ref, _ba, _shapes, _x, _y, _width);
__ref.runVoidMethodAndSync("innerInitializeHelper", _ba);
Debug.locals.put("ba", _ba);
Debug.locals.put("Shapes", _shapes);
Debug.locals.put("x", _x);
Debug.locals.put("y", _y);
Debug.locals.put("Width", _width);
 BA.debugLineNum = 7;BA.debugLine="Sub Initialize (Shapes As List, x As Int, y As Int";
Debug.ShouldStop(64);
 BA.debugLineNum = 8;BA.debugLine="mx = x";
Debug.ShouldStop(128);
__ref.setField ("_mx",_x);
 BA.debugLineNum = 9;BA.debugLine="my = y";
Debug.ShouldStop(256);
__ref.setField ("_my",_y);
 BA.debugLineNum = 10;BA.debugLine="mWidth = Width";
Debug.ShouldStop(512);
__ref.setField ("_mwidth",_width);
 BA.debugLineNum = 11;BA.debugLine="Shapes.Add(Me)";
Debug.ShouldStop(1024);
_shapes.runVoidMethod ("Add",(Object)(__ref));
 BA.debugLineNum = 12;BA.debugLine="End Sub";
Debug.ShouldStop(2048);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
}