fx.reflection: implement fx_property
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user