const char *g_java_support_template [] =
{
	"package com.runrev.external;\n",
	"\n",
	"import java.lang.*;\n",
	"import android.app.*;\n",
	"import android.view.*;\n",
	"import android.content.*;\n",
	"import com.runrev.android.EngineApi;\n",
	"\n",
	"public class LC\n",
	"{\n",
	"	public static final int USE_CASE_SENSITIVE = 1 << 30;\n",
	"	public static final int USE_CONVERT_OCTALS = 1 << 28;\n",
	"	public static final int USE_NUMBER_FORMAT_DECIMAL = 0 << 26;\n",
	"	public static final int USE_NUMBER_FORMAT_SCIENTIFIC = 1 << 26;\n",
	"	public static final int USE_NUMBER_FORMAT_COMPACT = 2 << 26;\n",
	"\n",
	"	public class Error extends RuntimeException\n",
	"	{\n",
	"		private int m_code;\n",
	"		\n",
	"		public Error(int p_code)\n",
	"		{\n",
	"			m_code = p_code;\n",
	"		}\n",
	"		\n",
	"		public int getCode()\n",
	"		{\n",
	"			return m_code;\n",
	"		}\n",
	"	};\n",
	"\n",
	"	/*public static class Array\n",
	"	{\n",
	"		private long m_pointer;\n",
	"		\n",
	"		public Array()\n",
	"		{\n",
	"			m_pointer = ArrayCreate(0);\n",
	"		}\n",
	"		\n",
	"		public void Release()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				return;\n",
	"			\n",
	"			ArrayRelease(m_pointer);\n",
	"			m_pointer = 0;\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		public int CountKeys()\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayCountKeys(m_pointer, 0, null);\n",
	"		}\n",
	"		\n",
	"		public String[] ListKeys()\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayListKeys(m_pointer, 0, null);\n",
	"		}\n",
	"		\n",
	"		public void RemoveKeys()\n",
	"		{\n",
	"			Check();\n",
	"			ArrayRemoveKeys(m_pointer, 0, null);\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		boolean HasKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayHasKey(m_pointer, 0, null, p_key);\n",
	"		}\n",
	"		\n",
	"		boolean HasExactKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayHasKey(m_pointer, USE_CASE_SENSITIVE, null, p_key);\n",
	"		}\n",
	"		\n",
	"		java.lang.Object FetchKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayFetchKey(m_pointer, 0, null, p_key);\n",
	"		}\n",
	"		\n",
	"		java.lang.Object FetchExactKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			return ArrayFetchKey(m_pointer, USE_CASE_SENSITIVE, null, p_key);\n",
	"		}\n",
	"		\n",
	"		void StoreKey(String p_key, Object p_value)\n",
	"		{\n",
	"			Check();\n",
	"			ArrayStoreKey(m_pointer, 0, null, p_key, p_value);\n",
	"		}\n",
	"		\n",
	"		void StoreExactKey(String p_key, Object p_value)\n",
	"		{\n",
	"			Check();\n",
	"			ArrayStoreKey(m_pointer, USE_CASE_SENSITIVE, null, p_key, p_value);\n",
	"		}\n",
	"		\n",
	"		void RemoveKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			ArrayRemoveKey(m_pointer, 0, null, p_key);\n",
	"		}\n",
	"		\n",
	"		void RemoveExactKey(String p_key)\n",
	"		{\n",
	"			Check();\n",
	"			ArrayRemoveKey(m_pointer, USE_CASE_SENSITIVE, null, p_key);\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		protected void finalize() throws java.lang.Throwable\n",
	"		{\n",
	"			Release();\n",
	"			super.finalize();\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		private Array(long p_pointer)\n",
	"		{\n",
	"			m_pointer = p_pointer;\n",
	"		}\n",
	"		\n",
	"		private void Check()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				throw new RuntimeException();\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"	};*/\n",
	"	\n",
	"	public static class Object\n",
	"	{\n",
	"		private long m_pointer;\n",
	"		\n",
	"		public Object(String p_chunk)\n",
	"		{\n",
	"			m_pointer = __ObjectResolve(p_chunk);\n",
	"		}\n",
	"		\n",
	"		public void Release()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				return;\n",
	"				\n",
	"			__ObjectRelease(m_pointer);\n",
	"				\n",
	"			m_pointer = 0;\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		public boolean Exists()\n",
	"		{\n",
	"			Check();\n",
	"			return true;\n",
	"		}\n",
	"			\n",
	"		//////////\n",
	"		\n",
	"		public void Send(String p_message, java.lang.Object... p_arguments)\n",
	"		{\n",
	"			Check();\n",
	"			__ObjectSend(m_pointer, p_message, p_arguments);\n",
	"		}\n",
	"		\n",
	"		public void Post(String p_message, java.lang.Object... p_arguments)\n",
	"		{\n",
	"			Check();\n",
	"			__ObjectPost(m_pointer, p_message, p_arguments);\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"		\n",
	"		private Object(long p_pointer)\n",
	"		{\n",
	"			m_pointer = p_pointer;\n",
	"		}\n",
	"		\n",
	"		private void Check()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				throw new RuntimeException();\n",
	"		}\n",
	"		\n",
	"		//////////\n",
	"	};\n",
	"	\n",
	"	public static class Wait\n",
	"	{\n",
	"		private long m_pointer;\n",
	"		\n",
	"		public Wait(boolean p_allow_dispatch)\n",
	"		{\n",
	"			if (p_allow_dispatch)\n",
	"				m_pointer = __WaitCreate(1);\n",
	"			else\n",
	"				m_pointer = __WaitCreate(0);\n",
	"		}\n",
	"		\n",
	"		public void Release()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				return;\n",
	"			\n",
	"			__WaitRelease(m_pointer);\n",
	"			\n",
	"			m_pointer = 0;\n",
	"		}\n",
	"		\n",
	"		public boolean IsRunning()\n",
	"		{\n",
	"			Check();\n",
	"			return __WaitIsRunning(m_pointer);\n",
	"		}\n",
	"		\n",
	"		public void Run()\n",
	"		{\n",
	"			Check();\n",
	"			__WaitRun(m_pointer);\n",
	"		}\n",
	"		\n",
	"		public void Break()\n",
	"		{\n",
	"			Check();\n",
	"			__WaitBreak(m_pointer);\n",
	"		}\n",
	"		\n",
	"		public void Reset()\n",
	"		{\n",
	"			Check();\n",
	"			__WaitReset(m_pointer);\n",
	"		}\n",
	"		\n",
	"		private void Check()\n",
	"		{\n",
	"			if (m_pointer == 0)\n",
	"				throw new RuntimeException();\n",
	"		}\n",
	"		\n",
	"		protected void finalize() throws java.lang.Throwable\n",
	"		{\n",
	"			Release();\n",
	"			super.finalize();\n",
	"		}\n",
	"	};\n",
	"	\n",
	"	public static Object ContextMe()\n",
	"	{\n",
	"		return new Object(__ContextMe());\n",
	"	}\n",
	"	\n",
	"	public static Object ContextTarget()\n",
	"	{\n",
	"		return new Object(__ContextTarget());\n",
	"	}\n",
	"	\n",
	"	///////////\n",
	"	\n",
	"	public static Activity InterfaceQueryActivity()\n",
	"	{\n",
	"		return getEngineApi() . getActivity();\n",
	"	}\n",
	"	\n",
	"	public static ViewGroup InterfaceQueryContainer()\n",
	"	{\n",
	"		return getEngineApi() . getContainer();\n",
	"	}\n",
	"    \n",
	"    public static double InterfaceQueryViewScale()\n",
	"    {\n",
	"        return __InterfaceQueryViewScale();\n",
	"    }\n",
	"	\n",
	"	//////////\n",
	"	\n",
	"	public interface ActivityResultCallback\n",
	"	{\n",
	"		public abstract void handleActivityResult(int resultCode, Intent data);\n",
	"	};\n",
	"\n",
	"	public static void ActivityRun(Intent p_intent, ActivityResultCallback p_callback)\n",
	"	{\n",
	"		final ActivityResultCallback t_callback = p_callback;\n",
	"		getEngineApi() . runActivity(p_intent, new EngineApi.ActivityResultCallback() {\n",
	"			public void handleActivityResult(int resultCode, Intent data)\n",
	"			{\n",
	"				t_callback . handleActivityResult(resultCode, data);\n",
	"			}\n",
	"		});\n",
	"	}\n",
	"	\n",
	"	//////////\n",
	"	\n",
	"	public static void RunOnSystemThread(Runnable p_callback)\n",
	"	{\n",
	"		__RunOnSystemThread(p_callback);\n",
	"	}\n",
	"	\n",
	"	//////////\n",
	"	\n",
	"	private static EngineApi s_engine_api = null;\n",
	"	\n",
	"	private static EngineApi getEngineApi()\n",
	"	{\n",
	"		if (s_engine_api == null)\n",
	"			s_engine_api = __InterfaceQueryEngine();\n",
	"		return s_engine_api;\n",
	"	}\n",
	"	\n",
	"	//////////\n",
	"	\n",
	"	/*private static native long ArrayCreate(int options);\n",
	"	private static native void ArrayRetain(long array);\n",
	"	private static native void ArrayRelease(long array);\n",
	"	private static native int ArrayCountKeys(long array, int options, String[] path);\n",
	"	private static native String[] ArrayListKeys(long array, int options, String[] path);\n",
	"	private static native void ArrayRemoveKeys(long array, int options, String[] path);\n",
	"	\n",
	"	private static native boolean ArrayHasKey(long array, int options, String[] path, String key);\n",
	"	private static native java.lang.Object ArrayFetchKey(long array, int options, String[] path, String key);\n",
	"	private static native void ArrayStoreKey(long array, int options, String[] path, String key, java.lang.Object value);\n",
	"	private static native void ArrayRemoveKey(long array, int options, String[] path, String key);*/\n",
	"	\n",
	"	private static native long __ObjectResolve(String chunk);\n",
	"	private static native void __ObjectRetain(long object);\n",
	"	private static native void __ObjectRelease(long object);\n",
	"	private static native boolean __ObjectExists(long object);\n",
	"	private static native void __ObjectSend(long object, String message, java.lang.Object[] arguments);\n",
	"	private static native void __ObjectPost(long object, String message, java.lang.Object[] arguments);\n",
	"	/*private static native java.lang.Object __ObjectGet(long object, int options, String property, String key);\n",
	"	private static native void __ObjectSet(long object, int options, String property, String key);*/\n",
	"	\n",
	"	private static native long __ContextMe();\n",
	"	private static native long __ContextTarget();\n",
	"	/*private static native long __ContextDefaultStack();\n",
	"	private static native long __ContextDefaultCard();\n",
	"	public static native boolean __ContextCaseSensitive();\n",
	"	public static native boolean __ContextConvertOctals();\n",
	"	public static native boolean __ContextWholeMatches();\n",
	"	private static native Object __ContextItemDelimiter(int options);\n",
	"	private static native Object __ContextLineDelimiter(int options);\n",
	"	private static native Object __ContextRowDelimiter(int options);\n",
	"	private static native Object __ContextColumnDelimiter(int options);\n",
	"	private static native Object __ContextResult(int options);\n",
	"	private static native Object __ContextIt(int options);\n",
	"	private static native Object __ContextEvaluate(String expression, int options);\n",
	"	private static native Object __ContextExecute(String statements, int options);*/\n",
	"	\n",
	"	private static native long __WaitCreate(int options);\n",
	"	//private static native long __WaitRetain(long wait);\n",
	"	private static native long __WaitRelease(long wait);\n",
	"	private static native boolean __WaitIsRunning(long wait);\n",
	"	private static native void __WaitRun(long wait);\n",
	"	private static native void __WaitBreak(long wait);\n",
	"	private static native void __WaitReset(long wait);\n",
	"	\n",
	"	private static native EngineApi __InterfaceQueryEngine();\n",
	"	\n",
	"	private static native void __RunOnSystemThread(Runnable callback);\n",
	"	\n",
	"	//private static native Activity __InterfaceQueryActivity();\n",
	"	//private static native ViewGroup __InterfaceQueryContainer();\n",
	"    private static native double __InterfaceQueryViewScale();\n",
	"};",
	0
};
