Slide 1

Slide 1 text

(PͰ࡞Δ ΠϯλϥΫςΟϒ ͳ$-*ίϚϯυͱ ͦͷσβΠϯ @lighttiger2505

Slide 2

Slide 2 text

ΠϯλϥΫςΟϒJTԿʁ

Slide 3

Slide 3 text

ΠϯλϥΫςΟϒJT • ࣮ߦ࣌ͷଈ࠲ʹऴྃ͠ͳ͍ • ϢʔβͷೖྗΛ଴ͭ • ϢʔβͷೖྗʹԠͨ͡ग़ྗΛฦ͢

Slide 4

Slide 4 text

௨ৗͷ$-*ίϚϯυ ೖྗ ॲཧ ग़ྗ

Slide 5

Slide 5 text

ΠϯλϥΫςΟϒͳ $-*ίϚϯυ Πϕϯτϧʔϓ։࢝ ೖྗ଴ػ ೖྗ ॲཧ ग़ྗ Πϕϯτϧʔϓऴྃ

Slide 6

Slide 6 text

UJH

Slide 7

Slide 7 text

5FSNCPYϥΠϒϥϦ ঺հ

Slide 8

Slide 8 text

5FSNCPYϥΠϒϥϦ • ΠϯλϥΫςΟϒͳCLIίϚϯυ࡞੒ʹඪ४ϥΠϒϥϦͰ ͸଍Γͳ͍ • termbox-go ⾨ຊ೔͸ओʹ͜Εͷ࿩ • https://github.com/nsf/termbox-go • tcell • https://github.com/gdamore/tcell

Slide 9

Slide 9 text

UFSNCPYHPͷ(P%PD

Slide 10

Slide 10 text

ΠϕϯττϥοΩϯά • ॳظԽ(ϢʔβͷΠϕϯτΛड෇͢Δνϟωϧ࡞ͬͯɺ ϧʔϓͰड͚औΓ) • func Init() error • ΠϕϯττϥοΩϯά(ΠϕϯτνϟωϧʹΠϕϯτ͕౉ ͞ΕΔ·Ͱ·ͭ) • func PollEvent() Event

Slide 11

Slide 11 text

syscall goroutine channel Init()

Slide 12

Slide 12 text

syscall goroutine channel PollEvent() ΦϨΦϨ ίʔυ Init()

Slide 13

Slide 13 text

syscall goroutine channel PollEvent() ΦϨΦϨ ίʔυ Πϕϯτ͸௖͍͍͖ͯ·͢Ͷ Init()

Slide 14

Slide 14 text

ඳը • όοΫόοϑΝʹඳը͢ΔจࣈྻΛඳը͍ͯ͘͠ • func SetCell(x, y int, ch rune, fg, bg Attribute) • όοΫόοϑΝΛεΫϦʔϯʹ൓ө • func Flush() error

Slide 15

Slide 15 text

termbox.SetCell(10, 5, 'a', termbox.ColorRed, termbox.ColorDefault) aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa ࢝఺͸(0, 0)

Slide 16

Slide 16 text

termbox.SetCell(3, 1, 'a', termbox.ColorRed, ...) termbox.SetCell(6, 3, 'b', termbox.ColorBlue, ...) termbox.SetCell(9, 5, 'c', termbox.ColorGreen, ...) όοΫόοϑΝ aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaabaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa aaaaaabaaaa aaaaaaaaaaa aaaaaaaaaca aaaaaaaaaaa

Slide 17

Slide 17 text

Flush() όοΫόοϑΝ εΫϦʔϯ aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaabaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaacaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaabaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaacaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa

Slide 18

Slide 18 text

೺Ѳͨ͠ ؆୯͡Όͳ͍͔

Slide 19

Slide 19 text

ΠϯλϥΫςΟϒͳ΍ͭ ࡞ͬͯΈ·ͨ͠

Slide 20

Slide 20 text

TUG

Slide 21

Slide 21 text

lͲ͏΍ͬͯ։ൃΛ͖͔ͯͨ͠#” ͭΒΈΛ βϥοͱ͝঺հ

Slide 22

Slide 22 text

ΠϕϯτϧʔϓʹΑΔ ঢ়ଶભҠ

Slide 23

Slide 23 text

ঢ়ଶΛ࣋ͭ • ϢʔβͷೖྗΛԿճ΋ड͚औΔ • ॲཧ͢ΔͨͼʹΞϓϦέʔγϣϯͷঢ়ଶ͸มԽ͢Δ

Slide 24

Slide 24 text

ී௨ͷίϚϯυͳΒ ೖྗ ॲཧ ग़ྗ

Slide 25

Slide 25 text

ΠϯλϥΫςΟϒͳίϚϯυͩͱ ೖྗ ঢ়ଶ͝ͱʹॲཧ෼ذ ग़ྗ ॲཧ ঢ়ଶͷߋ৽

Slide 26

Slide 26 text

จࣈඳըΛ ͜Ͷ͘Γճͯ͠6*࡞Ζ͏

Slide 27

Slide 27 text

͜ͷ"1*͚ͩͰ6*࡞ΕΔͩΖ͏͔ aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa termbox.SetCell(10, 5, ‘a’, white, red)

Slide 28

Slide 28 text

จࣈྻඳը func tbPrint(x, y int, fg, bg termbox.Attribute, msg string) { for _, c := range msg { termbox.SetCell(x, y, c, fg, bg) x++ } }

Slide 29

Slide 29 text

1 # Contributing to Go⊠ 2 ⊠ 3 Go is an open source project.⊠ 4 ⊠ 5 It is the work of hundreds of contributors...⊠ 6 ⊠ 7 ## Before filing an issue⊠ 8 ⊠ 9 If you are unsure whether you have found...⊠ 10 https://groups.google.com/forum/#!forum/...⊠ 11 the behavior you are seeing is confirmed...⊠ 12 ⊠ 13 ## Filing issues⊠ 14 ⊠ 15 Sensitive security-related issues should...⊠ 16 See the [security policy](https://golang...⊠ 17 ⊠ 18 The recommended way to file an issue is ...⊠ 19 Otherwise, when filing an issue, make...⊠ 20 ⊠ ίϯςϯπͷߴ͞ (20) ΧʔιϧҐஔ(17) ඳըҐஔ(3) ඳըྖҬͷߴ͞ (14) εΫϩʔϧ

Slide 30

Slide 30 text

1 # Contributing to Go⊠ 2 ⊠ 3 Go is an open source project.⊠ 4 ⊠ 5 It is the work of hundreds of contributors...⊠ 6 ⊠ 7 ## Before filing an issue⊠ 8 ⊠ 9 If you are unsure whether you have found...⊠ 10 https://groups.google.com/forum/#!forum/...⊠ 11 the behavior you are seeing is confirmed...⊠ 12 ⊠ 13 ## Filing issues⊠ 14 ⊠ 15 Sensitive security-related issues should...⊠ 16 See the [security policy](https://golang...⊠ 17 ⊠ 18 The recommended way to file an issue is ...⊠ 19 Otherwise, when filing an issue, make...⊠ 20 ⊠ ΧʔιϧҐஔ(19) ίϯςϯπͷߴ͞ (20) ඳըྖҬͷߴ͞ (14) ඳըҐஔ(3)

Slide 31

Slide 31 text

1 # Contributing to Go⊠ 2 ⊠ 3 Go is an open source project.⊠ 4 ⊠ 5 It is the work of hundreds of contributors...⊠ 6 ⊠ 7 ## Before filing an issue⊠ 8 ⊠ 9 If you are unsure whether you have found...⊠ 10 https://groups.google.com/forum/#!forum/...⊠ 11 the behavior you are seeing is confirmed...⊠ 12 ⊠ 13 ## Filing issues⊠ 14 ⊠ 15 Sensitive security-related issues should...⊠ 16 See the [security policy](https://golang...⊠ 17 ⊠ 18 The recommended way to file an issue is ...⊠ 19 Otherwise, when filing an issue, make...⊠ 20 ⊠ ΧʔιϧҐஔ(19) ඳըҐஔ(4) ίϯςϯπͷߴ͞ (20) ඳըྖҬͷߴ͞ (14)

Slide 32

Slide 32 text

ϩδοΫ func (l *Layer) DownCursor(val int, contentNum int) int { l.cursorPos.Y += val if l.cursorPos.Y > (contentNum - 1) { l.cursorPos.Y = contentNum - 1 } if l.cursorPos.Y > (l.drawPos.Y + l.win.Box.Height - 1) { l.drawPos.Y = l.cursorPos.Y - l.win.Box.Height + 1 } return l.cursorPos.Y }

Slide 33

Slide 33 text

lΊΜͲ͘͘͞ͳ͍ͩΖ͏͔” ҆͝৺͍ͩ͘͞

Slide 34

Slide 34 text

5FSNCPYϥούʔ

Slide 35

Slide 35 text

5FSNCPYΛϥοϓͨ͠ ίϯϙʔωϯτΛఏڙ • termbox-go֦ு • gocui • https://github.com/jroimartin/gocui • tcell֦ு • tui-go • https://github.com/marcusolsson/tui-go

Slide 36

Slide 36 text

HPDVJ

Slide 37

Slide 37 text

UVJHP

Slide 38

Slide 38 text

ΠϯλϥΫςΟϒͳ ίϚϯυͷσβΠϯ

Slide 39

Slide 39 text

ͳͥΠϯλϥΫςΟϒʹ͢Δ • ෳ਺ͷίϚϯυΛγʔϜϨεʹͭͳ͍͛ͨ

Slide 40

Slide 40 text

HJUͷEJ⒎͕ݟ͍ͨ

Slide 41

Slide 41 text

l$-*Λ࢖͍ͬͯΔҎ্ಀΕΒΕͳ͍ӡ໋” Ұཡදࣔͱબ୒

Slide 42

Slide 42 text

͚ͲΠϯλϥΫςΟϒͳΒ

Slide 43

Slide 43 text

ҰํͰۤ࿑͢Δͱ͜Ζ΋͋Δ • ߏ଄ͷγϯϓϧ͕͞ັྗͰCLIίϚϯυ࡞ͬͯΔ

Slide 44

Slide 44 text

ೖྗ ঢ়ଶ͝ͱʹॲཧ෼ذ ग़ྗ ॲཧ ঢ়ଶͷߋ৽

Slide 45

Slide 45 text

ҰํͰۤ࿑͢Δͱ͜Ζ΋͋Δ • ߏ଄ͷγϯϓϧ͕͞ັྗͰCLIίϚϯυ࡞ͬͯΔ • ΠϯλϥΫγϣϯͷ࢓ํ࣍ୈͰ͸ෳࡶʹͳΔͷͰ͸ʁ

Slide 46

Slide 46 text

ҰํͰۤ࿑͢Δͱ͜Ζ΋͋Δ • ߏ଄ͷγϯϓϧ͕͞ັྗͰCLIίϚϯυ࡞ͬͯΔ • ΠϯλϥΫγϣϯͷ࢓ํ࣍ୈͰ͸ෳࡶʹͳΔͷͰ͸ʁ • ͳΜ͔ͩΜͩඳըܥ΋ࣗ෼Ͱॻ͍ͨ΄͏͕֦ுੑߴ͍

Slide 47

Slide 47 text

1 # Contributing to Go⊠ 2 ⊠ 3 Go is an open source project.⊠ 4 ⊠ 5 It is the work of hundreds of contributors...⊠ 6 ⊠ 7 ## Before filing an issue⊠ 8 ⊠ 9 If you are unsure whether you have found...⊠ 10 https://groups.google.com/forum/#!forum/...⊠ 11 the behavior you are seeing is confirmed...⊠ 12 ⊠ 13 ## Filing issues⊠ 14 ⊠ 15 Sensitive security-related issues should...⊠ 16 See the [security policy](https://golang...⊠ 17 ⊠ 18 The recommended way to file an issue is ...⊠ 19 Otherwise, when filing an issue, make...⊠ 20 ⊠ ΧʔιϧҐஔ(19) ඳըҐஔ(4) ίϯςϯπͷߴ͞ (20) ඳըྖҬͷߴ͞ (14)

Slide 48

Slide 48 text

ҰํͰۤ࿑͢Δͱ͜Ζ΋͋Δ • ߏ଄ͷγϯϓϧ͕͞ັྗͰCLIίϚϯυ࡞ͬͯΔ • ΠϯλϥΫγϣϯͷ࢓ํ࣍ୈͰ͸ෳࡶʹͳΔͷͰ͸ʁ • ͳΜ͔ͩΜͩඳըܥ΋ࣗ෼Ͱॻ͍ͨ΄͏͕֦ுੑߴ͍ • UI࣮૷ΰϦΰϦ͍ͨ͠ʁ

Slide 49

Slide 49 text

Ͱ΋ɺ΍ΔΜͩΑ • CLI͔ΒऔಘͰ͖ΔΠϯϓοτ͸๲େ • CLI͔ΒGUIʹ৘ใΛ౉ͨ͢Ίʹ͸ίϐϖ • ৘ใͷྲྀΕΛ෼அ͠ͳ͍͜ͱͦ͜؊ཁ

Slide 50

Slide 50 text

͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠

Slide 51

Slide 51 text

ࣗݾ঺հ • େڮฏ࿨ (Toshikazu.Ohashi) • @lighttiger2505 • iRidge, Inc. • ΤϯδχΞืूத!! • αʔόαΠυΤϯδχΞ • Vim Go Vim Vim Go Go Vim ...Python