fx.reflection: implement fx_property

This commit is contained in:
2026-05-25 17:24:47 +01:00
parent 12b04eea8d
commit 82bb20c6af
2 changed files with 174 additions and 0 deletions
@@ -1,4 +1,38 @@
#ifndef FX_REFLECTION_PROPERTY_H_
#define FX_REFLECTION_PROPERTY_H_
#include <fx/macros.h>
#include <fx/value.h>
FX_DECLS_BEGIN;
#define FX_REFLECTION_TYPE_PROPERTY (fx_property_get_type())
FX_DECLARE_TYPE(fx_property)
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_property)
FX_TYPE_CLASS_DECLARATION_END(fx_property)
typedef fx_status (
*fx_property_getter)(const fx_value *, const fx_property *, fx_value *);
typedef fx_status (
*fx_property_setter)(fx_value *, const fx_property *, fx_value *);
FX_API fx_type_id fx_property_get_type(void);
FX_API fx_property *fx_property_create(
const char *name,
fx_property_getter get,
fx_property_setter set);
FX_API const char *fx_property_get_name(const fx_property *prop);
FX_API fx_status fx_property_get_value(
const fx_property *prop,
const fx_value *container,
fx_value *out);
FX_API fx_status fx_property_set_value(
const fx_property *prop,
fx_value *container,
fx_value *new_value);
#endif