cell.dart 672 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import 'package:xterm/buffer/cell_attr.dart';
  2. class Cell {
  3. Cell({this.codePoint, this.width = 1, this.attr});
  4. int? codePoint;
  5. int width;
  6. CellAttr? attr;
  7. void setCodePoint(int codePoint) {
  8. this.codePoint = codePoint;
  9. }
  10. void setAttr(CellAttr attr) {
  11. this.attr = attr;
  12. }
  13. void setWidth(int width) {
  14. this.width = width;
  15. }
  16. void reset(CellAttr attr) {
  17. codePoint = null;
  18. this.attr = attr;
  19. }
  20. void erase(CellAttr attr) {
  21. codePoint = null;
  22. this.attr = attr;
  23. }
  24. @override
  25. String toString() {
  26. return 'Cell($codePoint)';
  27. }
  28. Cell clone() => Cell(codePoint: this.codePoint, width: this.width, attr: this.attr);
  29. }