whirled_peas 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/doc/components.md +0 -4
  4. data/doc/themes.md +35 -0
  5. data/examples/components.rb +2 -4
  6. data/examples/graph.rb +1 -1
  7. data/lib/whirled_peas/animator/debug_consumer.rb +2 -2
  8. data/lib/whirled_peas/animator/easing.rb +57 -0
  9. data/lib/whirled_peas/animator/frameset.rb +13 -8
  10. data/lib/whirled_peas/animator/producer.rb +7 -8
  11. data/lib/whirled_peas/animator/renderer_consumer.rb +7 -5
  12. data/lib/whirled_peas/command/frames.rb +1 -3
  13. data/lib/whirled_peas/command/play.rb +5 -7
  14. data/lib/whirled_peas/command/record.rb +1 -3
  15. data/lib/whirled_peas/command/still.rb +6 -2
  16. data/lib/whirled_peas/command/themes.rb +4 -3
  17. data/lib/whirled_peas/component/list_with_active.rb +1 -1
  18. data/lib/whirled_peas/config.rb +1 -8
  19. data/lib/whirled_peas/device/null_device.rb +1 -1
  20. data/lib/whirled_peas/device/output_file.rb +2 -2
  21. data/lib/whirled_peas/device/rendered_frame.rb +12 -0
  22. data/lib/whirled_peas/device/screen.rb +12 -8
  23. data/lib/whirled_peas/graphics/pixel_grid.rb +44 -0
  24. data/lib/whirled_peas/graphics/renderer.rb +4 -5
  25. data/lib/whirled_peas/settings/border.rb +1 -1
  26. data/lib/whirled_peas/utils/ansi.rb +4 -2
  27. data/lib/whirled_peas/utils/file_handler.rb +14 -9
  28. data/lib/whirled_peas/utils/formatted_string.rb +5 -3
  29. data/lib/whirled_peas/version.rb +1 -1
  30. data/screen_test/components/list_with_active/l2r_position_end.frame +1 -1
  31. data/screen_test/components/list_with_active/l2r_position_middle.frame +1 -1
  32. data/screen_test/components/list_with_active/l2r_position_start.frame +1 -1
  33. data/screen_test/components/list_with_active/l2r_separator.frame +1 -1
  34. data/screen_test/components/list_with_active/t2b_position_end.frame +1 -1
  35. data/screen_test/components/list_with_active/t2b_position_middle.frame +1 -1
  36. data/screen_test/components/list_with_active/t2b_position_start.frame +1 -1
  37. data/screen_test/components/list_with_active/t2b_separator.frame +1 -1
  38. data/screen_test/elements/box.frame +1 -1
  39. data/screen_test/elements/graph_asc.frame +1 -1
  40. data/screen_test/elements/graph_desc.frame +1 -1
  41. data/screen_test/elements/graph_horiz.frame +1 -1
  42. data/screen_test/elements/graph_sin.frame +1 -1
  43. data/screen_test/elements/grid.frame +1 -1
  44. data/screen_test/elements/screen_overflow_x.frame +1 -1
  45. data/screen_test/elements/screen_overflow_y.frame +1 -1
  46. data/screen_test/elements/text.frame +1 -1
  47. data/screen_test/elements/text_multiline.frame +1 -1
  48. data/screen_test/elements/theme.frame +1 -1
  49. data/screen_test/settings/align/box_around.frame +1 -1
  50. data/screen_test/settings/align/box_between.frame +1 -1
  51. data/screen_test/settings/align/box_center.frame +1 -1
  52. data/screen_test/settings/align/box_default.frame +1 -1
  53. data/screen_test/settings/align/box_evenly.frame +1 -1
  54. data/screen_test/settings/align/box_left.frame +1 -1
  55. data/screen_test/settings/align/box_right.frame +1 -1
  56. data/screen_test/settings/align/children_center.frame +1 -1
  57. data/screen_test/settings/align/children_left.frame +1 -1
  58. data/screen_test/settings/align/children_right.frame +1 -1
  59. data/screen_test/settings/align/grid_center.frame +1 -1
  60. data/screen_test/settings/align/grid_default.frame +1 -1
  61. data/screen_test/settings/align/grid_left.frame +1 -1
  62. data/screen_test/settings/align/grid_right.frame +1 -1
  63. data/screen_test/settings/ansi/bold.frame +1 -1
  64. data/screen_test/settings/ansi/color.frame +1 -1
  65. data/screen_test/settings/ansi/underline.frame +1 -1
  66. data/screen_test/settings/border.frame +1 -1
  67. data/screen_test/settings/content_start/box_bottom.frame +1 -1
  68. data/screen_test/settings/content_start/box_left.frame +1 -1
  69. data/screen_test/settings/content_start/box_left_negative.frame +1 -1
  70. data/screen_test/settings/content_start/box_right.frame +1 -1
  71. data/screen_test/settings/content_start/box_top.frame +1 -1
  72. data/screen_test/settings/content_start/box_top_negative.frame +1 -1
  73. data/screen_test/settings/content_start/grid_left.frame +1 -1
  74. data/screen_test/settings/content_start/grid_left_negative.frame +1 -1
  75. data/screen_test/settings/content_start/grid_top.frame +1 -1
  76. data/screen_test/settings/content_start/grid_top_negative.frame +1 -1
  77. data/screen_test/settings/flow/box_b2t.frame +1 -1
  78. data/screen_test/settings/flow/box_l2r.frame +1 -1
  79. data/screen_test/settings/flow/box_r2l.frame +1 -1
  80. data/screen_test/settings/flow/box_t2b.frame +1 -1
  81. data/screen_test/settings/flow/grid_b2t.frame +1 -1
  82. data/screen_test/settings/flow/grid_l2r.frame +1 -1
  83. data/screen_test/settings/flow/grid_r2l.frame +1 -1
  84. data/screen_test/settings/flow/grid_t2b.frame +1 -1
  85. data/screen_test/settings/height/box.frame +1 -1
  86. data/screen_test/settings/height/box_border_sizing.frame +1 -1
  87. data/screen_test/settings/height/grid.frame +1 -1
  88. data/screen_test/settings/height/overflow_box.frame +1 -1
  89. data/screen_test/settings/height/overflow_box_l2r.frame +1 -1
  90. data/screen_test/settings/height/overflow_box_t2b.frame +1 -1
  91. data/screen_test/settings/height/overflow_grid.frame +1 -1
  92. data/screen_test/settings/margin.frame +1 -1
  93. data/screen_test/settings/padding.frame +1 -1
  94. data/screen_test/settings/scroll/horiz_box.frame +1 -1
  95. data/screen_test/settings/scroll/vert_box.frame +1 -1
  96. data/screen_test/settings/title_font.frame +1 -1
  97. data/screen_test/settings/valign/box_around.frame +1 -1
  98. data/screen_test/settings/valign/box_between.frame +1 -1
  99. data/screen_test/settings/valign/box_bottom.frame +1 -1
  100. data/screen_test/settings/valign/box_default.frame +1 -1
  101. data/screen_test/settings/valign/box_evenly.frame +1 -1
  102. data/screen_test/settings/valign/box_middle.frame +1 -1
  103. data/screen_test/settings/valign/box_top.frame +1 -1
  104. data/screen_test/settings/valign/grid_bottom.frame +1 -1
  105. data/screen_test/settings/valign/grid_default.frame +1 -1
  106. data/screen_test/settings/valign/grid_middle.frame +1 -1
  107. data/screen_test/settings/valign/grid_top.frame +1 -1
  108. data/screen_test/settings/width/box_border_sizing.frame +1 -1
  109. data/screen_test/settings/width/box_content.frame +1 -1
  110. data/screen_test/settings/width/box_default.frame +1 -1
  111. data/screen_test/settings/width/grid.frame +1 -1
  112. data/screen_test/settings/width/overflow_align_center.frame +1 -1
  113. data/screen_test/settings/width/overflow_align_right.frame +1 -1
  114. data/screen_test/settings/width/overflow_box.frame +1 -1
  115. data/screen_test/settings/width/overflow_box_l2r.frame +1 -1
  116. data/screen_test/settings/width/overflow_box_t2b.frame +1 -1
  117. data/screen_test/settings/width/overflow_grid.frame +1 -1
  118. data/tools/whirled_peas/tools/screen_tester.rb +5 -2
  119. metadata +3 -5
  120. data/screen_test/components/list_with_active/l2r_active_color.frame +0 -1
  121. data/screen_test/components/list_with_active/l2r_active_color.rb +0 -18
  122. data/screen_test/components/list_with_active/t2b_active_color.frame +0 -1
  123. data/screen_test/components/list_with_active/t2b_active_color.rb +0 -19
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━┓┃ ┃┗━━━━━━━━━┛3. NARROW┏━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━┛2. WIDE┏━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━┛1. MEDIUM[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━━┓ ┃┏━━━━━━━━━┓ ┃ ┃┃3. NARROW┃ ┃ ┃┗━━━━━━━━━┛ ┃ ┃┏━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ 2. WIDE ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━┛┃ ┃┏━━━━━━━━━━━━━━━┓ ┃ ┃┃ 1. MEDIUM ┃ ┃ ┃┗━━━━━━━━━━━━━━━┛ ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━┛              [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━┛1. MEDIUM┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛2. TALL┏━━━━━━━━┓┃ ┃┗━━━━━━━━┛3. SHORT[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃┏━━━━━━━━━┓┏━━━━━━━┓┏━━━━━━━━┓┃┃┃ ┃┃ ┃┃3. SHORT┃┃┃┃ ┃┃ ┃┗━━━━━━━━┛┃┃┃1. MEDIUM┃┃ ┃ ┃┃┃ ┃┃ ┃ ┃┃┃ ┃┃2. TALL┃ ┃┃┗━━━━━━━━━┛┃ ┃ ┃┃ ┃ ┃ ┃┃ ┃ ┃ ┃┃ ┃ ┃ ┃┃ ┗━━━━━━━┛ ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛           [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━┓┃ ┃┗━━━━━━━━┛3. SHORT┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛2. TALL┏━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━┛1. MEDIUM[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃┏━━━━━━━━┓┏━━━━━━━┓┏━━━━━━━━━┓┃┃┃3. SHORT┃┃ ┃┃ ┃┃┃┗━━━━━━━━┛┃ ┃┃ ┃┃┃ ┃ ┃┃1. MEDIUM┃┃┃ ┃ ┃┃ ┃┃┃ ┃2. TALL┃┃ ┃┃┃ ┃ ┃┗━━━━━━━━━┛┃┃ ┃ ┃ ┃┃ ┃ ┃ ┃┃ ┃ ┃ ┃┃ ┗━━━━━━━┛ ┃┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛           [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━┛1. MEDIUM┏━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━┛2. WIDE┏━━━━━━━━━┓┃ ┃┗━━━━━━━━━┛3. NARROW[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━━┓ ┃┏━━━━━━━━━━━━━━━┓ ┃ ┃┃ 1. MEDIUM ┃ ┃ ┃┗━━━━━━━━━━━━━━━┛ ┃ ┃┏━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ 2. WIDE ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━━━┛┃ ┃┏━━━━━━━━━┓ ┃ ┃┃3. NARROW┃ ┃ ┃┗━━━━━━━━━┛ ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━┛              [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
1
+ [?25l┏━━┳━━┳━━┳━━┓ ┃3 ┃6 ┃9 ┃ ┃ ┣━━╋━━╋━━╋━━┫ ┃2 ┃5 ┃8 ┃ ┃ ┣━━╋━━╋━━╋━━┫ ┃1 ┃4 ┃7 ┃10┃ ┗━━┻━━┻━━┻━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
1
+ [?25l┏━━┳━━┳━━┳━━┓ ┃1 ┃2 ┃3 ┃4 ┃ ┣━━╋━━╋━━╋━━┫ ┃5 ┃6 ┃7 ┃8 ┃ ┣━━╋━━╋━━╋━━┫ ┃9 ┃10┃ ┃ ┃ ┗━━┻━━┻━━┻━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
1
+ [?25l┏━━┳━━┳━━┳━━┓ ┃4 ┃3 ┃2 ┃1 ┃ ┣━━╋━━╋━━╋━━┫ ┃8 ┃7 ┃6 ┃5 ┃ ┣━━╋━━╋━━╋━━┫ ┃ ┃ ┃10┃9 ┃ ┗━━┻━━┻━━┻━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
1
+ [?25l┏━━┳━━┳━━┳━━┓ ┃1 ┃4 ┃7 ┃10┃ ┣━━╋━━╋━━╋━━┫ ┃2 ┃5 ┃8 ┃ ┃ ┣━━╋━━╋━━╋━━┫ ┃3 ┃6 ┃9 ┃ ┃ ┗━━┻━━┻━━┻━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━┛MultiLine[?25h
1
+ [?25l┏━━━━━┓ ┃Multi┃ ┃Line ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━━━━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛1122[?25h
1
+ [?25l┏━━┓ ┃ ┃ ┃11┃ ┃22┃ ┃ ┃ ┗━━┛                   [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┳━┳━┳━┓ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┗━┻━┻━┻━┛0123456789[?25h
1
+ [?25l┏━┳━┳━┳━┓ ┃0┃12┃3 ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━╋━╋━╋━┫ ┃4567┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣━╋━╋━╋━┫ ┃89┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━┻━┻━┻━┛      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
1
+ [?25l┏━━┓ ┃XO┃ ┃XO┃ ┃XO┃ ┃XO┃ ┃XO┃ ┗━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━┛012340123401234[?25h
1
+ [?25l┏━━━┓ ┃000┃ ┃111┃ ┃222┃ ┃333┃ ┃444┃ ┗━━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
1
+ [?25l┏━━┓ ┃XO┃ ┃XO┃ ┃XO┃ ┃XO┃ ┃XO┃ ┗━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛01234[?25h
1
+ [?25l┏━┓ ┃0┃ ┃1┃ ┃2┃ ┃3┃ ┃4┃ ┗━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━┓┃ ┃┗━━━━━━━━━┛Inner Box[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ┃ ┃ ┏━━━━━━━━━┓ ┃ ┃ ┃Inner Box┃ ┃ ┃ ┗━━━━━━━━━┛ ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━┛                 [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛Padded Room[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ┃ ┃ Padded Room ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━┛                   [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━┓┃ ┃┃ ▄ ┃┗━━━━━┛EFGHI[?25h
1
+ [?25l┏━━━━━┓ ┃EFGHI┃ ┃ ▄ ┃ ┗━━━━━┛                     [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━┓┃ ┃┃ ▐┃┃ ┃┃ ┃┃ ┃┗━━┛EFGHI[?25h
1
+ [?25l┏━━┓ ┃E ┃ ┃F▐┃ ┃G ┃ ┃H ┃ ┃I ┃ ┗━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ██╗ ██╗██╗██╗██║ ██║██║██║███████║██║██║██╔══██║██║╚═╝██║ ██║██║██╗╚═╝ ╚═╝╚═╝╚═╝[?25h
1
+ [?25l██╗ ██╗██╗██╗ ██║ ██║██║██║ ███████║██║██║ ██╔══██║██║╚═╝ ██║ ██║██║██╗ ╚═╝ ╚═╝╚═╝╚═╝                   [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃ ┃ ┃A┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃B┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃C┃ ┃ ┃ ┃ ┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃A┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃B┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃C┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃A┃ ┃B┃ ┃C┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃A┃ ┃B┃ ┃C┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃ ┃ ┃ ┃ ┃A┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃B┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃C┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃A┃ ┃B┃ ┃C┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l┏━┓ ┃A┃ ┃B┃ ┃C┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━┛        [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃ ┃ ┃A┃ ┗━┛                    [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l┏━┓ ┃A┃ ┃ ┃ ┃ ┃ ┗━┛                    [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l┏━┓ ┃ ┃ ┃A┃ ┃ ┃ ┗━┛                    [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l┏━┓ ┃A┃ ┃ ┃ ┃ ┃ ┗━┛                    [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━┛15/bor[?25h
1
+ [?25l┏━━━━━━━━━━━━━┓ ┃ 15/bor ┃ ┗━━━━━━━━━━━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/content[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━┓ ┃ 15/content ┃ ┗━━━━━━━━━━━━━━━━━━━━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/default[?25h
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━┓ ┃ 15/default ┃ ┗━━━━━━━━━━━━━━━━━━━━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━┳━━━━━━┓┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┗━━━━━━┻━━━━━━┛666666[?25h
1
+ [?25l┏━━━━━━┳━━━━━━┓ ┃6 ┃6 ┃ ┣━━━━━━╋━━━━━━┫ ┃6 ┃6 ┃ ┣━━━━━━╋━━━━━━┫ ┃6 ┃6 ┃ ┗━━━━━━┻━━━━━━┛                  [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━┓┃ ┃┗━━━┛345[?25h
1
+ [?25l┏━━━┓ ┃345┃ ┗━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━┓┃ ┃┗━━━┛456[?25h
1
+ [?25l┏━━━┓ ┃456┃ ┗━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?25h
1
+ [?25l┏━━━━━━━━━━┓ ┃ABCDEFGHIJ┃ ┗━━━━━━━━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛0|0|1|0|1|[?25h
1
+ [?25l┏━━━━━━━━━━┓ ┃0|0|1|0|1|┃ ┗━━━━━━━━━━┛                      [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━┛XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXO[?25h
1
+ [?25l┏━━━━━━━━━━┓ ┃XO ┃ ┃XOXO ┃ ┃XOXOXO ┃ ┃XOXOXOXO ┃ ┃XOXOXOXOXO┃ ┃XOXOXOXOXO┃ ┃XOXOXOXOXO┃ ┃XOXOXOXOXO┃ ┃XOXOXOXOXO┃ ┃XOXOXOXOXO┃ ┗━━━━━━━━━━┛             [?25h
@@ -1 +1 @@
1
- [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?25h
1
+ [?25l┏━━━━━━━━━━┓ ┃ABCDEFGHIJ┃ ┗━━━━━━━━━━┛                      [?25h
@@ -2,6 +2,7 @@ require 'bundler/setup'
2
2
  require 'whirled_peas'
3
3
  require 'whirled_peas/animator/producer'
4
4
  require 'whirled_peas/animator/renderer_consumer'
5
+ require 'whirled_peas/device/rendered_frame'
5
6
  require 'whirled_peas/device/screen'
6
7
  require 'whirled_peas/graphics/debugger'
7
8
  require 'whirled_peas/graphics/renderer'
@@ -286,12 +287,14 @@ module WhirledPeas
286
287
 
287
288
  def render_screen(template_factory, output)
288
289
  Utils::Ansi.with_screen(output, width: SCREEN_WIDTH, height: SCREEN_HEIGHT) do
289
- rendered = Graphics::Renderer.new(
290
+ strokes = Graphics::Renderer.new(
290
291
  template_factory.build('test', {}),
291
292
  SCREEN_WIDTH,
292
293
  SCREEN_HEIGHT
293
294
  ).paint
294
- Device::Screen.new(10000, output: output).handle_renders([rendered])
295
+ Device::Screen.new(output: output).handle_rendered_frames(
296
+ [Device::RenderedFrame.new(strokes, 0)]
297
+ )
295
298
  end
296
299
  end
297
300
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whirled_peas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Collier
@@ -115,6 +115,7 @@ files:
115
115
  - lib/whirled_peas/device.rb
116
116
  - lib/whirled_peas/device/null_device.rb
117
117
  - lib/whirled_peas/device/output_file.rb
118
+ - lib/whirled_peas/device/rendered_frame.rb
118
119
  - lib/whirled_peas/device/screen.rb
119
120
  - lib/whirled_peas/errors.rb
120
121
  - lib/whirled_peas/graphics.rb
@@ -131,6 +132,7 @@ files:
131
132
  - lib/whirled_peas/graphics/graph_painter.rb
132
133
  - lib/whirled_peas/graphics/grid_painter.rb
133
134
  - lib/whirled_peas/graphics/painter.rb
135
+ - lib/whirled_peas/graphics/pixel_grid.rb
134
136
  - lib/whirled_peas/graphics/renderer.rb
135
137
  - lib/whirled_peas/graphics/scrollbar_helper.rb
136
138
  - lib/whirled_peas/graphics/text_painter.rb
@@ -164,8 +166,6 @@ files:
164
166
  - lib/whirled_peas/utils/formatted_string.rb
165
167
  - lib/whirled_peas/utils/title_font.rb
166
168
  - lib/whirled_peas/version.rb
167
- - screen_test/components/list_with_active/l2r_active_color.frame
168
- - screen_test/components/list_with_active/l2r_active_color.rb
169
169
  - screen_test/components/list_with_active/l2r_position_end.frame
170
170
  - screen_test/components/list_with_active/l2r_position_end.rb
171
171
  - screen_test/components/list_with_active/l2r_position_middle.frame
@@ -174,8 +174,6 @@ files:
174
174
  - screen_test/components/list_with_active/l2r_position_start.rb
175
175
  - screen_test/components/list_with_active/l2r_separator.frame
176
176
  - screen_test/components/list_with_active/l2r_separator.rb
177
- - screen_test/components/list_with_active/t2b_active_color.frame
178
- - screen_test/components/list_with_active/t2b_active_color.rb
179
177
  - screen_test/components/list_with_active/t2b_position_end.frame
180
178
  - screen_test/components/list_with_active/t2b_position_end.rb
181
179
  - screen_test/components/list_with_active/t2b_position_middle.frame
@@ -1 +0,0 @@
1
- [?25l                        ┏━━━━━━━━━━┓┃ ┃┃ ▗▄▄▄▖ ┃┗━━━━━━━━━━┛HIJKLMNOPQ[?25h
@@ -1,18 +0,0 @@
1
- require 'whirled_peas'
2
- require 'whirled_peas/component/list_with_active'
3
-
4
- class TemplateFactory
5
- ITEMS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.chars
6
-
7
- def build(*)
8
- WhirledPeas.template(:test) do |composer, settings|
9
- WhirledPeas.component(composer, settings, :list_with_active) do |component|
10
- component.items = ITEMS
11
- component.active_index = ITEMS.length / 2
12
- component.viewport_size = 10
13
- component.active_color = :gray
14
- component.active_bg_color = :bright_white
15
- end
16
- end
17
- end
18
- end
@@ -1 +0,0 @@
1
- [?25l                        ┏━━┓┃ ┃┃ ┃┃ ▗┃┃ ▐┃┃ ▐┃┃ ▐┃┃ ▝┃┃ ┃┃ ┃┃ ┃┗━━┛HIJKLMNOPQ[?25h
@@ -1,19 +0,0 @@
1
- require 'whirled_peas'
2
- require 'whirled_peas/component/list_with_active'
3
-
4
- class TemplateFactory
5
- ITEMS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.chars
6
-
7
- def build(*)
8
- WhirledPeas.template(:test) do |composer, settings|
9
- WhirledPeas.component(composer, settings, :list_with_active) do |component|
10
- component.flow = :t2b
11
- component.items = ITEMS
12
- component.active_index = ITEMS.length / 2
13
- component.viewport_size = 10
14
- component.active_color = :gray
15
- component.active_bg_color = :bright_white
16
- end
17
- end
18
- end
19
- end