package b4a.ClassDraw;

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

public class main_subs_0 {


public static RemoteObject  _activity_create(RemoteObject _firsttime) throws Exception{
try {
		Debug.PushSubsStack("Activity_Create (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,23);
if (RapidSub.canDelegate("activity_create")) return main.remoteMe.runUserSub(false, "main","activity_create", _firsttime);
RemoteObject _square1 = RemoteObject.declareNull("b4a.ClassDraw.square");
RemoteObject _square2 = RemoteObject.declareNull("b4a.ClassDraw.square");
RemoteObject _circle1 = RemoteObject.declareNull("b4a.ClassDraw.circle");
Debug.locals.put("FirstTime", _firsttime);
 BA.debugLineNum = 23;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
Debug.ShouldStop(4194304);
 BA.debugLineNum = 24;BA.debugLine="cvsMain.Initialize(Activity)";
Debug.ShouldStop(8388608);
main.mostCurrent._cvsmain.runVoidMethod ("Initialize",(Object)((main.mostCurrent._activity.getObject())));
 BA.debugLineNum = 25;BA.debugLine="Private Square1, Square2 As Square";
Debug.ShouldStop(16777216);
_square1 = RemoteObject.createNew ("b4a.ClassDraw.square");Debug.locals.put("Square1", _square1);
_square2 = RemoteObject.createNew ("b4a.ClassDraw.square");Debug.locals.put("Square2", _square2);
 BA.debugLineNum = 26;BA.debugLine="Private Circle1 As Circle";
Debug.ShouldStop(33554432);
_circle1 = RemoteObject.createNew ("b4a.ClassDraw.circle");Debug.locals.put("Circle1", _circle1);
 BA.debugLineNum = 27;BA.debugLine="Shapes.Initialize";
Debug.ShouldStop(67108864);
main._shapes.runVoidMethod ("Initialize");
 BA.debugLineNum = 28;BA.debugLine="Square1.Initialize(Shapes, 110dip, 110dip, 50dip)";
Debug.ShouldStop(134217728);
_square1.runClassMethod (b4a.ClassDraw.square.class, "_initialize",main.processBA,(Object)(main._shapes),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 110)))),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 110)))),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 50)))));
 BA.debugLineNum = 29;BA.debugLine="Square2.Initialize(Shapes, 10dip, 10dip, 100dip)";
Debug.ShouldStop(268435456);
_square2.runClassMethod (b4a.ClassDraw.square.class, "_initialize",main.processBA,(Object)(main._shapes),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 10)))),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 10)))),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 100)))));
 BA.debugLineNum = 30;BA.debugLine="Circle1.Initialize(Shapes, 50%x, 50%y, 100dip)";
Debug.ShouldStop(536870912);
_circle1.runClassMethod (b4a.ClassDraw.circle.class, "_initialize",main.processBA,(Object)(main._shapes),(Object)(main.mostCurrent.__c.runMethod(true,"PerXToCurrent",(Object)(BA.numberCast(float.class, 50)),main.mostCurrent.activityBA)),(Object)(main.mostCurrent.__c.runMethod(true,"PerYToCurrent",(Object)(BA.numberCast(float.class, 50)),main.mostCurrent.activityBA)),(Object)(main.mostCurrent.__c.runMethod(true,"DipToCurrent",(Object)(BA.numberCast(int.class, 100)))));
 BA.debugLineNum = 32;BA.debugLine="DrawAllShapes";
Debug.ShouldStop(-2147483648);
_drawallshapes();
 BA.debugLineNum = 33;BA.debugLine="End Sub";
