cell.dart 582 B

123456789101112131415161718192021222324252627282930313233343536
  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. }