-- lx-bundle:true

-- This file is part of Lx and Qui, created by Liqube <www.liqube.com>
-- Copyright Liqube Audio. All rights reserved.
-- Lx Interim License. See LICENSE for details.

--- Register stable UI glyph names without exposing their current drawing backend
-- @module qui.glyph

local glyph_api = assert(ui_glyph, "the UI glyph API is not loaded")
local Font = require("qui.font")
local Glyph = {
	check = "check",	-- Checkbox code uses this name without knowing the current font symbol
	dropdown = "dropdown",	-- Combobox code keeps the arrow role independent from its current font shape
	font_size = "font_size",	-- Menu declarations can reserve a familiar text-size symbol by name
	submenu = "submenu",	-- Menu code reserves a stable right-pointing child indicator
	sort_ascending = "sort_ascending",	-- Table headers point upward for ascending provider order
	sort_descending = "sort_descending",	-- Table headers point downward for descending provider order
	tree_collapsed = "tree_collapsed",	-- Closed branches point toward the hidden children
	tree_expanded = "tree_expanded",	-- Open branches point down toward the visible children
}

-- The native cross has no font bearings and remains centered at every display scale
glyph_api.register_shape(Glyph.check, "cross")
-- A named text arrow stays cheap today and may become a vector without changing Combobox code
glyph_api.register_font(Glyph.dropdown, Font.compact, utf8.char(0x25be))
-- The ordinary letter stays in the fast UI-font path while the name may later resolve to vector artwork
glyph_api.register_font(Glyph.font_size, Font.compact, "A")
-- The hard-edged native triangle appears immediately without loading a fallback font
glyph_api.register_shape(Glyph.submenu, "triangle_right")
-- Sort markers use immediate native triangles rather than delayed font fallback glyphs
glyph_api.register_shape(Glyph.sort_ascending, "triangle_up")
glyph_api.register_shape(Glyph.sort_descending, "triangle_down")
-- Tree arrows stay inside the immediate native-shape path instead of loading or shaping a font
glyph_api.register_shape(Glyph.tree_collapsed, "triangle_right")
glyph_api.register_shape(Glyph.tree_expanded, "triangle_down")

return Glyph
