hexdumper2

package
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package hexdumper2 provides a widget which displays selectable hexdump-like output. Because it's built for termshark, it also allows styling to be applied to ranges of data intended to correspond to packet structure selected in another termshark view.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CanvasSlice

type CanvasSlice struct {
	C       *gowid.Canvas
	XOffset int
	YOffset int
}

func NewCanvasSlice

func NewCanvasSlice(c *gowid.Canvas, xoff, yoff int) CanvasSlice

func (CanvasSlice) BoxColumns

func (c CanvasSlice) BoxColumns() int

func (CanvasSlice) BoxRows

func (c CanvasSlice) BoxRows() int

func (CanvasSlice) CellAt

func (c CanvasSlice) CellAt(col, row int) gowid.Cell

func (CanvasSlice) ImplementsWidgetDimension

func (c CanvasSlice) ImplementsWidgetDimension()

func (CanvasSlice) SetCellAt

func (c CanvasSlice) SetCellAt(col, row int, cell gowid.Cell)

func (CanvasSlice) Write

func (c CanvasSlice) Write(p []byte) (n int, err error)

type LayerStyler

type LayerStyler struct {
	Start         int
	End           int
	ColUnselected string
	ColSelected   string
}

type Options

type Options struct {
	StyledLayers      []LayerStyler
	CursorUnselected  string
	CursorSelected    string
	LineNumUnselected string
	LineNumSelected   string
	PaletteIfCopying  string
	DownKeys          []vim.KeyPress
	UpKeys            []vim.KeyPress
	LeftKeys          []vim.KeyPress
	RightKeys         []vim.KeyPress
}

type PositionChangedCB

type PositionChangedCB struct{}

type Widget

type Widget struct {
	gowid.AddressProvidesID
	styled.UsePaletteIfSelectedForCopy
	Callbacks *gowid.Callbacks
	gowid.IsSelectable
	// contains filtered or unexported fields
}

func New

func New(data []byte, opts ...Options) *Widget

func (*Widget) Clips

func (w *Widget) Clips(app gowid.IApp) []gowid.ICopyResult

func (*Widget) CopyModeLevels

func (w *Widget) CopyModeLevels() int

func (*Widget) CursorSelected

func (w *Widget) CursorSelected() string

func (*Widget) CursorUnselected

func (w *Widget) CursorUnselected() string

func (*Widget) Data

func (w *Widget) Data() []byte

func (*Widget) Down added in v2.1.0

func (t *Widget) Down(lines int, size gowid.IRenderSize, app gowid.IApp)

Can leave the cursor out of sight

func (*Widget) DownPage added in v2.1.0

func (t *Widget) DownPage(num int, size gowid.IRenderSize, app gowid.IApp)

func (*Widget) GoHome added in v2.1.0

func (t *Widget) GoHome(size gowid.IRenderSize, app gowid.IApp)

Adjusts cursor pos too

func (*Widget) GoToEnd added in v2.1.0

func (t *Widget) GoToEnd(size gowid.IRenderSize, app gowid.IApp)

func (*Widget) Layers

func (w *Widget) Layers() []LayerStyler

func (*Widget) LineNumSelected

func (w *Widget) LineNumSelected() string

func (*Widget) LineNumUnselected

func (w *Widget) LineNumUnselected() string

func (*Widget) OnPositionChanged

func (w *Widget) OnPositionChanged(f gowid.IWidgetChangedCallback)

func (*Widget) Position

func (w *Widget) Position() int

func (*Widget) RemoveOnPositionChanged

func (w *Widget) RemoveOnPositionChanged(f gowid.IIdentity)

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

1<-4><3><----------(8 * 3)-1---<2<-------(8 * 3)-1-----><3><---8-->1<---8-->

0660   72 6f 72 73 2e 57 69 74  68 53 74 61 63 6b 28 67   rors.Wit hStack(g
0670   6f 77 69 64 2e 57 69 74  68 4b 56 73 28 4f 70 65   owid.Wit hKVs(Ope
0680   6e 45 72 72 6f 72 2c 20  6d 61 70 5b 73 74 72 69   nError,  map[stri
0690   6e 67 5d 69 6e 74 65 72  66 61 63 65 7b 7d 7b 0a   ng]inter face{}{.
06a0   09 09 09 09 22 64 65 73  63 72 69 70 74 6f 72 22   ...."des criptor"
06b0   3a 20 6e 65 77 73 74 64  69 6e 2c 0a 09 09 09 09   : newstd in,.....

func (*Widget) RenderSize

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) ScrollLength added in v2.1.0

func (t *Widget) ScrollLength() int

Implement withscrollbar.IScrollValues

func (*Widget) ScrollPosition added in v2.1.0

func (t *Widget) ScrollPosition() int

Implement withscrollbar.IScrollValues

func (*Widget) SetData

func (w *Widget) SetData(data []byte, app gowid.IApp)

func (*Widget) SetLayers

func (w *Widget) SetLayers(layers []LayerStyler, app gowid.IApp)

func (*Widget) SetPos added in v2.1.0

func (t *Widget) SetPos(pos list.IBoundedWalkerPosition, app gowid.IApp)

Implements withscrollbar.iSetPosition. Note that position is a row.

func (*Widget) SetPosition

func (w *Widget) SetPosition(pos int, app gowid.IApp)

func (*Widget) String

func (w *Widget) String() string

func (*Widget) Up added in v2.1.0

func (t *Widget) Up(lines int, size gowid.IRenderSize, app gowid.IApp)

Can leave the cursor out of sight

func (*Widget) UpPage added in v2.1.0

func (t *Widget) UpPage(num int, size gowid.IRenderSize, app gowid.IApp)

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL