Documentation ¶
Index ¶
- Constants
- func Allergic(debug bool, err error)
- func Allergic3(debug bool, err error, silent bool)
- func Dedup(v []string) []string
- func FloatToFixed(x float64) fixed.Int26_6
- func Fmtevent2(eventChan chan string, origin EventOrigin, istag, isbltin, hasextra bool, ...)
- func Fmtevent2extra(eventChan chan string, origin EventOrigin, istag bool, s, e int, ...)
- func Fmtevent3(eventChan chan string, origin EventOrigin, istag bool, p, s, e int, arg string, ...)
- func FmteventBase(eventChan chan string, origin EventOrigin, istag bool, etype EventType, ...)
- func KeyEvent(e key.Event) string
- func MeasureString(face font.Face, in string) int
- func MixColorHack(rs []rune, cs []uint8) []byte
- func Must(err error, msg string)
- func MustNewFont(dpi, size, lineSpacing float64, fullHinting, autoligatures bool, ...) font.Face
- func MustNewFontFromBytes(dpi, size, lineSpacing float64, fullHinting, autoligatures bool, ...) font.Face
- func NewFont(dpi, size, lineSpacing float64, fullHinting, autoligatures bool, ...) (font.Face, error)
- func NewFontFromBytes(dpi, size, lineSpacing float64, fullHinting, autoligatures bool, ...) (font.Face, error)
- func P9Copy(dst *clnt.File, src io.Reader) (written int64, err error)
- func QuotedSplit(s string) []string
- func ReadProps(p9clnt *clnt.Clnt) (map[string]string, error)
- func ResolvePath(rel2dir, path string) string
- func SetTag(p9clnt *clnt.Clnt, outbufid string, tagstr string) error
- func ShortPath(ap string, canRelative bool) string
- func SingleQuote(s string) string
- func UnmixColorHack(data []byte) (text []rune, color []uint8)
- func YaccoConnect() (*clnt.Clnt, error)
- type AltingEntry
- type BufferConn
- func FindWin(name string, p9clnt *clnt.Clnt) (*BufferConn, bool, error)
- func FindWinEx(name string, p9clnt *clnt.Clnt) (*BufferConn, bool, error)
- func MakeBufferConn(p9clnt *clnt.Clnt, id string, ctlfd, eventfd *clnt.File) (*BufferConn, error)
- func OpenBufferConn(p9clnt *clnt.Clnt, id string) (*BufferConn, error)
- type EventFlag
- type EventOrRunnable
- type EventOrigin
- type EventReader
- func (er *EventReader) BuiltIn() bool
- func (er *EventReader) Done() bool
- func (er *EventReader) ExtraArg() (path string, s, e int, txt string)
- func (er *EventReader) Flags() EventFlag
- func (er *EventReader) Insert(msg string)
- func (er *EventReader) IsCompat() bool
- func (er *EventReader) MissingExtraArg() bool
- func (er *EventReader) Origin() EventOrigin
- func (er *EventReader) Points() (p, s, e int)
- func (er *EventReader) ReadFrom(in io.Reader) error
- func (er *EventReader) Reset()
- func (er *EventReader) SendBack(fh io.Writer) error
- func (er *EventReader) SetExtraArg(s string)
- func (er *EventReader) SetText(s string)
- func (er *EventReader) ShouldFetchText() bool
- func (er *EventReader) String() string
- func (er *EventReader) Text(addrRead io.ReadSeeker, addrWrite io.Writer, xdata io.ReadSeeker) (txt string, err error)
- func (er *EventReader) Type() EventType
- func (er *EventReader) Valid() (bool, string)
- type EventType
- type IndexEntry
- type LoadRule
- type MouseDownEvent
- type Multiface
- func (f *Multiface) Close() error
- func (f *Multiface) Glyph(dot fixed.Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ...)
- func (f *Multiface) GlyphAdvance(r rune) (advance fixed.Int26_6, ok bool)
- func (f *Multiface) GlyphBounds(r rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)
- func (f *Multiface) Kern(r0, r1 rune) fixed.Int26_6
- func (f *Multiface) Metrics() font.Metrics
- type SaveRule
- type Sel
- type WheelEvent
Constants ¶
const ( EO_BODYTAG = EventOrigin('E') EO_FILES = EventOrigin('F') EO_KBD = EventOrigin('K') EO_MOUSE = EventOrigin('M') )
const ( ET_BODYDEL = EventType('D') ET_TAGDEL = EventType('d') ET_BODYINS = EventType('I') ET_TAGINS = EventType('i') ET_BODYLOAD = EventType('L') ET_TAGLOAD = EventType('l') ET_BODYEXEC = EventType('X') ET_TAGEXEC = EventType('x') )
const ( EFX_BUILTIN = EventFlag(1) EFX_EXPANDED = EventFlag(2) EFX_EXTRAARG = EventFlag(8) EFL_EXPANDED = EventFlag(2) )
const MAX_EVENT_TEXT_LENGTH = 256
original p9 value is 256
const SHORT_NAME_LEN = 40
Variables ¶
This section is empty.
Functions ¶
func FloatToFixed ¶
func Fmtevent2 ¶
func Fmtevent2(eventChan chan string, origin EventOrigin, istag, isbltin, hasextra bool, p, s, e int, arg string, onfail func())
Writes an execute event to eventChan. s and e are the boundaries of the selection, p is the point of the click that was expanded (-1 if the user made the selection directly)
func Fmtevent2extra ¶
func Fmtevent2extra(eventChan chan string, origin EventOrigin, istag bool, s, e int, originPath, arg string, onfail func())
Writes messages to describe the extra argument for an execute message (ie you should call Fmtevent2 first with hasextra == true
func Fmtevent3 ¶
func Fmtevent3(eventChan chan string, origin EventOrigin, istag bool, p, s, e int, arg string, onfail func())
func FmteventBase ¶
func MeasureString ¶
Mesures the length of the string
func MixColorHack ¶
func MustNewFont ¶
func MustNewFontFromBytes ¶
func NewFont ¶
func NewFont(dpi, size, lineSpacing float64, fullHinting, autoligatures bool, fontPath string) (font.Face, error)
Reads a Font: fontPath is a ':' separated list of ttf or pcf font files (they will be used to search characters)
func NewFontFromBytes ¶
func QuotedSplit ¶
func ResolvePath ¶
func SingleQuote ¶
func UnmixColorHack ¶
func YaccoConnect ¶
Types ¶
type AltingEntry ¶
type BufferConn ¶
type BufferConn struct { Id string CtlFd *clnt.File EventFd *clnt.File BodyFd *clnt.File AddrFd *clnt.File XDataFd *clnt.File PropFd *clnt.File TagFd *clnt.File ColorFd *clnt.File // contains filtered or unexported fields }
func MakeBufferConn ¶
func OpenBufferConn ¶
func OpenBufferConn(p9clnt *clnt.Clnt, id string) (*BufferConn, error)
func (*BufferConn) Close ¶
func (buf *BufferConn) Close()
func (*BufferConn) GetTag ¶
func (buf *BufferConn) GetTag() (string, error)
func (*BufferConn) ReadAddr ¶
func (buf *BufferConn) ReadAddr() ([]int, error)
func (*BufferConn) ReadXData ¶
func (buf *BufferConn) ReadXData() ([]byte, error)
func (*BufferConn) SetTag ¶
func (buf *BufferConn) SetTag(newtag string) error
type EventOrRunnable ¶
type EventOrRunnable struct {
// contains filtered or unexported fields
}
func NewEvent ¶
func NewEvent(e interface{}) EventOrRunnable
func NewRunnable ¶
func NewRunnable(r func()) EventOrRunnable
func (*EventOrRunnable) EventOrRun ¶
func (e *EventOrRunnable) EventOrRun() interface{}
type EventOrigin ¶
type EventOrigin rune
type EventReader ¶
type EventReader struct {
// contains filtered or unexported fields
}
func (*EventReader) BuiltIn ¶
func (er *EventReader) BuiltIn() bool
If the event is an execute event and the command is a builtin command then true is returned otherwise false is returned
func (*EventReader) ExtraArg ¶
func (er *EventReader) ExtraArg() (path string, s, e int, txt string)
Returns the extra argument as: path of the buffer containing it, start and end points of the selection and text
func (*EventReader) Flags ¶
func (er *EventReader) Flags() EventFlag
func (*EventReader) Insert ¶
func (er *EventReader) Insert(msg string)
Adds an event message to the event reader
func (*EventReader) IsCompat ¶
func (er *EventReader) IsCompat() bool
func (*EventReader) MissingExtraArg ¶
func (er *EventReader) MissingExtraArg() bool
The extra argument (to an execute command) was too big to be included in the message
func (*EventReader) Points ¶
func (er *EventReader) Points() (p, s, e int)
Pre-expanded point (if applicable), start point and end point of the event
func (*EventReader) SendBack ¶
func (er *EventReader) SendBack(fh io.Writer) error
Writes the event back to a file
func (*EventReader) SetExtraArg ¶
func (er *EventReader) SetExtraArg(s string)
func (*EventReader) SetText ¶
func (er *EventReader) SetText(s string)
func (*EventReader) ShouldFetchText ¶
func (er *EventReader) ShouldFetchText() bool
The text was too big to be included in the message, we will need to fetch it using addr and data files
func (*EventReader) String ¶
func (er *EventReader) String() string
func (*EventReader) Text ¶
func (er *EventReader) Text(addrRead io.ReadSeeker, addrWrite io.Writer, xdata io.ReadSeeker) (txt string, err error)
Returns the text of the event, if the text was to long to be included in the message attempts to retrieve it using addr and data. If addr and data are nil an empty string is returned
func (*EventReader) Valid ¶
func (er *EventReader) Valid() (bool, string)
Returns true if the event is valid. If the event is invalid false is returned along with a description of why parsing failed
type IndexEntry ¶
type LoadRule ¶
type LoadRule struct { BufRe string // only apply to buffers matching this regular expression Re string // apply when this regular expression is matched Action string // action to execute }
LoadRule describes a rule executed when right clicking on text.
Concerning Action: - If the first character is 'X' the rest of the string will be interpreted as a command (possibly external) and executed - if the first character is 'L' the rest of the string *up to the first semicolon* will be interpreted as a file name to open, the text after the semicolon will be interpreted as an address expression (like those understood by Edit) and used to calculate the initial position of the cursor
In either case expressions like $1, $2 etc... inside Action string will be replaced with the corrisponding matching group of Re.
An 'L' type action will only succeed if the specified file exists, is a UTF8 file and is less than 10MB. If any of this conditions isn't met the rule will be considered failed and other rules will be evaluated.