aboutsummaryrefslogtreecommitdiff
path: root/vendor/maunium.net/go/tview/primitive.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-01-11 23:28:47 +0200
committerTulir Asokan <tulir@maunium.net>2019-01-11 23:28:47 +0200
commit331597b9f8a7942cbcb233a328301e4d5bf94fb0 (patch)
tree5ec624585ebf66c63549a098acb6f7421f1193a7 /vendor/maunium.net/go/tview/primitive.go
parent2fc3378b717f40f37f3a188b68407887242d9c06 (diff)
Switch to Go modules and make other changes
Diffstat (limited to 'vendor/maunium.net/go/tview/primitive.go')
-rw-r--r--vendor/maunium.net/go/tview/primitive.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/maunium.net/go/tview/primitive.go b/vendor/maunium.net/go/tview/primitive.go
deleted file mode 100644
index f5034c4..0000000
--- a/vendor/maunium.net/go/tview/primitive.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package tview
-
-import "maunium.net/go/tcell"
-
-// Primitive is the top-most interface for all graphical primitives.
-type Primitive interface {
- // Draw draws this primitive onto the screen. Implementers can call the
- // screen's ShowCursor() function but should only do so when they have focus.
- // (They will need to keep track of this themselves.)
- Draw(screen tcell.Screen)
-
- // GetRect returns the current position of the primitive, x, y, width, and
- // height.
- GetRect() (int, int, int, int)
-
- // SetRect sets a new position of the primitive.
- SetRect(x, y, width, height int)
-
- // InputHandler returns a handler which receives key events when it has focus.
- // It is called by the Application class.
- //
- // A value of nil may also be returned, in which case this primitive cannot
- // receive focus and will not process any key events.
- //
- // The handler will receive the key event and a function that allows it to
- // set the focus to a different primitive, so that future key events are sent
- // to that primitive.
- //
- // The Application's Draw() function will be called automatically after the
- // handler returns.
- //
- // The Box class provides functionality to intercept keyboard input. If you
- // subclass from Box, it is recommended that you wrap your handler using
- // Box.WrapInputHandler() so you inherit that functionality.
- InputHandler() func(event *tcell.EventKey, setFocus func(p Primitive))
-
- MouseHandler() func(event *tcell.EventMouse, setFocus func(p Primitive))
-
- PasteHandler() func(event *tcell.EventPaste)
-
- // Focus is called by the application when the primitive receives focus.
- // Implementers may call delegate() to pass the focus on to another primitive.
- Focus(delegate func(p Primitive))
-
- // Blur is called by the application when the primitive loses focus.
- Blur()
-
- // GetFocusable returns the item's Focusable.
- GetFocusable() Focusable
-}