Beispiel #1
0
        public void Init(MoSync.Core core, Stream resources)
        {
            mCore = core;
            mRuntime = new MoSync.Runtime(mCore);
            mCore.SetRuntime(mRuntime);

            if (resources != null)
            {
                if (!mRuntime.LoadResources(resources))
                {
                    MoSync.Util.CriticalError("Failed to load resources!");
                }
            }

            mCore.Init();
            mRuntime.Init();
        }
 public long Invoke(MoSync.Core core, int id, int a, int b, int c)
 {
     long result = MoSync.Constants.MA_EXTENSION_FUNCTION_UNAVAILABLE;
     switch (id)
     {
         case 1:
             if (maSillyTest == null)
                 result = MoSync.Constants.IOCTL_UNAVAILABLE;
             else
                 result = maSillyTest(a);
     #if SYSCALL_LOG
     Util.Log("maSillyTest("+
         a+
         "): "+result+"\n");
     #endif
             return result;
     }
     return result;
 }
Beispiel #3
0
        protected void InitExtensions(MoSync.Core core, MoSync.Runtime runtime)
        {
            try
            {
                MoSync.ExtensionsLoader.Load();
            }
            catch (Exception e)
            {
                MoSync.Util.CriticalError("Couldn't load extension: " + e.ToString());
            }

            MoSync.ExtensionModule extMod = runtime.GetModule<MoSync.ExtensionModule>();
            System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
            foreach (System.Reflection.Assembly a in assemblies)
            {
                try
                {
                    foreach (Type t in a.GetTypes())
                    {
                        IExtensionModule extensionGroupInstance = null;
                        if (t.GetInterface("MoSync.IExtensionModule", false) != null)
                        {
                            extensionGroupInstance = Activator.CreateInstance(t) as IExtensionModule;
                            extMod.AddModule(extensionGroupInstance);
                            extensionGroupInstance.Init(core, runtime);
                        }
                    }
                }
                catch { }
            }
        }
Beispiel #4
0
 public void InitLib(MoSync.Core core, Stream resources)
 {
     Init(core, resources);
     InitSyscalls(this);
 }