### LibDeflate usage example in Lua Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/examples/example.lua.html Complete example showing how to load LibDeflate (either via LibStub for WoW addons or require for Lua), compress and decompress using raw deflate and zlib formats, control compression level, use a preset dictionary, and encode data for WoW addon channels or printable output. Includes checks for decompression success and dictionary consistency. ```lua --[[ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/. --]] --- LibDeflate usage example -- @author Haoqian He -- @file example.lua local LibDeflate if LibStub then -- You are using LibDeflate as WoW addon LibDeflate = LibStub:GetLibrary("LibDeflate") else -- You are using LibDeflate as Lua library. -- Setup the path to locate LibDeflate.lua, -- if 'require("LibDeflate")' fails, for example: -- package.path = ("?.lua;../?.lua;")..(package.path or "") LibDeflate = require("LibDeflate") end local example_input = "12123123412345123456123456712345678123456789" -- Compress using raw deflate format local compress_deflate = LibDeflate:CompressDeflate(example_input) -- decompress local decompress_deflate = LibDeflate:DecompressDeflate(compress_deflate) -- Check if the first return value of DecompressXXXX is non-nil to know if the -- decompression succeeds. if decompress_deflate == nil then error("Decompression fails.") else -- Decompression succeeds. assert(example_input == decompress_deflate) end -- If it is to transmit through WoW addon channel, -- compressed data must be encoded so NULL ("\000") is not transmitted. local data_to_trasmit_WoW_addon = LibDeflate:EncodeForWoWAddonChannel( compress_deflate) -- When the receiver gets the data, decoded it first. local data_decoded_WoW_addon = LibDeflate:DecodeForWoWAddonChannel( data_to_trasmit_WoW_addon) -- Then decomrpess it assert(LibDeflate:DecompressDeflate(data_decoded_WoW_addon) == example_input) -- The compressed output is not printable. EncodeForPrint will convert to -- a printable format, in case you want to export to the user to -- copy and paste. This encoding will make the data 25% bigger. local printable_compressed = LibDeflate:EncodeForPrint(compress_deflate) -- DecodeForPrint to convert back. -- DecodeForPrint will remove prefixed and trailing control or space characters -- in the string before decode it. assert(LibDeflate:DecodeForPrint(printable_compressed) == compress_deflate) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Compress and decompress using zlib format local compress_zlib = LibDeflate:CompressZlib(example_input) local decompress_zlib = LibDeflate:DecompressZlib(compress_zlib) assert(decompress_zlib == example_input) --- Control the compression level -- NOTE: High compression level does not make a difference here, -- because the input data is very small local compress_deflate_with_level = LibDeflate:CompressDeflate(example_input , {level = 9}) local decompress_deflate_with_level = LibDeflate:DecompressDeflate( compress_deflate_with_level) assert(decompress_deflate_with_level == example_input) -- Compress with a preset dictionary local dict_str = "121231234" -- example preset dictionary string. -- print(LibDeflate:Adler32(dict_str), #dict_str) -- 9 147325380 -- hardcode the print result above, the ensure it is not modified -- accidenttaly during the program development. -- -- WARNING: The compressor and decompressor must use the same dictionary. -- You should be aware of this when tranmitting compressed data over the -- internet. local dict = LibDeflate:CreateDictionary(dict_str, 9, 147325380) -- Using the dictionary with raw deflate format local compress_deflate_with_dict = LibDeflate:CompressDeflateWithDict( example_input, dict) assert(#compress_deflate_with_dict < #compress_deflate) local decompress_deflate_with_dict = LibDeflate:DecompressDeflateWithDict( compress_deflate_with_dict, dict) assert(decompress_deflate_with_dict == example_input) -- Using the dictionary with zlib format, specifying compression level local compress_zlib_with_dict = LibDeflate:CompressZlibWithDict( example_input, dict, {level = 9}) assert(#compress_zlib_with_dict < #compress_zlib) local decompress_zlib_with_dict = LibDeflate:DecompressZlibWithDict( compress_zlib_with_dict, dict) assert(decompress_zlib_with_dict == example_input) ``` -------------------------------- ### ButtonGlow_Start Source: https://github.com/arcsim/arcui/blob/main/Libs/LibCustomGlow-1.0/README.md Starts a Blizzard-style button glow effect on a target frame with configurable color and frequency. ```APIDOC ## ButtonGlow_Start ### Description Starts glow over target frame with set parameters. ### Function Signature `ButtonGlow_Start(frame[, color[, frequency]])` ### Parameters - **frame** (Frame) - Required - Target frame to set glowing. - **color** (table {r,g,b,a}) - Optional - Color of particles and opacity, from 0 to 1. Default value is {0.95, 0.95, 0.32, 1}. - **frequency** (number) - Optional - Frequency. Default value is 0.125. ### Returns No explicit return value documented. ``` -------------------------------- ### Initialize and reanchor a frame with LibEditModeOverride Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Initializes the library, loads saved edit mode layouts, reanchors the MainMenuBar frame to the top of the UI parent, and applies the changes. This is the minimal setup required before using other library functions. ```lua local LibEditModeOverride = LibStub("LibEditModeOverride-1.0") LibEditModeOverride:LoadLayouts() LibEditModeOverride:ReanchorFrame(MainMenuBar, "TOP", UIParent) LibEditModeOverride:ApplyChanges() ``` -------------------------------- ### CreateDictionary usage example Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a preset dictionary from the string "1234567890" with hardcoded length and Adler-32 checksum. The length and checksum are hardcoded to verify the string is not accidentally modified during development. ```lua local dict_str = "1234567890" -- print(dict_str:len(), LibDeflate:Adler32(dict_str)) -- Hardcode the print result below to verify it to avoid acciently -- modification of 'str' during the program development. -- string length: 10, Adler-32: 187433486, -- Don't calculate string length and its Adler-32 at run-time. local dict = LibDeflate:CreateDictionary(dict_str, 10, 187433486) ``` -------------------------------- ### LibEditModeOverride:GetGlobalSetting(setting) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Gets the value of an account-wide edit mode setting. ```APIDOC ## LibEditModeOverride:GetGlobalSetting(setting) ### Description Get the value of a specific edit mode account-wide setting. This setting won't affect the UI outside of edit mode. ### Method Function call ### Endpoint `LibEditModeOverride:GetGlobalSetting(setting)` ### Parameters - **setting** (string) - Required - The setting name. ### Returns - **any** - The value of the setting. ``` -------------------------------- ### AutoCastGlow_Start Source: https://github.com/arcsim/arcui/blob/main/Libs/LibCustomGlow-1.0/README.md Starts an autocast glow effect on a target frame with configurable parameters such as color, number of particle groups, frequency, scale, offsets, and key. ```APIDOC ## AutoCastGlow_Start ### Description Starts glow over target frame with set parameters. ### Function Signature `AutoCastGlow_Start(frame[, color[, N[, frequency[, scale[, xOffset[, yOffset[, key]]]]]]]])` ### Parameters - **frame** (Frame) - Required - Target frame to set glowing. - **color** (table {r,g,b,a}) - Optional - Color of particles and opacity, from 0 to 1. Default value is {0.95, 0.95, 0.32, 1}. - **N** (number) - Optional - Number of particle groups. Each group contains 4 particles. Default value is 4. - **frequency** (number) - Optional - Frequency, set to negative to inverse direction of rotation. Default value is 0.125. - **scale** (number) - Optional - Scale of particles. - **xOffset** (number) - Optional - Offset of glow relative to region border. - **yOffset** (number) - Optional - Offset of glow relative to region border. - **key** (string/number) - Optional - Key of glow, allows for multiple glows on one frame. ### Returns No explicit return value documented. ``` -------------------------------- ### CreateCodec usage example Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a codec that maps all "\000" to "\003" and escapes "\001" (and "\002" and "\003") properly. The encoded string will not contain "\000" or "\001". Decoding returns the original string. ```lua -- Create an encoder/decoder that maps all "\000" to "\003", -- and escape "\001" (and "\002" and "\003") properly local codec = LibDeflate:CreateCodec("\000\001", "\002", "\003") local encoded = codec:Encode(SOME_STRING) -- "encoded" does not contain "\000" or "\001" local decoded = codec:Decode(encoded) -- assert(decoded == SOME_STRING) ``` -------------------------------- ### PixelGlow_Start Source: https://github.com/arcsim/arcui/blob/main/Libs/LibCustomGlow-1.0/README.md Starts a pixel glow effect on a target frame with configurable parameters such as color, number of lines, frequency, length, thickness, offsets, border, and key. ```APIDOC ## PixelGlow_Start ### Description Starts glow over target frame with set parameters. ### Function Signature `PixelGlow_Start(frame[, color[, N[, frequency[, length[, th[, xOffset[, yOffset[, border[, key]]]]]]]]]]))` ### Parameters - **frame** (Frame) - Required - Target frame to set glowing. - **color** (table {r,g,b,a}) - Optional - Color of lines and opacity, from 0 to 1. Default value is {0.95, 0.95, 0.32, 1}. - **N** (number) - Optional - Number of lines. Default value is 8. - **frequency** (number) - Optional - Frequency, set to negative to inverse direction of rotation. Default value is 0.25. - **length** (number) - Optional - Length of lines. Default value depends on region size and number of lines. - **th** (number) - Optional - Thickness of lines. Default value is 2. - **xOffset** (number) - Optional - Offset of glow relative to region border. - **yOffset** (number) - Optional - Offset of glow relative to region border. - **border** (boolean) - Optional - Set to true to create border under lines. - **key** (string/number) - Optional - Key of glow, allows for multiple glows on one frame. ### Returns No explicit return value documented. ``` -------------------------------- ### LibEditModeOverride:GetFrameSetting(frame, setting) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Gets the value of a specific edit mode setting on a frame. ```APIDOC ## LibEditModeOverride:GetFrameSetting(frame, setting) ### Description Get the value of a specific edit mode setting on an edit mode managed frame. Use the enumerations found in the Blizzard Lua dumps for the setting parameter. ### Method Function call ### Endpoint `LibEditModeOverride:GetFrameSetting(frame, setting)` ### Parameters - **frame** (Frame) - Required - The frame to get the setting from. - **setting** (string) - Required - The setting name (enumeration). ### Returns - **any** - The value of the setting. ``` -------------------------------- ### Compress, decompress, and encode with LibDeflate Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/README.md Shows how to load LibDeflate either as a WoW addon via LibStub or as a Lua module via require, then compress and decompress a string with CompressDeflate/DecompressDeflate. It also demonstrates EncodeForWoWAddonChannel/DecodeForWoWAddonChannel for addon-channel transmission and EncodeForPrint/DecodeForPrint for printable output, noting that EncodeForPrint increases size by 25% and DecodeForPrint strips leading/trailing control or space characters. ```lua local LibDeflate if LibStub then -- You are using LibDeflate as WoW addon LibDeflate = LibStub:GetLibrary("LibDeflate") else LibDeflate = require("LibDeflate") end local example_input = "12123123412345123456123456712345678123456789" --- Compress using raw deflate format local compress_deflate = LibDeflate:CompressDeflate(example_input) -- decompress local decompress_deflate = LibDeflate:DecompressDeflate(compress_deflate) -- Check if the first return value of DecompressXXXX is non-nil to know if the -- decompression succeeds. if decompress_deflate == nil then error("Decompression fails.") else -- Decompression succeeds. assert(example_input == decompress_deflate) end -- To transmit through WoW addon channel, data must be encoded so NULL ("\000") -- is not in the data. local data_to_trasmit_WoW_addon = LibDeflate:EncodeForWoWAddonChannel( compress_deflate) -- When the receiver gets the data, decoded it first. local data_decoded_WoW_addon = LibDeflate:DecodeForWoWAddonChannel( data_to_trasmit_WoW_addon) -- Then decomrpess it local decompress_deflate = LibDeflate:DecompressDeflate(data_decoded_WoW_addon) assert(decompress_deflate == example_input) -- The compressed output is not printable. EncodeForPrint will convert to -- a printable format, in case you want to export to the user to -- copy and paste. This encoding will make the data 25% bigger. local printable_compressed = LibDeflate:EncodeForPrint(compress_deflate) -- DecodeForPrint to convert back. -- DecodeForPrint will remove prefixed and trailing control or space characters -- in the string before decode it. assert(LibDeflate:DecodeForPrint(printable_compressed) == compress_deflate) ``` -------------------------------- ### Command-line usage for LibDeflate Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Shows the command-line syntax and available options for the LibDeflate tool. Use this to invoke the tool with options for compression level, decompression, dictionary, strategy, and format. ```text lua LibDeflate.lua [OPTION] [INPUT] [OUTPUT] -0 store only. no compression. -1 fastest compression. -9 slowest and best compression. -d do decompression instead of compression. --dict specify the file that contains he entire preset dictionary. -h give this help. --strategy specify a special compression strategy. -v print the version and copyright info. --zlib use zlib format instead of raw deflate. ``` -------------------------------- ### LibDeflate:CreateDictionary(str, strlen, adler32) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a preset dictionary. ```APIDOC ## LibDeflate:CreateDictionary(str, strlen, adler32) ### Description Creates a preset dictionary. ### Parameters - **str** (string) - Required - The dictionary string. - **strlen** (number) - Required - The length of the dictionary string. - **adler32** (number) - Required - The Adler-32 checksum of the dictionary. ### Returns - **string** - The preset dictionary. ``` -------------------------------- ### LibDeflate:CreateDictionary Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a preset dictionary for compression and decompression. The dictionary must be used consistently by both compressors and decompressors. This function is not fast and consumes about 50 times the input string's memory. ```APIDOC ## LibDeflate:CreateDictionary ### Description Creates a preset dictionary for compression and decompression. The dictionary must be used consistently by both compressors and decompressors. This function is not fast and consumes about 50 times the input string's memory. ### Method Function call ### Signature `LibDeflate:CreateDictionary(str, strlen, adler32)` ### Parameters - **str** (string) - Required - The string used as the preset dictionary. You should put stuffs that frequently appears in the dictionary string and preferablely put more frequently appeared stuffs toward the end of the string. Empty string and string longer than 32768 bytes are not allowed. - **strlen** (integer) - Required - The length of 'str'. Please pass in this parameter as a hardcoded constant, in order to verify the content of 'str'. The value of this parameter should be known before your program runs. - **adler32** (integer) - Required - The Adler-32 checksum of 'str'. Please pass in this parameter as a hardcoded constant, in order to verify the content of 'str'. The value of this parameter should be known before your program runs. ### Returns - **table** - The dictionary used for preset dictionary compression and decompression. ### Raises - error if 'strlen' does not match the length of 'str', or if 'adler32' does not match the Adler-32 checksum of 'str'. ### Usage Example ```lua local dict_str = "1234567890" -- print(dict_str:len(), LibDeflate:Adler32(dict_str)) -- Hardcode the print result below to verify it to avoid acciently -- modification of 'str' during the program development. -- string length: 10, Adler-32: 187433486, -- Don't calculate string length and its Adler-32 at run-time. local dict = LibDeflate:CreateDictionary(dict_str, 10, 187433486) ``` ``` -------------------------------- ### LibEditModeOverride:GetPresetLayoutNames() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Returns the names of all preset non-editable layouts. ```APIDOC ## LibEditModeOverride:GetPresetLayoutNames() ### Description Returns a table of the names of all preset non-editable layouts. ### Method Function call ### Endpoint `LibEditModeOverride:GetPresetLayoutNames()` ### Parameters None ### Returns - **table** - A table of layout names. ``` -------------------------------- ### LibDeflate:CompressZlibWithDict(str, dictionary, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses the input string using the zlib format with a preset dictionary. ```APIDOC ## LibDeflate:CompressZlibWithDict(str, dictionary, configs) ### Description Compresses the input string using the zlib format with a preset dictionary. ### Parameters - **str** (string) - Required - The string to compress. - **dictionary** (string) - Required - The preset dictionary. - **configs** (table) - Optional - Compression configuration options. ### Returns - **string** - The compressed data. ``` -------------------------------- ### LibEditModeOverride:LoadLayouts() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Loads the saved edit mode layouts from the Blizzard API. Must be called before using other library functions. ```APIDOC ## LibEditModeOverride:LoadLayouts() ### Description Required to call before using any other functions in this library. Queries and saves from the Blizzard API last saved edit mode frame settings and positions. You **will** need to call this again if the edit mode UI updates the layouts. ### Method Function call ### Endpoint `LibEditModeOverride:LoadLayouts()` ### Parameters None ### Returns None ``` -------------------------------- ### LibDeflate:CompressZlibWithDict(str, dictionary, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses data using the zlib format with a preset dictionary. The dictionary must be created by LibDeflate:CreateDictionary. ```APIDOC ## LibDeflate:CompressZlibWithDict(str, dictionary, configs) ### Description Compresses the input string using the zlib format with a preset dictionary. ### Parameters - **str** (string) - Required - The data to be compressed. - **dictionary** (table) - Required - A preset dictionary produced by LibDeflate:CreateDictionary(). - **configs** (table/nil) - Optional - The configuration table to control compression. If nil, use the default configuration. ### Returns 1. **string** - The compressed data. 2. **integer** - The number of bits padded at the end of output. Should always be 0. Zlib formatted compressed data never has padding bits at the end. ### See Also - compression_configs - LibDeflate:CreateDictionary - LibDeflate:DecompressZlibWithDict ``` -------------------------------- ### LibEditModeOverride:IsReady() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Checks if the edit mode state has been loaded by the Blizzard APIs. ```APIDOC ## LibEditModeOverride:IsReady() ### Description Returns `true` once the Blizzard APIs have loaded the edit mode state. This happens on `EDIT_MODE_LAYOUTS_UPDATED`. ### Method Function call ### Endpoint `LibEditModeOverride:IsReady()` ### Parameters None ### Returns - **boolean** - `true` if the edit mode state is loaded, `false` otherwise. ``` -------------------------------- ### LibDeflate:EncodeForWoWAddonChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes the string to make it ready to be transmitted in World of Warcraft addon channel. ```APIDOC ## LibDeflate:EncodeForWoWAddonChannel(str) ### Description Encodes the string to make it ready to be transmitted in World of Warcraft addon channel. ### Parameters - **str** (string) - Required - The string to encode. ### Returns - **string** - The encoded string. ``` -------------------------------- ### LibEditModeOverride:AddLayout(layoutType, layoutName) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Creates a new edit mode layout. ```APIDOC ## LibEditModeOverride:AddLayout(layoutType, layoutName) ### Description Create a new layout called `layoutName`. This name must not already be in use. Set `layoutType` to `Enum.EditModeLayoutType.Account` or `Enum.EditModeLayoutType.Character` depending on where you want the layout to be saved. ### Method Function call ### Endpoint `LibEditModeOverride:AddLayout(layoutType, layoutName)` ### Parameters - **layoutType** (Enum.EditModeLayoutType) - Required - The type of layout (Account or Character). - **layoutName** (string) - Required - The name of the new layout. ``` -------------------------------- ### LibDeflate:EncodeForWoWChatChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes the string to make it ready to be transmitted in World of Warcraft chat channel. ```APIDOC ## LibDeflate:EncodeForWoWChatChannel(str) ### Description Encodes the string to make it ready to be transmitted in World of Warcraft chat channel. ### Parameters - **str** (string) - Required - The string to encode. ### Returns - **string** - The encoded string. ``` -------------------------------- ### LibDeflate:CompressDeflateWithDict(str, dictionary, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses data using the raw deflate format with a preset dictionary. The dictionary must be created by LibDeflate:CreateDictionary. ```APIDOC ## LibDeflate:CompressDeflateWithDict(str, dictionary, configs) ### Description Compresses the input string using the raw deflate format with a preset dictionary. ### Parameters - **str** (string) - Required - The data to be compressed. - **dictionary** (table) - Required - The preset dictionary produced by LibDeflate:CreateDictionary. - **configs** (table/nil) - Optional - The configuration table to control compression. If nil, use the default configuration. ### Returns 1. **string** - The compressed data. 2. **integer** - The number of bits padded at the end of output. 0 <= bits < 8. The most significant bits of the last byte are padding bits and don't affect decompression. ### See Also - compression_configs - LibDeflate:CreateDictionary - LibDeflate:DecompressDeflateWithDict ``` -------------------------------- ### LibDeflate:CompressZlib(str, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses data using the zlib format. Optionally accepts a configuration table; if nil, uses default configuration. ```APIDOC ## LibDeflate:CompressZlib(str, configs) ### Description Compresses the input string using the zlib format. ### Parameters - **str** (string) - Required - The data to be compressed. - **configs** (table/nil) - Optional - The configuration table to control compression. If nil, use the default configuration. ### Returns 1. **string** - The compressed data. 2. **integer** - The number of bits padded at the end of output. Should always be 0. Zlib formatted compressed data never has padding bits at the end. ### See Also - compression_configs - LibDeflate:DecompressZlib ``` -------------------------------- ### LibEditModeOverride:AreLayoutsLoaded() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Checks whether the layouts have been loaded. ```APIDOC ## LibEditModeOverride:AreLayoutsLoaded() ### Description Has `LibEditModeOverride:LoadLayouts()` been called at some point? ### Method Function call ### Endpoint `LibEditModeOverride:AreLayoutsLoaded()` ### Parameters None ### Returns - **boolean** - `true` if layouts have been loaded, `false` otherwise. ``` -------------------------------- ### LibDeflate:CompressZlib(str, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses the input string using the zlib format. ```APIDOC ## LibDeflate:CompressZlib(str, configs) ### Description Compresses the input string using the zlib format. ### Parameters - **str** (string) - Required - The string to compress. - **configs** (table) - Optional - Compression configuration options. ### Returns - **string** - The compressed data. ``` -------------------------------- ### LibEditModeOverride:DoesLayoutExist(layoutName) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Checks if a layout with the given name exists. ```APIDOC ## LibEditModeOverride:DoesLayoutExist(layoutName) ### Description Does a layout with the name `layoutName` exist? ### Method Function call ### Endpoint `LibEditModeOverride:DoesLayoutExist(layoutName)` ### Parameters - **layoutName** (string) - Required - The name of the layout to check. ### Returns - **boolean** - `true` if the layout exists, `false` otherwise. ``` -------------------------------- ### LibDeflate:EncodeForWoWAddonChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes a string to be ready for transmission in World of Warcraft addon channels. The encoded string contains no NULL characters. ```APIDOC ## LibDeflate:EncodeForWoWAddonChannel(str) ### Description Encodes the input string to make it ready for transmission in World of Warcraft addon channels. The encoded string is guaranteed to contain no NULL ("\000") characters. ### Method Function call ### Parameters - **str** (string) - Required - The string to be encoded. ### Returns - **encoded** (string) - The encoded string. ### See Also - [LibDeflate:DecodeForWoWAddonChannel](../source/LibDeflate.lua.html#LibDeflate:DecodeForWoWAddonChannel) ``` -------------------------------- ### LibEditModeOverride:ApplyChanges() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Saves and applies layout changes to frames. Does not work during combat. ```APIDOC ## LibEditModeOverride:ApplyChanges() ### Description Save any changes made and apply any layout changes to the frames. Does not work during combat. ### Method Function call ### Endpoint `LibEditModeOverride:ApplyChanges()` ### Parameters None ### Returns None ``` -------------------------------- ### LibEditModeOverride:SetGlobalSetting(setting, value) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Sets an account-wide edit mode setting. ```APIDOC ## LibEditModeOverride:SetGlobalSetting(setting, value) ### Description Set an edit mode account-wide setting. This is just an alias for `C_EditMode.SetAccountSetting`. This setting won't affect the UI outside of edit mode. ### Method Function call ### Endpoint `LibEditModeOverride:SetGlobalSetting(setting, value)` ### Parameters - **setting** (string) - Required - The setting name. - **value** (any) - Required - The value to set. ``` -------------------------------- ### LibDeflate:CreateCodec(reserved_chars, escape_chars, map_chars) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a custom codec with encoder and decoder. ```APIDOC ## LibDeflate:CreateCodec(reserved_chars, escape_chars, map_chars) ### Description Creates a custom codec with encoder and decoder. ### Parameters - **reserved_chars** (string) - Required - Characters reserved for special use. - **escape_chars** (string) - Required - Characters used for escaping. - **map_chars** (string) - Required - Characters used for mapping. ### Returns - **table** - A codec object with encode and decode functions. ``` -------------------------------- ### LibDeflate:CompressDeflateWithDict(str, dictionary, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses the input string using the raw deflate format with a preset dictionary. ```APIDOC ## LibDeflate:CompressDeflateWithDict(str, dictionary, configs) ### Description Compresses the input string using the raw deflate format with a preset dictionary. ### Parameters - **str** (string) - Required - The string to compress. - **dictionary** (string) - Required - The preset dictionary. - **configs** (table) - Optional - Compression configuration options. ### Returns - **string** - The compressed data. ``` -------------------------------- ### LibEditModeOverride:GetActiveLayout() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Returns the name of the currently active layout. ```APIDOC ## LibEditModeOverride:GetActiveLayout() ### Description Returns the string name of the currently active layout. ### Method Function call ### Endpoint `LibEditModeOverride:GetActiveLayout()` ### Parameters None ### Returns - **string** - The name of the active layout. ``` -------------------------------- ### LibDeflate:CompressDeflate(str, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses the input string using the raw deflate format. ```APIDOC ## LibDeflate:CompressDeflate(str, configs) ### Description Compresses the input string using the raw deflate format. ### Parameters - **str** (string) - Required - The string to compress. - **configs** (table) - Optional - Compression configuration options. ### Returns - **string** - The compressed data. ``` -------------------------------- ### LibEditModeOverride:GetEditableLayoutNames() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Returns the names of all editable layouts. ```APIDOC ## LibEditModeOverride:GetEditableLayoutNames() ### Description Returns a table of the names of all editable layouts. ### Method Function call ### Endpoint `LibEditModeOverride:GetEditableLayoutNames()` ### Parameters None ### Returns - **table** - A table of layout names. ``` -------------------------------- ### LibDeflate:EncodeForWoWChatChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes a string to be ready for transmission in World of Warcraft chat channels, ensuring compatibility with valid chat message characters. ```APIDOC ## LibDeflate:EncodeForWoWChatChannel(str) ### Description Encodes the input string to make it ready for transmission in World of Warcraft chat channels. The encoding ensures the string uses only valid chat message characters. ### Method Function call ### Parameters - **str** (string) - Required - The string to be encoded. ### Returns - **encoded** (string) - The encoded string. ### See Also - [LibDeflate:DecodeForWoWChatChannel](../source/LibDeflate.lua.html#LibDeflate:DecodeForWoWChatChannel) ``` -------------------------------- ### LibDeflate:CompressDeflate(str, configs) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Compresses data using the raw deflate format. Optionally accepts a configuration table to control compression; if nil, uses default configuration. ```APIDOC ## LibDeflate:CompressDeflate(str, configs) ### Description Compresses the input string using the raw deflate format. ### Parameters - **str** (string) - Required - The data to be compressed. - **configs** (table/nil) - Optional - The configuration table to control compression. If nil, use the default configuration. ### Returns 1. **string** - The compressed data. 2. **integer** - The number of bits padded at the end of output. 0 <= bits < 8. The most significant bits of the last byte are padding bits and don't affect decompression. ### See Also - compression_configs - LibDeflate:DecompressDeflate ``` -------------------------------- ### LibDeflate:DecompressZlibWithDict(str, dictionary) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decompresses a zlib compressed data with a preset dictionary. ```APIDOC ## LibDeflate:DecompressZlibWithDict(str, dictionary) ### Description Decompresses a zlib compressed data with a preset dictionary. ### Parameters - **str** (string) - Required - The compressed data. - **dictionary** (string) - Required - The preset dictionary. ### Returns - **string** - The decompressed data. ``` -------------------------------- ### LibDeflate:DecompressZlibWithDict(str, dictionary) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decompresses zlib compressed data using a preset dictionary. The dictionary must match the one used during compression. ```APIDOC ## LibDeflate:DecompressZlibWithDict(str, dictionary) ### Description Decompresses zlib compressed data with a preset dictionary. ### Method Function call ### Parameters - **str** (string) - Required - The data to be decompressed. - **dictionary** (table) - Required - The preset dictionary used during compression. Must be the same as used in compression, otherwise wrong data may be produced without error. ### Returns 1. **string/nil** - The decompressed data if successful, nil if fails. 2. **integer** - The number of unprocessed bytes in the input compressed data. Positive integer if extra bytes are present, 0 if no extra bytes. Undefined if decompression fails. ### See Also - LibDeflate:CompressZlibWithDict ``` -------------------------------- ### LibDeflate:EncodeForPrint(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes the string to make it printable. ```APIDOC ## LibDeflate:EncodeForPrint(str) ### Description Encodes the string to make it printable. ### Parameters - **str** (string) - Required - The string to encode. ### Returns - **string** - The encoded printable string. ``` -------------------------------- ### LibDeflate:EncodeForPrint(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Encodes a string to make it printable, using only 64 printable ASCII characters. The encoded string is 25% larger than the original. ```APIDOC ## LibDeflate:EncodeForPrint(str) ### Description Encodes the input string to make it printable. The encoded string uses only 64 printable ASCII characters (26 lowercase letters, 26 uppercase letters, 10 digits, left parenthesis, right parenthesis). The encoded string is 25% larger than the original. ### Method Function call ### Parameters - **str** (string) - Required - The string to be encoded. ### Returns - **encoded** (string) - The encoded string. ### See Also - [LibDeflate:CompressZlibWithDict](../source/LibDeflate.lua.html#LibDeflate:CompressZlibWithDict) ``` -------------------------------- ### LibEditModeOverride:SetActiveLayout(layoutName) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Sets the active edit mode layout. ```APIDOC ## LibEditModeOverride:SetActiveLayout(layoutName) ### Description Change the active layout to `layoutName`. This name must exist. You need to call `LibEditModeOverride:ApplyChanges` or similar for this to take effect and persist. ### Method Function call ### Endpoint `LibEditModeOverride:SetActiveLayout(layoutName)` ### Parameters - **layoutName** (string) - Required - The name of the layout to set as active. ``` -------------------------------- ### LibEditModeOverride:SetFrameSetting(frame, setting, value) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Sets an edit mode setting on a frame. ```APIDOC ## LibEditModeOverride:SetFrameSetting(frame, setting, value) ### Description Set an edit mode setting on an edit mode managed frame. Use the enumerations found in the Blizzard Lua dumps for the setting parameter. See https://github.com/Gethe/wow-ui-source/blob/live/Interface/FrameXML/EditModePresetLayouts.lua ### Method Function call ### Endpoint `LibEditModeOverride:SetFrameSetting(frame, setting, value)` ### Parameters - **frame** (Frame) - Required - The frame to set the setting on. - **setting** (string) - Required - The setting name (enumeration). - **value** (any) - Required - The value to set. ``` -------------------------------- ### LibDeflate:CreateCodec(reserved_chars, escape_chars, map_chars) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a custom codec with encoder and decoder. This codec converts an input string to avoid specific bytes. It does not take localization into account; one byte (0-255) is exactly one character (0-255). ```APIDOC ## LibDeflate:CreateCodec(reserved_chars, escape_chars, map_chars) ### Description Creates a custom codec with encoder and decoder. This codec is used to convert an input string to make it not contain some specific bytes. This created codec and the parameters of this function do NOT take localization into account. One byte (0-255) in the string is exactly one character (0-255). Credits to LibCompress. ### Parameters - **reserved_chars** - Required - Reserved characters. - **escape_chars** - Required - Escape characters. - **map_chars** - Required - Map characters. ### Returns - **codec** - The created codec with encoder and decoder. ``` -------------------------------- ### LibEditModeOverride:SaveOnly() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Saves changes without applying them. Works during combat. ```APIDOC ## LibEditModeOverride:SaveOnly() ### Description Save any changes made. Works during combat. ### Method Function call ### Endpoint `LibEditModeOverride:SaveOnly()` ### Parameters None ### Returns None ``` -------------------------------- ### LibDeflate:DecompressDeflateWithDict(str, dictionary) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decompresses a raw deflate compressed data with a preset dictionary. ```APIDOC ## LibDeflate:DecompressDeflateWithDict(str, dictionary) ### Description Decompresses a raw deflate compressed data with a preset dictionary. ### Parameters - **str** (string) - Required - The compressed data. - **dictionary** (string) - Required - The preset dictionary. ### Returns - **string** - The decompressed data. ``` -------------------------------- ### LibDeflate:CreateCodec Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Creates a codec (encode/decode table) that maps reserved characters and escapes specified characters. Returns nil and an error message if the codec cannot be created. ```APIDOC ## LibDeflate:CreateCodec ### Description Creates a codec (encode/decode table) that maps reserved characters and escapes specified characters. Returns nil and an error message if the codec cannot be created. ### Method Function call ### Signature `LibDeflate:CreateCodec(reserved_chars, escape_chars, map_chars)` ### Parameters - **reserved_chars** (string) - Required - The created encoder will ensure encoded data does not contain any single character in reserved_chars. This parameter should be non-empty. - **escape_chars** (string) - Required - The escape character(s) used in the created codec. The codec converts any character included in reserved_chars / escape_chars / map_chars to (one escape char + one character not in reserved_chars / escape_chars / map_chars). You usually only need to provide a length-1 string for this parameter. Length-2 string is only needed when reserved_chars + escape_chars + map_chars is longer than 127. This parameter should be non-empty. - **map_chars** (string) - Required - The created encoder will map every reserved_chars:sub(i, i) (1 <= i <= #map_chars) to map_chars:sub(i, i). This parameter CAN be empty string. ### Returns 1. **table/nil** - If the codec cannot be created, return nil. If the codec can be created according to the given parameters, return the codec, which is a encode/decode table. The table contains two functions: t:Encode(str) returns the encoded string. t:Decode(str) returns the decoded string if succeeds. nil if fails. 2. **nil/string** - If the codec is successfully created, return nil. If not, return a string that describes the reason why the codec cannot be created. ### Usage Example ```lua -- Create an encoder/decoder that maps all "\000" to "\003", -- and escape "\001" (and "\002" and "\003") properly local codec = LibDeflate:CreateCodec("\000\001", "\002", "\003") local encoded = codec:Encode(SOME_STRING) -- "encoded" does not contain "\000" or "\001" local decoded = codec:Decode(encoded) -- assert(decoded == SOME_STRING) ``` ``` -------------------------------- ### LibDeflate:DecompressDeflateWithDict(str, dictionary) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decompresses raw deflate compressed data using a preset dictionary. The dictionary must match the one used during compression. ```APIDOC ## LibDeflate:DecompressDeflateWithDict(str, dictionary) ### Description Decompresses raw deflate compressed data with a preset dictionary. ### Method Function call ### Parameters - **str** (string) - Required - The data to be decompressed. - **dictionary** (table) - Required - The preset dictionary used during compression. Must be the same as used in compression, otherwise wrong data may be produced without error. ### Returns 1. **string/nil** - The decompressed data if successful, nil if fails. 2. **integer** - The number of unprocessed bytes in the input compressed data. Positive integer if extra bytes are present, 0 if no extra bytes. Undefined if decompression fails. ### See Also - LibDeflate:CompressDeflateWithDict ``` -------------------------------- ### LibDeflate:DecodeForWoWChatChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decodes the string produced by LibDeflate:EncodeForWoWChatChannel. ```APIDOC ## LibDeflate:DecodeForWoWChatChannel(str) ### Description Decodes the string produced by LibDeflate:EncodeForWoWChatChannel. ### Parameters - **str** (string) - Required - The encoded string. ### Returns - **string** - The decoded string. ``` -------------------------------- ### LibDeflate:DecodeForWoWAddonChannel Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decodes a string produced by LibDeflate:EncodeForWoWAddonChannel. ```APIDOC ## LibDeflate:DecodeForWoWAddonChannel ### Description Decodes a string produced by LibDeflate:EncodeForWoWAddonChannel. ### Method Function call ### Signature `LibDeflate:DecodeForWoWAddonChannel(str)` ### Parameters - **str** (string) - Required - The string to be decoded. ### Returns - **string/nil** - The decoded string if succeeds. nil if fails. ### Usage Example ```lua -- Example usage not provided in source. ``` ``` -------------------------------- ### LibDeflate:DecodeForWoWChatChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decodes a string that was encoded using LibDeflate:EncodeForWoWChatChannel. Returns the decoded string or nil on failure. ```APIDOC ## LibDeflate:DecodeForWoWChatChannel(str) ### Description Decodes a string that was encoded using LibDeflate:EncodeForWoWChatChannel. ### Method Function call ### Parameters - **str** (string) - Required - The string to be decoded. ### Returns - **string/nil** - The decoded string if successful, nil if fails. ### See Also - LibDeflate:EncodeForWoWChatChannel ``` -------------------------------- ### LibDeflate:DecodeForWoWAddonChannel(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decodes the string produced by LibDeflate:EncodeForWoWAddonChannel. ```APIDOC ## LibDeflate:DecodeForWoWAddonChannel(str) ### Description Decodes the string produced by LibDeflate:EncodeForWoWAddonChannel. ### Parameters - **str** (string) - Required - The encoded string. ### Returns - **string** - The decoded string. ``` -------------------------------- ### LibEditModeOverride:CanEditActiveLayout() Source: https://github.com/arcsim/arcui/blob/main/Libs/LibEditModeOverride/README.md Checks if the active layout can be edited. ```APIDOC ## LibEditModeOverride:CanEditActiveLayout() ### Description Can the current layout be modified, either via edit mode or this library. If it cannot you will need to create or select a new layout to edit. ### Method Function call ### Endpoint `LibEditModeOverride:CanEditActiveLayout()` ### Parameters None ### Returns - **boolean** - `true` if the active layout can be edited, `false` otherwise. ``` -------------------------------- ### LibDeflate:DecompressZlib(str) Source: https://github.com/arcsim/arcui/blob/main/Libs/LibDeflate/docs/source/LibDeflate.lua.html Decompresses a zlib compressed data. ```APIDOC ## LibDeflate:DecompressZlib(str) ### Description Decompresses a zlib compressed data. ### Parameters - **str** (string) - Required - The compressed data. ### Returns - **string** - The decompressed data. ```