eheditor

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewerTheme paint.Theme
	WindowTheme paint.Theme

	ActiveButtonTheme  paint.Theme
	DefaultButtonTheme paint.Theme

	SidebarFrameTheme  paint.Theme
	SidebarHeaderTheme paint.Theme
	SidebarButtonTheme paint.Theme
	SidebarActiveTheme paint.Theme
)
View Source
var ButtonActiveTheme paint.ThemeName = "toggle-button-active"

Functions

func SortedKeys added in v0.5.0

func SortedKeys[V interface{}](data map[string]V) (keys []string)

func StringInSlices added in v0.5.0

func StringInSlices(src string, dst ...[]string) bool

Types

type CEheditor

type CEheditor struct {
	App ctk.Application

	HostFile     *editor.Hostfile
	SourceFile   string
	LastError    error
	ReadOnlyMode bool

	ContentsHBox ctk.HBox
	ActionHBox   ctk.HButtonBox
	Display      cdk.Display
	Window       ctk.Window
	EditorButton ctk.Button
	ViewerButton ctk.Button
	SaveButton   ctk.Button
	ReloadButton ctk.Button
	QuitButton   ctk.Button

	HostsViewport ctk.ScrolledViewport
	HostsVBox     ctk.VBox

	EditingHBox ctk.HBox

	ByDomainsButton ctk.Button
	ByAddressButton ctk.Button
	ByEntryButton   ctk.Button

	SidebarFrame        ctk.Frame
	SidebarEntryList    ctk.VBox
	SidebarLocalsList   ctk.VBox
	SidebarCustomList   ctk.VBox
	SidebarCommentsList ctk.VBox

	SidebarAddEntryButton      ctk.Button
	SidebarMoveEntryUpButton   ctk.Button
	SidebarMoveEntryDownButton ctk.Button

	CommentsEntry  ctk.Entry
	HostEditVBox   ctk.VBox
	AddressEntry   ctk.Entry
	AddressButton  ctk.Button
	DomainsEntry   ctk.Entry
	ActivateButton ctk.Button
	DeleteButton   ctk.Button

	HostSelectedFrame    ctk.Frame
	NothingSelectedFrame ctk.Frame
	CommentSelectedFrame ctk.Frame

	SidebarMode  SidebarListMode
	SelectedHost *editor.Host

	EditorCommentList   []*editor.Host
	EditorAddressLookup map[string]*editor.Host
	EditorDomainsLookup map[string]*editor.Host

	ViewerDomainLookup map[string]*editor.Host

	sync.RWMutex
}

func NewEheditor

func NewEheditor(name string, usage string, description string, version string, tag string, title string, ttyPath string) (e *CEheditor)

func (*CEheditor) Run

func (e *CEheditor) Run(argv []string) (err error)

type SidebarListMode added in v0.5.0

type SidebarListMode uint8
const (
	ListByDomain SidebarListMode = iota
	ListByAddress
	ListByEntry
)

type ViewerRow

type ViewerRow struct {
	Host   *editor.Host
	Active bool

	Size *ptypes.Rectangle

	Frame     ctk.Frame
	FrameVBox ctk.VBox
	Comment   ctk.Entry
	FrameHBox ctk.HBox
	InfoVBox  ctk.VBox
	Actual    ctk.Button
	Address   ctk.Entry
	Domains   ctk.Entry

	Controls *ViewerRowControls

	Eheditor *CEheditor
}

func NewViewerRow

func NewViewerRow(eheditor *CEheditor, host *editor.Host, viewerWidth int) (row *ViewerRow)

func (*ViewerRow) IsCommentRow

func (row *ViewerRow) IsCommentRow() bool

func (*ViewerRow) Resize

func (row *ViewerRow) Resize()

func (*ViewerRow) Update

func (row *ViewerRow) Update(host *editor.Host, viewerWidth int)

type ViewerRowControls

type ViewerRowControls struct {
	Row      *ViewerRow
	HBox     ctk.HBox
	Toggle   ctk.Button
	MoveUp   ctk.Button
	MoveDn   ctk.Button
	AddEntry ctk.Button
	DelEntry ctk.Button

	Eheditor *CEheditor
}

func (*ViewerRowControls) Update

func (ctrls *ViewerRowControls) Update(row *ViewerRow)

func (*ViewerRowControls) UpdateToggle

func (ctrls *ViewerRowControls) UpdateToggle()

Jump to

Keyboard shortcuts

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