/* Copyright (c) 2023 Alex Diener This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Alex Diener alex@ludobloom.com */ #ifndef __UIAppearance_H__ #define __UIAppearance_H__ #include "gamemath/Rect4f.h" #include "gamemath/Vector2f.h" #include "renderer/VertexTypes.h" #include "uitoolkit/UITypeface.h" #include "uitoolkit/UITypes.h" #include "utilities/HashTable.h" typedef struct UIAppearance { struct UIAppearance * parent; HashTable * parameters; } UIAppearance; UIAppearance UIAppearance_init(UIAppearance * parent); void UIAppearance_dispose(UIAppearance appearance); UIAppearance UIAppearance_copy(UIAppearance appearance); float getAppearanceFloat(UIAppearance appearance, UIAppearance_key key); double getAppearanceDouble(UIAppearance appearance, UIAppearance_key key); Vector2f getAppearanceVector2f(UIAppearance appearance, UIAppearance_key key); Rect4f getAppearanceRect4f(UIAppearance appearance, UIAppearance_key key); Color4f getAppearanceColor4f(UIAppearance appearance, UIAppearance_key key); UISliceGrid3x3 getAppearanceSliceGrid3x3(UIAppearance appearance, UIAppearance_key key); UISliceGrid3x1 getAppearanceSliceGrid3x1(UIAppearance appearance, UIAppearance_key key); UISliceGrid1x3 getAppearanceSliceGrid1x3(UIAppearance appearance, UIAppearance_key key); UITypeface * getAppearanceTypeface(UIAppearance appearance, UIAppearance_key key); UIAtlasEntry getAppearanceAtlasEntry(UIAppearance appearance, UIAppearance_key key); void setAppearanceFloat(UIAppearance * appearance, UIAppearance_key key, float value); void setAppearanceDouble(UIAppearance * appearance, UIAppearance_key key, double value); void setAppearanceVector2f(UIAppearance * appearance, UIAppearance_key key, Vector2f value); void setAppearanceRect4f(UIAppearance * appearance, UIAppearance_key key, Rect4f value); void setAppearanceColor4f(UIAppearance * appearance, UIAppearance_key key, Color4f value); void setAppearanceSliceGrid3x3(UIAppearance * appearance, UIAppearance_key key, UISliceGrid3x3 value); void setAppearanceSliceGrid3x1(UIAppearance * appearance, UIAppearance_key key, UISliceGrid3x1 value); void setAppearanceSliceGrid1x3(UIAppearance * appearance, UIAppearance_key key, UISliceGrid1x3 value); void setAppearanceTypeface(UIAppearance * appearance, UIAppearance_key key, compat_type(UITypeface *) value); void setAppearanceAtlasEntry(UIAppearance * appearance, UIAppearance_key key, UIAtlasEntry value); void setAppearanceReference(UIAppearance * appearance, UIAppearance_key childKey, UIAppearance_key parentKey); #endif