コード例 #1
0
ファイル: ScreenExplorer.php プロジェクト: Glifery/ConsoleApp
 /**
  * @return Window
  */
 public function createRootWindow()
 {
     $rootWindow = new Window();
     $rootWindow->setX(0);
     $rootWindow->setY(0);
     $rootWindow->setWidth($this->shellCommandRepository->getTerminalWidth());
     $rootWindow->setHeight($this->shellCommandRepository->getTerminalHeight());
     return $rootWindow;
 }
コード例 #2
0
ファイル: CycleLoop.php プロジェクト: Glifery/ConsoleApp
 /**
  * @return $this
  */
 public function run()
 {
     $this->shellCommandRepository->switchInputToCatchMode();
     $this->cycleHandler->init();
     $this->isRun = true;
     while ($this->isRun && ($symbol = fread(STDIN, 4096))) {
         $cycleEvent = $this->createCycleEvent($symbol);
         $this->cycleHandler->handleIteration($cycleEvent);
     }
     $this->shellCommandRepository->switchInputToTextMode();
     return $this;
 }
コード例 #3
0
ファイル: ScreenDrawer.php プロジェクト: Glifery/ConsoleApp
 /**
  * @param OutputInterface $output
  */
 public function initDraw(OutputInterface $output)
 {
     $this->terminalDrawer->setOutput($output);
     $this->shellCommandRepository->resetTerminal();
 }