Lines Matching refs:this

175         $this->base_attr_cell = clone $attr_cell;
176 $this->attr_cell = clone $attr_cell;
178 $this->setHistory(200);
179 $this->setDimensions(80, 24);
193 $this->max_x = $x - 1;
194 $this->max_y = $y - 1;
195 $this->x = $this->y = 0;
196 $this->history = $this->history_attrs = [];
197 $this->attr_row = array_fill(0, $this->max_x + 2, $this->base_attr_cell);
198 $this->screen = array_fill(0, $this->max_y + 1, '');
199 $this->attrs = array_fill(0, $this->max_y + 1, $this->attr_row);
200 $this->ansi = '';
211 $this->max_history = $history;
222 $this->setDimensions($this->max_x + 1, $this->max_y + 1);
223 $this->appendString($source);
234 $this->tokenization = [''];
236 if (strlen($this->ansi)) {
237 $this->ansi .= $source[$i];
242 case $this->ansi == "\x1B=":
243 $this->ansi = '';
245 case strlen($this->ansi) == 2 && $chr >= 64 && $chr <= 95 && $chr != ord('['):
246 case strlen($this->ansi) > 2 && $chr >= 64 && $chr <= 126:
251 $this->tokenization[] = $this->ansi;
252 $this->tokenization[] = '';
254 switch ($this->ansi) {
256 $this->old_x = $this->x;
257 $this->old_y = $this->y;
258 $this->x = $this->y = 0;
261 …$this->history = array_merge($this->history, array_slice(array_splice($this->screen, $this->y + 1)…
262 … $this->screen = array_merge($this->screen, array_fill($this->y, $this->max_y, ''));
264 …$this->history_attrs = array_merge($this->history_attrs, array_slice(array_splice($this->attrs, $t…
265 … $this->attrs = array_merge($this->attrs, array_fill($this->y, $this->max_y, $this->attr_row));
267 if (count($this->history) == $this->max_history) {
268 array_shift($this->history);
269 array_shift($this->history_attrs);
273 $this->screen[$this->y] = substr($this->screen[$this->y], 0, $this->x);
275 …array_splice($this->attrs[$this->y], $this->x + 1, $this->max_x - $this->x, array_fill($this->x, $
278 $this->screen[$this->y] = str_repeat(' ', $this->x);
279 $this->attrs[$this->y] = $this->attr_row;
286 $this->newLine();
287 $this->x = 0;
291 … case preg_match('#\x1B\[(\d+)B#', $this->ansi, $match): // Move cursor down n lines
292 $this->old_y = $this->y;
293 $this->y += (int) $match[1];
295 …case preg_match('#\x1B\[(\d+);(\d+)H#', $this->ansi, $match): // Move cursor to screen location v,h
296 $this->old_x = $this->x;
297 $this->old_y = $this->y;
298 $this->x = $match[2] - 1;
299 $this->y = (int) $match[1] - 1;
301 … case preg_match('#\x1B\[(\d+)C#', $this->ansi, $match): // Move cursor right n lines
302 $this->old_x = $this->x;
303 $this->x += $match[1];
305 … case preg_match('#\x1B\[(\d+)D#', $this->ansi, $match): // Move cursor left n lines
306 $this->old_x = $this->x;
307 $this->x -= $match[1];
308 if ($this->x < 0) {
309 $this->x = 0;
312 …case preg_match('#\x1B\[(\d+);(\d+)r#', $this->ansi, $match): // Set top and bottom lines of a win…
314 … case preg_match('#\x1B\[(\d*(?:;\d*)*)m#', $this->ansi, $match): // character attributes
315 $attr_cell = &$this->attr_cell;
321 $attr_cell = clone $this->base_attr_cell;
366 $this->ansi = '';
376 $this->ansi = '';
380 $this->tokenization[count($this->tokenization) - 1] .= $source[$i];
383 $this->x = 0;
386 $this->newLine();
389 if ($this->x) {
390 $this->x--;
391 $this->attrs[$this->y][$this->x] = clone $this->base_attr_cell;
392 $this->screen[$this->y] = substr_replace(
393 $this->screen[$this->y],
395 $this->x,
403 …$this->tokenization[count($this->tokenization) - 1] = substr($this->tokenization[count($this->toke…
407 $this->ansi .= "\x1B";
410 $this->attrs[$this->y][$this->x] = clone $this->attr_cell;
411 if ($this->x > strlen($this->screen[$this->y])) {
412 $this->screen[$this->y] = str_repeat(' ', $this->x);
414 $this->screen[$this->y] = substr_replace(
415 $this->screen[$this->y],
417 $this->x,
421 if ($this->x > $this->max_x) {
422 $this->x = 0;
423 $this->newLine();
425 $this->x++;
444 while ($this->y >= $this->max_y) {
445 $this->history = array_merge($this->history, [array_shift($this->screen)]);
446 $this->screen[] = '';
448 $this->history_attrs = array_merge($this->history_attrs, [array_shift($this->attrs)]);
449 $this->attrs[] = $this->attr_row;
451 if (count($this->history) >= $this->max_history) {
452 array_shift($this->history);
453 array_shift($this->history_attrs);
456 $this->y--;
458 $this->y++;
530 $last_attr = $this->base_attr_cell;
531 for ($i = 0; $i <= $this->max_y; $i++) {
532 for ($j = 0; $j <= $this->max_x; $j++) {
533 $cur_attr = $this->attrs[$i][$j];
534 …$output .= $this->processCoordinate($last_attr, $cur_attr, isset($this->screen[$i][$j]) ? $this->s…
535 $last_attr = $this->attrs[$i][$j];
541 $output .= $this->processCoordinate($last_attr, $this->base_attr_cell, '');
553 …return '<pre width="' . ($this->max_x + 1) . '" style="color: white; background: black">' . $this-…
565 $last_attr = $this->base_attr_cell;
566 for ($i = 0; $i < count($this->history); $i++) {
567 for ($j = 0; $j <= $this->max_x + 1; $j++) {
568 $cur_attr = $this->history_attrs[$i][$j];
569 …$scrollback .= $this->processCoordinate($last_attr, $cur_attr, isset($this->history[$i][$j]) ? $th…
570 $last_attr = $this->history_attrs[$i][$j];
574 $base_attr_cell = $this->base_attr_cell;
575 $this->base_attr_cell = $last_attr;
576 $scrollback .= $this->getScreen();
577 $this->base_attr_cell = $base_attr_cell;
579 …return '<pre width="' . ($this->max_x + 1) . '" style="color: white; background: black">' . $scrol…