Documentation
¶
Overview ¶
This file implements library embedding and extraction at runtime, a pattern also used in several other Go projects that need to distribute native binaries:
github.com/kluctl/go-embed-python: Embeds a full Python distribution in Go binaries, extracting to temporary directories at runtime. The approach used here was directly inspired by its embed_util implementation.
github.com/kluctl/go-jinja2: Uses the same pattern to embed Jinja2 and related Python libraries, allowing Go applications to use Jinja2 templates without external dependencies.
This approach has several advantages: - Allows distribution of a single, self-contained binary - Eliminates the need for users to set LD_LIBRARY_PATH or other environment variables - Works cross-platform with the same codebase - Preserves backward compatibility with existing methods - Extracts libraries only once per execution via sync.Once
The embedded library is extracted to a user-specific temporary directory and loaded dynamically. If extraction fails, the code falls back to the traditional method of searching system paths.
Index ¶
- Constants
- Variables
- func Load(path string) (pixels []uint8, width, height int32, err error)
- type Align
- type Canvas
- type CanvasCell
- type CanvasConfig
- type CanvasMode
- type Color
- type ColorExtractor
- type ColorPair
- type ColorSpace
- type ColorTable
- type ColorTableEntry
- type Dither
- type DitherMode
- type Features
- type Frame
- type GError
- type GString
- type Image
- type Optimizations
- type Palette
- type PaletteColor
- type PaletteType
- type ParseResult
- type Passthrough
- type Pixel
- type PixelMode
- type PixelType
- type Placement
- type SeqArgInfo
- type Symbol
- type Symbol2
- type SymbolMap
- type SymbolTags
- type TermDb
- type TermInfo
- type TermQuirks
- type TermSeq
- type Tuck
- type Vec3i32
Constants ¶
const CHAFA_COLOR_TABLE_MAX_ENTRIES = 256
const CHAFA_PALETTE_INDEX_MAX = 259
const CHAFA_TERM_SEQ_ARGS_MAX = 24
const CHAFA_TERM_SEQ_LENGTH_MAX = 96
Variables ¶
var ( // Creates a new canvas with the specified configuration. The canvas makes // a private copy of the configuration, so it will not be affected by subsequent changes. CanvasNew func(config *CanvasConfig) *Canvas // Creates a new canvas configured similarly to orig. CanvasNewSimilar func(orig *Canvas) *Canvas // Adds a reference to canvas. CanvasRef func(canvas *Canvas) // Removes a reference from canvas. When remaining references drops to zero, // the canvas is freed and can no longer be used. CanvasUnRef func(canvas *Canvas) // Returns a pointer to the configuration belonging to canvas. // This can be inspected using the [CanvasConfig] getter functions, but not changed. CanvasPeekConfig func(canvas *Canvas) *CanvasConfig // Places placement on canvas, replacing the latter's content. The placement will cover the entire canvas. // // The canvas will keep a reference to the placement until it is replaced or the canvas itself is freed. CanvasSetPlacement func(canvas *Canvas, placement *Placement) // Replaces pixel data of canvas with a copy of that found at src_pixels , // which must be in one of the formats supported by [PixelType]. CanvasDrawAllPixels func( canvas *Canvas, srcPixelType PixelType, srcPixels []uint8, srcWidth int32, srcHeight int32, srcRowstride int32, ) // Builds a UTF-8 string of terminal control sequences and symbols representing the canvas' current contents. // This can be printed to a terminal. The exact choice of escape sequences and symbols, dimensions, etc. // is determined by the configuration assigned to canvas on its creation. // // All output lines except for the last one will end in a newline. CanvasPrint func(canvas *Canvas, termInfo *TermInfo) *GString //Builds an array of UTF-8 strings made up of terminal control sequences and symbols // representing the canvas' current contents. These can be printed to a terminal. // The exact choice of escape sequences and symbols, dimensions, etc. is determined // by the configuration assigned to canvas on its creation. // // The array will be NULL-terminated. The element count does not include the terminator. // // When the canvas' pixel mode is [CHAFA_PIXEL_MODE_SYMBOLS], each element will hold // the contents of exactly one symbol row. There will be no row separators, // newlines or control sequences to reposition the cursor between rows. // Row positioning is left to the caller. // // In other pixel modes, there may be one or more strings, but the splitting // criteria should not be relied on. They must be printed in sequence, exactly as they appear. CanvasPrintRows func(canvas *Canvas, termInfo *TermInfo, arrayOut *unsafe.Pointer, lenOut *int32) // Builds an array of UTF-8 strings made up of terminal control sequences and symbols // representing the canvas' current contents. These can be printed to a terminal. // The exact choice of escape sequences and symbols, dimensions, etc. is determined by // the configuration assigned to canvas on its creation. // // When the canvas' pixel mode is [CHAFA_PIXEL_MODE_SYMBOLS], each element // will hold the contents of exactly one symbol row. There will be no row separators, // newlines or control sequences to reposition the cursor between rows. // Row positioning is left to the caller. // // In other pixel modes, there may be one or more strings, // but the splitting criteria should not be relied on. // They must be printed in sequence, exactly as they appear. CanvasPrintRowsStrv func(canvas *Canvas, termInfo *TermInfo) unsafe.Pointer // Returns the character at cell (x, y). The coordinates are zero-indexed. // For double-width characters, the leftmost cell will contain the character // and the rightmost cell will contain 0. CanvasGetCharAt func(canvas *Canvas, x, y int32) rune // Sets the character at cell (x, y). The coordinates are zero-indexed. // For double-width characters, the leftmost cell must contain the character // and the cell to the right of it will automatically be set to 0. // // If the character is a nonprintable or zero-width, no change will be made. CanvasSetCharAt func(canvas *Canvas, x, y int32, c rune) int32 // Gets the colors at cell (x, y). The coordinates are zero-indexed. // For double-width characters, both cells will contain the same colors. // // The colors will be -1 for transparency, packed 8bpc RGB otherwise, i.e. 0x00RRGGBB hex. // // If the canvas is in an indexed mode, palette lookups will be made for you. CanvasGetColorsAt func(canvas *Canvas, x, y int32, fgOut, bgOut *int32) // Sets the colors at cell (x, y). The coordinates are zero-indexed. // For double-width characters, both cells will be set to the same color. // // The colors must be -1 for transparency, packed 8bpc RGB otherwise, i.e. 0x00RRGGBB hex. // // If the canvas is in an indexed mode, palette lookups will be made for you. CanvasSetColorsAt func(canvas *Canvas, x, y, fg, bg int32) // Gets the colors at cell (x, y). The coordinates are zero-indexed. // For double-width characters, both cells will contain the same colors. // // The colors will be -1 for transparency, packed 8bpc RGB, i.e. 0x00RRGGBB hex // in truecolor mode, or the raw pen value (0-255) in indexed modes. // // It's the caller's responsibility to handle the color values correctly // according to the canvas mode (truecolor or indexed). CanvasGetRawColorsAt func(canvas *Canvas, x, y int32, fgOut, bgOut *int32) // Sets the colors at cell (x, y). The coordinates are zero-indexed. // For double-width characters, both cells will be set to the same color. // // The colors must be -1 for transparency, packed 8bpc RGB, i.e. 0x00RRGGBB hex // in truecolor mode, or the raw pen value (0-255) in indexed modes. // // It's the caller's responsibility to handle the color values correctly // according to the canvas mode (truecolor or indexed). CanvasSetRawColorsAt func(canvas *Canvas, x, y, fg, bg int32) )
var ( // Creates a new [CanvasConfig] with default settings. // This object can later be used in the creation of a [Canvas]. CanvasConfigNew func() *CanvasConfig // Creates a new [CanvasConfig] that's a copy of config. CanvasConfigCopy func(config *CanvasConfig) *CanvasConfig // Adds a reference to config. CanvasConfigRef func(config *CanvasConfig) // Removes a reference from config. CanvasConfigUnref func(config *CanvasConfig) // Returns config's width and height in character cells in the provided output locations. CanvasConfigGetGeometry func(config *CanvasConfig, widthOut, heightOut *int32) // Sets config's width and height in character cells to width x height. CanvasConfigSetGeometry func(config *CanvasConfig, width, height int32) // Returns config's cell width and height in pixels in the provided output locations. CanvasConfigGetCellGeometry func(config *CanvasConfig, cellWidthOut, cellHeightOut *int32) // Sets config's cell width and height in pixels to cellWidth x cellHeight. CanvasConfigSetCellGeometry func(config *CanvasConfig, cellWidth, cellHeight int32) // Returns config's [PixelMode]. CanvasConfigGetPixelMode func(config *CanvasConfig) PixelMode // Sets config's stored [PixelMode] to pixelMode. // This determines how pixel graphics are rendered in the output. CanvasConfigSetPixelMode func(config *CanvasConfig, pixelMode PixelMode) // Returns config's [CanvasMode]. This determines how colors (and color control codes) // are used in the output. CanvasConfigGetCanvasMode func(config *CanvasConfig) CanvasMode // Sets config's stored [CanvasMode] to mode. // This determines how colors (and color control codes) are used in the output. CanvasConfigSetCanvasMode func(config *CanvasConfig, mode CanvasMode) // Returns config's [ColorExtractor]. This determines how colors // are approximated in character symbol output. CanvasConfigGetColorExtractor func(config *CanvasConfig) ColorExtractor // Sets config's stored [ColorExtractor] to colorExtractor. // This determines how colors are approximated in character symbol output. CanvasConfigSetColorExtractor func(config *CanvasConfig, colorExtractor ColorExtractor) // Returns config's [ColorSpace]. CanvasConfigGetColorSpace func(config *CanvasConfig) ColorSpace // Sets config's stored [ColorSpace] to colorSpace. CanvasConfigSetColorSpace func(config *CanvasConfig, colorSpace ColorSpace) // Queries whether automatic image preprocessing is enabled. This allows Chafa // to boost contrast and saturation in an attempt to improve legibility. // The type of preprocessing applied (if any) depends on the canvas mode. CanvasConfigGetPreprocessingEnabled func(config *CanvasConfig) bool // Indicates whether automatic image preprocessing should be enabled. This // allows Chafa to boost contrast and saturation in an attempt to improve legibility. // The type of preprocessing applied (if any) depends on the canvas mode. CanvasConfigSetPreprocessingEnabled func(config *CanvasConfig, preprocessing_enabled bool) // Returns a pointer to the symbol map belonging to config. This can be // inspected using the [SymbolMap] getter functions, but not changed. CanvasConfigPeekSymbolMap func(config *CanvasConfig) *SymbolMap // Assigns a copy of symbolMap to config. CanvasConfigSetSymbolMap func(config *CanvasConfig, symbolMap *SymbolMap) // Returns a pointer to the fill symbol map belonging to config. This can // be inspected using the [SymbolMap] getter functions, but not changed. // // Fill symbols are assigned according to their overall foreground to // background coverage, disregarding shape. CanvasConfigPeekFillSymbolMap func(config *CanvasConfig) *SymbolMap // Returns the threshold above which full transparency will be used. CanvasConfigGetTransparencyThreshold func(config *CanvasConfig) float32 // Sets the threshold above which full transparency will be used. CanvasConfigSetTransparencyThreshold func(config *CanvasConfig, alphaThreshold float32) // Queries whether to use foreground colors only, leaving the background // unmodified in the canvas output. This is relevant only when the [PixelMode] // is set to [CHAFA_PIXEL_MODE_SYMBOLS]. // // When this is set, the canvas will emit escape codes to set the foreground color only. CanvasConfigGetFgOnlyEnabled func(config *CanvasConfig) bool // Indicates whether to use foreground colors only, leaving the background // unmodified in the canvas output. This is relevant only when the [PixelMode] // is set to [CHAFA_PIXEL_MODE_SYMBOLS]. // //When this is set, the canvas will emit escape codes to set the foreground color only. CanvasConfigSetFgOnlyEnabled func(config *CanvasConfig, fgOnlyEnabled bool) // Gets the assumed foreground color of the output device. This is used to // determine how to apply the foreground pen in FGBG modes. CanvasConfigGetFgColor func(config *CanvasConfig) uint32 // Sets the assumed foreground color of the output device. This is used to // determine how to apply the foreground pen in FGBG modes. CanvasConfigSetFgColor func(config *CanvasConfig, fgColorPackedRGB uint32) // Gets the assumed background color of the output device. This is used to // determine how to apply the background pen in FGBG modes. CanvasConfigGetBgColor func(config *CanvasConfig) uint32 // Sets the assumed background color of the output device. This is used to // determine how to apply the background and transparency pens in FGBG modes, // and will also be substituted for partial transparency. CanvasConfigSetBgColor func(config *CanvasConfig, bgColorPackedRGB uint32) // Gets the work/quality tradeoff factor. A higher value means more time // and memory will be spent towards a higher quality output. CanvasConfigGetWorkFactor func(config *CanvasConfig) float32 // Sets the work/quality tradeoff factor. A higher value means more time // and memory will be spent towards a higher quality output. CanvasConfigSetWorkFactor func(config *CanvasConfig, workFactor float32) // Returns config's [DitherMode]. CanvasConfigGetDitherMode func(config *CanvasConfig) DitherMode // Sets config's stored [DitherMode] to ditherMode. CanvasConfigSetDitherMode func(config *CanvasConfig, ditherMode DitherMode) // Returns config's dither grain size in widthOut and heightOut. CanvasConfigGetDitherGrainSize func(config *CanvasConfig, widthOut, heightOut *int32) // Sets config's stored dither grain size to width by height pixels. // These values can be 1, 2, 4 or 8. 8 corresponds to the size of an entire // character cell. The default is 4 pixels by 4 pixels. CanvasConfigSetDitherGrainSize func(config *CanvasConfig, width, height int32) // Returns the relative intensity of the dithering pattern applied during // image conversion. 1.0 is the default, corresponding to a moderate intensity. CanvasConfigGetDitherIntensity func(config *CanvasConfig) float32 // Sets config's stored relative intensity of the dithering pattern applied // during image conversion. 1.0 is the default, corresponding to a moderate // intensity. Possible values range from 0.0 to infinity, but in practice, // values above 10.0 are rarely useful. CanvasConfigSetDitherIntensity func(config *CanvasConfig, intensity float32) // Returns config's optimization flags. When enabled, these may produce // more compact output at the cost of reduced compatibility and increased // CPU use. Output quality is unaffected. CanvasConfigGetOptimizations func(config *CanvasConfig) Optimizations // Sets config's stored optimization flags. When enabled, these may produce // more compact output at the cost of reduced compatibility and increased // CPU use. Output quality is unaffected. CanvasConfigSetOptimizations func(config *CanvasConfig, optimizations Optimizations) // Returns config's [Passthrough] setting. This defaults to [CHAFA_PASSTHROUGH_NONE]. // // Passthrough is needed to transmit certain escape codes to the outer terminal // when running in an inner terminal environment like tmux. When enabled, // this will happen automatically as needed, dictated by information // contained in a [TermInfo]. CanvasConfigGetPassthrough func(config *CanvasConfig) Passthrough // Indicates which passthrough mode to use. This defaults to [CHAFA_PASSTHROUGH_NONE]. // // [Passthrough] is needed to transmit certain escape codes to the outer // terminal when running in an inner terminal environment like tmux. When // enabled, this will happen automatically as needed, dictated by information // contained in a [TermInfo]. CanvasConfigSetPassthrough func(config *CanvasConfig, passthrough Passthrough) )
var ( // Gets a list of the platform-specific features this library was built with. GetBuiltinFeatures func() Features // Gets a list of the platform-specific features that are built in and usable on the runtime platform. GetSupportedFeatures func() Features // Takes a set of flags potentially returned from [GetBuiltinFeatures] or // [GetSupportedFeatures] and generates a human-readable ASCII string descriptor. DescribeFeatures func(features Features) string // Queries the maximum number of worker threads to use for parallel processing. GetNThreads func() int32 // Sets the maximum number of worker threads to use for parallel processing, // or -1 to determine this automatically. The default is -1. // // Setting this to 0 or 1 will avoid using thread pools and instead perform // all processing in the main thread. SetNThreads func(n int32) // Queries the number of worker threads that will actually be used for // parallel processing. GetNActualThreads func() int32 )
var ( // Creates a new [Frame] containing a copy of the image data pointed to by data. FrameNew func(data []uint8, pixelType PixelType, width, height, rowstride int32) *Frame // Creates a new [Frame] embedding the data pointer. It's the caller's // responsibility to ensure the pointer remains valid for the lifetime of // the frame. The frame will not free the buffer when its reference count // drops to zero. // // THIS IS DANGEROUS API which should only be used when the life cycle of // the frame is short, stealing the buffer is impossible, and copying would // cause unacceptable performance degradation. // // Use [FrameNew] instead. FrameNewBorrow func(data []uint8, pixelType PixelType, width, height, rowstride int32) *Frame // Creates a new [Frame], which takes ownership of the data buffer. The // buffer will be freed with g_free() when the frame's reference count drops // to zero. FrameNewSteal func(data []uint8, pixelType PixelType, width, height, rowstride int32) *Frame // Adds a reference to frame. FrameRef func(frame *Frame) // Removes a reference from frame. When the reference count drops to zero, // the frame is freed and can no longer be used. FrameUnref func(frame *Frame) )
var ( // Creates a new [Image]. The image is initially transparent // and dimensionless. ImageNew func() *Image // Adds a reference to image. ImageRef func(image *Image) // Removes a reference from image. When the reference count drops to zero, // the image is freed and can no longer be used. ImageUnref func(image *Image) // Assigns frame as the content for image. The image will keep its own // reference to the frame. ImageSetFrame func(image *Image, frame *Frame) )
var ( // Creates a new [Placement] for the specified image and ID. // If id <= 0, an ID is assigned automatically. PlacementNew func(image *Image, id int32) *Placement // Adds a reference to placement. PlacementRef func(placement *Placement) // Removes a reference from placement. When remaining references drops to zero, // the placement is freed and can no longer be used. PlacementUnref func(placement *Placement) // Gets the tucking policy of placement. This describes how the image is // resized to fit placement's extents, and defaults to [CHAFA_TUCK_STRETCH]. PlacementGetTuck func(placement *Placement) Tuck // Sets the tucking policy for placement to tuck . This describes how the // image is resized to fit placement 's extents, and defaults to [CHAFA_TUCK_STRETCH]. PlacementSetTuck func(placement *Placement, tuck Tuck) // Gets the horizontal alignment of placement. This determines how any // padding added by the tucking policy is distributed, and defaults to [CHAFA_ALIGN_START]. PlacementGetHAlign func(placement *Placement) Align // Sets the horizontal alignment of placement. This determines how any // padding added by the tucking policy is distributed, and defaults to [CHAFA_ALIGN_START]. PlacementSetHAlign func(placement *Placement, align Align) // Gets the vertical alignment of placement. This determines how any padding // added by the tucking policy is distributed, and defaults to [CHAFA_ALIGN_START]. PlacementGetVAlign func(placement *Placement) Align // Sets the vertical alignment of placement . This determines how any // padding added by the tucking policy is distributed. PlacementSetVAlign func(placement *Placement, align Align) )
var ( // Creates a new [SymbolMap] representing a set of Unicode symbols. // The symbol map starts out empty. SymbolMapNew func() *SymbolMap // Creates a new [SymbolMap] that's a copy of symbolMap. SymbolMapCopy func(symbolMap *SymbolMap) *SymbolMap // Adds a reference to symbolMap. SymbolMapRef func(symbolMap *SymbolMap) // Removes a reference from symbolMap. When remaining references drops to // zero, the symbol map is freed and can no longer be used. SymbolMapUnref func(symbolMap *SymbolMap) // Adds symbols matching the set of tags to symbolMap. SymbolMapAddByTags func(symbolMap *SymbolMap, tags SymbolTags) // Adds symbols in the code point range starting with first and ending // with last to symbolMap. SymbolMapAddByRange func(symbolMap *SymbolMap, first, last rune) // Removes symbols matching the set of tags from symbolMap. SymbolMapRemoveByTags func(symbolMap *SymbolMap, tags SymbolTags) // Removes symbols in the code point range starting with first and ending // with last from symbolMap. SymbolMapRemoveByRange func(symbolMap *SymbolMap, first, last rune) // Parses a string consisting of symbol tags separated by [+-,] and applies // the pattern to symbolMap . If the string begins with + or -, it's // understood to be relative to the current set in symbolMap, otherwise the // map is cleared first. // // The symbol tags are string versions of [SymbolTags], i.e. [all, none, // space, solid, stipple, block, border, diagonal, dot, quad, half, hhalf, // vhalf, braille, technical, geometric, ascii, extra]. // // Examples: "block,border" sets map to contain symbols matching either of // those tags. "+block,border-dot,stipple" adds block and border symbols then // removes dot and stipple symbols. // // If there is a parse error, none of the changes are applied. SymbolMapApplySelectors func(symbolMap *SymbolMap, selectors string) bool // Queries whether a symbol map is allowed to use built-in glyphs for symbol // selection. This can be turned off if you want to use your own glyphs // exclusively (see [SymbolMapAddGlyph]). // // Defaults to TRUE. SymbolMapGetAllowBuiltinGlyphs func(symbolMap *SymbolMap) bool // Controls whether a symbol map is allowed to use built-in glyphs for symbol // selection. This can be turned off if you want to use your own glyphs // exclusively (see [SymbolMapAddGlyph]). // // Defaults to TRUE. SymbolMapSetAllowBuiltinGlyphs func(symbolMap *SymbolMap, allow bool) // Returns data for the glyph corresponding to codePoint stored in symbolMap. // Any of pixelsOut , widthOut , heightOut and rowstrideOut can be nil, // in which case the corresponding data is not retrieved. // // If pixelsOut is not nil, a pointer to freshly allocated memory containing // height * rowstride bytes in the pixel format specified by pixelFormat will // be stored at this address. It must be freed using g_free() when you're // done with it. // // Monochrome glyphs (the only kind currently supported) will be rendered // as opaque white on a transparent black background // (0xffffffff for inked pixels and 0x00000000 for uninked). SymbolMapGetGlyph func( symbolMap *SymbolMap, codePoint rune, pixelFormat PixelType, pixelsOut **byte, widthOut, heightOut, rowstrideOut *int32, ) bool // Assigns a rendered glyph to a Unicode code point. This tells Chafa what // the glyph looks like so the corresponding symbol can be used appropriately // in output. // // Assigned glyphs override built-in glyphs and any earlier glyph that may // have been assigned to the same code point. // // If the input is in a format with an alpha channel, the alpha channel will // be used for the shape. If not, an average of the color channels will be used. SymbolMapAddGlyph func( symbolMap *SymbolMap, codePoint rune, pixelFormat PixelType, pixels unsafe.Pointer, width, height, rowstride int32, ) )
var ( // Creates a new, blank [TermDb]. TermDbNew func() *TermDb // Creates a new [TermDb] that's a copy of termDb. TermDbCopy func(termDb *TermDb) *TermDb // Adds a reference to termDb. TermDbRef func(termDb *TermDb) // Removes a reference from termDb. TermDbUnref func(termDb *TermDb) // Gets the global [TermDb]. This can normally be used safely in a read-only // capacity. The caller should not unref the returned object. TermDbGetDefault func() *TermDb // Builds a new [TermInfo] with fallback control sequences. This can be used // with unknown but presumably modern terminals, or to supplement missing // capabilities in a detected terminal. // // Fallback control sequences may cause unpredictable behavior and should // only be used as a last resort. TermDbGetFallbackInfo func(termDb *TermDb) *TermInfo )
var ( // Creates a new, blank [TermInfo]. TermInfoNew func() *TermInfo // Creates a new [TermInfo] that's a copy of termInfo. TermInfoCopy func(termInfo *TermInfo) *TermInfo // Adds a reference to termInfo. TermInfoRef func(termInfo *TermInfo) // Removes a reference from termInfo. TermInfoUnref func(termInfo *TermInfo) // Gets the string equivalent of seq stored in termInfo. TermInfoGetSeq func(termInfo *TermInfo, seq TermSeq) string // Sets the control sequence string equivalent of seq stored in termInfo to str. // // The string may contain argument indexes to be substituted with integers on // formatting. The indexes are preceded by a percentage character and // start at 1, i.e. %1, %2, %3, etc. // // The string's length after formatting must not exceed [CHAFA_TERM_SEQ_LENGTH_MAX] bytes. // Each argument can add up to four digits, or three for those specified as 8-bit integers. // If the string could potentially exceed this length when formatted, // [TermInfoSetSeq] will return FALSE. // // If parsing fails or str is too long, any previously existing sequence will be left untouched. // // Passing NULL for str clears the corresponding control sequence. TermInfoSetSeq func(termInfo *TermInfo, seq TermSeq, str string, err **GError) bool // TODO: // Checks if termInfo can emit seq. TermInfoHaveSeq func(termInfo *TermInfo, seq TermSeq) bool // Formats the terminal sequence seq, inserting positional arguments. // The seq's number of arguments must be supplied exactly. // // The argument list must be terminated by -1, or undefined behavior will result. // // If the wrong number of arguments is supplied, or an argument is out of range, // this function will return NULL. Otherwise, it returns a zero-terminated string // that must be freed with g_free(). // // If you want compile-time validation of arguments, consider using one of // the specific chafa_term_info_emit_*() functions. They are also faster, // but require you to allocate at least [CHAFA_TERM_SEQ_LENGTH_MAX] bytes up front. TermInfoEmitSeq func(termInfo *TermInfo, seq TermSeq, args ...any) string // Attempts to parse a terminal sequence from an input data array. // If successful, [CHAFA_PARSE_SUCCESS] will be returned, the input pointer // will be advanced and the parsed length will be subtracted from inputLen. TermInfoParseSeq func( term_info *TermInfo, seq TermSeq, input []string, inputLen *int32, argsOut *uint32, ) ParseResult // Supplements missing sequences in termInfo with ones copied from source. TermInfoSupplement func(termInfo, source *TermInfo) // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_TERMINAL_SOFT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetTerminalSoft func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_TERMINAL_HARD]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetTerminalHard func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_ATTRIBUTES]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetAttributes func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CLEAR]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitClear func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_TO_POS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorToPos func(termInfo *TermInfo, dest *string, x, y uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_TO_TOP_LEFT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorToTopLeft func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_TO_BOTTOM_LEFT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorToBottomLeft func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_UP]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorUp func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_DOWN]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorDown func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_LEFT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorLeft func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_RIGHT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorRight func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_UP_1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorUp1 func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_DOWN_1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorDown1 func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_LEFT_1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorLeft1 func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_RIGHT_1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorRight1 func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_UP_SCROLL]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorUpScroll func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_CURSOR_DOWN_SCROLL]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCursorDownScroll func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_INSERT_CELLS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInsertCells func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_DELETE_CELLS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDeleteCells func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_INSERT_ROWS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInsertRows func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_DELETE_ROWS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDeleteRows func(termInfo *TermInfo, dest *string, n uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_CURSOR]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableCursor func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_CURSOR]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableCursor func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_ECHO]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableEcho func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_ECHO]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableEcho func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_INSERT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableInsert func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_INSERT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableInsert func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_WRAP]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableWrap func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_WRAP]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableWrap func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_BOLD]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableBold func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_INVERT_COLORS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInvertColors func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_BG_8]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorBg8 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FG_8]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFg8 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FGBG_8]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFgbg8 func(termInfo *TermInfo, dest *string, fgPen, bgPen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FG_16]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFg16 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_BG_16]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorBg16 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FGBG_16]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFgbg16 func(termInfo *TermInfo, dest *string, fgPen, bgPen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FG_256]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFg256 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_BG_256]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorBg256 func(termInfo *TermInfo, dest *string, pen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FGBG_256]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFgbg256 func(termInfo *TermInfo, dest *string, fgPen, bgPen uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FG_DIRECT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFgDirect func(termInfo *TermInfo, dest *string, r, g, b uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_BG_DIRECT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorBgDirect func(termInfo *TermInfo, dest *string, r, g, b uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_COLOR_FGBG_DIRECT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetColorFgbgDirect func(termInfo *TermInfo, dest *string, fgR, fgG, fgB, bgR, bgG, bgB uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_COLOR_FG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetColorFg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_COLOR_BG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetColorBg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_COLOR_FGBG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetColorFgbg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_DEFAULT_FG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetDefaultFg func(termInfo *TermInfo, dest *string, r, g, b uint16) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_DEFAULT_BG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetDefaultBg func(termInfo *TermInfo, dest *string, r, g, b uint16) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_DEFAULT_FG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetDefaultFg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_DEFAULT_BG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetDefaultBg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_DEFAULT_FG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryDefaultFg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_DEFAULT_BG]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryDefaultBg func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_REPEAT_CHAR]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitRepeatChar func(termInfo *TermInfo, dest *string, n uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_SCROLLING_ROWS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetScrollingRows func(termInfo *TermInfo, dest *string, top, bottom uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESET_SCROLLING_ROWS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitResetScrollingRows func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_SAVE_CURSOR_POS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSaveCursorPos func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RESTORE_CURSOR_POS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitRestoreCursorPos func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_SIXELS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // All three parameters (p1 , p2 and p3 ) can normally be set to 0. TermInfoEmitBeginSixels func(termInfo *TermInfo, dest *string, p1, p2, p3 uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_SIXELS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndSixels func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_SIXEL_SCROLLING]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableSixelScrolling func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_SIXEL_SCROLLING]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableSixelScrolling func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_SIXEL_ADVANCE_DOWN]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetSixelAdvanceDown func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_SET_SIXEL_ADVANCE_RIGHT]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitSetSixelAdvanceRight func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_IMAGE_V1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // bpp must be set to either 24 for RGB data, 32 for RGBA, or 100 to embed a PNG file. // // This sequence must be followed by zero or more paired sequences of type // [CHAFA_TERM_SEQ_BEGIN_KITTY_IMAGE_CHUNK] and [CHAFA_TERM_SEQ_END_KITTY_IMAGE_CHUNK] // with base-64 encoded image data between them. // // When the image data has been transferred, [CHAFA_TERM_SEQ_END_KITTY_IMAGE] must be emitted. TermInfoEmitBeginKittyImmediateImageV1 func( termInfo *TermInfo, dest *string, bpp, widthPixels, heightPixels, widthCells, heightCells uint8, ) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_IMAGE_V1]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // bpp must be set to either 24 for RGB data, 32 for RGBA, or 100 to embed a PNG file. // // This sequence must be followed by zero or more paired sequences of type // [CHAFA_TERM_SEQ_BEGIN_KITTY_IMAGE_CHUNK] and [CHAFA_TERM_SEQ_END_KITTY_IMAGE_CHUNK] // with base-64 encoded image data between them. // // When the image data has been transferred, [CHAFA_TERM_SEQ_END_KITTY_IMAGE] must be emitted. TermInfoEmitBeginKittyImmediateVirtImageV1 func( termInfo *TermInfo, dest *string, bpp, widthPixels, heightPixels, widthCells, heightCells, id uint8, ) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_KITTY_IMAGE]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndKittyImage func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_KITTY_IMAGE_CHUNK]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitBeginKittyImageChunk func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_KITTY_IMAGE_CHUNK]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndKittyImageChunk func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_ITERM2_IMAGE]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // This sequence must be followed by base64-encoded image file data. The image // can be any format supported by MacOS, e.g. PNG, JPEG, TIFF, GIF. When the // image data has been transferred, [CHAFA_TERM_SEQ_END_ITERM2_IMAGE] must be emitted. TermInfoEmitBeginIterm2Image func(termInfo *TermInfo, dest *string, width, height uint8) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_ITERM2_IMAGE]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndIterm2Image func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_SCREEN_PASSTHROUGH]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // Any control sequences between the beginning and end passthrough seqs must // be escaped by turning \033 into \033\033. TermInfoEmitBeginScreenPassthrough func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_SCREEN_PASSTHROUGH]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // Any control sequences between the beginning and end passthrough seqs must // be escaped by turning \033 into \033\033. TermInfoEmitEndScreenPassthrough func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_ENABLE_ALT_SCREEN]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEnableAltScreen func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DISABLE_ALT_SCREEN]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDisableAltScreen func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BEGIN_TMUX_PASSTHROUGH]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // Any control sequences between the beginning and end passthrough seqs must // be escaped by turning \033 into \033\033. TermInfoEmitBeginTmuxPassthrough func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_TMUX_PASSTHROUGH]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. // // Any control sequences between the beginning and end passthrough seqs must // be escaped by turning \033 into \033\033. TermInfoEmitEndTmuxPassthrough func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RETURN_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitReturnKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_BACKSPACE_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitBackspaceKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DELETE_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDeleteKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DELETE_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDeleteCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DELETE_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDeleteShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_INSERT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInsertKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_INSERT_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInsertCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_INSERT_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitInsertShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_HOME_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitHomeKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_HOME_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitHomeCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_HOME_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitHomeShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_END_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitEndShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_UP_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitUpKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_UP_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitUpCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_UP_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitUpShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DOWN_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDownKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DOWN_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDownCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_DOWN_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitDownShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_LEFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitLeftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_LEFT_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitLeftCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_LEFT_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitLeftShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RIGHT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitRightKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RIGHT_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitRightCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_RIGHT_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitRightShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_UP_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageUpKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_UP_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageUpCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_UP_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageUpShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_DOWN_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageDownKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_DOWN_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageDownCtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_PAGE_DOWN_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPageDownShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_TAB_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitTabKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_TAB_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitTabShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F1_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF1Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F1_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF1CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F1_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF1ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F2_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF2Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F2_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF2CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F2_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF2ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F3_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF3Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F3_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF3CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F3_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF3ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F4_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF4Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F4_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF4CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F4_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF4ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F5_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF5Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F5_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF5CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F5_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF5ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F6_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF6Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F6_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF6CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F6_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF6ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F7_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF7Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F7_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF7CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F7_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF7ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F8_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF8Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F8_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF8CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F8_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF8ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F9_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF9Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F9_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF9CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F9_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF9ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F10_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF10Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F10_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF10CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F10_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF10ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F11_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF11Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F11_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF11CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F11_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF11ShiftKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F12_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF12Key func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F12_CTRL_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF12CtrlKey func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_F12_SHIFT_KEY]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitF12ShiftKey func(termInfo *TermInfo, dest *string) string // Terminal emulators and applications are often nested, with the inner // application's capabilities limiting, extending or modifying the outer's. // // Examples are terminal multiplexers like Screen and tmux, or terminal // emulators running inside editors like Emacs and vi. // // This merges the outer and inner sequences into a single [ChafaTermInfo] // according to the following rules. // // For sequences marked as inherited in inner: // // - If either inner or outer sequence is nil, pick the outer sequence. // - Otherwise, pick inner sequence. // // For sequences not marked as inherited, always use the inner sequence. // // This allows for using the inner term's sequences while clearing them if // the outer term does not support the sequence at all. This is useful for // muxers (e.g. fbterm supports 256 colors, but with private seqs; we want to // use the inner mux' corresponding seqs). // // The merged [TermInfo] is a new instance, with the initial reference owned // by the caller. // // This function can be used repeatedly to create chains that're arbitrarily long, // but is unlikely to be useful beyond three levels // (terminal emulator, multiplexer, application). TermInfoChain func(outer, inner *TermInfo) *TermInfo // Prints the control sequence for [CHAFA_TERM_SEQ_CELL_SIZE_PX]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitCellSizePx func(termInfo *TermInfo, dest *string, heightPx, widthPx uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_PRIMARY_DEVICE_ATTRIBUTES]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitPrimaryDeviceAttributes func(termInfo *TermInfo, dest *string, args *uint32, nArgs int32) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_CELL_SIZE_PX]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryCellSizePx func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_PRIMARY_DEVICE_ATTRIBUTES]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryPrimaryDeviceAttributes func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_TEXT_AREA_SIZE_CELLS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX bytes], // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryTextAreaSizeCells func(termInfo *TermInfo, dest *string) string // Prints the control sequence for [CHAFA_TERM_SEQ_QUERY_TEXT_AREA_SIZE_PX]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitQueryTextAreaSizePx func(termInfo *TermInfo, dest *string) string // Behaves like [TermInfoEmitSeq] TermInfoEmitSeqValist func(termInfo *TermInfo, seq TermSeq, args ...any) string // Prints the control sequence for [CHAFA_TERM_SEQ_TEXT_AREA_SIZE_CELLS]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX bytes], // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitTextAreaSizeCells func(termInfo *TermInfo, dest *string, heightCells, widthCells uint32) string // Prints the control sequence for [CHAFA_TERM_SEQ_TEXT_AREA_SIZE_PX]. // // dest must have enough space to hold [CHAFA_TERM_SEQ_LENGTH_MAX] bytes, // even if the emitted sequence is shorter. The output will not be zero-terminated. TermInfoEmitTextAreaSizePx func(termInfo *TermInfo, dest *string, heightPx, widthPx uint32) string // Gets the optimal [CanvasMode] supported by termInfo. TermInfoGetBestCanvasMode func(termInfo *TermInfo) CanvasMode // Gets the optimal [PixelMode] supported by termInfo. TermInfoGetBestPixelMode func(termInfo *TermInfo) PixelMode // Gets whether seq can be inherited from the outer [TermInfo] when chaining // with [TermInfoChain]. TermInfoGetInheritSeq func(termInfo *TermInfo, seq TermSeq) bool // Gets if passthrough should be used to convey images in pixel_mode. // If needed, the passthrough type can be gotten from [TermInfoGetPassthroughType]. TermInfoGetIsPixelPassthroughNeeded func(termInfo *TermInfo, pixelMode PixelMode) bool // Gets the name associated with the termInfo. This may be nil. The returned // string belongs to termInfo, and is only valid until the next operation on // this data structure. TermInfoGetName func(termInfo *TermInfo) string // Gets the passthrough mode supported by termInfo. TermInfoGetPassthroughType func(termInfo *TermInfo) Passthrough // Gets the quirks associated with termInfo. TermInfoGetQuirks func(termInfo *TermInfo) TermQuirks // Gets the [SymbolTags] that are likely safe to use with termInfo. // The [SymbolTags] are a bitwise OR of flags from the enum. TermInfoGetSafeSymbolTags func(termInfo *TermInfo) SymbolTags // Checks if termInfo has terminal sequences that support canvasMode. TermInfoIsCanvasModeSupported func(termInfo *TermInfo, canvasMode CanvasMode) bool // Checks if termInfo has terminal sequences that support pixelMode. TermInfoIsPixelModeSupported func(termInfo *TermInfo, pixelMode PixelMode) bool // Attempts to parse a terminal sequence from an input data array. If successful, // [CHAFA_PARSE_SUCCESS] will be returned, the input pointer will be advanced // and the parsed length will be subtracted from inputLen. // // Any numeric parsed arguments are returned as an array starting at argsOut , // which must have room for up to [CHAFA_TERM_SEQ_ARGS_MAX] elements. // // The number of parsed arguments is returned in nArgsOut. This is useful for // seqs with a variable number of arguments, like // [CHAFA_TERM_SEQ_PRIMARY_DEVICE_ATTRIBUTES]. // // Either or both of argsOut and nArgsOut can be NULL, in which case nothing // is returned for that parameter. TermInfoParseSeqVarargs func( term_info *TermInfo, seq TermSeq, input []string, inputLen *int32, argsOut *uint32, nArgsOut *int32, ) ParseResult // Sets whether seq can be inherited from the outer [TermInfo] when chaining // with [TermInfoChain]. TermInfoSetInheritSeq func(termInfo *TermInfo, seq TermSeq, inherit bool) // Specifies if passthrough should be used to convey images in pixelMode. TermInfoSetIsPixelPassthroughNeeded func(termInfo *TermInfo, pixelMode PixelMode, pixelPassthroughNeeded bool) // Assigns a new name to termInfo. The name should be a short lowercase ASCII // string that uniquely identifies the terminal or program described by termInfo. TermInfoSetName func(termInfo *TermInfo, name string) // Assigns a set of quirks to termInfo. TermInfoSetQuirks func(termInfo *TermInfo, quirks TermQuirks) // Sets the [SymbolTags] that are likely safe to use with termInfo. // The tags are a bitwise OR of flags from the enum. TermInfoSetSafeSymbolTags func(termInfo *TermInfo, tags SymbolTags) )
var CalcCanvasGeometry func( srcWidth, srcHeight int32, destWidthInout, destHeightInout *int32, fontRatio float32, zoom, stretch bool, )
Calculates an optimal geometry for a Canvas given the width and height of an input image, maximum width and height of the canvas, font ratio, zoom and stretch preferences.
srcWidth and srcHeight must both be zero or greater.
destWidthInout and destHeightInout must point to integers containing the maximum dimensions of the canvas in character cells. These will be replaced by the calculated values, which may be zero if one of the input dimensions is zero. If one or both of the input parameters is negative, they will be treated as unspecified and calculated based on the remaining parameters and aspect ratio.
fontRatio is the font's width divided by its height. 0.5 is a typical value.
Functions ¶
Types ¶
type Canvas ¶
type Canvas struct {
Refs int32
WidthPixels, HeightPixels int32
Pixels *Pixel
Cells *CanvasCell
HaveAlpha bool
NeedsClear bool
// Whether to consider inverted symbols; FALSE if using FG only
ConsiderInverted bool
// Whether to extract symbol colors; FALSE if using default colors
ExtractColors bool
// Whether to quantize colors before calculating error (slower, but
// yields better results in palettized modes, especially 16/8)
UseQuantizedError bool
DefaultColors ColorPair
WorkFactorInt uint32
// Character to use in cells where fg color == bg color. Typically
// space, but could be something else depending on the symbol map.
BlankChar uint8 // gunichar
// Character to use in cells where fg color == bg color and the color
// is only legal in FG. Typically 0x2588 (solid block), but could be
// something else depending on the symbol map. Can be zero if there is
// no good candidate!
SolidChar uint8 // gunichar
Config CanvasConfig
// Used when setting pixel data
Dither Dither
// This is NULL in CHAFA_PIXEL_MODE_SYMBOLS, otherwise one of:
// (ChafaSixelCanvas *), (ChafaKittyCanvas *), (ChafaIterm2Canvas *)
PixelCanvas unsafe.Pointer
// It's possible to have a single placement that covers the entire
// canvas. In this case, it is stored here.
Placement *Placement
// Our palettes. Kind of a big structure, so they go last.
FgPalette Palette
BgPalette Palette
}
type CanvasCell ¶
type CanvasConfig ¶
type CanvasConfig struct {
Refs int32
Width, Height int32
CellWidth, CellHeight int32
CanvasMode CanvasMode
ColorSpace ColorSpace
DitherMode DitherMode
ColorExtractor ColorExtractor
PixelMode PixelMode
DitherGrainWidth, DitherGrainHeight int32
DitherIntensity float32
FgColorPackedRgb uint32
BgColorPackedRgb uint32
AlphaThreshold int32 // 0-255. 255 = no alpha in output
WorkFactor float32
SymbolMap SymbolMap
FillSymbolMap SymbolMap
PreprocessingEnabled bool
FgOnlyEnabled bool
Optimizations Optimizations
Passthrough Passthrough
}
type CanvasMode ¶
type CanvasMode int32
const ( CHAFA_CANVAS_MODE_TRUECOLOR CanvasMode = 0 CHAFA_CANVAS_MODE_INDEXED_256 CanvasMode = 1 CHAFA_CANVAS_MODE_INDEXED_240 CanvasMode = 2 CHAFA_CANVAS_MODE_INDEXED_16 CanvasMode = 3 CHAFA_CANVAS_MODE_FGBG_BGFG CanvasMode = 4 CHAFA_CANVAS_MODE_FGBG CanvasMode = 5 CHAFA_CANVAS_MODE_INDEXED_8 CanvasMode = 6 CHAFA_CANVAS_MODE_INDEXED_16_8 CanvasMode = 7 CHAFA_CANVAS_MODE_MAX CanvasMode = 8 )
type ColorExtractor ¶
type ColorExtractor int32
const ( CHAFA_COLOR_EXTRACTOR_AVERAGE ColorExtractor = 0 CHAFA_COLOR_EXTRACTOR_MEDIAN ColorExtractor = 1 CHAFA_COLOR_EXTRACTOR_MAX ColorExtractor = 2 )
type ColorSpace ¶
type ColorSpace int32
const ( CHAFA_COLOR_SPACE_RGB ColorSpace = 0 CHAFA_COLOR_SPACE_DIN99D ColorSpace = 1 CHAFA_COLOR_SPACE_MAX ColorSpace = 2 )
type ColorTable ¶
type ColorTable struct {
Entries [CHAFA_COLOR_TABLE_MAX_ENTRIES]ColorTableEntry
// Each pen is 24 bits (B8G8R8) of color information
Pens [CHAFA_COLOR_TABLE_MAX_ENTRIES]uint32
NEntries int32
IsSorted bool
Eigenvectors [2]Vec3i32
Average Vec3i32
EigenMul [2]uint32
}
type ColorTableEntry ¶
type DitherMode ¶
type DitherMode int32
const ( CHAFA_DITHER_MODE_NONE DitherMode = 0 CHAFA_DITHER_MODE_ORDERED DitherMode = 1 CHAFA_DITHER_MODE_DIFFUSION DitherMode = 2 CHAFA_DITHER_MODE_MAX DitherMode = 3 )
type Optimizations ¶
type Optimizations int32
const ( CHAFA_OPTIMIZATION_REUSE_ATTRIBUTES Optimizations = (1 << 0) CHAFA_OPTIMIZATION_SKIP_CELLS Optimizations = (1 << 1) CHAFA_OPTIMIZATION_REPEAT_CELLS Optimizations = (1 << 2) CHAFA_OPTIMIZATION_NONE Optimizations = 0 CHAFA_OPTIMIZATION_ALL Optimizations = 0x7fffffff )
type Palette ¶
type Palette struct {
Type PaletteType
Colors [CHAFA_PALETTE_INDEX_MAX]PaletteColor
Table [CHAFA_COLOR_SPACE_MAX]ColorTable
FirstColor int32
NColors int32
AlphaThreshold int32
TransparentIndex int32
}
type PaletteColor ¶
type PaletteColor struct {
Col [CHAFA_COLOR_SPACE_MAX]Color
}
type PaletteType ¶
type PaletteType int32
const ( CHAFA_PALETTE_TYPE_DYNAMIC_256 PaletteType = 0 CHAFA_PALETTE_TYPE_FIXED_256 PaletteType = 1 CHAFA_PALETTE_TYPE_FIXED_240 PaletteType = 2 CHAFA_PALETTE_TYPE_FIXED_16 PaletteType = 3 CHAFA_PALETTE_TYPE_FIXED_8 PaletteType = 4 CHAFA_PALETTE_TYPE_FIXED_FGBG PaletteType = 5 )
type ParseResult ¶
type ParseResult int32
const ( CHAFA_PARSE_SUCCESS ParseResult = 0 CHAFA_PARSE_FAILURE ParseResult = 1 CHAFA_PARSE_AGAIN ParseResult = 2 )
type Passthrough ¶
type Passthrough int32
const ( CHAFA_PASSTHROUGH_NONE Passthrough = 0 CHAFA_PASSTHROUGH_SCREEN Passthrough = 1 CHAFA_PASSTHROUGH_TMUX Passthrough = 2 CHAFA_PASSTHROUGH_MAX Passthrough = 3 )
type PixelType ¶
type PixelType int32
const ( CHAFA_PIXEL_RGBA8_PREMULTIPLIED PixelType = 0 CHAFA_PIXEL_BGRA8_PREMULTIPLIED PixelType = 1 CHAFA_PIXEL_ARGB8_PREMULTIPLIED PixelType = 2 CHAFA_PIXEL_ABGR8_PREMULTIPLIED PixelType = 3 CHAFA_PIXEL_RGBA8_UNASSOCIATED PixelType = 4 CHAFA_PIXEL_BGRA8_UNASSOCIATED PixelType = 5 CHAFA_PIXEL_ARGB8_UNASSOCIATED PixelType = 6 CHAFA_PIXEL_ABGR8_UNASSOCIATED PixelType = 7 CHAFA_PIXEL_RGB8 PixelType = 8 CHAFA_PIXEL_BGR8 PixelType = 9 CHAFA_PIXEL_MAX PixelType = 10 )
type SeqArgInfo ¶
type SymbolMap ¶
type SymbolMap struct {
Refs int32
NeedRebuild bool
UseBuiltinGlyphs bool
Glyphs unsafe.Pointer
Glyphs2 unsafe.Pointer // Wide glyphs with left/right bitmaps
Selectors unsafe.Pointer
// Narrow symbols
Symbols []Symbol
NSymbols int32
PackedBitmaps *uint64
// Wide symbols
Symbols2 []Symbol2
NSymbols2 int32
PackedBitmaps2 *uint64
}
type SymbolTags ¶
type SymbolTags int32
const ( CHAFA_SYMBOL_TAG_NONE SymbolTags = 0 CHAFA_SYMBOL_TAG_SPACE SymbolTags = (1 << 0) CHAFA_SYMBOL_TAG_SOLID SymbolTags = (1 << 1) CHAFA_SYMBOL_TAG_STIPPLE SymbolTags = (1 << 2) CHAFA_SYMBOL_TAG_BLOCK SymbolTags = (1 << 3) CHAFA_SYMBOL_TAG_BORDER SymbolTags = (1 << 4) CHAFA_SYMBOL_TAG_DIAGONAL SymbolTags = (1 << 5) CHAFA_SYMBOL_TAG_DOT SymbolTags = (1 << 6) CHAFA_SYMBOL_TAG_QUAD SymbolTags = (1 << 7) CHAFA_SYMBOL_TAG_HHALF SymbolTags = (1 << 8) CHAFA_SYMBOL_TAG_VHALF SymbolTags = (1 << 9) CHAFA_SYMBOL_TAG_HALF SymbolTags = ((CHAFA_SYMBOL_TAG_HHALF) | (CHAFA_SYMBOL_TAG_VHALF)) CHAFA_SYMBOL_TAG_INVERTED SymbolTags = (1 << 10) CHAFA_SYMBOL_TAG_BRAILLE SymbolTags = (1 << 11) CHAFA_SYMBOL_TAG_TECHNICAL SymbolTags = (1 << 12) CHAFA_SYMBOL_TAG_GEOMETRIC SymbolTags = (1 << 13) CHAFA_SYMBOL_TAG_ASCII SymbolTags = (1 << 14) CHAFA_SYMBOL_TAG_ALPHA SymbolTags = (1 << 15) CHAFA_SYMBOL_TAG_DIGIT SymbolTags = (1 << 16) CHAFA_SYMBOL_TAG_ALNUM SymbolTags = CHAFA_SYMBOL_TAG_ALPHA | CHAFA_SYMBOL_TAG_DIGIT CHAFA_SYMBOL_TAG_NARROW SymbolTags = (1 << 17) CHAFA_SYMBOL_TAG_WIDE SymbolTags = (1 << 18) CHAFA_SYMBOL_TAG_AMBIGUOUS SymbolTags = (1 << 19) CHAFA_SYMBOL_TAG_UGLY SymbolTags = (1 << 20) CHAFA_SYMBOL_TAG_LEGACY SymbolTags = (1 << 21) CHAFA_SYMBOL_TAG_SEXTANT SymbolTags = (1 << 22) CHAFA_SYMBOL_TAG_WEDGE SymbolTags = (1 << 23) CHAFA_SYMBOL_TAG_LATIN SymbolTags = (1 << 24) CHAFA_SYMBOL_TAG_IMPORTED SymbolTags = (1 << 25) CHAFA_SYMBOL_TAG_OCTANT SymbolTags = (1 << 26) CHAFA_SYMBOL_TAG_EXTRA SymbolTags = (1 << 30) CHAFA_SYMBOL_TAG_BAD SymbolTags = CHAFA_SYMBOL_TAG_AMBIGUOUS | CHAFA_SYMBOL_TAG_UGLY CHAFA_SYMBOL_TAG_ALL SymbolTags = ^(CHAFA_SYMBOL_TAG_EXTRA | CHAFA_SYMBOL_TAG_BAD) )
type TermInfo ¶
type TermInfo struct {
Refs int32
Name string
SeqStr [CHAFA_TERM_SEQ_MAX][CHAFA_TERM_SEQ_LENGTH_MAX]byte
SeqArgs [CHAFA_TERM_SEQ_MAX][CHAFA_TERM_SEQ_ARGS_MAX]SeqArgInfo
UnparsedStr [CHAFA_TERM_SEQ_MAX]string
PixelPassthroughNeeded [CHAFA_PIXEL_MODE_MAX]uint8
InheritSeq [CHAFA_TERM_SEQ_MAX]uint8
Quirks TermQuirks
SafeSymbolTags SymbolTags
}
func TermDbDetect ¶
type TermQuirks ¶
type TermQuirks int32
const (
CHAFA_TERM_QUIRK_SIXEL_OVERSHOOT TermQuirks = (1 << 0)
)
type TermSeq ¶
type TermSeq int32
const ( CHAFA_TERM_SEQ_RESET_TERMINAL_SOFT TermSeq = 0 CHAFA_TERM_SEQ_RESET_TERMINAL_HARD TermSeq = 1 CHAFA_TERM_SEQ_RESET_ATTRIBUTES TermSeq = 2 CHAFA_TERM_SEQ_CLEAR TermSeq = 3 CHAFA_TERM_SEQ_INVERT_COLORS TermSeq = 4 CHAFA_TERM_SEQ_CURSOR_TO_TOP_LEFT TermSeq = 5 CHAFA_TERM_SEQ_CURSOR_TO_BOTTOM_LEFT TermSeq = 6 CHAFA_TERM_SEQ_CURSOR_TO_POS TermSeq = 7 CHAFA_TERM_SEQ_CURSOR_UP_1 TermSeq = 8 CHAFA_TERM_SEQ_CURSOR_UP TermSeq = 9 CHAFA_TERM_SEQ_CURSOR_DOWN_1 TermSeq = 10 CHAFA_TERM_SEQ_CURSOR_DOWN TermSeq = 11 CHAFA_TERM_SEQ_CURSOR_LEFT_1 TermSeq = 12 CHAFA_TERM_SEQ_CURSOR_LEFT TermSeq = 13 CHAFA_TERM_SEQ_CURSOR_RIGHT_1 TermSeq = 14 CHAFA_TERM_SEQ_CURSOR_RIGHT TermSeq = 15 CHAFA_TERM_SEQ_CURSOR_UP_SCROLL TermSeq = 16 CHAFA_TERM_SEQ_CURSOR_DOWN_SCROLL TermSeq = 17 CHAFA_TERM_SEQ_INSERT_CELLS TermSeq = 18 CHAFA_TERM_SEQ_DELETE_CELLS TermSeq = 19 CHAFA_TERM_SEQ_INSERT_ROWS TermSeq = 20 CHAFA_TERM_SEQ_DELETE_ROWS TermSeq = 21 CHAFA_TERM_SEQ_SET_SCROLLING_ROWS TermSeq = 22 CHAFA_TERM_SEQ_ENABLE_INSERT TermSeq = 23 CHAFA_TERM_SEQ_DISABLE_INSERT TermSeq = 24 CHAFA_TERM_SEQ_ENABLE_CURSOR TermSeq = 25 CHAFA_TERM_SEQ_DISABLE_CURSOR TermSeq = 26 CHAFA_TERM_SEQ_ENABLE_ECHO TermSeq = 27 CHAFA_TERM_SEQ_DISABLE_ECHO TermSeq = 28 CHAFA_TERM_SEQ_ENABLE_WRAP TermSeq = 29 CHAFA_TERM_SEQ_DISABLE_WRAP TermSeq = 30 CHAFA_TERM_SEQ_SET_COLOR_FG_DIRECT TermSeq = 31 CHAFA_TERM_SEQ_SET_COLOR_BG_DIRECT TermSeq = 32 CHAFA_TERM_SEQ_SET_COLOR_FGBG_DIRECT TermSeq = 33 CHAFA_TERM_SEQ_SET_COLOR_FG_256 TermSeq = 34 CHAFA_TERM_SEQ_SET_COLOR_BG_256 TermSeq = 35 CHAFA_TERM_SEQ_SET_COLOR_FGBG_256 TermSeq = 36 CHAFA_TERM_SEQ_SET_COLOR_FG_16 TermSeq = 37 CHAFA_TERM_SEQ_SET_COLOR_BG_16 TermSeq = 38 CHAFA_TERM_SEQ_SET_COLOR_FGBG_16 TermSeq = 39 CHAFA_TERM_SEQ_BEGIN_SIXELS TermSeq = 40 CHAFA_TERM_SEQ_END_SIXELS TermSeq = 41 CHAFA_TERM_SEQ_REPEAT_CHAR TermSeq = 42 CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_IMAGE_V1 TermSeq = 43 CHAFA_TERM_SEQ_END_KITTY_IMAGE TermSeq = 44 CHAFA_TERM_SEQ_BEGIN_KITTY_IMAGE_CHUNK TermSeq = 45 CHAFA_TERM_SEQ_END_KITTY_IMAGE_CHUNK TermSeq = 46 CHAFA_TERM_SEQ_BEGIN_ITERM2_IMAGE TermSeq = 47 CHAFA_TERM_SEQ_END_ITERM2_IMAGE TermSeq = 48 CHAFA_TERM_SEQ_ENABLE_SIXEL_SCROLLING TermSeq = 49 CHAFA_TERM_SEQ_DISABLE_SIXEL_SCROLLING TermSeq = 50 CHAFA_TERM_SEQ_ENABLE_BOLD TermSeq = 51 CHAFA_TERM_SEQ_SET_COLOR_FG_8 TermSeq = 52 CHAFA_TERM_SEQ_SET_COLOR_BG_8 TermSeq = 53 CHAFA_TERM_SEQ_SET_COLOR_FGBG_8 TermSeq = 54 CHAFA_TERM_SEQ_RESET_DEFAULT_FG TermSeq = 55 CHAFA_TERM_SEQ_SET_DEFAULT_FG TermSeq = 56 CHAFA_TERM_SEQ_QUERY_DEFAULT_FG TermSeq = 57 CHAFA_TERM_SEQ_RESET_DEFAULT_BG TermSeq = 58 CHAFA_TERM_SEQ_SET_DEFAULT_BG TermSeq = 59 CHAFA_TERM_SEQ_QUERY_DEFAULT_BG TermSeq = 60 CHAFA_TERM_SEQ_RETURN_KEY TermSeq = 61 CHAFA_TERM_SEQ_BACKSPACE_KEY TermSeq = 62 CHAFA_TERM_SEQ_TAB_KEY TermSeq = 63 CHAFA_TERM_SEQ_TAB_SHIFT_KEY TermSeq = 64 CHAFA_TERM_SEQ_UP_KEY TermSeq = 65 CHAFA_TERM_SEQ_UP_CTRL_KEY TermSeq = 66 CHAFA_TERM_SEQ_UP_SHIFT_KEY TermSeq = 67 CHAFA_TERM_SEQ_DOWN_KEY TermSeq = 68 CHAFA_TERM_SEQ_DOWN_CTRL_KEY TermSeq = 69 CHAFA_TERM_SEQ_DOWN_SHIFT_KEY TermSeq = 70 CHAFA_TERM_SEQ_LEFT_KEY TermSeq = 71 CHAFA_TERM_SEQ_LEFT_CTRL_KEY TermSeq = 72 CHAFA_TERM_SEQ_LEFT_SHIFT_KEY TermSeq = 73 CHAFA_TERM_SEQ_RIGHT_KEY TermSeq = 74 CHAFA_TERM_SEQ_RIGHT_CTRL_KEY TermSeq = 75 CHAFA_TERM_SEQ_RIGHT_SHIFT_KEY TermSeq = 76 CHAFA_TERM_SEQ_PAGE_UP_KEY TermSeq = 77 CHAFA_TERM_SEQ_PAGE_UP_CTRL_KEY TermSeq = 78 CHAFA_TERM_SEQ_PAGE_UP_SHIFT_KEY TermSeq = 79 CHAFA_TERM_SEQ_PAGE_DOWN_KEY TermSeq = 80 CHAFA_TERM_SEQ_PAGE_DOWN_CTRL_KEY TermSeq = 81 CHAFA_TERM_SEQ_PAGE_DOWN_SHIFT_KEY TermSeq = 82 CHAFA_TERM_SEQ_HOME_KEY TermSeq = 83 CHAFA_TERM_SEQ_HOME_CTRL_KEY TermSeq = 84 CHAFA_TERM_SEQ_HOME_SHIFT_KEY TermSeq = 85 CHAFA_TERM_SEQ_END_KEY TermSeq = 86 CHAFA_TERM_SEQ_END_CTRL_KEY TermSeq = 87 CHAFA_TERM_SEQ_END_SHIFT_KEY TermSeq = 88 CHAFA_TERM_SEQ_INSERT_KEY TermSeq = 89 CHAFA_TERM_SEQ_INSERT_CTRL_KEY TermSeq = 90 CHAFA_TERM_SEQ_INSERT_SHIFT_KEY TermSeq = 91 CHAFA_TERM_SEQ_DELETE_KEY TermSeq = 92 CHAFA_TERM_SEQ_DELETE_CTRL_KEY TermSeq = 93 CHAFA_TERM_SEQ_DELETE_SHIFT_KEY TermSeq = 94 CHAFA_TERM_SEQ_F1_KEY TermSeq = 95 CHAFA_TERM_SEQ_F1_CTRL_KEY TermSeq = 96 CHAFA_TERM_SEQ_F1_SHIFT_KEY TermSeq = 97 CHAFA_TERM_SEQ_F2_KEY TermSeq = 98 CHAFA_TERM_SEQ_F2_CTRL_KEY TermSeq = 99 CHAFA_TERM_SEQ_F2_SHIFT_KEY TermSeq = 100 CHAFA_TERM_SEQ_F3_KEY TermSeq = 101 CHAFA_TERM_SEQ_F3_CTRL_KEY TermSeq = 102 CHAFA_TERM_SEQ_F3_SHIFT_KEY TermSeq = 103 CHAFA_TERM_SEQ_F4_KEY TermSeq = 104 CHAFA_TERM_SEQ_F4_CTRL_KEY TermSeq = 105 CHAFA_TERM_SEQ_F4_SHIFT_KEY TermSeq = 106 CHAFA_TERM_SEQ_F5_KEY TermSeq = 107 CHAFA_TERM_SEQ_F5_CTRL_KEY TermSeq = 108 CHAFA_TERM_SEQ_F5_SHIFT_KEY TermSeq = 109 CHAFA_TERM_SEQ_F6_KEY TermSeq = 110 CHAFA_TERM_SEQ_F6_CTRL_KEY TermSeq = 111 CHAFA_TERM_SEQ_F6_SHIFT_KEY TermSeq = 112 CHAFA_TERM_SEQ_F7_KEY TermSeq = 113 CHAFA_TERM_SEQ_F7_CTRL_KEY TermSeq = 114 CHAFA_TERM_SEQ_F7_SHIFT_KEY TermSeq = 115 CHAFA_TERM_SEQ_F8_KEY TermSeq = 116 CHAFA_TERM_SEQ_F8_CTRL_KEY TermSeq = 117 CHAFA_TERM_SEQ_F8_SHIFT_KEY TermSeq = 118 CHAFA_TERM_SEQ_F9_KEY TermSeq = 119 CHAFA_TERM_SEQ_F9_CTRL_KEY TermSeq = 120 CHAFA_TERM_SEQ_F9_SHIFT_KEY TermSeq = 121 CHAFA_TERM_SEQ_F10_KEY TermSeq = 122 CHAFA_TERM_SEQ_F10_CTRL_KEY TermSeq = 123 CHAFA_TERM_SEQ_F10_SHIFT_KEY TermSeq = 124 CHAFA_TERM_SEQ_F11_KEY TermSeq = 125 CHAFA_TERM_SEQ_F11_CTRL_KEY TermSeq = 126 CHAFA_TERM_SEQ_F11_SHIFT_KEY TermSeq = 127 CHAFA_TERM_SEQ_F12_KEY TermSeq = 128 CHAFA_TERM_SEQ_F12_CTRL_KEY TermSeq = 129 CHAFA_TERM_SEQ_F12_SHIFT_KEY TermSeq = 130 CHAFA_TERM_SEQ_RESET_COLOR_FG TermSeq = 131 CHAFA_TERM_SEQ_RESET_COLOR_BG TermSeq = 132 CHAFA_TERM_SEQ_RESET_COLOR_FGBG TermSeq = 133 CHAFA_TERM_SEQ_RESET_SCROLLING_ROWS TermSeq = 134 CHAFA_TERM_SEQ_SAVE_CURSOR_POS TermSeq = 135 CHAFA_TERM_SEQ_RESTORE_CURSOR_POS TermSeq = 136 CHAFA_TERM_SEQ_SET_SIXEL_ADVANCE_DOWN TermSeq = 137 CHAFA_TERM_SEQ_SET_SIXEL_ADVANCE_RIGHT TermSeq = 138 CHAFA_TERM_SEQ_ENABLE_ALT_SCREEN TermSeq = 139 CHAFA_TERM_SEQ_DISABLE_ALT_SCREEN TermSeq = 140 CHAFA_TERM_SEQ_BEGIN_SCREEN_PASSTHROUGH TermSeq = 141 CHAFA_TERM_SEQ_END_SCREEN_PASSTHROUGH TermSeq = 142 CHAFA_TERM_SEQ_BEGIN_TMUX_PASSTHROUGH TermSeq = 143 CHAFA_TERM_SEQ_END_TMUX_PASSTHROUGH TermSeq = 144 CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_VIRT_IMAGE_V1 TermSeq = 145 CHAFA_TERM_SEQ_QUERY_PRIMARY_DEVICE_ATTRIBUTES TermSeq = 146 CHAFA_TERM_SEQ_PRIMARY_DEVICE_ATTRIBUTES TermSeq = 147 CHAFA_TERM_SEQ_QUERY_TEXT_AREA_SIZE_CELLS TermSeq = 148 CHAFA_TERM_SEQ_TEXT_AREA_SIZE_CELLS TermSeq = 149 CHAFA_TERM_SEQ_QUERY_TEXT_AREA_SIZE_PX TermSeq = 150 CHAFA_TERM_SEQ_TEXT_AREA_SIZE_PX TermSeq = 151 CHAFA_TERM_SEQ_QUERY_CELL_SIZE_PX TermSeq = 152 CHAFA_TERM_SEQ_CELL_SIZE_PX TermSeq = 153 CHAFA_TERM_SEQ_MAX TermSeq = 154 )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
aspectratio
command
|
|
|
passthrough
command
|
|
|
simple
command
|
|
|
adaptive
module
|