Projects STRLCPY termdash Commits 614d6ed8
🤬
  • ■ ■ ■ ■ ■ ■
    CHANGELOG.md
    skipped 6 lines
    7 7   
    8 8  ## [Unreleased]
    9 9   
     10 +## [0.7.1] - 24-Feb-2019
     11 + 
     12 +### Fixed
     13 + 
     14 +- Some of the packages that were moved into internal are required externally.
     15 + This release makes them available again.
     16 + 
     17 +#### Breaking API changes
     18 + 
     19 +- The draw.LineStyle enum was refactored into its own package
     20 + linestyle.LineStyle. Users will have to replace:
     21 + 
     22 + - draw.LineStyleNone -> linestyle.None
     23 + - draw.LineStyleLight -> linestyle.Light
     24 + - draw.LineStyleDouble -> linestyle.Double
     25 + - draw.LineStyleRound -> linestyle.Round
     26 + 
    10 27  ## [0.7.0] - 24-Feb-2019
    11 28   
    12 29  ### Added
    skipped 155 lines
    168 185  - The Gauge widget.
    169 186  - The Text widget.
    170 187   
    171  -[Unreleased]: https://github.com/mum4k/termdash/compare/v0.7.0...devel
     188 +[Unreleased]: https://github.com/mum4k/termdash/compare/v0.7.1...devel
     189 +[0.7.1]: https://github.com/mum4k/termdash/compare/v0.7.0...v0.7.1
    172 190  [0.7.0]: https://github.com/mum4k/termdash/compare/v0.6.1...v0.7.0
    173 191  [0.6.1]: https://github.com/mum4k/termdash/compare/v0.6.0...v0.6.1
    174 192  [0.6.0]: https://github.com/mum4k/termdash/compare/v0.5.0...v0.6.0
    skipped 5 lines
  • ■ ■ ■ ■
    internal/align/align.go align/align.go
    skipped 19 lines
    20 20   "image"
    21 21   "strings"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell/runewidth"
     23 + "github.com/mum4k/termdash/internal/runewidth"
    24 24  )
    25 25   
    26 26  // Horizontal indicates the type of horizontal alignment.
    skipped 148 lines
  • internal/align/align_test.go align/align_test.go
    Content is identical
  • ■ ■ ■ ■
    internal/cell/cell.go cell/cell.go
    skipped 23 lines
    24 24   "image"
    25 25   
    26 26   "github.com/mum4k/termdash/internal/area"
    27  - "github.com/mum4k/termdash/internal/cell/runewidth"
     27 + "github.com/mum4k/termdash/internal/runewidth"
    28 28  )
    29 29   
    30 30  // Option is used to provide options for cells on a 2-D terminal.
    skipped 191 lines
  • internal/cell/cell_test.go cell/cell_test.go
    Content is identical
  • internal/cell/color.go cell/color.go
    Content is identical
  • internal/cell/color_test.go cell/color_test.go
    Content is identical
  • ■ ■ ■ ■ ■ ■
    container/container.go
    skipped 25 lines
    26 26   "image"
    27 27   "sync"
    28 28   
    29  - "github.com/mum4k/termdash/internal/align"
     29 + "github.com/mum4k/termdash/align"
    30 30   "github.com/mum4k/termdash/internal/area"
    31  - "github.com/mum4k/termdash/internal/draw"
    32 31   "github.com/mum4k/termdash/internal/event"
    33  - "github.com/mum4k/termdash/internal/terminalapi"
    34 32   "github.com/mum4k/termdash/internal/widgetapi"
     33 + "github.com/mum4k/termdash/linestyle"
     34 + "github.com/mum4k/termdash/terminal/terminalapi"
    35 35  )
    36 36   
    37 37  // Container wraps either sub containers or widgets and positions them on the
    skipped 65 lines
    103 103   
    104 104  // hasBorder determines if this container has a border.
    105 105  func (c *Container) hasBorder() bool {
    106  - return c.opts.border != draw.LineStyleNone
     106 + return c.opts.border != linestyle.None
    107 107  }
    108 108   
    109 109  // hasWidget determines if this container has a widget.
    skipped 197 lines
  • ■ ■ ■ ■ ■ ■
    container/container_test.go
    skipped 20 lines
    21 21   "testing"
    22 22   "time"
    23 23   
    24  - "github.com/mum4k/termdash/internal/align"
     24 + "github.com/mum4k/termdash/align"
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    26  - "github.com/mum4k/termdash/internal/cell"
    27 27   "github.com/mum4k/termdash/internal/draw"
    28 28   "github.com/mum4k/termdash/internal/draw/testdraw"
    29 29   "github.com/mum4k/termdash/internal/event"
    30 30   "github.com/mum4k/termdash/internal/event/testevent"
    31  - "github.com/mum4k/termdash/internal/keyboard"
    32  - "github.com/mum4k/termdash/internal/mouse"
    33  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    34  - "github.com/mum4k/termdash/internal/terminalapi"
     31 + "github.com/mum4k/termdash/internal/faketerm"
    35 32   "github.com/mum4k/termdash/internal/widgetapi"
     33 + "github.com/mum4k/termdash/keyboard"
     34 + "github.com/mum4k/termdash/linestyle"
     35 + "github.com/mum4k/termdash/mouse"
     36 + "github.com/mum4k/termdash/terminal/terminalapi"
     37 + "github.com/mum4k/termdash/widgets/barchart"
    36 38   "github.com/mum4k/termdash/widgets/fakewidget"
    37 39  )
    38 40   
    39 41  // Example demonstrates how to use the Container API.
    40 42  func Example() {
     43 + bc, err := barchart.New()
     44 + if err != nil {
     45 + panic(err)
     46 + }
    41 47   if _, err := New(
    42 48   /* terminal = */ nil,
    43 49   SplitVertical(
    44 50   Left(
    45 51   SplitHorizontal(
    46 52   Top(
    47  - Border(draw.LineStyleLight),
     53 + Border(linestyle.Light),
    48 54   ),
    49 55   Bottom(
    50 56   SplitHorizontal(
    51 57   Top(
    52  - Border(draw.LineStyleLight),
     58 + Border(linestyle.Light),
    53 59   ),
    54 60   Bottom(
    55  - Border(draw.LineStyleLight),
     61 + Border(linestyle.Light),
    56 62   ),
    57 63   ),
    58 64   ),
    skipped 1 lines
    60 66   ),
    61 67   ),
    62 68   Right(
    63  - Border(draw.LineStyleLight),
    64  - PlaceWidget(fakewidget.New(widgetapi.Options{})),
     69 + Border(linestyle.Light),
     70 + PlaceWidget(bc),
    65 71   ),
    66 72   ),
    67 73   ); err != nil {
    skipped 25 lines
    93 99   container: func(ft *faketerm.Terminal) (*Container, error) {
    94 100   return New(
    95 101   ft,
    96  - Border(draw.LineStyleLight),
     102 + Border(linestyle.Light),
    97 103   )
    98 104   },
    99 105   want: func(size image.Point) *faketerm.Terminal {
    skipped 16 lines
    116 122   ft,
    117 123   SplitHorizontal(
    118 124   Top(
    119  - Border(draw.LineStyleLight),
     125 + Border(linestyle.Light),
    120 126   ),
    121 127   Bottom(
    122  - Border(draw.LineStyleLight),
     128 + Border(linestyle.Light),
    123 129   ),
    124 130   ),
    125 131   )
    skipped 15 lines
    141 147   ft,
    142 148   SplitHorizontal(
    143 149   Top(
    144  - Border(draw.LineStyleLight),
     150 + Border(linestyle.Light),
    145 151   ),
    146 152   Bottom(
    147  - Border(draw.LineStyleLight),
     153 + Border(linestyle.Light),
    148 154   ),
    149 155   SplitPercent(0),
    150 156   ),
    skipped 12 lines
    163 169   ft,
    164 170   SplitHorizontal(
    165 171   Top(
    166  - Border(draw.LineStyleLight),
     172 + Border(linestyle.Light),
    167 173   ),
    168 174   Bottom(
    169  - Border(draw.LineStyleLight),
     175 + Border(linestyle.Light),
    170 176   ),
    171 177   SplitPercent(100),
    172 178   ),
    skipped 12 lines
    185 191   ft,
    186 192   SplitHorizontal(
    187 193   Top(
    188  - Border(draw.LineStyleLight),
     194 + Border(linestyle.Light),
    189 195   ),
    190 196   Bottom(
    191  - Border(draw.LineStyleLight),
     197 + Border(linestyle.Light),
    192 198   ),
    193 199   SplitPercent(20),
    194 200   ),
    skipped 14 lines
    209 215   container: func(ft *faketerm.Terminal) (*Container, error) {
    210 216   return New(
    211 217   ft,
    212  - Border(draw.LineStyleLight),
     218 + Border(linestyle.Light),
    213 219   SplitHorizontal(
    214 220   Top(
    215  - Border(draw.LineStyleLight),
     221 + Border(linestyle.Light),
    216 222   ),
    217 223   Bottom(
    218  - Border(draw.LineStyleLight),
     224 + Border(linestyle.Light),
    219 225   ),
    220 226   ),
    221 227   )
    skipped 20 lines
    242 248   ft,
    243 249   SplitVertical(
    244 250   Left(
    245  - Border(draw.LineStyleLight),
     251 + Border(linestyle.Light),
    246 252   ),
    247 253   Right(
    248  - Border(draw.LineStyleLight),
     254 + Border(linestyle.Light),
    249 255   ),
    250 256   ),
    251 257   )
    skipped 15 lines
    267 273   ft,
    268 274   SplitVertical(
    269 275   Left(
    270  - Border(draw.LineStyleLight),
     276 + Border(linestyle.Light),
    271 277   ),
    272 278   Right(
    273  - Border(draw.LineStyleLight),
     279 + Border(linestyle.Light),
    274 280   ),
    275 281   SplitPercent(0),
    276 282   ),
    skipped 12 lines
    289 295   ft,
    290 296   SplitVertical(
    291 297   Left(
    292  - Border(draw.LineStyleLight),
     298 + Border(linestyle.Light),
    293 299   ),
    294 300   Right(
    295  - Border(draw.LineStyleLight),
     301 + Border(linestyle.Light),
    296 302   ),
    297 303   SplitPercent(100),
    298 304   ),
    skipped 12 lines
    311 317   ft,
    312 318   SplitVertical(
    313 319   Left(
    314  - Border(draw.LineStyleLight),
     320 + Border(linestyle.Light),
    315 321   ),
    316 322   Right(
    317  - Border(draw.LineStyleLight),
     323 + Border(linestyle.Light),
    318 324   ),
    319 325   SplitPercent(20),
    320 326   ),
    skipped 14 lines
    335 341   container: func(ft *faketerm.Terminal) (*Container, error) {
    336 342   return New(
    337 343   ft,
    338  - Border(draw.LineStyleLight),
     344 + Border(linestyle.Light),
    339 345   SplitVertical(
    340 346   Left(
    341  - Border(draw.LineStyleLight),
     347 + Border(linestyle.Light),
    342 348   ),
    343 349   Right(
    344  - Border(draw.LineStyleLight),
     350 + Border(linestyle.Light),
    345 351   ),
    346 352   ),
    347 353   )
    skipped 22 lines
    370 376   Left(
    371 377   SplitHorizontal(
    372 378   Top(
    373  - Border(draw.LineStyleLight),
     379 + Border(linestyle.Light),
    374 380   ),
    375 381   Bottom(
    376 382   SplitHorizontal(
    377 383   Top(
    378  - Border(draw.LineStyleLight),
     384 + Border(linestyle.Light),
    379 385   ),
    380 386   Bottom(
    381  - Border(draw.LineStyleLight),
     387 + Border(linestyle.Light),
    382 388   ),
    383 389   ),
    384 390   ),
    385 391   ),
    386 392   ),
    387 393   Right(
    388  - Border(draw.LineStyleLight),
     394 + Border(linestyle.Light),
    389 395   ),
    390 396   ),
    391 397   )
    skipped 15 lines
    407 413   container: func(ft *faketerm.Terminal) (*Container, error) {
    408 414   return New(
    409 415   ft,
    410  - Border(draw.LineStyleLight),
     416 + Border(linestyle.Light),
    411 417   BorderColor(cell.ColorRed),
    412 418   FocusedColor(cell.ColorBlue),
    413 419   SplitVertical(
    414 420   Left(
    415  - Border(draw.LineStyleLight),
     421 + Border(linestyle.Light),
    416 422   ),
    417 423   Right(
    418  - Border(draw.LineStyleLight),
     424 + Border(linestyle.Light),
    419 425   ),
    420 426   ),
    421 427   )
    skipped 26 lines
    448 454   container: func(ft *faketerm.Terminal) (*Container, error) {
    449 455   return New(
    450 456   ft,
    451  - Border(draw.LineStyleLight),
     457 + Border(linestyle.Light),
    452 458   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    453 459   SplitVertical(
    454 460   Left(
    455  - Border(draw.LineStyleLight),
     461 + Border(linestyle.Light),
    456 462   ),
    457 463   Right(
    458  - Border(draw.LineStyleLight),
     464 + Border(linestyle.Light),
    459 465   ),
    460 466   ),
    461 467   )
    skipped 20 lines
    482 488   ft,
    483 489   SplitVertical(
    484 490   Left(
    485  - Border(draw.LineStyleLight),
     491 + Border(linestyle.Light),
    486 492   ),
    487 493   Right(
    488  - Border(draw.LineStyleLight),
     494 + Border(linestyle.Light),
    489 495   ),
    490 496   ),
    491 497   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    skipped 467 lines
    959 965   container: func(ft *faketerm.Terminal) (*Container, error) {
    960 966   return New(
    961 967   ft,
    962  - Border(draw.LineStyleLight),
     968 + Border(linestyle.Light),
    963 969   PlaceWidget(
    964 970   fakewidget.New(widgetapi.Options{WantMouse: widgetapi.MouseScopeWidget}),
    965 971   ),
    skipped 28 lines
    994 1000   container: func(ft *faketerm.Terminal) (*Container, error) {
    995 1001   return New(
    996 1002   ft,
    997  - Border(draw.LineStyleLight),
     1003 + Border(linestyle.Light),
    998 1004   PlaceWidget(
    999 1005   fakewidget.New(widgetapi.Options{WantMouse: widgetapi.MouseScopeContainer}),
    1000 1006   ),
    skipped 29 lines
    1030 1036   container: func(ft *faketerm.Terminal) (*Container, error) {
    1031 1037   return New(
    1032 1038   ft,
    1033  - Border(draw.LineStyleLight),
     1039 + Border(linestyle.Light),
    1034 1040   PlaceWidget(
    1035 1041   fakewidget.New(widgetapi.Options{WantMouse: widgetapi.MouseScopeGlobal}),
    1036 1042   ),
    skipped 367 lines
  • ■ ■ ■ ■
    container/draw.go
    skipped 20 lines
    21 21   "fmt"
    22 22   "image"
    23 23   
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/internal/area"
    25 26   "github.com/mum4k/termdash/internal/canvas"
    26  - "github.com/mum4k/termdash/internal/cell"
    27 27   "github.com/mum4k/termdash/internal/draw"
    28 28  )
    29 29   
    skipped 130 lines
  • ■ ■ ■ ■ ■ ■
    container/draw_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
    21  - "github.com/mum4k/termdash/internal/align"
     21 + "github.com/mum4k/termdash/align"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24 24   "github.com/mum4k/termdash/internal/draw"
    25 25   "github.com/mum4k/termdash/internal/draw/testdraw"
    26  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     26 + "github.com/mum4k/termdash/internal/faketerm"
    27 27   "github.com/mum4k/termdash/internal/widgetapi"
     28 + "github.com/mum4k/termdash/linestyle"
    28 29   "github.com/mum4k/termdash/widgets/fakewidget"
    29 30  )
    30 31   
    skipped 11 lines
    42 43   container: func(ft *faketerm.Terminal) (*Container, error) {
    43 44   return New(
    44 45   ft,
    45  - Border(draw.LineStyleLight),
     46 + Border(linestyle.Light),
    46 47   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    47 48   )
    48 49   },
    skipped 20 lines
    69 70   container: func(ft *faketerm.Terminal) (*Container, error) {
    70 71   return New(
    71 72   ft,
    72  - Border(draw.LineStyleLight),
     73 + Border(linestyle.Light),
    73 74   BorderTitle("ab"),
    74 75   BorderTitleAlignLeft(),
    75 76   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    skipped 27 lines
    103 104   container: func(ft *faketerm.Terminal) (*Container, error) {
    104 105   return New(
    105 106   ft,
    106  - Border(draw.LineStyleLight),
     107 + Border(linestyle.Light),
    107 108   BorderTitle("ab"),
    108 109   BorderTitleAlignCenter(),
    109 110   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    skipped 28 lines
    138 139   container: func(ft *faketerm.Terminal) (*Container, error) {
    139 140   return New(
    140 141   ft,
    141  - Border(draw.LineStyleLight),
     142 + Border(linestyle.Light),
    142 143   BorderTitle("ab"),
    143 144   BorderTitleAlignRight(),
    144 145   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    skipped 28 lines
    173 174   container: func(ft *faketerm.Terminal) (*Container, error) {
    174 175   return New(
    175 176   ft,
    176  - Border(draw.LineStyleLight),
     177 + Border(linestyle.Light),
    177 178   BorderTitle("abcdefgh"),
    178 179   BorderTitleAlignRight(),
    179 180   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    skipped 48 lines
    228 229   container: func(ft *faketerm.Terminal) (*Container, error) {
    229 230   return New(
    230 231   ft,
    231  - Border(draw.LineStyleLight),
     232 + Border(linestyle.Light),
    232 233   PlaceWidget(fakewidget.New(widgetapi.Options{})),
    233 234   )
    234 235   },
    skipped 8 lines
    243 244   container: func(ft *faketerm.Terminal) (*Container, error) {
    244 245   return New(
    245 246   ft,
    246  - Border(draw.LineStyleLight),
     247 + Border(linestyle.Light),
    247 248   )
    248 249   },
    249 250   want: func(size image.Point) *faketerm.Terminal {
    skipped 29 lines
    279 280   container: func(ft *faketerm.Terminal) (*Container, error) {
    280 281   return New(
    281 282   ft,
    282  - Border(draw.LineStyleLight),
     283 + Border(linestyle.Light),
    283 284   PlaceWidget(fakewidget.New(widgetapi.Options{
    284 285   MaximumSize: image.Point{10, 10},
    285 286   })),
    skipped 25 lines
    311 312   container: func(ft *faketerm.Terminal) (*Container, error) {
    312 313   return New(
    313 314   ft,
    314  - Border(draw.LineStyleLight),
     315 + Border(linestyle.Light),
    315 316   PlaceWidget(fakewidget.New(widgetapi.Options{
    316 317   MaximumSize: image.Point{10, 0},
    317 318   })),
    skipped 25 lines
    343 344   container: func(ft *faketerm.Terminal) (*Container, error) {
    344 345   return New(
    345 346   ft,
    346  - Border(draw.LineStyleLight),
     347 + Border(linestyle.Light),
    347 348   PlaceWidget(fakewidget.New(widgetapi.Options{
    348 349   MaximumSize: image.Point{0, 10},
    349 350   })),
    skipped 25 lines
    375 376   container: func(ft *faketerm.Terminal) (*Container, error) {
    376 377   return New(
    377 378   ft,
    378  - Border(draw.LineStyleLight),
     379 + Border(linestyle.Light),
    379 380   PlaceWidget(fakewidget.New(widgetapi.Options{
    380 381   Ratio: image.Point{1, 2}},
    381 382   )),
    skipped 25 lines
    407 408   container: func(ft *faketerm.Terminal) (*Container, error) {
    408 409   return New(
    409 410   ft,
    410  - Border(draw.LineStyleLight),
     411 + Border(linestyle.Light),
    411 412   PlaceWidget(fakewidget.New(widgetapi.Options{
    412 413   MaximumSize: image.Point{20, 19},
    413 414   Ratio: image.Point{1, 1},
    skipped 25 lines
    439 440   container: func(ft *faketerm.Terminal) (*Container, error) {
    440 441   return New(
    441 442   ft,
    442  - Border(draw.LineStyleLight),
     443 + Border(linestyle.Light),
    443 444   AlignHorizontal(align.HorizontalLeft),
    444 445   PlaceWidget(fakewidget.New(widgetapi.Options{
    445 446   Ratio: image.Point{1, 2}},
    skipped 24 lines
    470 471   container: func(ft *faketerm.Terminal) (*Container, error) {
    471 472   return New(
    472 473   ft,
    473  - Border(draw.LineStyleLight),
     474 + Border(linestyle.Light),
    474 475   AlignHorizontal(align.HorizontalCenter),
    475 476   PlaceWidget(fakewidget.New(widgetapi.Options{
    476 477   Ratio: image.Point{1, 2}},
    skipped 24 lines
    501 502   container: func(ft *faketerm.Terminal) (*Container, error) {
    502 503   return New(
    503 504   ft,
    504  - Border(draw.LineStyleLight),
     505 + Border(linestyle.Light),
    505 506   AlignHorizontal(align.HorizontalRight),
    506 507   PlaceWidget(fakewidget.New(widgetapi.Options{
    507 508   Ratio: image.Point{1, 2}},
    skipped 24 lines
    532 533   container: func(ft *faketerm.Terminal) (*Container, error) {
    533 534   return New(
    534 535   ft,
    535  - Border(draw.LineStyleLight),
     536 + Border(linestyle.Light),
    536 537   AlignVertical(align.VerticalTop),
    537 538   PlaceWidget(fakewidget.New(widgetapi.Options{
    538 539   Ratio: image.Point{2, 1}},
    skipped 24 lines
    563 564   container: func(ft *faketerm.Terminal) (*Container, error) {
    564 565   return New(
    565 566   ft,
    566  - Border(draw.LineStyleLight),
     567 + Border(linestyle.Light),
    567 568   AlignVertical(align.VerticalMiddle),
    568 569   PlaceWidget(fakewidget.New(widgetapi.Options{
    569 570   Ratio: image.Point{2, 1}},
    skipped 24 lines
    594 595   container: func(ft *faketerm.Terminal) (*Container, error) {
    595 596   return New(
    596 597   ft,
    597  - Border(draw.LineStyleLight),
     598 + Border(linestyle.Light),
    598 599   AlignVertical(align.VerticalBottom),
    599 600   PlaceWidget(fakewidget.New(widgetapi.Options{
    600 601   Ratio: image.Point{2, 1}},
    skipped 194 lines
  • ■ ■ ■ ■ ■ ■
    container/focus.go
    skipped 18 lines
    19 19  import (
    20 20   "image"
    21 21   
    22  - "github.com/mum4k/termdash/internal/mouse"
    23  - "github.com/mum4k/termdash/internal/mouse/button"
    24  - "github.com/mum4k/termdash/internal/terminalapi"
     22 + "github.com/mum4k/termdash/internal/button"
     23 + "github.com/mum4k/termdash/mouse"
     24 + "github.com/mum4k/termdash/terminal/terminalapi"
    25 25  )
    26 26   
    27 27  // pointCont finds the top-most (on the screen) container whose area contains
    skipped 68 lines
  • ■ ■ ■ ■ ■ ■
    container/focus_test.go
    skipped 19 lines
    20 20   "testing"
    21 21   "time"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/draw"
     23 + "github.com/mum4k/termdash/cell"
    25 24   "github.com/mum4k/termdash/internal/event"
    26 25   "github.com/mum4k/termdash/internal/event/testevent"
    27  - "github.com/mum4k/termdash/internal/mouse"
    28  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     26 + "github.com/mum4k/termdash/internal/faketerm"
     27 + "github.com/mum4k/termdash/linestyle"
     28 + "github.com/mum4k/termdash/mouse"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30  )
    31 31   
    32 32  // pointCase is a test case for the pointCont function.
    skipped 64 lines
    97 97   container: func(ft *faketerm.Terminal) (*Container, error) {
    98 98   return New(
    99 99   ft,
    100  - Border(draw.LineStyleLight),
     100 + Border(linestyle.Light),
    101 101   BorderColor(cell.ColorBlue),
    102 102   )
    103 103   },
    skipped 63 lines
    167 167   container: func(ft *faketerm.Terminal) (*Container, error) {
    168 168   return New(
    169 169   ft,
    170  - Border(draw.LineStyleLight),
     170 + Border(linestyle.Light),
    171 171   BorderColor(cell.ColorBlack),
    172 172   SplitVertical(
    173 173   Left(
    skipped 275 lines
  • ■ ■ ■ ■ ■ ■
    container/options.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   
    22  - "github.com/mum4k/termdash/internal/align"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/draw"
     22 + "github.com/mum4k/termdash/align"
     23 + "github.com/mum4k/termdash/cell"
    25 24   "github.com/mum4k/termdash/internal/widgetapi"
     25 + "github.com/mum4k/termdash/linestyle"
    26 26  )
    27 27   
    28 28  // applyOptions applies the options to the container.
    skipped 31 lines
    60 60   vAlign align.Vertical
    61 61   
    62 62   // border is the border around the container.
    63  - border draw.LineStyle
     63 + border linestyle.LineStyle
    64 64   borderTitle string
    65 65   borderTitleHAlign align.Horizontal
    66 66  }
    skipped 157 lines
    224 224  }
    225 225   
    226 226  // Border configures the container to have a border of the specified style.
    227  -func Border(ls draw.LineStyle) Option {
     227 +func Border(ls linestyle.LineStyle) Option {
    228 228   return option(func(c *Container) error {
    229 229   c.opts.border = ls
    230 230   return nil
    skipped 176 lines
  • ■ ■ ■ ■ ■ ■
    container/traversal_test.go
    skipped 19 lines
    20 20   "reflect"
    21 21   "testing"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     23 + "github.com/mum4k/termdash/cell"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  func TestRoot(t *testing.T) {
    skipped 141 lines
  • ■ ■ ■ ■
    internal/attrrange/attrrange_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23  )
    24 24   
    25 25  func Example() {
    skipped 141 lines
  • ■ ■ ■ ■ ■ ■
    internal/mouse/button/button.go internal/button/button.go
    skipped 17 lines
    18 18  import (
    19 19   "image"
    20 20   
    21  - "github.com/mum4k/termdash/internal/mouse"
    22  - "github.com/mum4k/termdash/internal/terminalapi"
     21 + "github.com/mum4k/termdash/mouse"
     22 + "github.com/mum4k/termdash/terminal/terminalapi"
    23 23  )
    24 24   
    25 25  // State represents the state of the mouse button.
    skipped 111 lines
  • ■ ■ ■ ■ ■ ■
    internal/mouse/button/button_test.go internal/button/button_test.go
    skipped 18 lines
    19 19   "image"
    20 20   "testing"
    21 21   
    22  - "github.com/mum4k/termdash/internal/mouse"
    23  - "github.com/mum4k/termdash/internal/terminalapi"
     22 + "github.com/mum4k/termdash/mouse"
     23 + "github.com/mum4k/termdash/terminal/terminalapi"
    24 24  )
    25 25   
    26 26  // eventTestCase is one mouse event and the output expectation.
    skipped 290 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/braille/braille.go
    skipped 44 lines
    45 45   "fmt"
    46 46   "image"
    47 47   
     48 + "github.com/mum4k/termdash/cell"
    48 49   "github.com/mum4k/termdash/internal/canvas"
    49  - "github.com/mum4k/termdash/internal/cell"
    50  - "github.com/mum4k/termdash/internal/terminalapi"
     50 + "github.com/mum4k/termdash/terminal/terminalapi"
    51 51  )
    52 52   
    53 53  const (
    skipped 232 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/braille/braille_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/area"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24 25   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     26 + "github.com/mum4k/termdash/internal/faketerm"
    27 27  )
    28 28   
    29 29  func Example_copiedToCanvas() {
    skipped 964 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/braille/testbraille/testbraille.go
    skipped 18 lines
    19 19   "fmt"
    20 20   "image"
    21 21   
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    26 26  )
    27 27   
    28 28  // MustNew returns a new canvas or panics.
    skipped 50 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/canvas.go
    skipped 18 lines
    19 19   "fmt"
    20 20   "image"
    21 21   
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/area"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/cell/runewidth"
    25  - "github.com/mum4k/termdash/internal/terminalapi"
     24 + "github.com/mum4k/termdash/internal/runewidth"
     25 + "github.com/mum4k/termdash/terminal/terminalapi"
    26 26  )
    27 27   
    28 28  // Canvas is where a widget draws its output for display on the terminal.
    skipped 219 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/canvas_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/area"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  func TestNew(t *testing.T) {
    skipped 1129 lines
  • ■ ■ ■ ■ ■ ■
    internal/canvas/testcanvas/testcanvas.go
    skipped 18 lines
    19 19   "fmt"
    20 20   "image"
    21 21   
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  // MustNew returns a new canvas or panics.
    skipped 50 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/border.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
    23  - "github.com/mum4k/termdash/internal/align"
     23 + "github.com/mum4k/termdash/align"
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/internal/canvas"
    25  - "github.com/mum4k/termdash/internal/cell"
     26 + "github.com/mum4k/termdash/linestyle"
    26 27  )
    27 28   
    28 29  // BorderOption is used to provide options to Border().
    skipped 5 lines
    34 35  // borderOptions stores the provided options.
    35 36  type borderOptions struct {
    36 37   cellOpts []cell.Option
    37  - lineStyle LineStyle
     38 + lineStyle linestyle.LineStyle
    38 39   title string
    39 40   titleOM OverrunMode
    40 41   titleCellOpts []cell.Option
    skipped 9 lines
    50 51  }
    51 52   
    52 53  // DefaultBorderLineStyle is the default value for the BorderLineStyle option.
    53  -const DefaultBorderLineStyle = LineStyleLight
     54 +const DefaultBorderLineStyle = linestyle.Light
    54 55   
    55 56  // BorderLineStyle sets the style of the line used to draw the border.
    56  -func BorderLineStyle(ls LineStyle) BorderOption {
     57 +func BorderLineStyle(ls linestyle.LineStyle) BorderOption {
    57 58   return borderOption(func(bOpts *borderOptions) {
    58 59   bOpts.lineStyle = ls
    59 60   })
    skipped 122 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/border_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
    21  - "github.com/mum4k/termdash/internal/align"
     21 + "github.com/mum4k/termdash/align"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24  - "github.com/mum4k/termdash/internal/cell"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
     26 + "github.com/mum4k/termdash/linestyle"
    26 27  )
    27 28   
    28 29  func TestBorder(t *testing.T) {
    skipped 28 lines
    57 58   canvas: image.Rect(0, 0, 4, 4),
    58 59   border: image.Rect(0, 0, 2, 2),
    59 60   opts: []BorderOption{
    60  - BorderLineStyle(LineStyle(-1)),
     61 + BorderLineStyle(linestyle.LineStyle(-1)),
    61 62   },
    62 63   want: func(size image.Point) *faketerm.Terminal {
    63 64   return faketerm.MustNew(size)
    skipped 8 lines
    72 73   ft := faketerm.MustNew(size)
    73 74   c := testcanvas.MustNew(ft.Area())
    74 75   
    75  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    76  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    77  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    78  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     76 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     77 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     78 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     79 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    79 80   
    80  - testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine])
    81  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     81 + testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine])
     82 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    82 83   
    83  - testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleLight][hLine])
    84  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     84 + testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Light][hLine])
     85 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    85 86   
    86  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    87  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine])
    88  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine])
    89  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     87 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     88 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine])
     89 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine])
     90 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    90 91   
    91 92   testcanvas.MustApply(c, ft)
    92 93   return ft
    skipped 4 lines
    97 98   canvas: image.Rect(0, 0, 4, 4),
    98 99   border: image.Rect(0, 0, 4, 4),
    99 100   opts: []BorderOption{
    100  - BorderLineStyle(LineStyleDouble),
     101 + BorderLineStyle(linestyle.Double),
    101 102   },
    102 103   want: func(size image.Point) *faketerm.Terminal {
    103 104   ft := faketerm.MustNew(size)
    104 105   c := testcanvas.MustNew(ft.Area())
    105 106   
    106  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleDouble][topLeftCorner])
    107  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleDouble][vLine])
    108  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleDouble][vLine])
    109  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleDouble][bottomLeftCorner])
     107 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Double][topLeftCorner])
     108 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Double][vLine])
     109 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Double][vLine])
     110 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Double][bottomLeftCorner])
    110 111   
    111  - testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleDouble][hLine])
    112  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleDouble][hLine])
     112 + testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Double][hLine])
     113 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Double][hLine])
    113 114   
    114  - testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleDouble][hLine])
    115  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleDouble][hLine])
     115 + testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Double][hLine])
     116 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Double][hLine])
    116 117   
    117  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleDouble][topRightCorner])
    118  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleDouble][vLine])
    119  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleDouble][vLine])
    120  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleDouble][bottomRightCorner])
     118 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Double][topRightCorner])
     119 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Double][vLine])
     120 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Double][vLine])
     121 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Double][bottomRightCorner])
    121 122   
    122 123   testcanvas.MustApply(c, ft)
    123 124   return ft
    skipped 4 lines
    128 129   canvas: image.Rect(0, 0, 4, 4),
    129 130   border: image.Rect(0, 0, 4, 4),
    130 131   opts: []BorderOption{
    131  - BorderLineStyle(LineStyleRound),
     132 + BorderLineStyle(linestyle.Round),
    132 133   },
    133 134   want: func(size image.Point) *faketerm.Terminal {
    134 135   ft := faketerm.MustNew(size)
    135 136   c := testcanvas.MustNew(ft.Area())
    136 137   
    137  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleRound][topLeftCorner])
    138  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleRound][vLine])
    139  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleRound][vLine])
    140  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleRound][bottomLeftCorner])
     138 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Round][topLeftCorner])
     139 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Round][vLine])
     140 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Round][vLine])
     141 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Round][bottomLeftCorner])
    141 142   
    142  - testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleRound][hLine])
    143  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleRound][hLine])
     143 + testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Round][hLine])
     144 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Round][hLine])
    144 145   
    145  - testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleRound][hLine])
    146  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleRound][hLine])
     146 + testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Round][hLine])
     147 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Round][hLine])
    147 148   
    148  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleRound][topRightCorner])
    149  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleRound][vLine])
    150  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleRound][vLine])
    151  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleRound][bottomRightCorner])
     149 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Round][topRightCorner])
     150 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Round][vLine])
     151 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Round][vLine])
     152 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Round][bottomRightCorner])
    152 153   
    153 154   testcanvas.MustApply(c, ft)
    154 155   return ft
    skipped 7 lines
    162 163   ft := faketerm.MustNew(size)
    163 164   c := testcanvas.MustNew(ft.Area())
    164 165   
    165  - testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[LineStyleLight][topLeftCorner])
    166  - testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     166 + testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[linestyle.Light][topLeftCorner])
     167 + testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    167 168   
    168  - testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[LineStyleLight][topRightCorner])
    169  - testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[LineStyleLight][bottomRightCorner])
     169 + testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[linestyle.Light][topRightCorner])
     170 + testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[linestyle.Light][bottomRightCorner])
    170 171   
    171 172   testcanvas.MustApply(c, ft)
    172 173   return ft
    skipped 11 lines
    184 185   c := testcanvas.MustNew(ft.Area())
    185 186   
    186 187   testcanvas.MustSetCell(c, image.Point{1, 1},
    187  - lineStyleChars[LineStyleLight][topLeftCorner], cell.FgColor(cell.ColorRed))
     188 + lineStyleChars[linestyle.Light][topLeftCorner], cell.FgColor(cell.ColorRed))
    188 189   testcanvas.MustSetCell(c, image.Point{1, 2},
    189  - lineStyleChars[LineStyleLight][bottomLeftCorner], cell.FgColor(cell.ColorRed))
     190 + lineStyleChars[linestyle.Light][bottomLeftCorner], cell.FgColor(cell.ColorRed))
    190 191   
    191 192   testcanvas.MustSetCell(c, image.Point{2, 1},
    192  - lineStyleChars[LineStyleLight][topRightCorner], cell.FgColor(cell.ColorRed))
     193 + lineStyleChars[linestyle.Light][topRightCorner], cell.FgColor(cell.ColorRed))
    193 194   testcanvas.MustSetCell(c, image.Point{2, 2},
    194  - lineStyleChars[LineStyleLight][bottomRightCorner], cell.FgColor(cell.ColorRed))
     195 + lineStyleChars[linestyle.Light][bottomRightCorner], cell.FgColor(cell.ColorRed))
    195 196   
    196 197   testcanvas.MustApply(c, ft)
    197 198   return ft
    skipped 10 lines
    208 209   ft := faketerm.MustNew(size)
    209 210   c := testcanvas.MustNew(ft.Area())
    210 211   
    211  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    212  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    213  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    214  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     212 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     213 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     214 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     215 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    215 216   
    216 217   testcanvas.MustSetCell(c, image.Point{1, 0}, 'a')
    217  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     218 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    218 219   
    219 220   testcanvas.MustSetCell(c, image.Point{2, 0}, 'b')
    220  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     221 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    221 222   
    222  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    223  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine])
    224  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine])
    225  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     223 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     224 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine])
     225 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine])
     226 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    226 227   
    227 228   testcanvas.MustApply(c, ft)
    228 229   return ft
    skipped 10 lines
    239 240   ft := faketerm.MustNew(size)
    240 241   c := testcanvas.MustNew(ft.Area())
    241 242   
    242  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    243  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    244  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    245  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     243 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     244 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     245 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     246 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    246 247   
    247 248   testcanvas.MustSetCell(c, image.Point{1, 0}, 'a', cell.FgColor(cell.ColorRed))
    248  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     249 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    249 250   
    250 251   testcanvas.MustSetCell(c, image.Point{2, 0}, 'b', cell.FgColor(cell.ColorRed))
    251  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     252 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    252 253   
    253  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    254  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine])
    255  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine])
    256  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     254 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     255 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine])
     256 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine])
     257 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    257 258   
    258 259   testcanvas.MustApply(c, ft)
    259 260   return ft
    skipped 22 lines
    282 283   ft := faketerm.MustNew(size)
    283 284   c := testcanvas.MustNew(ft.Area())
    284 285   
    285  - testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[LineStyleLight][topLeftCorner])
    286  - testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     286 + testcanvas.MustSetCell(c, image.Point{1, 1}, lineStyleChars[linestyle.Light][topLeftCorner])
     287 + testcanvas.MustSetCell(c, image.Point{1, 2}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    287 288   
    288  - testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[LineStyleLight][topRightCorner])
    289  - testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[LineStyleLight][bottomRightCorner])
     289 + testcanvas.MustSetCell(c, image.Point{2, 1}, lineStyleChars[linestyle.Light][topRightCorner])
     290 + testcanvas.MustSetCell(c, image.Point{2, 2}, lineStyleChars[linestyle.Light][bottomRightCorner])
    290 291   
    291 292   testcanvas.MustApply(c, ft)
    292 293   return ft
    skipped 10 lines
    303 304   ft := faketerm.MustNew(size)
    304 305   c := testcanvas.MustNew(ft.Area())
    305 306   
    306  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    307  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    308  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    309  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     307 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     308 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     309 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     310 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    310 311   
    311 312   testcanvas.MustSetCell(c, image.Point{1, 0}, 'a')
    312  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     313 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    313 314   
    314 315   testcanvas.MustSetCell(c, image.Point{2, 0}, 'b')
    315  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     316 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    316 317   
    317  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    318  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine])
    319  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine])
    320  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     318 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     319 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine])
     320 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine])
     321 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    321 322   
    322 323   testcanvas.MustApply(c, ft)
    323 324   return ft
    skipped 10 lines
    334 335   ft := faketerm.MustNew(size)
    335 336   c := testcanvas.MustNew(ft.Area())
    336 337   
    337  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    338  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    339  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    340  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     338 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     339 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     340 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     341 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    341 342   
    342 343   testcanvas.MustSetCell(c, image.Point{1, 0}, 'a')
    343  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     344 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    344 345   
    345 346   testcanvas.MustSetCell(c, image.Point{2, 0}, '…')
    346  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     347 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    347 348   
    348  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    349  - testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[LineStyleLight][vLine])
    350  - testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[LineStyleLight][vLine])
    351  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     349 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     350 + testcanvas.MustSetCell(c, image.Point{3, 1}, lineStyleChars[linestyle.Light][vLine])
     351 + testcanvas.MustSetCell(c, image.Point{3, 2}, lineStyleChars[linestyle.Light][vLine])
     352 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    352 353   
    353 354   testcanvas.MustApply(c, ft)
    354 355   return ft
    skipped 11 lines
    366 367   ft := faketerm.MustNew(size)
    367 368   c := testcanvas.MustNew(ft.Area())
    368 369   
    369  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    370  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    371  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    372  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     370 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     371 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     372 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     373 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    373 374   
    374 375   testcanvas.MustSetCell(c, image.Point{1, 0}, 'a')
    375  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     376 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    376 377   
    377 378   testcanvas.MustSetCell(c, image.Point{2, 0}, 'b')
    378  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     379 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    379 380   
    380  - testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[LineStyleLight][hLine])
    381  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine])
     381 + testcanvas.MustSetCell(c, image.Point{3, 0}, lineStyleChars[linestyle.Light][hLine])
     382 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine])
    382 383   
    383  - testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[LineStyleLight][hLine])
    384  - testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine])
     384 + testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[linestyle.Light][hLine])
     385 + testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine])
    385 386   
    386  - testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    387  - testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine])
    388  - testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine])
    389  - testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     387 + testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     388 + testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine])
     389 + testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine])
     390 + testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    390 391   
    391 392   testcanvas.MustApply(c, ft)
    392 393   return ft
    skipped 11 lines
    404 405   ft := faketerm.MustNew(size)
    405 406   c := testcanvas.MustNew(ft.Area())
    406 407   
    407  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    408  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    409  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    410  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     408 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     409 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     410 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     411 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    411 412   
    412  - testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine])
    413  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     413 + testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine])
     414 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    414 415   
    415 416   testcanvas.MustSetCell(c, image.Point{2, 0}, 'a')
    416  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     417 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    417 418   
    418 419   testcanvas.MustSetCell(c, image.Point{3, 0}, 'b')
    419  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine])
     420 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine])
    420 421   
    421  - testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[LineStyleLight][hLine])
    422  - testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine])
     422 + testcanvas.MustSetCell(c, image.Point{4, 0}, lineStyleChars[linestyle.Light][hLine])
     423 + testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine])
    423 424   
    424  - testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    425  - testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine])
    426  - testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine])
    427  - testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     425 + testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     426 + testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine])
     427 + testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine])
     428 + testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    428 429   
    429 430   testcanvas.MustApply(c, ft)
    430 431   return ft
    skipped 11 lines
    442 443   ft := faketerm.MustNew(size)
    443 444   c := testcanvas.MustNew(ft.Area())
    444 445   
    445  - testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[LineStyleLight][topLeftCorner])
    446  - testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[LineStyleLight][vLine])
    447  - testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[LineStyleLight][vLine])
    448  - testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[LineStyleLight][bottomLeftCorner])
     446 + testcanvas.MustSetCell(c, image.Point{0, 0}, lineStyleChars[linestyle.Light][topLeftCorner])
     447 + testcanvas.MustSetCell(c, image.Point{0, 1}, lineStyleChars[linestyle.Light][vLine])
     448 + testcanvas.MustSetCell(c, image.Point{0, 2}, lineStyleChars[linestyle.Light][vLine])
     449 + testcanvas.MustSetCell(c, image.Point{0, 3}, lineStyleChars[linestyle.Light][bottomLeftCorner])
    449 450   
    450  - testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[LineStyleLight][hLine])
    451  - testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[LineStyleLight][hLine])
     451 + testcanvas.MustSetCell(c, image.Point{1, 0}, lineStyleChars[linestyle.Light][hLine])
     452 + testcanvas.MustSetCell(c, image.Point{1, 3}, lineStyleChars[linestyle.Light][hLine])
    452 453   
    453  - testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[LineStyleLight][hLine])
    454  - testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[LineStyleLight][hLine])
     454 + testcanvas.MustSetCell(c, image.Point{2, 0}, lineStyleChars[linestyle.Light][hLine])
     455 + testcanvas.MustSetCell(c, image.Point{2, 3}, lineStyleChars[linestyle.Light][hLine])
    455 456   
    456 457   testcanvas.MustSetCell(c, image.Point{3, 0}, 'a')
    457  - testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[LineStyleLight][hLine])
     458 + testcanvas.MustSetCell(c, image.Point{3, 3}, lineStyleChars[linestyle.Light][hLine])
    458 459   
    459 460   testcanvas.MustSetCell(c, image.Point{4, 0}, 'b')
    460  - testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[LineStyleLight][hLine])
     461 + testcanvas.MustSetCell(c, image.Point{4, 3}, lineStyleChars[linestyle.Light][hLine])
    461 462   
    462  - testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[LineStyleLight][topRightCorner])
    463  - testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[LineStyleLight][vLine])
    464  - testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[LineStyleLight][vLine])
    465  - testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[LineStyleLight][bottomRightCorner])
     463 + testcanvas.MustSetCell(c, image.Point{5, 0}, lineStyleChars[linestyle.Light][topRightCorner])
     464 + testcanvas.MustSetCell(c, image.Point{5, 1}, lineStyleChars[linestyle.Light][vLine])
     465 + testcanvas.MustSetCell(c, image.Point{5, 2}, lineStyleChars[linestyle.Light][vLine])
     466 + testcanvas.MustSetCell(c, image.Point{5, 3}, lineStyleChars[linestyle.Light][bottomRightCorner])
    466 467   
    467 468   testcanvas.MustApply(c, ft)
    468 469   return ft
    skipped 35 lines
  • ■ ■ ■ ■
    internal/draw/braille_circle.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25   "github.com/mum4k/termdash/internal/numbers/trig"
    26 26  )
    27 27   
    skipped 237 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/braille_circle_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/area"
    22 23   "github.com/mum4k/termdash/internal/canvas/braille"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    26 26  )
    27 27   
    28 28  // mustBrailleLine draws the braille line or panics.
    skipped 1164 lines
  • ■ ■ ■ ■
    internal/draw/braille_fill.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25  )
    26 26   
    27 27  // BrailleFillOption is used to provide options to BrailleFill.
    skipped 134 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/braille_fill_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/area"
    22 23   "github.com/mum4k/termdash/internal/canvas/braille"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    26 26  )
    27 27   
    28 28  func TestBrailleFill(t *testing.T) {
    skipped 243 lines
  • ■ ■ ■ ■
    internal/draw/braille_line.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25   "github.com/mum4k/termdash/internal/numbers"
    26 26  )
    27 27   
    skipped 178 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/braille_line_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/area"
    22 23   "github.com/mum4k/termdash/internal/canvas/braille"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    24  - "github.com/mum4k/termdash/internal/cell"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    26 26  )
    27 27   
    28 28  func TestBrailleLine(t *testing.T) {
    skipped 430 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/hv_line.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24  - "github.com/mum4k/termdash/internal/cell"
     25 + "github.com/mum4k/termdash/linestyle"
    25 26  )
    26 27   
    27 28  // HVLineOption is used to provide options to HVLine().
    skipped 5 lines
    33 34  // hVLineOptions stores the provided options.
    34 35  type hVLineOptions struct {
    35 36   cellOpts []cell.Option
    36  - lineStyle LineStyle
     37 + lineStyle linestyle.LineStyle
    37 38  }
    38 39   
    39 40  // newHVLineOptions returns a new hVLineOptions instance.
    40 41  func newHVLineOptions() *hVLineOptions {
    41 42   return &hVLineOptions{
    42  - lineStyle: DefaultHVLineStyle,
     43 + lineStyle: DefaultLineStyle,
    43 44   }
    44 45  }
    45 46   
    skipped 5 lines
    51 52   o(opts)
    52 53  }
    53 54   
    54  -// DefaultHVLineStyle is the default value for the HVLineStyle option.
    55  -const DefaultHVLineStyle = LineStyleLight
     55 +// DefaultLineStyle is the default value for the HVLineStyle option.
     56 +const DefaultLineStyle = linestyle.Light
    56 57   
    57 58  // HVLineStyle sets the style of the line.
    58  -// Defaults to DefaultHVLineStyle.
    59  -func HVLineStyle(ls LineStyle) HVLineOption {
     59 +// Defaults to DefaultLineStyle.
     60 +func HVLineStyle(ls linestyle.LineStyle) HVLineOption {
    60 61   return hVLineOption(func(opts *hVLineOptions) {
    61 62   opts.lineStyle = ls
    62 63   })
    skipped 145 lines
  • ■ ■ ■ ■ ■
    internal/draw/hv_line_graph.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   "image"
     22 + 
     23 + "github.com/mum4k/termdash/linestyle"
    22 24  )
    23 25   
    24 26  // hVLineEdge is an edge between two points on the graph.
    skipped 65 lines
    90 92  // rune, given the selected line style returns the correct line character to
    91 93  // represent this node.
    92 94  // Only handles nodes with two or more edges, as returned by multiEdgeNodes().
    93  -func (n *hVLineNode) rune(ls LineStyle) (rune, error) {
     95 +func (n *hVLineNode) rune(ls linestyle.LineStyle) (rune, error) {
    94 96   parts, err := lineParts(ls)
    95 97   if err != nil {
    96 98   return -1, err
    skipped 109 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/hv_line_graph_test.go
    skipped 20 lines
    21 21   
    22 22   "github.com/kylelemons/godebug/pretty"
    23 23   "github.com/mum4k/termdash/internal/canvas"
     24 + "github.com/mum4k/termdash/linestyle"
    24 25  )
    25 26   
    26 27  func TestMultiEdgeNodes(t *testing.T) {
    skipped 153 lines
    180 181   tests := []struct {
    181 182   desc string
    182 183   node *hVLineNode
    183  - ls LineStyle
     184 + ls linestyle.LineStyle
    184 185   want rune
    185 186   wantErr bool
    186 187   }{
    skipped 10 lines
    197 198   newHVLineEdge(image.Point{1, 1}, image.Point{2, 2}): true,
    198 199   },
    199 200   },
    200  - ls: LineStyleLight,
     201 + ls: linestyle.Light,
    201 202   wantErr: true,
    202 203   },
    203 204   {
    skipped 5 lines
    209 210   newHVLineEdge(image.Point{1, 1}, image.Point{2, 2}): true,
    210 211   },
    211 212   },
    212  - ls: LineStyleLight,
     213 + ls: linestyle.Light,
    213 214   wantErr: true,
    214 215   },
    215 216   {
    216 217   desc: "fails on unsupported line style",
    217 218   node: &hVLineNode{},
    218  - ls: LineStyle(-1),
     219 + ls: linestyle.LineStyle(-1),
    219 220   wantErr: true,
    220 221   },
    221 222   {
    skipped 5 lines
    227 228   newHVLineEdge(image.Point{1, 1}, image.Point{2, 1}): true,
    228 229   },
    229 230   },
    230  - ls: LineStyleLight,
    231  - want: lineStyleChars[LineStyleLight][hLine],
     231 + ls: linestyle.Light,
     232 + want: lineStyleChars[linestyle.Light][hLine],
    232 233   },
    233 234   {
    234 235   desc: "vertical line",
    skipped 4 lines
    239 240   newHVLineEdge(image.Point{1, 1}, image.Point{1, 2}): true,
    240 241   },
    241 242   },
    242  - ls: LineStyleLight,
    243  - want: lineStyleChars[LineStyleLight][vLine],
     243 + ls: linestyle.Light,
     244 + want: lineStyleChars[linestyle.Light][vLine],
    244 245   },
    245 246   {
    246 247   desc: "top left corner",
    skipped 4 lines
    251 252   newHVLineEdge(image.Point{0, 0}, image.Point{0, 1}): true,
    252 253   },
    253 254   },
    254  - ls: LineStyleLight,
    255  - want: lineStyleChars[LineStyleLight][topLeftCorner],
     255 + ls: linestyle.Light,
     256 + want: lineStyleChars[linestyle.Light][topLeftCorner],
    256 257   },
    257 258   {
    258 259   desc: "top right corner",
    skipped 4 lines
    263 264   newHVLineEdge(image.Point{2, 0}, image.Point{2, 1}): true,
    264 265   },
    265 266   },
    266  - ls: LineStyleLight,
    267  - want: lineStyleChars[LineStyleLight][topRightCorner],
     267 + ls: linestyle.Light,
     268 + want: lineStyleChars[linestyle.Light][topRightCorner],
    268 269   },
    269 270   {
    270 271   desc: "bottom left corner",
    skipped 4 lines
    275 276   newHVLineEdge(image.Point{0, 2}, image.Point{1, 2}): true,
    276 277   },
    277 278   },
    278  - ls: LineStyleLight,
    279  - want: lineStyleChars[LineStyleLight][bottomLeftCorner],
     279 + ls: linestyle.Light,
     280 + want: lineStyleChars[linestyle.Light][bottomLeftCorner],
    280 281   },
    281 282   {
    282 283   desc: "bottom right corner",
    skipped 4 lines
    287 288   newHVLineEdge(image.Point{2, 1}, image.Point{2, 2}): true,
    288 289   },
    289 290   },
    290  - ls: LineStyleLight,
    291  - want: lineStyleChars[LineStyleLight][bottomRightCorner],
     291 + ls: linestyle.Light,
     292 + want: lineStyleChars[linestyle.Light][bottomRightCorner],
    292 293   },
    293 294   {
    294 295   desc: "T horizontal and up",
    skipped 5 lines
    300 301   newHVLineEdge(image.Point{1, 2}, image.Point{2, 2}): true,
    301 302   },
    302 303   },
    303  - ls: LineStyleLight,
    304  - want: lineStyleChars[LineStyleLight][hAndUp],
     304 + ls: linestyle.Light,
     305 + want: lineStyleChars[linestyle.Light][hAndUp],
    305 306   },
    306 307   {
    307 308   desc: "T horizontal and down",
    skipped 5 lines
    313 314   newHVLineEdge(image.Point{1, 0}, image.Point{1, 1}): true,
    314 315   },
    315 316   },
    316  - ls: LineStyleLight,
    317  - want: lineStyleChars[LineStyleLight][hAndDown],
     317 + ls: linestyle.Light,
     318 + want: lineStyleChars[linestyle.Light][hAndDown],
    318 319   },
    319 320   {
    320 321   desc: "T vertical and right",
    skipped 5 lines
    326 327   newHVLineEdge(image.Point{0, 1}, image.Point{0, 2}): true,
    327 328   },
    328 329   },
    329  - ls: LineStyleLight,
    330  - want: lineStyleChars[LineStyleLight][vAndRight],
     330 + ls: linestyle.Light,
     331 + want: lineStyleChars[linestyle.Light][vAndRight],
    331 332   },
    332 333   {
    333 334   desc: "T vertical and left",
    skipped 5 lines
    339 340   newHVLineEdge(image.Point{2, 1}, image.Point{2, 2}): true,
    340 341   },
    341 342   },
    342  - ls: LineStyleLight,
    343  - want: lineStyleChars[LineStyleLight][vAndLeft],
     343 + ls: linestyle.Light,
     344 + want: lineStyleChars[linestyle.Light][vAndLeft],
    344 345   },
    345 346   {
    346 347   desc: "cross",
    skipped 6 lines
    353 354   newHVLineEdge(image.Point{1, 1}, image.Point{1, 2}): true,
    354 355   },
    355 356   },
    356  - ls: LineStyleLight,
    357  - want: lineStyleChars[LineStyleLight][vAndH],
     357 + ls: linestyle.Light,
     358 + want: lineStyleChars[linestyle.Light][vAndH],
    358 359   },
    359 360   }
    360 361   
    skipped 16 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/hv_line_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/canvas"
    22 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
     25 + "github.com/mum4k/termdash/linestyle"
    25 26  )
    26 27   
    27 28  func TestHVLines(t *testing.T) {
    skipped 74 lines
    102 103   ft := faketerm.MustNew(size)
    103 104   c := testcanvas.MustNew(ft.Area())
    104 105   
    105  - parts := lineStyleChars[LineStyleLight]
     106 + parts := lineStyleChars[linestyle.Light]
    106 107   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine])
    107 108   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hLine])
    108 109   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[hLine])
    skipped 12 lines
    121 122   },
    122 123   },
    123 124   opts: []HVLineOption{
    124  - HVLineStyle(LineStyleLight),
     125 + HVLineStyle(linestyle.Light),
    125 126   },
    126 127   want: func(size image.Point) *faketerm.Terminal {
    127 128   ft := faketerm.MustNew(size)
    128 129   c := testcanvas.MustNew(ft.Area())
    129 130   
    130  - parts := lineStyleChars[LineStyleLight]
     131 + parts := lineStyleChars[linestyle.Light]
    131 132   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine])
    132 133   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hLine])
    133 134   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[hLine])
    skipped 21 lines
    155 156   ft := faketerm.MustNew(size)
    156 157   c := testcanvas.MustNew(ft.Area())
    157 158   
    158  - parts := lineStyleChars[LineStyleLight]
     159 + parts := lineStyleChars[linestyle.Light]
    159 160   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine],
    160 161   cell.FgColor(cell.ColorYellow),
    161 162   cell.BgColor(cell.ColorBlue),
    skipped 24 lines
    186 187   ft := faketerm.MustNew(size)
    187 188   c := testcanvas.MustNew(ft.Area())
    188 189   
    189  - parts := lineStyleChars[LineStyleLight]
     190 + parts := lineStyleChars[linestyle.Light]
    190 191   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine])
    191 192   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hLine])
    192 193   
    skipped 14 lines
    207 208   ft := faketerm.MustNew(size)
    208 209   c := testcanvas.MustNew(ft.Area())
    209 210   
    210  - parts := lineStyleChars[LineStyleLight]
     211 + parts := lineStyleChars[linestyle.Light]
    211 212   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[vLine])
    212 213   testcanvas.MustSetCell(c, image.Point{1, 1}, parts[vLine])
    213 214   testcanvas.MustSetCell(c, image.Point{1, 2}, parts[vLine])
    skipped 15 lines
    229 230   ft := faketerm.MustNew(size)
    230 231   c := testcanvas.MustNew(ft.Area())
    231 232   
    232  - parts := lineStyleChars[LineStyleLight]
     233 + parts := lineStyleChars[linestyle.Light]
    233 234   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[vLine])
    234 235   testcanvas.MustSetCell(c, image.Point{1, 1}, parts[vLine])
    235 236   
    skipped 18 lines
    254 255   ft := faketerm.MustNew(size)
    255 256   c := testcanvas.MustNew(ft.Area())
    256 257   
    257  - parts := lineStyleChars[LineStyleLight]
     258 + parts := lineStyleChars[linestyle.Light]
    258 259   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine])
    259 260   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hLine])
    260 261   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[hLine])
    skipped 23 lines
    284 285   ft := faketerm.MustNew(size)
    285 286   c := testcanvas.MustNew(ft.Area())
    286 287   
    287  - parts := lineStyleChars[LineStyleLight]
     288 + parts := lineStyleChars[linestyle.Light]
    288 289   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[vLine])
    289 290   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[vLine])
    290 291   testcanvas.MustSetCell(c, image.Point{0, 2}, parts[vLine])
    skipped 23 lines
    314 315   ft := faketerm.MustNew(size)
    315 316   c := testcanvas.MustNew(ft.Area())
    316 317   
    317  - parts := lineStyleChars[LineStyleLight]
     318 + parts := lineStyleChars[linestyle.Light]
    318 319   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[vLine])
    319 320   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[vLine])
    320 321   testcanvas.MustSetCell(c, image.Point{0, 2}, parts[vLine])
    skipped 22 lines
    343 344   ft := faketerm.MustNew(size)
    344 345   c := testcanvas.MustNew(ft.Area())
    345 346   
    346  - parts := lineStyleChars[LineStyleLight]
     347 + parts := lineStyleChars[linestyle.Light]
    347 348   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[topLeftCorner])
    348 349   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[vLine])
    349 350   testcanvas.MustSetCell(c, image.Point{0, 2}, parts[vLine])
    skipped 22 lines
    372 373   ft := faketerm.MustNew(size)
    373 374   c := testcanvas.MustNew(ft.Area())
    374 375   
    375  - parts := lineStyleChars[LineStyleLight]
     376 + parts := lineStyleChars[linestyle.Light]
    376 377   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[topRightCorner])
    377 378   testcanvas.MustSetCell(c, image.Point{2, 1}, parts[vLine])
    378 379   testcanvas.MustSetCell(c, image.Point{2, 2}, parts[vLine])
    skipped 22 lines
    401 402   ft := faketerm.MustNew(size)
    402 403   c := testcanvas.MustNew(ft.Area())
    403 404   
    404  - parts := lineStyleChars[LineStyleLight]
     405 + parts := lineStyleChars[linestyle.Light]
    405 406   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[vLine])
    406 407   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[vLine])
    407 408   testcanvas.MustSetCell(c, image.Point{0, 2}, parts[bottomLeftCorner])
    skipped 22 lines
    430 431   ft := faketerm.MustNew(size)
    431 432   c := testcanvas.MustNew(ft.Area())
    432 433   
    433  - parts := lineStyleChars[LineStyleLight]
     434 + parts := lineStyleChars[linestyle.Light]
    434 435   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[vLine])
    435 436   testcanvas.MustSetCell(c, image.Point{2, 1}, parts[vLine])
    436 437   testcanvas.MustSetCell(c, image.Point{2, 2}, parts[bottomRightCorner])
    skipped 22 lines
    459 460   ft := faketerm.MustNew(size)
    460 461   c := testcanvas.MustNew(ft.Area())
    461 462   
    462  - parts := lineStyleChars[LineStyleLight]
     463 + parts := lineStyleChars[linestyle.Light]
    463 464   testcanvas.MustSetCell(c, image.Point{0, 2}, parts[hLine])
    464 465   testcanvas.MustSetCell(c, image.Point{1, 2}, parts[hAndUp])
    465 466   testcanvas.MustSetCell(c, image.Point{2, 2}, parts[hLine])
    skipped 22 lines
    488 489   ft := faketerm.MustNew(size)
    489 490   c := testcanvas.MustNew(ft.Area())
    490 491   
    491  - parts := lineStyleChars[LineStyleLight]
     492 + parts := lineStyleChars[linestyle.Light]
    492 493   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[hLine])
    493 494   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hAndDown])
    494 495   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[hLine])
    skipped 22 lines
    517 518   ft := faketerm.MustNew(size)
    518 519   c := testcanvas.MustNew(ft.Area())
    519 520   
    520  - parts := lineStyleChars[LineStyleLight]
     521 + parts := lineStyleChars[linestyle.Light]
    521 522   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[hLine])
    522 523   testcanvas.MustSetCell(c, image.Point{1, 1}, parts[hLine])
    523 524   testcanvas.MustSetCell(c, image.Point{2, 1}, parts[vAndLeft])
    skipped 22 lines
    546 547   ft := faketerm.MustNew(size)
    547 548   c := testcanvas.MustNew(ft.Area())
    548 549   
    549  - parts := lineStyleChars[LineStyleLight]
     550 + parts := lineStyleChars[linestyle.Light]
    550 551   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[vAndRight])
    551 552   testcanvas.MustSetCell(c, image.Point{1, 1}, parts[hLine])
    552 553   testcanvas.MustSetCell(c, image.Point{2, 1}, parts[hLine])
    skipped 22 lines
    575 576   ft := faketerm.MustNew(size)
    576 577   c := testcanvas.MustNew(ft.Area())
    577 578   
    578  - parts := lineStyleChars[LineStyleLight]
     579 + parts := lineStyleChars[linestyle.Light]
    579 580   testcanvas.MustSetCell(c, image.Point{0, 1}, parts[hLine])
    580 581   testcanvas.MustSetCell(c, image.Point{1, 1}, parts[vAndH])
    581 582   testcanvas.MustSetCell(c, image.Point{2, 1}, parts[hLine])
    skipped 40 lines
    622 623   ft := faketerm.MustNew(size)
    623 624   c := testcanvas.MustNew(ft.Area())
    624 625   
    625  - parts := lineStyleChars[LineStyleLight]
     626 + parts := lineStyleChars[linestyle.Light]
    626 627   testcanvas.MustSetCell(c, image.Point{0, 0}, parts[topLeftCorner])
    627 628   testcanvas.MustSetCell(c, image.Point{1, 0}, parts[hAndDown])
    628 629   testcanvas.MustSetCell(c, image.Point{2, 0}, parts[topRightCorner])
    skipped 46 lines
  • ■ ■ ■ ■ ■
    internal/draw/line_style.go
    skipped 16 lines
    17 17  import (
    18 18   "fmt"
    19 19   
    20  - "github.com/mum4k/termdash/internal/cell/runewidth"
     20 + "github.com/mum4k/termdash/internal/runewidth"
     21 + "github.com/mum4k/termdash/linestyle"
    21 22  )
    22 23   
    23 24  // line_style.go contains the Unicode characters used for drawing lines of
    skipped 1 lines
    25 26   
    26 27  // lineStyleChars maps the line styles to the corresponding component characters.
    27 28  // Source: http://en.wikipedia.org/wiki/Box-drawing_character.
    28  -var lineStyleChars = map[LineStyle]map[linePart]rune{
    29  - LineStyleLight: {
     29 +var lineStyleChars = map[linestyle.LineStyle]map[linePart]rune{
     30 + linestyle.Light: {
    30 31   hLine: '─',
    31 32   vLine: '│',
    32 33   topLeftCorner: '┌',
    skipped 6 lines
    39 40   vAndRight: '├',
    40 41   vAndH: '┼',
    41 42   },
    42  - LineStyleDouble: {
     43 + linestyle.Double: {
    43 44   hLine: '═',
    44 45   vLine: '║',
    45 46   topLeftCorner: '╔',
    skipped 6 lines
    52 53   vAndRight: '╠',
    53 54   vAndH: '╬',
    54 55   },
    55  - LineStyleRound: {
     56 + linestyle.Round: {
    56 57   hLine: '─',
    57 58   vLine: '│',
    58 59   topLeftCorner: '╭',
    skipped 21 lines
    80 81  }
    81 82   
    82 83  // lineParts returns the line component characters for the provided line style.
    83  -func lineParts(ls LineStyle) (map[linePart]rune, error) {
     84 +func lineParts(ls linestyle.LineStyle) (map[linePart]rune, error) {
    84 85   parts, ok := lineStyleChars[ls]
    85 86   if !ok {
    86 87   return nil, fmt.Errorf("unsupported line style %d", ls)
    87 88   }
    88 89   return parts, nil
    89 90  }
    90  - 
    91  -// LineStyle defines the supported line styles.Q
    92  -type LineStyle int
    93  - 
    94  -// String implements fmt.Stringer()
    95  -func (ls LineStyle) String() string {
    96  - if n, ok := lineStyleNames[ls]; ok {
    97  - return n
    98  - }
    99  - return "LineStyleUnknown"
    100  -}
    101  - 
    102  -// lineStyleNames maps LineStyle values to human readable names.
    103  -var lineStyleNames = map[LineStyle]string{
    104  - LineStyleLight: "LineStyleLight",
    105  - LineStyleDouble: "LineStyleDouble",
    106  - LineStyleRound: "LineStyleRound",
    107  -}
    108  - 
    109  -// Supported line styles.
    110  -const (
    111  - LineStyleNone LineStyle = iota
    112  - LineStyleLight
    113  - LineStyleDouble
    114  - LineStyleRound
    115  -)
    116 91   
    117 92  // linePart identifies individual line parts.
    118 93  type linePart int
    skipped 37 lines
  • ■ ■ ■ ■
    internal/draw/rectangle.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25  )
    26 26   
    27 27  // RectangleOption is used to provide options to the Rectangle function.
    skipped 67 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/rectangle_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/canvas"
    22 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  func TestRectangle(t *testing.T) {
    skipped 134 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/text.go
    skipped 20 lines
    21 21   "fmt"
    22 22   "image"
    23 23   
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/internal/canvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/cell/runewidth"
     26 + "github.com/mum4k/termdash/internal/runewidth"
    27 27  )
    28 28   
    29 29  // OverrunMode represents
    skipped 167 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/text_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/canvas"
    22 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  func TestTrimText(t *testing.T) {
    skipped 630 lines
  • ■ ■ ■ ■
    internal/draw/vertical_text.go
    skipped 20 lines
    21 21   "fmt"
    22 22   "image"
    23 23   
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/internal/canvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26 26  )
    27 27   
    28 28  // VerticalTextOption is used to provide options to Text().
    skipped 93 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/vertical_text_test.go
    skipped 17 lines
    18 18   "image"
    19 19   "testing"
    20 20   
     21 + "github.com/mum4k/termdash/cell"
    21 22   "github.com/mum4k/termdash/internal/canvas"
    22 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     24 + "github.com/mum4k/termdash/internal/faketerm"
    25 25  )
    26 26   
    27 27  func TestVerticalText(t *testing.T) {
    skipped 395 lines
  • ■ ■ ■ ■
    internal/event/event.go
    skipped 21 lines
    22 22   "sync"
    23 23   
    24 24   "github.com/mum4k/termdash/internal/event/eventqueue"
    25  - "github.com/mum4k/termdash/internal/terminalapi"
     25 + "github.com/mum4k/termdash/terminal/terminalapi"
    26 26  )
    27 27   
    28 28  // Callback is a function provided by an event subscriber.
    skipped 233 lines
  • ■ ■ ■ ■ ■ ■
    internal/event/event_test.go
    skipped 23 lines
    24 24   
    25 25   "github.com/kylelemons/godebug/pretty"
    26 26   "github.com/mum4k/termdash/internal/event/testevent"
    27  - "github.com/mum4k/termdash/internal/keyboard"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/keyboard"
     28 + "github.com/mum4k/termdash/terminal/terminalapi"
    29 29  )
    30 30   
    31 31  // receiverMode defines how the receiver behaves.
    skipped 395 lines
  • ■ ■ ■ ■
    internal/event/eventqueue/eventqueue.go
    skipped 20 lines
    21 21   "sync"
    22 22   "time"
    23 23   
    24  - "github.com/mum4k/termdash/internal/terminalapi"
     24 + "github.com/mum4k/termdash/terminal/terminalapi"
    25 25  )
    26 26   
    27 27  // node is a single data item on the queue.
    skipped 205 lines
  • ■ ■ ■ ■
    internal/event/eventqueue/eventqueue_test.go
    skipped 19 lines
    20 20   "time"
    21 21   
    22 22   "github.com/kylelemons/godebug/pretty"
    23  - "github.com/mum4k/termdash/internal/terminalapi"
     23 + "github.com/mum4k/termdash/terminal/terminalapi"
    24 24  )
    25 25   
    26 26  func TestQueue(t *testing.T) {
    skipped 224 lines
  • ■ ■ ■ ■
    internal/terminal/faketerm/diff.go internal/faketerm/diff.go
    skipped 22 lines
    23 23   "reflect"
    24 24   
    25 25   "github.com/kylelemons/godebug/pretty"
    26  - "github.com/mum4k/termdash/internal/cell"
     26 + "github.com/mum4k/termdash/cell"
    27 27  )
    28 28   
    29 29  // optDiff is used to display differences in cell options.
    skipped 80 lines
  • ■ ■ ■ ■ ■ ■
    internal/terminal/faketerm/faketerm.go internal/faketerm/faketerm.go
    skipped 22 lines
    23 23   "log"
    24 24   "sync"
    25 25   
    26  - "github.com/mum4k/termdash/internal/cell"
     26 + "github.com/mum4k/termdash/cell"
    27 27   "github.com/mum4k/termdash/internal/event/eventqueue"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     28 + "github.com/mum4k/termdash/terminal/terminalapi"
    29 29  )
    30 30   
    31 31  // Option is used to provide options.
    skipped 180 lines
  • internal/cell/runewidth/runewidth.go internal/runewidth/runewidth.go
    Content is identical
  • internal/cell/runewidth/runewidth_test.go internal/runewidth/runewidth_test.go
    Content is identical
  • ■ ■ ■ ■
    internal/draw/segdisp/segment/segment.go internal/segdisp/segment/segment.go
    skipped 18 lines
    19 19   "fmt"
    20 20   "image"
    21 21   
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas/braille"
    23  - "github.com/mum4k/termdash/internal/cell"
    24 24   "github.com/mum4k/termdash/internal/draw"
    25 25  )
    26 26   
    skipped 447 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/segdisp/segment/segment_test.go internal/segdisp/segment/segment_test.go
    skipped 18 lines
    19 19   "image"
    20 20   "testing"
    21 21   
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/area"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille"
    24 25   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    25  - "github.com/mum4k/termdash/internal/cell"
    26 26   "github.com/mum4k/termdash/internal/draw"
    27 27   "github.com/mum4k/termdash/internal/draw/testdraw"
    28  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     28 + "github.com/mum4k/termdash/internal/faketerm"
    29 29  )
    30 30   
    31 31  func TestHV(t *testing.T) {
    skipped 1730 lines
  • ■ ■ ■ ■
    internal/draw/segdisp/segment/testsegment/testsegment.go internal/segdisp/segment/testsegment/testsegment.go
    skipped 19 lines
    20 20   "image"
    21 21   
    22 22   "github.com/mum4k/termdash/internal/canvas/braille"
    23  - "github.com/mum4k/termdash/internal/draw/segdisp/segment"
     23 + "github.com/mum4k/termdash/internal/segdisp/segment"
    24 24  )
    25 25   
    26 26  // MustHV draws the segment or panics.
    skipped 13 lines
  • ■ ■ ■ ■
    internal/draw/segdisp/sixteen/attributes.go internal/segdisp/sixteen/attributes.go
    skipped 21 lines
    22 22   "image"
    23 23   "math"
    24 24   
    25  - "github.com/mum4k/termdash/internal/draw/segdisp/segment"
    26 25   "github.com/mum4k/termdash/internal/numbers"
     26 + "github.com/mum4k/termdash/internal/segdisp/segment"
    27 27  )
    28 28   
    29 29  // hvSegType maps horizontal and vertical segments to their type.
    skipped 272 lines
  • internal/draw/segdisp/sixteen/doc/16-Segment-ASCII-All.jpg internal/segdisp/sixteen/doc/16-Segment-ASCII-All.jpg
  • internal/draw/segdisp/sixteen/doc/segment_placement.graffle internal/segdisp/sixteen/doc/segment_placement.graffle
    Binary file.
  • internal/draw/segdisp/sixteen/doc/segment_placement.svg internal/segdisp/sixteen/doc/segment_placement.svg
  • ■ ■ ■ ■ ■ ■
    internal/draw/segdisp/sixteen/sixteen.go internal/segdisp/sixteen/sixteen.go
    skipped 44 lines
    45 45   "image"
    46 46   "math"
    47 47   
     48 + "github.com/mum4k/termdash/cell"
    48 49   "github.com/mum4k/termdash/internal/area"
    49 50   "github.com/mum4k/termdash/internal/canvas"
    50 51   "github.com/mum4k/termdash/internal/canvas/braille"
    51  - "github.com/mum4k/termdash/internal/cell"
    52  - "github.com/mum4k/termdash/internal/draw/segdisp/segment"
     52 + "github.com/mum4k/termdash/internal/segdisp/segment"
    53 53  )
    54 54   
    55 55  // Segment represents a single segment in the display.
    skipped 435 lines
  • ■ ■ ■ ■ ■ ■
    internal/draw/segdisp/sixteen/sixteen_test.go internal/segdisp/sixteen/sixteen_test.go
    skipped 19 lines
    20 20   "testing"
    21 21   
    22 22   "github.com/kylelemons/godebug/pretty"
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/area"
    24 25   "github.com/mum4k/termdash/internal/canvas"
    25 26   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    26 27   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    27  - "github.com/mum4k/termdash/internal/cell"
    28  - "github.com/mum4k/termdash/internal/draw/segdisp/segment"
    29  - "github.com/mum4k/termdash/internal/draw/segdisp/segment/testsegment"
    30  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     28 + "github.com/mum4k/termdash/internal/faketerm"
     29 + "github.com/mum4k/termdash/internal/segdisp/segment"
     30 + "github.com/mum4k/termdash/internal/segdisp/segment/testsegment"
    31 31  )
    32 32   
    33 33  func TestDraw(t *testing.T) {
    skipped 1734 lines
  • ■ ■ ■ ■
    internal/draw/segdisp/sixteen/testsixteen/testsixteen.go internal/segdisp/sixteen/testsixteen/testsixteen.go
    skipped 18 lines
    19 19   "fmt"
    20 20   
    21 21   "github.com/mum4k/termdash/internal/canvas"
    22  - "github.com/mum4k/termdash/internal/draw/segdisp/sixteen"
     22 + "github.com/mum4k/termdash/internal/segdisp/sixteen"
    23 23  )
    24 24   
    25 25  // MustSetCharacter sets the character on the display or panics.
    skipped 13 lines
  • ■ ■ ■ ■
    internal/widgetapi/widgetapi.go
    skipped 18 lines
    19 19   "image"
    20 20   
    21 21   "github.com/mum4k/termdash/internal/canvas"
    22  - "github.com/mum4k/termdash/internal/terminalapi"
     22 + "github.com/mum4k/termdash/terminal/terminalapi"
    23 23  )
    24 24   
    25 25  // KeyScope indicates the scope at which the widget wants to receive keyboard
    skipped 153 lines
  • internal/keyboard/keyboard.go keyboard/keyboard.go
    Content is identical
  • ■ ■ ■ ■ ■ ■
    linestyle/linestyle.go
     1 +// Copyright 2019 Google Inc.
     2 +//
     3 +// Licensed under the Apache License, Version 2.0 (the "License");
     4 +// you may not use this file except in compliance with the License.
     5 +// You may obtain a copy of the License at
     6 +//
     7 +// http://www.apache.org/licenses/LICENSE-2.0
     8 +//
     9 +// Unless required by applicable law or agreed to in writing, software
     10 +// distributed under the License is distributed on an "AS IS" BASIS,
     11 +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 +// See the License for the specific language governing permissions and
     13 +// limitations under the License.
     14 + 
     15 +// Package linestyle defines various line styles.
     16 +package linestyle
     17 + 
     18 +// LineStyle defines the supported line styles.Q
     19 +type LineStyle int
     20 + 
     21 +// String implements fmt.Stringer()
     22 +func (ls LineStyle) String() string {
     23 + if n, ok := lineStyleNames[ls]; ok {
     24 + return n
     25 + }
     26 + return "LineStyleUnknown"
     27 +}
     28 + 
     29 +// lineStyleNames maps LineStyle values to human readable names.
     30 +var lineStyleNames = map[LineStyle]string{
     31 + None: "LineStyleNone",
     32 + Light: "LineStyleLight",
     33 + Double: "LineStyleDouble",
     34 + Round: "LineStyleRound",
     35 +}
     36 + 
     37 +// Supported line styles.
     38 +// See https://en.wikipedia.org/wiki/Box-drawing_character.
     39 +const (
     40 + // None indicates that no line should be present.
     41 + None LineStyle = iota
     42 + 
     43 + // Light is line style using the '─' characters.
     44 + Light
     45 + 
     46 + // Double is line style using the '═' characters.
     47 + Double
     48 + 
     49 + // Round is line style using the rounded corners '╭' characters.
     50 + Round
     51 +)
     52 + 
  • ■ ■ ■ ■ ■ ■
    linestyle/linestyle_test.go
     1 +// Copyright 2019 Google Inc.
     2 +//
     3 +// Licensed under the Apache License, Version 2.0 (the "License");
     4 +// you may not use this file except in compliance with the License.
     5 +// You may obtain a copy of the License at
     6 +//
     7 +// http://www.apache.org/licenses/LICENSE-2.0
     8 +//
     9 +// Unless required by applicable law or agreed to in writing, software
     10 +// distributed under the License is distributed on an "AS IS" BASIS,
     11 +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 +// See the License for the specific language governing permissions and
     13 +// limitations under the License.
     14 + 
     15 +package linestyle
     16 + 
     17 +import "testing"
     18 + 
     19 +func TestLineStyleName(t *testing.T) {
     20 + tests := []struct {
     21 + desc string
     22 + ls LineStyle
     23 + want string
     24 + }{
     25 + {
     26 + desc: "unknown",
     27 + ls: LineStyle(-1),
     28 + want: "LineStyleUnknown",
     29 + },
     30 + {
     31 + desc: "none",
     32 + ls: None,
     33 + want: "LineStyleNone",
     34 + },
     35 + {
     36 + desc: "light",
     37 + ls: Light,
     38 + want: "LineStyleLight",
     39 + },
     40 + {
     41 + desc: "double",
     42 + ls: Double,
     43 + want: "LineStyleDouble",
     44 + },
     45 + {
     46 + desc: "round",
     47 + ls: Round,
     48 + want: "LineStyleRound",
     49 + },
     50 + }
     51 + 
     52 + for _, tc := range tests {
     53 + t.Run(tc.desc, func(t *testing.T) {
     54 + if got := tc.ls.String(); got != tc.want {
     55 + t.Errorf("String => %q, want %q", got, tc.want)
     56 + }
     57 + 
     58 + })
     59 + }
     60 +}
     61 + 
  • internal/mouse/mouse.go mouse/mouse.go
    Content is identical
  • ■ ■ ■ ■
    termdash.go
    skipped 31 lines
    32 32   
    33 33   "github.com/mum4k/termdash/container"
    34 34   "github.com/mum4k/termdash/internal/event"
    35  - "github.com/mum4k/termdash/internal/terminalapi"
     35 + "github.com/mum4k/termdash/terminal/terminalapi"
    36 36  )
    37 37   
    38 38  // DefaultRedrawInterval is the default for the RedrawInterval option.
    skipped 309 lines
  • ■ ■ ■ ■ ■ ■
    termdash_test.go
    skipped 27 lines
    28 28   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    29 29   "github.com/mum4k/termdash/internal/event/eventqueue"
    30 30   "github.com/mum4k/termdash/internal/event/testevent"
    31  - "github.com/mum4k/termdash/internal/keyboard"
    32  - "github.com/mum4k/termdash/internal/mouse"
    33  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    34  - "github.com/mum4k/termdash/internal/terminal/termbox"
    35  - "github.com/mum4k/termdash/internal/terminalapi"
     31 + "github.com/mum4k/termdash/internal/faketerm"
    36 32   "github.com/mum4k/termdash/internal/widgetapi"
     33 + "github.com/mum4k/termdash/keyboard"
     34 + "github.com/mum4k/termdash/mouse"
     35 + "github.com/mum4k/termdash/terminal/termbox"
     36 + "github.com/mum4k/termdash/terminal/terminalapi"
     37 + "github.com/mum4k/termdash/widgets/barchart"
    37 38   "github.com/mum4k/termdash/widgets/fakewidget"
     39 + "github.com/mum4k/termdash/widgets/gauge"
    38 40  )
    39 41   
    40 42  // Example shows how to setup and run termdash with periodic redraw.
    skipped 5 lines
    46 48   }
    47 49   defer t.Close()
    48 50   
    49  - wOpts := widgetapi.Options{
    50  - MinimumSize: fakewidget.MinimumSize,
    51  - WantKeyboard: widgetapi.KeyScopeFocused,
    52  - WantMouse: widgetapi.MouseScopeWidget,
     51 + // Create some widgets.
     52 + bc, err := barchart.New()
     53 + if err != nil {
     54 + panic(err)
     55 + }
     56 + g, err := gauge.New()
     57 + if err != nil {
     58 + panic(err)
    53 59   }
    54 60   
    55  - // Create the container with two fake widgets.
     61 + // Create the container with two widgets.
    56 62   c, err := container.New(
    57 63   t,
    58 64   container.SplitVertical(
    59 65   container.Left(
    60  - container.PlaceWidget(fakewidget.New(wOpts)),
     66 + container.PlaceWidget(bc),
    61 67   ),
    62 68   container.Right(
    63  - container.PlaceWidget(fakewidget.New(wOpts)),
     69 + container.PlaceWidget(g),
    64 70   ),
    65 71   container.SplitPercent(30),
    66 72   ),
    skipped 19 lines
    86 92   }
    87 93   defer t.Close()
    88 94   
    89  - wOpts := widgetapi.Options{
    90  - MinimumSize: fakewidget.MinimumSize,
    91  - WantKeyboard: widgetapi.KeyScopeFocused,
    92  - WantMouse: widgetapi.MouseScopeWidget,
     95 + // Create a widget.
     96 + bc, err := barchart.New()
     97 + if err != nil {
     98 + panic(err)
    93 99   }
    94 100   
    95 101   // Create the container with a widget.
    96 102   c, err := container.New(
    97 103   t,
    98  - container.PlaceWidget(fakewidget.New(wOpts)),
     104 + container.PlaceWidget(bc),
    99 105   )
    100 106   if err != nil {
    101 107   panic(err)
    skipped 525 lines
  • ■ ■ ■ ■ ■ ■
    termdashdemo/termdashdemo.go
    skipped 24 lines
    25 25   "time"
    26 26   
    27 27   "github.com/mum4k/termdash"
     28 + "github.com/mum4k/termdash/align"
     29 + "github.com/mum4k/termdash/cell"
    28 30   "github.com/mum4k/termdash/container"
    29  - "github.com/mum4k/termdash/internal/align"
    30  - "github.com/mum4k/termdash/internal/cell"
    31  - "github.com/mum4k/termdash/internal/draw"
    32  - "github.com/mum4k/termdash/internal/terminal/termbox"
    33  - "github.com/mum4k/termdash/internal/terminalapi"
     31 + "github.com/mum4k/termdash/linestyle"
     32 + "github.com/mum4k/termdash/terminal/termbox"
     33 + "github.com/mum4k/termdash/terminal/terminalapi"
    34 34   "github.com/mum4k/termdash/widgets/barchart"
    35 35   "github.com/mum4k/termdash/widgets/button"
    36 36   "github.com/mum4k/termdash/widgets/donut"
    skipped 25 lines
    62 62   segmentTextSpark := []container.Option{
    63 63   container.SplitHorizontal(
    64 64   container.Top(
    65  - container.Border(draw.LineStyleLight),
     65 + container.Border(linestyle.Light),
    66 66   container.BorderTitle("Press Q to quit"),
    67 67   container.PlaceWidget(sd),
    68 68   ),
    69 69   container.Bottom(
    70 70   container.SplitVertical(
    71 71   container.Left(
    72  - container.Border(draw.LineStyleLight),
     72 + container.Border(linestyle.Light),
    73 73   container.BorderTitle("A rolling text"),
    74 74   container.PlaceWidget(rollT),
    75 75   ),
    76 76   container.Right(
    77  - container.Border(draw.LineStyleLight),
     77 + container.Border(linestyle.Light),
    78 78   container.BorderTitle("A SparkLine group"),
    79 79   container.SplitHorizontal(
    80 80   container.Top(container.PlaceWidget(spGreen)),
    skipped 18 lines
    99 99   gaugeAndHeartbeat := []container.Option{
    100 100   container.SplitHorizontal(
    101 101   container.Top(
    102  - container.Border(draw.LineStyleLight),
     102 + container.Border(linestyle.Light),
    103 103   container.BorderTitle("A Gauge"),
    104 104   container.BorderColor(cell.ColorNumber(39)),
    105 105   container.PlaceWidget(g),
    106 106   ),
    107 107   container.Bottom(
    108  - container.Border(draw.LineStyleLight),
     108 + container.Border(linestyle.Light),
    109 109   container.BorderTitle("A LineChart"),
    110 110   container.PlaceWidget(heartLC),
    111 111   ),
    skipped 26 lines
    138 138   lcAndButtons := []container.Option{
    139 139   container.SplitHorizontal(
    140 140   container.Top(
    141  - container.Border(draw.LineStyleLight),
     141 + container.Border(linestyle.Light),
    142 142   container.BorderTitle("Multiple series"),
    143 143   container.BorderTitleAlignRight(),
    144 144   container.PlaceWidget(sineLC),
    skipped 17 lines
    162 162   rightSide := []container.Option{
    163 163   container.SplitHorizontal(
    164 164   container.Top(
    165  - container.Border(draw.LineStyleLight),
     165 + container.Border(linestyle.Light),
    166 166   container.BorderTitle("BarChart"),
    167 167   container.PlaceWidget(bc),
    168 168   container.BorderTitleAlignRight(),
    skipped 1 lines
    170 170   container.Bottom(
    171 171   container.SplitHorizontal(
    172 172   container.Top(
    173  - container.Border(draw.LineStyleLight),
     173 + container.Border(linestyle.Light),
    174 174   container.BorderTitle("A Donut"),
    175 175   container.BorderTitleAlignRight(),
    176 176   container.PlaceWidget(don),
    skipped 363 lines
  • ■ ■ ■ ■
    internal/terminal/termbox/cell_options.go terminal/termbox/cell_options.go
    skipped 16 lines
    17 17  // cell_options.go converts termdash cell options to the termbox format.
    18 18   
    19 19  import (
    20  - "github.com/mum4k/termdash/internal/cell"
     20 + "github.com/mum4k/termdash/cell"
    21 21   tbx "github.com/nsf/termbox-go"
    22 22  )
    23 23   
    skipped 15 lines
  • ■ ■ ■ ■
    internal/terminal/termbox/cell_options_test.go terminal/termbox/cell_options_test.go
    skipped 16 lines
    17 17  import (
    18 18   "testing"
    19 19   
    20  - "github.com/mum4k/termdash/internal/cell"
     20 + "github.com/mum4k/termdash/cell"
    21 21   tbx "github.com/nsf/termbox-go"
    22 22  )
    23 23   
    skipped 28 lines
  • ■ ■ ■ ■
    internal/terminal/termbox/color_mode.go terminal/termbox/color_mode.go
    skipped 16 lines
    17 17  import (
    18 18   "fmt"
    19 19   
    20  - "github.com/mum4k/termdash/internal/terminalapi"
     20 + "github.com/mum4k/termdash/terminal/terminalapi"
    21 21   tbx "github.com/nsf/termbox-go"
    22 22  )
    23 23   
    skipped 16 lines
  • ■ ■ ■ ■ ■ ■
    internal/terminal/termbox/event.go terminal/termbox/event.go
    skipped 18 lines
    19 19  import (
    20 20   "image"
    21 21   
    22  - "github.com/mum4k/termdash/internal/keyboard"
    23  - "github.com/mum4k/termdash/internal/mouse"
    24  - "github.com/mum4k/termdash/internal/terminalapi"
     22 + "github.com/mum4k/termdash/keyboard"
     23 + "github.com/mum4k/termdash/mouse"
     24 + "github.com/mum4k/termdash/terminal/terminalapi"
    25 25   tbx "github.com/nsf/termbox-go"
    26 26  )
    27 27   
    skipped 213 lines
  • ■ ■ ■ ■ ■ ■
    internal/terminal/termbox/event_test.go terminal/termbox/event_test.go
    skipped 20 lines
    21 21   "testing"
    22 22   
    23 23   "github.com/kylelemons/godebug/pretty"
    24  - "github.com/mum4k/termdash/internal/keyboard"
    25  - "github.com/mum4k/termdash/internal/mouse"
    26  - "github.com/mum4k/termdash/internal/terminalapi"
     24 + "github.com/mum4k/termdash/keyboard"
     25 + "github.com/mum4k/termdash/mouse"
     26 + "github.com/mum4k/termdash/terminal/terminalapi"
    27 27   
    28 28   tbx "github.com/nsf/termbox-go"
    29 29  )
    skipped 290 lines
  • ■ ■ ■ ■ ■ ■
    internal/terminal/termbox/termbox.go terminal/termbox/termbox.go
    skipped 18 lines
    19 19   "context"
    20 20   "image"
    21 21   
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23   "github.com/mum4k/termdash/internal/event/eventqueue"
    24  - "github.com/mum4k/termdash/internal/terminalapi"
     24 + "github.com/mum4k/termdash/terminal/terminalapi"
    25 25   tbx "github.com/nsf/termbox-go"
    26 26  )
    27 27   
    skipped 138 lines
  • ■ ■ ■ ■
    internal/terminal/termbox/termbox_test.go terminal/termbox/termbox_test.go
    skipped 17 lines
    18 18   "testing"
    19 19   
    20 20   "github.com/kylelemons/godebug/pretty"
    21  - "github.com/mum4k/termdash/internal/terminalapi"
     21 + "github.com/mum4k/termdash/terminal/terminalapi"
    22 22  )
    23 23   
    24 24  func TestNewTerminal(t *testing.T) {
    skipped 37 lines
  • internal/terminalapi/color_mode.go terminal/terminalapi/color_mode.go
    Content is identical
  • ■ ■ ■ ■ ■ ■
    internal/terminalapi/event.go terminal/terminalapi/event.go
    skipped 18 lines
    19 19   "fmt"
    20 20   "image"
    21 21   
    22  - "github.com/mum4k/termdash/internal/keyboard"
    23  - "github.com/mum4k/termdash/internal/mouse"
     22 + "github.com/mum4k/termdash/keyboard"
     23 + "github.com/mum4k/termdash/mouse"
    24 24  )
    25 25   
    26 26  // event.go defines events that can be received through the terminal API.
    skipped 81 lines
  • ■ ■ ■ ■
    internal/terminalapi/terminalapi.go terminal/terminalapi/terminalapi.go
    skipped 18 lines
    19 19   "context"
    20 20   "image"
    21 21   
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23  )
    24 24   
    25 25  // Terminal abstracts an implementation of a 2-D terminal.
    skipped 28 lines
  • ■ ■ ■ ■ ■ ■
    widgets/barchart/barchart.go
    skipped 21 lines
    22 22   "image"
    23 23   "sync"
    24 24   
    25  - "github.com/mum4k/termdash/internal/align"
     25 + "github.com/mum4k/termdash/align"
     26 + "github.com/mum4k/termdash/cell"
    26 27   "github.com/mum4k/termdash/internal/area"
    27 28   "github.com/mum4k/termdash/internal/canvas"
    28  - "github.com/mum4k/termdash/internal/cell"
    29 29   "github.com/mum4k/termdash/internal/draw"
    30  - "github.com/mum4k/termdash/internal/terminalapi"
    31 30   "github.com/mum4k/termdash/internal/widgetapi"
     31 + "github.com/mum4k/termdash/terminal/terminalapi"
    32 32  )
    33 33   
    34 34  // BarChart displays multiple bars showing relative ratios of values.
    skipped 278 lines
  • ■ ■ ■ ■ ■ ■
    widgets/barchart/barchart_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25   "github.com/mum4k/termdash/internal/draw"
    26 26   "github.com/mum4k/termdash/internal/draw/testdraw"
    27  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     27 + "github.com/mum4k/termdash/internal/faketerm"
    28 28   "github.com/mum4k/termdash/internal/widgetapi"
    29 29  )
    30 30   
    skipped 713 lines
  • ■ ■ ■ ■ ■ ■
    widgets/barchart/barchartdemo/barchartdemo.go
    skipped 21 lines
    22 22   "time"
    23 23   
    24 24   "github.com/mum4k/termdash"
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/container"
    26  - "github.com/mum4k/termdash/internal/cell"
    27  - "github.com/mum4k/termdash/internal/draw"
    28  - "github.com/mum4k/termdash/internal/terminal/termbox"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/linestyle"
     28 + "github.com/mum4k/termdash/terminal/termbox"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30   "github.com/mum4k/termdash/widgets/barchart"
    31 31  )
    32 32   
    skipped 65 lines
    98 98   
    99 99   c, err := container.New(
    100 100   t,
    101  - container.Border(draw.LineStyleLight),
     101 + container.Border(linestyle.Light),
    102 102   container.BorderTitle("PRESS Q TO QUIT"),
    103 103   container.PlaceWidget(bc),
    104 104   )
    skipped 15 lines
  • ■ ■ ■ ■
    widgets/barchart/options.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23   "github.com/mum4k/termdash/internal/draw"
    24 24  )
    25 25   
    skipped 138 lines
  • ■ ■ ■ ■ ■ ■
    widgets/button/button.go
    skipped 21 lines
    22 22   "sync"
    23 23   "time"
    24 24   
    25  - "github.com/mum4k/termdash/internal/align"
     25 + "github.com/mum4k/termdash/align"
     26 + "github.com/mum4k/termdash/cell"
     27 + "github.com/mum4k/termdash/internal/button"
    26 28   "github.com/mum4k/termdash/internal/canvas"
    27  - "github.com/mum4k/termdash/internal/cell"
    28 29   "github.com/mum4k/termdash/internal/draw"
    29  - "github.com/mum4k/termdash/internal/mouse"
    30  - "github.com/mum4k/termdash/internal/mouse/button"
    31  - "github.com/mum4k/termdash/internal/terminalapi"
    32 30   "github.com/mum4k/termdash/internal/widgetapi"
     31 + "github.com/mum4k/termdash/mouse"
     32 + "github.com/mum4k/termdash/terminal/terminalapi"
    33 33  )
    34 34   
    35 35  // CallbackFn is the function called when the button is pressed.
    skipped 110 lines
    146 146   if err != nil {
    147 147   return err
    148 148   }
    149  - if err := draw.Text(cvs, b.text, start,
     149 + return draw.Text(cvs, b.text, start,
    150 150   draw.TextOverrunMode(draw.OverrunModeThreeDot),
    151 151   draw.TextMaxX(buttonAr.Max.X),
    152 152   draw.TextCellOpts(cell.FgColor(b.opts.textColor)),
    153  - ); err != nil {
    154  - return err
    155  - }
    156  - return nil
     153 + )
    157 154  }
    158 155   
    159 156  // Keyboard processes keyboard events, acts as a button press on the configured
    skipped 51 lines
  • ■ ■ ■ ■ ■ ■
    widgets/button/button_test.go
    skipped 21 lines
    22 22   "time"
    23 23   
    24 24   "github.com/kylelemons/godebug/pretty"
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/internal/canvas"
    26 27   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    27  - "github.com/mum4k/termdash/internal/cell"
    28 28   "github.com/mum4k/termdash/internal/draw"
    29 29   "github.com/mum4k/termdash/internal/draw/testdraw"
    30  - "github.com/mum4k/termdash/internal/keyboard"
    31  - "github.com/mum4k/termdash/internal/mouse"
    32  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    33  - "github.com/mum4k/termdash/internal/terminalapi"
     30 + "github.com/mum4k/termdash/internal/faketerm"
    34 31   "github.com/mum4k/termdash/internal/widgetapi"
     32 + "github.com/mum4k/termdash/keyboard"
     33 + "github.com/mum4k/termdash/mouse"
     34 + "github.com/mum4k/termdash/terminal/terminalapi"
    35 35  )
    36 36   
    37 37  // callbackTracker tracks whether callback was called.
    skipped 810 lines
  • ■ ■ ■ ■ ■ ■
    widgets/button/buttondemo/buttondemo.go
    skipped 20 lines
    21 21   "time"
    22 22   
    23 23   "github.com/mum4k/termdash"
     24 + "github.com/mum4k/termdash/align"
     25 + "github.com/mum4k/termdash/cell"
    24 26   "github.com/mum4k/termdash/container"
    25  - "github.com/mum4k/termdash/internal/align"
    26  - "github.com/mum4k/termdash/internal/cell"
    27  - "github.com/mum4k/termdash/internal/draw"
    28  - "github.com/mum4k/termdash/internal/terminal/termbox"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/linestyle"
     28 + "github.com/mum4k/termdash/terminal/termbox"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30   "github.com/mum4k/termdash/widgets/button"
    31 31   "github.com/mum4k/termdash/widgets/segmentdisplay"
    32 32  )
    skipped 46 lines
    79 79   
    80 80   c, err := container.New(
    81 81   t,
    82  - container.Border(draw.LineStyleLight),
     82 + container.Border(linestyle.Light),
    83 83   container.BorderTitle("PRESS Q TO QUIT"),
    84 84   container.SplitHorizontal(
    85 85   container.Top(
    skipped 32 lines
  • ■ ■ ■ ■ ■ ■
    widgets/button/options.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "time"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell"
    24  - "github.com/mum4k/termdash/internal/cell/runewidth"
    25  - "github.com/mum4k/termdash/internal/keyboard"
     23 + "github.com/mum4k/termdash/cell"
     24 + "github.com/mum4k/termdash/internal/runewidth"
    26 25   "github.com/mum4k/termdash/internal/widgetapi"
     26 + "github.com/mum4k/termdash/keyboard"
    27 27  )
    28 28   
    29 29  // Option is used to provide options.
    skipped 143 lines
  • ■ ■ ■ ■ ■ ■
    widgets/donut/donut.go
    skipped 21 lines
    22 22   "image"
    23 23   "sync"
    24 24   
    25  - "github.com/mum4k/termdash/internal/align"
     25 + "github.com/mum4k/termdash/align"
    26 26   "github.com/mum4k/termdash/internal/canvas"
    27 27   "github.com/mum4k/termdash/internal/canvas/braille"
    28  - "github.com/mum4k/termdash/internal/cell/runewidth"
    29 28   "github.com/mum4k/termdash/internal/draw"
    30 29   "github.com/mum4k/termdash/internal/numbers"
    31  - "github.com/mum4k/termdash/internal/terminalapi"
     30 + "github.com/mum4k/termdash/internal/runewidth"
    32 31   "github.com/mum4k/termdash/internal/widgetapi"
     32 + "github.com/mum4k/termdash/terminal/terminalapi"
    33 33  )
    34 34   
    35 35  // progressType indicates how was the current progress provided by the caller.
    skipped 219 lines
  • ■ ■ ■ ■ ■ ■
    widgets/donut/donut_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    24 25   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26 26   "github.com/mum4k/termdash/internal/draw"
    27 27   "github.com/mum4k/termdash/internal/draw/testdraw"
    28  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     28 + "github.com/mum4k/termdash/internal/faketerm"
    30 29   "github.com/mum4k/termdash/internal/widgetapi"
     30 + "github.com/mum4k/termdash/terminal/terminalapi"
    31 31  )
    32 32   
    33 33  func TestDonut(t *testing.T) {
    skipped 643 lines
  • ■ ■ ■ ■ ■ ■
    widgets/donut/donutdemo/donutdemo.go
    skipped 20 lines
    21 21   "time"
    22 22   
    23 23   "github.com/mum4k/termdash"
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/container"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/draw"
    27  - "github.com/mum4k/termdash/internal/terminal/termbox"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     26 + "github.com/mum4k/termdash/linestyle"
     27 + "github.com/mum4k/termdash/terminal/termbox"
     28 + "github.com/mum4k/termdash/terminal/terminalapi"
    29 29   "github.com/mum4k/termdash/widgets/donut"
    30 30  )
    31 31   
    skipped 80 lines
    112 112   
    113 113   c, err := container.New(
    114 114   t,
    115  - container.Border(draw.LineStyleLight),
     115 + container.Border(linestyle.Light),
    116 116   container.BorderTitle("PRESS Q TO QUIT"),
    117 117   container.SplitVertical(
    118 118   container.Left(
    skipped 28 lines
  • ■ ■ ■ ■
    widgets/donut/options.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23  )
    24 24   
    25 25  // Option is used to provide options.
    skipped 135 lines
  • ■ ■ ■ ■ ■ ■
    widgets/fakewidget/fakewidget.go
    skipped 23 lines
    24 24   "github.com/mum4k/termdash/internal/area"
    25 25   "github.com/mum4k/termdash/internal/canvas"
    26 26   "github.com/mum4k/termdash/internal/draw"
    27  - "github.com/mum4k/termdash/internal/keyboard"
    28  - "github.com/mum4k/termdash/internal/mouse"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
    30 27   "github.com/mum4k/termdash/internal/widgetapi"
     28 + "github.com/mum4k/termdash/keyboard"
     29 + "github.com/mum4k/termdash/mouse"
     30 + "github.com/mum4k/termdash/terminal/terminalapi"
    31 31  )
    32 32   
    33 33  // outputLines are the number of lines written by this plugin.
    skipped 173 lines
  • ■ ■ ■ ■ ■ ■
    widgets/fakewidget/fakewidget_test.go
    skipped 21 lines
    22 22   "github.com/mum4k/termdash/internal/canvas"
    23 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24 24   "github.com/mum4k/termdash/internal/draw/testdraw"
    25  - "github.com/mum4k/termdash/internal/keyboard"
    26  - "github.com/mum4k/termdash/internal/mouse"
    27  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    29 26   "github.com/mum4k/termdash/internal/widgetapi"
     27 + "github.com/mum4k/termdash/keyboard"
     28 + "github.com/mum4k/termdash/mouse"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30  )
    31 31   
    32 32  // keyEvents are keyboard events to send to the widget.
    skipped 329 lines
  • ■ ■ ■ ■ ■ ■
    widgets/gauge/gauge.go
    skipped 21 lines
    22 22   "image"
    23 23   "sync"
    24 24   
    25  - "github.com/mum4k/termdash/internal/align"
     25 + "github.com/mum4k/termdash/align"
     26 + "github.com/mum4k/termdash/cell"
    26 27   "github.com/mum4k/termdash/internal/area"
    27 28   "github.com/mum4k/termdash/internal/canvas"
    28  - "github.com/mum4k/termdash/internal/cell"
    29  - "github.com/mum4k/termdash/internal/cell/runewidth"
    30 29   "github.com/mum4k/termdash/internal/draw"
    31  - "github.com/mum4k/termdash/internal/terminalapi"
     30 + "github.com/mum4k/termdash/internal/runewidth"
    32 31   "github.com/mum4k/termdash/internal/widgetapi"
     32 + "github.com/mum4k/termdash/linestyle"
     33 + "github.com/mum4k/termdash/terminal/terminalapi"
    33 34  )
    34 35   
    35 36  // progressType indicates how was the current progress provided by the caller.
    skipped 109 lines
    145 146   
    146 147  // hasBorder determines of the gauge has a border.
    147 148  func (g *Gauge) hasBorder() bool {
    148  - return g.opts.border != draw.LineStyleNone
     149 + return g.opts.border != linestyle.None
    149 150  }
    150 151   
    151 152  // usable determines the usable area for the gauge itself.
    skipped 185 lines
  • ■ ■ ■ ■ ■ ■
    widgets/gauge/gauge_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
    22  - "github.com/mum4k/termdash/internal/align"
     22 + "github.com/mum4k/termdash/align"
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24 25   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26 26   "github.com/mum4k/termdash/internal/draw"
    27 27   "github.com/mum4k/termdash/internal/draw/testdraw"
    28  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     28 + "github.com/mum4k/termdash/internal/faketerm"
    29 29   "github.com/mum4k/termdash/internal/widgetapi"
     30 + "github.com/mum4k/termdash/linestyle"
    30 31  )
    31 32   
    32 33  // percentCall contains arguments for a call to GaugePercent().
    skipped 56 lines
    89 90   desc: "draws resize needed character when canvas is smaller than requested",
    90 91   opts: []Option{
    91 92   Char('o'),
    92  - Border(draw.LineStyleLight),
     93 + Border(linestyle.Light),
    93 94   },
    94 95   percent: &percentCall{p: 35},
    95 96   canvas: image.Rect(0, 0, 1, 1),
    skipped 30 lines
    126 127   Char('o'),
    127 128   HorizontalTextAlign(align.HorizontalLeft),
    128 129   VerticalTextAlign(align.VerticalTop),
    129  - Border(draw.LineStyleLight),
     130 + Border(linestyle.Light),
    130 131   },
    131 132   percent: &percentCall{p: 0},
    132 133   canvas: image.Rect(0, 0, 10, 4),
    skipped 31 lines
    164 165   Char('o'),
    165 166   HorizontalTextAlign(align.HorizontalRight),
    166 167   VerticalTextAlign(align.VerticalBottom),
    167  - Border(draw.LineStyleLight),
     168 + Border(linestyle.Light),
    168 169   },
    169 170   percent: &percentCall{p: 0},
    170 171   canvas: image.Rect(0, 0, 10, 4),
    skipped 11 lines
    182 183   desc: "gauge showing percentage with border",
    183 184   opts: []Option{
    184 185   Char('o'),
    185  - Border(draw.LineStyleLight),
     186 + Border(linestyle.Light),
    186 187   BorderTitle("title"),
    187 188   },
    188 189   percent: &percentCall{p: 35},
    skipped 18 lines
    207 208   desc: "respects border options",
    208 209   opts: []Option{
    209 210   Char('o'),
    210  - Border(draw.LineStyleLight, cell.FgColor(cell.ColorBlue)),
     211 + Border(linestyle.Light, cell.FgColor(cell.ColorBlue)),
    211 212   BorderTitle("title"),
    212 213   BorderTitleAlign(align.HorizontalRight),
    213 214   },
    skipped 59 lines
    273 274   desc: "gauge showing 100 percent with border",
    274 275   opts: []Option{
    275 276   Char('o'),
    276  - Border(draw.LineStyleLight),
     277 + Border(linestyle.Light),
    277 278   },
    278 279   percent: &percentCall{p: 100},
    279 280   canvas: image.Rect(0, 0, 10, 3),
    skipped 342 lines
    622 623   opts: []Option{
    623 624   Char('o'),
    624 625   TextLabel("long label"),
    625  - Border(draw.LineStyleLight),
     626 + Border(linestyle.Light),
    626 627   },
    627 628   percent: &percentCall{p: 0},
    628 629   canvas: image.Rect(0, 0, 10, 3),
    skipped 37 lines
    666 667   opts: []Option{
    667 668   Char('o'),
    668 669   TextLabel("long label"),
    669  - Border(draw.LineStyleLight),
     670 + Border(linestyle.Light),
    670 671   },
    671 672   percent: &percentCall{p: 100},
    672 673   canvas: image.Rect(0, 0, 10, 3),
    skipped 44 lines
    717 718   opts: []Option{
    718 719   Char('o'),
    719 720   TextLabel("long label"),
    720  - Border(draw.LineStyleLight),
     721 + Border(linestyle.Light),
    721 722   },
    722 723   percent: &percentCall{p: 50},
    723 724   canvas: image.Rect(0, 0, 10, 4),
    skipped 108 lines
    832 833   {
    833 834   desc: "border is accounted for in maximum and minimum size",
    834 835   opts: []Option{
    835  - Border(draw.LineStyleLight),
     836 + Border(linestyle.Light),
    836 837   Height(2),
    837 838   },
    838 839   want: widgetapi.Options{
    skipped 24 lines
  • ■ ■ ■ ■ ■ ■
    widgets/gauge/gaugedemo/gaugedemo.go
    skipped 20 lines
    21 21   "time"
    22 22   
    23 23   "github.com/mum4k/termdash"
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/container"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/draw"
    27  - "github.com/mum4k/termdash/internal/terminal/termbox"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     26 + "github.com/mum4k/termdash/linestyle"
     27 + "github.com/mum4k/termdash/terminal/termbox"
     28 + "github.com/mum4k/termdash/terminal/terminalapi"
    29 29   "github.com/mum4k/termdash/widgets/gauge"
    30 30  )
    31 31   
    skipped 56 lines
    88 88   ctx, cancel := context.WithCancel(context.Background())
    89 89   slim, err := gauge.New(
    90 90   gauge.Height(1),
    91  - gauge.Border(draw.LineStyleLight),
     91 + gauge.Border(linestyle.Light),
    92 92   gauge.BorderTitle("Percentage progress"),
    93 93   )
    94 94   if err != nil {
    skipped 4 lines
    99 99   absolute, err := gauge.New(
    100 100   gauge.Height(1),
    101 101   gauge.Color(cell.ColorBlue),
    102  - gauge.Border(draw.LineStyleLight),
     102 + gauge.Border(linestyle.Light),
    103 103   gauge.BorderTitle("Absolute progress"),
    104 104   )
    105 105   if err != nil {
    skipped 3 lines
    109 109   
    110 110   noProgress, err := gauge.New(
    111 111   gauge.Height(1),
    112  - gauge.Border(draw.LineStyleLight, cell.FgColor(cell.ColorMagenta)),
     112 + gauge.Border(linestyle.Light, cell.FgColor(cell.ColorMagenta)),
    113 113   gauge.BorderTitle("Without progress text"),
    114 114   gauge.HideTextProgress(),
    115 115   )
    skipped 18 lines
    134 134   t,
    135 135   container.SplitVertical(
    136 136   container.Left(
    137  - container.Border(draw.LineStyleLight),
     137 + container.Border(linestyle.Light),
    138 138   container.BorderTitle("PRESS Q TO QUIT"),
    139 139   container.SplitHorizontal(
    140 140   container.Top(
    skipped 39 lines
  • ■ ■ ■ ■ ■ ■
    widgets/gauge/options.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   
    22  - "github.com/mum4k/termdash/internal/align"
    23  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/align"
     23 + "github.com/mum4k/termdash/cell"
    24 24   "github.com/mum4k/termdash/internal/draw"
     25 + "github.com/mum4k/termdash/linestyle"
    25 26  )
    26 27   
    27 28  // Option is used to provide options.
    skipped 14 lines
    42 43   filledTextColor cell.Color
    43 44   emptyTextColor cell.Color
    44 45   // If set, draws a border around the gauge.
    45  - border draw.LineStyle
     46 + border linestyle.LineStyle
    46 47   borderCellOpts []cell.Option
    47 48   borderTitle string
    48 49   borderTitleHAlign align.Horizontal
    skipped 130 lines
    179 180  }
    180 181   
    181 182  // Border configures the gauge to have a border of the specified style.
    182  -func Border(ls draw.LineStyle, cOpts ...cell.Option) Option {
     183 +func Border(ls linestyle.LineStyle, cOpts ...cell.Option) Option {
    183 184   return option(func(opts *options) {
    184 185   opts.border = ls
    185 186   opts.borderCellOpts = cOpts
    skipped 18 lines
  • ■ ■ ■ ■
    widgets/linechart/internal/axes/label.go
    skipped 19 lines
    20 20   "fmt"
    21 21   "image"
    22 22   
    23  - "github.com/mum4k/termdash/internal/align"
     23 + "github.com/mum4k/termdash/align"
    24 24  )
    25 25   
    26 26  // LabelOrientation represents the orientation of text labels.
    skipped 240 lines
  • ■ ■ ■ ■ ■ ■
    widgets/linechart/internal/zoom/zoom.go
    skipped 19 lines
    20 20   "image"
    21 21   "reflect"
    22 22   
    23  - "github.com/mum4k/termdash/internal/mouse"
    24  - "github.com/mum4k/termdash/internal/mouse/button"
     23 + "github.com/mum4k/termdash/internal/button"
    25 24   "github.com/mum4k/termdash/internal/numbers"
    26  - "github.com/mum4k/termdash/internal/terminalapi"
     25 + "github.com/mum4k/termdash/mouse"
     26 + "github.com/mum4k/termdash/terminal/terminalapi"
    27 27   "github.com/mum4k/termdash/widgets/linechart/internal/axes"
    28 28  )
    29 29   
    skipped 537 lines
  • ■ ■ ■ ■ ■ ■
    widgets/linechart/internal/zoom/zoom_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
    22  - "github.com/mum4k/termdash/internal/mouse"
    23  - "github.com/mum4k/termdash/internal/terminalapi"
     22 + "github.com/mum4k/termdash/mouse"
     23 + "github.com/mum4k/termdash/terminal/terminalapi"
    24 24   "github.com/mum4k/termdash/widgets/linechart/internal/axes"
    25 25  )
    26 26   
    skipped 2003 lines
  • ■ ■ ■ ■ ■ ■
    widgets/linechart/linechart.go
    skipped 21 lines
    22 22   "sort"
    23 23   "sync"
    24 24   
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/internal/area"
    26 27   "github.com/mum4k/termdash/internal/canvas"
    27 28   "github.com/mum4k/termdash/internal/canvas/braille"
    28  - "github.com/mum4k/termdash/internal/cell"
    29 29   "github.com/mum4k/termdash/internal/draw"
    30 30   "github.com/mum4k/termdash/internal/numbers"
    31  - "github.com/mum4k/termdash/internal/terminalapi"
    32 31   "github.com/mum4k/termdash/internal/widgetapi"
     32 + "github.com/mum4k/termdash/terminal/terminalapi"
    33 33   "github.com/mum4k/termdash/widgets/linechart/internal/axes"
    34 34   "github.com/mum4k/termdash/widgets/linechart/internal/zoom"
    35 35  )
    skipped 478 lines
  • ■ ■ ■ ■ ■ ■
    widgets/linechart/linechart_test.go
    skipped 19 lines
    20 20   "testing"
    21 21   
    22 22   "github.com/kylelemons/godebug/pretty"
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24 25   "github.com/mum4k/termdash/internal/canvas/braille/testbraille"
    25 26   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    26  - "github.com/mum4k/termdash/internal/cell"
    27 27   "github.com/mum4k/termdash/internal/draw"
    28 28   "github.com/mum4k/termdash/internal/draw/testdraw"
    29  - "github.com/mum4k/termdash/internal/mouse"
    30  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    31  - "github.com/mum4k/termdash/internal/terminalapi"
     29 + "github.com/mum4k/termdash/internal/faketerm"
    32 30   "github.com/mum4k/termdash/internal/widgetapi"
     31 + "github.com/mum4k/termdash/mouse"
     32 + "github.com/mum4k/termdash/terminal/terminalapi"
    33 33  )
    34 34   
    35 35  func TestLineChartDraws(t *testing.T) {
    skipped 1611 lines
  • ■ ■ ■ ■ ■ ■
    widgets/linechart/linechartdemo/linechartdemo.go
    skipped 21 lines
    22 22   "time"
    23 23   
    24 24   "github.com/mum4k/termdash"
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/container"
    26  - "github.com/mum4k/termdash/internal/cell"
    27  - "github.com/mum4k/termdash/internal/draw"
    28  - "github.com/mum4k/termdash/internal/terminal/termbox"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/linestyle"
     28 + "github.com/mum4k/termdash/terminal/termbox"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30   "github.com/mum4k/termdash/widgets/linechart"
    31 31  )
    32 32   
    skipped 60 lines
    93 93   go playLineChart(ctx, lc, redrawInterval/3)
    94 94   c, err := container.New(
    95 95   t,
    96  - container.Border(draw.LineStyleLight),
     96 + container.Border(linestyle.Light),
    97 97   container.BorderTitle("PRESS Q TO QUIT"),
    98 98   container.PlaceWidget(lc),
    99 99   )
    skipped 15 lines
  • ■ ■ ■ ■
    widgets/linechart/options.go
    skipped 17 lines
    18 18   "fmt"
    19 19   "math"
    20 20   
    21  - "github.com/mum4k/termdash/internal/cell"
     21 + "github.com/mum4k/termdash/cell"
    22 22   "github.com/mum4k/termdash/widgets/linechart/internal/axes"
    23 23   "github.com/mum4k/termdash/widgets/linechart/internal/zoom"
    24 24  )
    skipped 173 lines
  • ■ ■ ■ ■
    widgets/segmentdisplay/options.go
    skipped 16 lines
    17 17  import (
    18 18   "fmt"
    19 19   
    20  - "github.com/mum4k/termdash/internal/align"
     20 + "github.com/mum4k/termdash/align"
    21 21  )
    22 22   
    23 23  // options.go contains configurable options for SegmentDisplay.
    skipped 90 lines
  • ■ ■ ■ ■
    widgets/segmentdisplay/segment_area.go
    skipped 20 lines
    21 21   "fmt"
    22 22   "image"
    23 23   
    24  - "github.com/mum4k/termdash/internal/draw/segdisp/sixteen"
     24 + "github.com/mum4k/termdash/internal/segdisp/sixteen"
    25 25  )
    26 26   
    27 27  // segArea contains information about the area that will contain the segments.
    skipped 89 lines
  • ■ ■ ■ ■ ■ ■
    widgets/segmentdisplay/segmentdisplay.go
    skipped 22 lines
    23 23   "image"
    24 24   "sync"
    25 25   
    26  - "github.com/mum4k/termdash/internal/align"
     26 + "github.com/mum4k/termdash/align"
    27 27   "github.com/mum4k/termdash/internal/attrrange"
    28 28   "github.com/mum4k/termdash/internal/canvas"
    29  - "github.com/mum4k/termdash/internal/draw/segdisp/sixteen"
    30  - "github.com/mum4k/termdash/internal/terminalapi"
     29 + "github.com/mum4k/termdash/internal/segdisp/sixteen"
    31 30   "github.com/mum4k/termdash/internal/widgetapi"
     31 + "github.com/mum4k/termdash/terminal/terminalapi"
    32 32  )
    33 33   
    34 34  // SegmentDisplay displays ASCII content by simulating a segment display.
    skipped 231 lines
  • ■ ■ ■ ■ ■ ■
    widgets/segmentdisplay/segmentdisplay_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
    22  - "github.com/mum4k/termdash/internal/align"
     22 + "github.com/mum4k/termdash/align"
     23 + "github.com/mum4k/termdash/cell"
    23 24   "github.com/mum4k/termdash/internal/canvas"
    24 25   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/draw/segdisp/sixteen"
    27  - "github.com/mum4k/termdash/internal/draw/segdisp/sixteen/testsixteen"
    28  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     26 + "github.com/mum4k/termdash/internal/faketerm"
     27 + "github.com/mum4k/termdash/internal/segdisp/sixteen"
     28 + "github.com/mum4k/termdash/internal/segdisp/sixteen/testsixteen"
    30 29   "github.com/mum4k/termdash/internal/widgetapi"
     30 + "github.com/mum4k/termdash/terminal/terminalapi"
    31 31  )
    32 32   
    33 33  // mustDrawChar draws the provided character in the area of the canvas or panics.
    skipped 799 lines
  • ■ ■ ■ ■ ■ ■
    widgets/segmentdisplay/segmentdisplaydemo/segmentdisplaydemo.go
    skipped 20 lines
    21 21   "time"
    22 22   
    23 23   "github.com/mum4k/termdash"
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/container"
    25  - "github.com/mum4k/termdash/internal/cell"
    26  - "github.com/mum4k/termdash/internal/draw"
    27  - "github.com/mum4k/termdash/internal/terminal/termbox"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
     26 + "github.com/mum4k/termdash/linestyle"
     27 + "github.com/mum4k/termdash/terminal/termbox"
     28 + "github.com/mum4k/termdash/terminal/terminalapi"
    29 29   "github.com/mum4k/termdash/widgets/segmentdisplay"
    30 30  )
    31 31   
    skipped 102 lines
    134 134   
    135 135   c, err := container.New(
    136 136   t,
    137  - container.Border(draw.LineStyleLight),
     137 + container.Border(linestyle.Light),
    138 138   container.BorderTitle("PRESS Q TO QUIT"),
    139 139   container.SplitHorizontal(
    140 140   container.Top(
    skipped 23 lines
  • ■ ■ ■ ■
    widgets/segmentdisplay/write_options.go
    skipped 15 lines
    16 16   
    17 17  // write_options.go contains options used when writing content to the widget.
    18 18   
    19  -import "github.com/mum4k/termdash/internal/cell"
     19 +import "github.com/mum4k/termdash/cell"
    20 20   
    21 21  // WriteOption is used to provide options to Write().
    22 22  type WriteOption interface {
    skipped 52 lines
  • ■ ■ ■ ■
    widgets/sparkline/options.go
    skipped 18 lines
    19 19  import (
    20 20   "fmt"
    21 21   
    22  - "github.com/mum4k/termdash/internal/cell"
     22 + "github.com/mum4k/termdash/cell"
    23 23  )
    24 24   
    25 25  // Option is used to provide options.
    skipped 64 lines
  • ■ ■ ■ ■ ■ ■
    widgets/sparkline/sparkline.go
    skipped 20 lines
    21 21   "image"
    22 22   "sync"
    23 23   
     24 + "github.com/mum4k/termdash/cell"
    24 25   "github.com/mum4k/termdash/internal/area"
    25 26   "github.com/mum4k/termdash/internal/canvas"
    26  - "github.com/mum4k/termdash/internal/cell"
    27 27   "github.com/mum4k/termdash/internal/draw"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
    29 28   "github.com/mum4k/termdash/internal/widgetapi"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30  )
    31 31   
    32 32  // SparkLine draws a graph showing a series of values as vertical bars.
    skipped 205 lines
  • ■ ■ ■ ■ ■ ■
    widgets/sparkline/sparkline_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25   "github.com/mum4k/termdash/internal/draw"
    26 26   "github.com/mum4k/termdash/internal/draw/testdraw"
    27  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     27 + "github.com/mum4k/termdash/internal/faketerm"
    28 28   "github.com/mum4k/termdash/internal/widgetapi"
    29 29  )
    30 30   
    skipped 498 lines
  • ■ ■ ■ ■ ■ ■
    widgets/sparkline/sparklinedemo/sparklinedemo.go
    skipped 21 lines
    22 22   "time"
    23 23   
    24 24   "github.com/mum4k/termdash"
     25 + "github.com/mum4k/termdash/cell"
    25 26   "github.com/mum4k/termdash/container"
    26  - "github.com/mum4k/termdash/internal/cell"
    27  - "github.com/mum4k/termdash/internal/draw"
    28  - "github.com/mum4k/termdash/internal/terminal/termbox"
    29  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/linestyle"
     28 + "github.com/mum4k/termdash/terminal/termbox"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30   "github.com/mum4k/termdash/widgets/sparkline"
    31 31  )
    32 32   
    skipped 53 lines
    86 86   
    87 87   c, err := container.New(
    88 88   t,
    89  - container.Border(draw.LineStyleLight),
     89 + container.Border(linestyle.Light),
    90 90   container.BorderTitle("PRESS Q TO QUIT"),
    91 91   container.SplitVertical(
    92 92   container.Left(
    93 93   container.SplitHorizontal(
    94 94   container.Top(),
    95 95   container.Bottom(
    96  - container.Border(draw.LineStyleLight),
     96 + container.Border(linestyle.Light),
    97 97   container.BorderTitle("SparkLine group"),
    98 98   container.SplitHorizontal(
    99 99   container.Top(
    skipped 7 lines
    107 107   ),
    108 108   ),
    109 109   container.Right(
    110  - container.Border(draw.LineStyleLight),
     110 + container.Border(linestyle.Light),
    111 111   container.PlaceWidget(yellow),
    112 112   ),
    113 113   ),
    skipped 16 lines
  • ■ ■ ■ ■
    widgets/sparkline/sparks.go
    skipped 19 lines
    20 20  import (
    21 21   "fmt"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell/runewidth"
    24 23   "github.com/mum4k/termdash/internal/numbers"
     24 + "github.com/mum4k/termdash/internal/runewidth"
    25 25  )
    26 26   
    27 27  // sparks are the characters used to draw the SparkLine.
    skipped 74 lines
  • ■ ■ ■ ■
    widgets/text/line_scanner.go
    skipped 19 lines
    20 20   "strings"
    21 21   "text/scanner"
    22 22   
    23  - "github.com/mum4k/termdash/internal/cell/runewidth"
     23 + "github.com/mum4k/termdash/internal/runewidth"
    24 24  )
    25 25   
    26 26  // wrapNeeded returns true if wrapping is needed for the rune at the horizontal
    skipped 118 lines
  • ■ ■ ■ ■
    widgets/text/line_trim.go
    skipped 18 lines
    19 19   "image"
    20 20   
    21 21   "github.com/mum4k/termdash/internal/canvas"
    22  - "github.com/mum4k/termdash/internal/cell/runewidth"
     22 + "github.com/mum4k/termdash/internal/runewidth"
    23 23  )
    24 24   
    25 25  // line_trim.go contains code that trims lines that are too long.
    skipped 92 lines
  • ■ ■ ■ ■
    widgets/text/line_trim_test.go
    skipped 21 lines
    22 22   "github.com/mum4k/termdash/internal/canvas"
    23 23   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24 24   "github.com/mum4k/termdash/internal/draw/testdraw"
    25  - "github.com/mum4k/termdash/internal/terminal/faketerm"
     25 + "github.com/mum4k/termdash/internal/faketerm"
    26 26  )
    27 27   
    28 28  func TestLineTrim(t *testing.T) {
    skipped 255 lines
  • ■ ■ ■ ■ ■ ■
    widgets/text/options.go
    skipped 16 lines
    17 17  import (
    18 18   "fmt"
    19 19   
    20  - "github.com/mum4k/termdash/internal/keyboard"
    21  - "github.com/mum4k/termdash/internal/mouse"
     20 + "github.com/mum4k/termdash/keyboard"
     21 + "github.com/mum4k/termdash/mouse"
    22 22  )
    23 23   
    24 24  // options.go contains configurable options for Text.
    skipped 123 lines
  • ■ ■ ■ ■
    widgets/text/text.go
    skipped 24 lines
    25 25   
    26 26   "github.com/mum4k/termdash/internal/attrrange"
    27 27   "github.com/mum4k/termdash/internal/canvas"
    28  - "github.com/mum4k/termdash/internal/terminalapi"
    29 28   "github.com/mum4k/termdash/internal/widgetapi"
     29 + "github.com/mum4k/termdash/terminal/terminalapi"
    30 30  )
    31 31   
    32 32  // Text displays a block of text.
    skipped 310 lines
  • ■ ■ ■ ■ ■ ■
    widgets/text/text_test.go
    skipped 18 lines
    19 19   "testing"
    20 20   
    21 21   "github.com/kylelemons/godebug/pretty"
     22 + "github.com/mum4k/termdash/cell"
    22 23   "github.com/mum4k/termdash/internal/canvas"
    23 24   "github.com/mum4k/termdash/internal/canvas/testcanvas"
    24  - "github.com/mum4k/termdash/internal/cell"
    25 25   "github.com/mum4k/termdash/internal/draw"
    26 26   "github.com/mum4k/termdash/internal/draw/testdraw"
    27  - "github.com/mum4k/termdash/internal/keyboard"
    28  - "github.com/mum4k/termdash/internal/mouse"
    29  - "github.com/mum4k/termdash/internal/terminal/faketerm"
    30  - "github.com/mum4k/termdash/internal/terminalapi"
     27 + "github.com/mum4k/termdash/internal/faketerm"
    31 28   "github.com/mum4k/termdash/internal/widgetapi"
     29 + "github.com/mum4k/termdash/keyboard"
     30 + "github.com/mum4k/termdash/mouse"
     31 + "github.com/mum4k/termdash/terminal/terminalapi"
    32 32  )
    33 33   
    34 34  func TestTextDraws(t *testing.T) {
    skipped 784 lines
  • ■ ■ ■ ■ ■ ■
    widgets/text/textdemo/textdemo.go
    skipped 22 lines
    23 23   "time"
    24 24   
    25 25   "github.com/mum4k/termdash"
     26 + "github.com/mum4k/termdash/cell"
    26 27   "github.com/mum4k/termdash/container"
    27  - "github.com/mum4k/termdash/internal/cell"
    28  - "github.com/mum4k/termdash/internal/draw"
    29  - "github.com/mum4k/termdash/internal/terminal/termbox"
    30  - "github.com/mum4k/termdash/internal/terminalapi"
     28 + "github.com/mum4k/termdash/linestyle"
     29 + "github.com/mum4k/termdash/terminal/termbox"
     30 + "github.com/mum4k/termdash/terminal/terminalapi"
    31 31   "github.com/mum4k/termdash/widgets/text"
    32 32  )
    33 33   
    skipped 89 lines
    123 123   
    124 124   c, err := container.New(
    125 125   t,
    126  - container.Border(draw.LineStyleLight),
     126 + container.Border(linestyle.Light),
    127 127   container.BorderTitle("PRESS Q TO QUIT"),
    128 128   container.SplitVertical(
    129 129   container.Left(
    skipped 6 lines
    136 136   container.PlaceWidget(borderless),
    137 137   ),
    138 138   container.Right(
    139  - container.Border(draw.LineStyleLight),
     139 + container.Border(linestyle.Light),
    140 140   container.BorderTitle("你好,世界!"),
    141 141   container.PlaceWidget(unicode),
    142 142   ),
    143 143   ),
    144 144   ),
    145 145   container.Bottom(
    146  - container.Border(draw.LineStyleLight),
     146 + container.Border(linestyle.Light),
    147 147   container.BorderTitle("Trims lines"),
    148 148   container.PlaceWidget(trimmed),
    149 149   ),
    150 150   ),
    151 151   ),
    152 152   container.Bottom(
    153  - container.Border(draw.LineStyleLight),
     153 + container.Border(linestyle.Light),
    154 154   container.BorderTitle("Wraps lines at rune boundaries"),
    155 155   container.PlaceWidget(wrapped),
    156 156   ),
    157 157   ),
    158 158   ),
    159 159   container.Right(
    160  - container.Border(draw.LineStyleLight),
     160 + container.Border(linestyle.Light),
    161 161   container.BorderTitle("Rolls and scrolls content"),
    162 162   container.PlaceWidget(rolled),
    163 163   ),
    skipped 17 lines
  • ■ ■ ■ ■
    widgets/text/write_options.go
    skipped 16 lines
    17 17  // write_options.go contains options used when writing content to the Text widget.
    18 18   
    19 19  import (
    20  - "github.com/mum4k/termdash/internal/cell"
     20 + "github.com/mum4k/termdash/cell"
    21 21  )
    22 22   
    23 23  // WriteOption is used to provide options to Write().
    skipped 45 lines
Please wait...
Page is in error, reload to recover