Debug.ShouldStop(1);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_pause(RemoteObject _userclosed) throws Exception{
try {
		Debug.PushSubsStack("Activity_Pause (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,39);
if (RapidSub.canDelegate("activity_pause")) return main.remoteMe.runUserSub(false, "main","activity_pause", _userclosed);
Debug.locals.put("UserClosed", _userclosed);
 BA.debugLineNum = 39;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
Debug.ShouldStop(64);
 BA.debugLineNum = 41;BA.debugLine="End Sub";
Debug.ShouldStop(256);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _activity_resume() throws Exception{
try {
		Debug.PushSubsStack("Activity_Resume (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,35);
if (RapidSub.canDelegate("activity_resume")) return main.remoteMe.runUserSub(false, "main","activity_resume");
 BA.debugLineNum = 35;BA.debugLine="Sub Activity_Resume";
Debug.ShouldStop(4);
 BA.debugLineNum = 37;BA.debugLine="End Sub";
Debug.ShouldStop(16);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _drawallshapes() throws Exception{
try {
		Debug.PushSubsStack("DrawAllShapes (main) ","main",0,main.mostCurrent.activityBA,main.mostCurrent,43);
if (RapidSub.canDelegate("drawallshapes")) return main.remoteMe.runUserSub(false, "main","drawallshapes");
RemoteObject _i = RemoteObject.createImmutable(0);
 BA.debugLineNum = 43;BA.debugLine="Private Sub DrawAllShapes";
Debug.ShouldStop(1024);
 BA.debugLineNum = 44;BA.debugLine="Private i As Int";
Debug.ShouldStop(2048);
_i = RemoteObject.createImmutable(0);Debug.locals.put("i", _i);
 BA.debugLineNum = 46;BA.debugLine="For i = 0 To Shapes.Size - 1";
Debug.ShouldStop(8192);
{
final int step2 = 1;
final int limit2 = RemoteObject.solve(new RemoteObject[] {main._shapes.runMethod(true,"getSize"),RemoteObject.createImmutable(1)}, "-",1, 1).<Integer>get().intValue();
for (_i = BA.numberCast(int.class, 0) ; (step2 > 0 && _i.<Integer>get().intValue() <= limit2) || (step2 < 0 && _i.<Integer>get().intValue() >= limit2); _i = RemoteObject.createImmutable((int)(0 + _i.<Integer>get().intValue() + step2)) ) {
Debug.locals.put("i", _i);
 BA.debugLineNum = 47;BA.debugLine="CallSub2(Shapes.Get(i), \"Draw\", cvsMain)";
Debug.ShouldStop(16384);
main.mostCurrent.__c.runMethodAndSync(false,"CallSubNew2",main.mostCurrent.activityBA,(Object)(main._shapes.runMethod(false,"Get",(Object)(_i))),(Object)(BA.ObjectToString("Draw")),(Object)((main.mostCurrent._cvsmain)));
 }
}Debug.locals.put("i", _i);
;
 BA.debugLineNum = 49;BA.debugLine="Activity.Invalidate";
Debug.ShouldStop(65536);
main.mostCurrent._activity.runVoidMethod ("Invalidate");
 BA.debugLineNum = 50;BA.debugLine="End Sub";
Debug.ShouldStop(131072);
return RemoteObject.createImmutable("");
}
catch (Exception e) {
			Debug.ErrorCaught(e);
			throw e;
		} 
finally {
			Debug.PopSubsStack();
		}}
public static RemoteObject  _globals() throws Exception{
 //BA.debugLineNum = 19;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 20;BA.debugLine="Private cvsMain As Canvas";
main.mostCurrent._cvsmain = RemoteObject.createNew ("anywheresoftware.b4a.objects.drawable.CanvasWrapper");
 //BA.debugLineNum = 21;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}

public static void initializeProcessGlobals() {
    
    if (main.processGlobalsRun == false) {
	    main.processGlobalsRun = true;
		try {
		        main_subs_0._process_globals();
starter_subs_0._process_globals();
main.myClass = BA.getDeviceClass ("b4a.ClassDraw.main");
starter.myClass = BA.getDeviceClass ("b4a.ClassDraw.starter");
square.myClass = BA.getDeviceClass ("b4a.ClassDraw.square");
circle.myClass = BA.getDeviceClass ("b4a.ClassDraw.circle");
		
        } catch (Exception e) {
			throw new RuntimeException(e);
		}
    }
}public static RemoteObject  _process_globals() throws Exception{
 //BA.debugLineNum = 15;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 16;BA.debugLine="Public Shapes As List";
main._shapes = RemoteObject.createNew ("anywheresoftware.b4a.objects.collections.List");
 //BA.debugLineNum = 17;BA.debugLine="End Sub";
return RemoteObject.createImmutable("");
}
}