cell_attr.dart 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import 'package:meta/meta.dart';
  2. import 'package:xterm/buffer/cell_color.dart';
  3. class CellAttr {
  4. CellAttr({
  5. @required this.fgColor,
  6. this.bgColor,
  7. this.bold = false,
  8. this.faint = false,
  9. this.italic = false,
  10. this.underline = false,
  11. this.blink = false,
  12. this.inverse = false,
  13. this.invisible = false,
  14. });
  15. CellColor fgColor;
  16. CellColor bgColor;
  17. bool bold;
  18. bool faint;
  19. bool italic;
  20. bool underline;
  21. bool blink;
  22. bool inverse;
  23. bool invisible;
  24. CellAttr copy() {
  25. return CellAttr(
  26. fgColor: this.fgColor,
  27. bgColor: this.bgColor,
  28. bold: this.bold,
  29. faint: this.faint,
  30. italic: this.italic,
  31. underline: this.underline,
  32. blink: this.blink,
  33. inverse: this.inverse,
  34. invisible: this.invisible,
  35. );
  36. }
  37. void reset({
  38. @required fgColor,
  39. bgColor,
  40. bold = false,
  41. faint = false,
  42. italic = false,
  43. underline = false,
  44. blink = false,
  45. inverse = false,
  46. invisible = false,
  47. }) {
  48. this.fgColor = fgColor;
  49. this.bgColor = bgColor;
  50. this.bold = bold;
  51. this.faint = faint;
  52. this.italic = italic;
  53. this.underline = underline;
  54. this.blink = blink;
  55. this.inverse = inverse;
  56. this.invisible = invisible;
  57. }
  58. // CellAttr copyWith({
  59. // CellColor fgColour,
  60. // CellColor bgColour,
  61. // bool bold,
  62. // bool faint,
  63. // bool italic,
  64. // bool underline,
  65. // bool blink,
  66. // bool inverse,
  67. // bool invisible,
  68. // }) {
  69. // return CellAttr(
  70. // fgColour: fgColour ?? this.fgColour,
  71. // bgColour: bgColour ?? this.bgColour,
  72. // bold: bold ?? this.bold,
  73. // faint: faint ?? this.faint,
  74. // italic: italic ?? this.italic,
  75. // underline: underline ?? this.underline,
  76. // blink: blink ?? this.blink,
  77. // inverse: inverse ?? this.inverse,
  78. // invisible: invisible ?? this.invisible,
  79. // );
  80. // }
  81. }
  82. // class CellAttrTemplate {
  83. // }