Esempio n. 1
0
            public void Start()
            {
                CursorX = 0;
                CursorY = 0;
                ScrollX = 0;
                ScrollY = 0;

                Colours          = new Dictionary <string, int[]>();
                Colours["xterm"] = new int[] {
                    0x000000, 0xcd0000, 0x00cd00, 0xcdcd00, 0x0000ee, 0xcd00cd, 0x00cdcd, 0xe5e5e5,
                    0x7f7f7f, 0xff0000, 0x00ff00, 0xffff00, 0x5c5cff, 0xff00ff, 0x00ffff, 0xffffff
                };

                CurrentProperty.Colour = Colours["xterm"][7];

                Font f = (Font)Resources.LoadAssetAtPath(@"Assets\Fonts\LiberationMono-Regular.ttf", typeof(Font));

                style          = new GUIStyle();
                style.fontSize = 11;
                style.font     = f;

                textMesh = (TextMesh)GetComponent <TextMesh>();

                UpdateBufferSize();

                NixSystem sys = GetComponent <NixSystem>();

                if (sys != null)
                {
                    sys.AttachTerminal(this);
                }
            }
Esempio n. 2
0
 public void ExecuteAsync(NixSystem system, Session session, IList <string> argv)
 {
     MainSystem  = system;
     MainSession = session;
     Argv        = argv;
     MainThread.Start();
 }
Esempio n. 3
0
                public LuaDevice(Session session, NixSystem system)
                {
                    MainSession = session;
                    MainSystem  = system;
                    Bin.Program shell = session.Shell;

                    LuaSystem = new LuaSystem(session, system, shell.StdOut, shell.StdIn, shell.StdErr);
                }
Esempio n. 4
0
                public FileSystem(NixSystem system)
                {
                    MainSystem        = system;
                    SymlinkHeader     = System.Text.Encoding.ASCII.GetBytes("!<symlink>  ");
                    SymlinkHeader[10] = 0xFF;
                    SymlinkHeader[11] = 0xFE;

                    CharacterDeviceHeader     = System.Text.Encoding.ASCII.GetBytes("!<chardevice>  ");
                    CharacterDeviceHeader[10] = 0xFF;
                    CharacterDeviceHeader[11] = 0xFE;
                }
Esempio n. 5
0
            public LuaSystem(Session session, NixSystem system, Stream stdOut, Stream stdIn, Stream stdErr)
            {
                MainSession = session;
                MainSystem  = system;
                StdOut      = stdOut;
                StdIn       = stdIn;
                StdErr      = stdErr;

                Lua.LuaOptions opts = new Lua.LuaOptions();
                opts.StdOut                 = stdOut;
                opts.StdIn                  = stdIn;
                opts.StdErr                 = stdErr;
                opts.ExecuteHandler         = ExecuteHandler;
                opts.OpenFileHandler        = OpenFileHandler;
                opts.RenameFileHandler      = RenameFileHandler;
                opts.RemoveFileHandler      = RemoveFileHandler;
                opts.GetTempFilenameHandler = GetTempFilenameHandler;
                Lua = new Lua(opts);
            }
 public DeviceManager(NixSystem system)
 {
     DevicesById   = new Dictionary <int, Device.CharacterDevice>();
     DevicesByType = new Dictionary <string, List <Device.CharacterDevice> >();
     MainSystem    = system;
 }
Esempio n. 7
0
 public int Execute(NixSystem system, Session session, IList <string> argv)
 {
     ExecuteAsync(system, session, argv);
     MainThread.Join();
     return(Result);
 }